fidl_fuchsia_io/
fidl_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 fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_io__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14/// The type to identify a connection to a node.
15/// It represents a capability: a reference to a node with associated rights.
16pub type Token = fidl::Event;
17
18#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19pub struct DirectoryCreateSymlinkRequest {
20    pub name: String,
21    pub target: Vec<u8>,
22    pub connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
23}
24
25impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
26    for DirectoryCreateSymlinkRequest
27{
28}
29
30#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31pub struct DirectoryDeprecatedOpenRequest {
32    pub flags: OpenFlags,
33    pub mode: ModeType,
34    pub path: String,
35    pub object: fidl::endpoints::ServerEnd<NodeMarker>,
36}
37
38impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
39    for DirectoryDeprecatedOpenRequest
40{
41}
42
43#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
44pub struct DirectoryGetTokenResponse {
45    pub s: i32,
46    pub token: Option<fidl::NullableHandle>,
47}
48
49impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryGetTokenResponse {}
50
51#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
52pub struct DirectoryLinkRequest {
53    pub src: String,
54    pub dst_parent_token: fidl::NullableHandle,
55    pub dst: String,
56}
57
58impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryLinkRequest {}
59
60#[derive(Debug, PartialEq)]
61pub struct DirectoryOpenRequest {
62    pub path: String,
63    pub flags: Flags,
64    pub options: Options,
65    pub object: fidl::Channel,
66}
67
68impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryOpenRequest {}
69
70#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
71pub struct DirectoryRenameRequest {
72    pub src: String,
73    pub dst_parent_token: fidl::Event,
74    pub dst: String,
75}
76
77impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryRenameRequest {}
78
79#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
80pub struct DirectoryWatchRequest {
81    pub mask: WatchMask,
82    pub options: u32,
83    pub watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
84}
85
86impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryWatchRequest {}
87
88#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
89pub struct FileAllocateRequest {
90    pub offset: u64,
91    pub length: u64,
92    /// If an empty bits is passed for mode, the default behavior is used. Otherwise the
93    /// behavior is modified as described for each mode bit. If the backing filesystem doesn't
94    /// support a particular provided mode bit, or combination of mode bits, an error is
95    /// returned.
96    pub mode: AllocateMode,
97}
98
99impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileAllocateRequest {}
100
101#[derive(Debug, PartialEq)]
102pub struct FileEnableVerityRequest {
103    pub options: VerificationOptions,
104}
105
106impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileEnableVerityRequest {}
107
108#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
109pub struct FileObject {
110    /// An optional event which transmits information about an object's readability
111    /// or writability. This event relays information about the underlying object, not
112    /// the capability granted to client: this event may be signalled "readable" on a
113    /// connection that does not have the capability to read.
114    ///
115    /// The "`FILE_SIGNAL_`" values may be observed on this event.
116    pub event: Option<fidl::Event>,
117    /// A placeholder for future stream support.
118    ///
119    /// Currently, servers are required not to send a handle in this field.
120    pub stream: Option<fidl::Stream>,
121}
122
123impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileObject {}
124
125#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
126pub struct FileGetBackingMemoryResponse {
127    pub vmo: fidl::Vmo,
128}
129
130impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
131    for FileGetBackingMemoryResponse
132{
133}
134
135#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
136pub struct LinkableLinkIntoRequest {
137    pub dst_parent_token: fidl::Event,
138    pub dst: String,
139}
140
141impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LinkableLinkIntoRequest {}
142
143#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
144pub struct NodeDeprecatedCloneRequest {
145    pub flags: OpenFlags,
146    pub object: fidl::endpoints::ServerEnd<NodeMarker>,
147}
148
149impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
150    for NodeDeprecatedCloneRequest
151{
152}
153
154#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
155pub struct NodeListExtendedAttributesRequest {
156    pub iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
157}
158
159impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
160    for NodeListExtendedAttributesRequest
161{
162}
163
164#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
165pub struct NodeOnOpenRequest {
166    pub s: i32,
167    pub info: Option<Box<NodeInfoDeprecated>>,
168}
169
170impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NodeOnOpenRequest {}
171
172#[derive(Debug, PartialEq)]
173pub struct NodeSetExtendedAttributeRequest {
174    pub name: Vec<u8>,
175    pub value: ExtendedAttributeValue,
176    /// Specifies the behavior based on the current state of the attribute.
177    pub mode: SetExtendedAttributeMode,
178}
179
180impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
181    for NodeSetExtendedAttributeRequest
182{
183}
184
185#[derive(Debug, Default, PartialEq)]
186pub struct ConnectionInfo {
187    /// The rights possessed by the current connection. Note: `rights` limits
188    /// the set of operations allowed on the connection, but does not guarantee
189    /// their availability. For example, one may have the [`Rights.EXECUTE`]
190    /// right on a file connection, but the file itself does not have the
191    /// `EXECUTE` ability, and hence cannot be executed. See
192    /// [`ConnectionOptions.rights`].
193    pub rights: Option<Operations>,
194    #[doc(hidden)]
195    pub __source_breaking: fidl::marker::SourceBreaking,
196}
197
198impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ConnectionInfo {}
199
200/// Auxiliary data for the file representation of a node.
201#[derive(Debug, Default, PartialEq)]
202pub struct FileInfo {
203    /// True if the file is opened in append mode.
204    /// In append mode, the seek offset is moved to the end before every
205    /// write, the two steps performed in an atomic manner.
206    pub is_append: Option<bool>,
207    /// An optional event which transmits information about an object's
208    /// readability or writability. This event relays information about the
209    /// underlying object, not the capability granted to client: this event
210    /// may be signalled "readable" on a connection that does not have
211    /// the capability to read.
212    ///
213    /// This event will be present if the following conditions are met:
214    ///
215    /// - The `available_operations` on the file connection is not empty.
216    /// - The filesystem supports signalling readability/writability events.
217    ///
218    /// The [`FileSignal`] values may be observed on this event.
219    pub observer: Option<fidl::Event>,
220    /// An optional stream object, which can be used to read to and write from
221    /// the file.
222    ///
223    /// Reading and writing the file using the stream object can be up to 20x
224    /// faster than reading and writing the file using the Read and Write
225    /// operations in the [`File`] protocol.
226    pub stream: Option<fidl::Stream>,
227    /// Requested attributes for the file. This is only populated if requested.
228    pub attributes: Option<NodeAttributes2>,
229    #[doc(hidden)]
230    pub __source_breaking: fidl::marker::SourceBreaking,
231}
232
233impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileInfo {}
234
235/// The value type for an extended attribute. If the value is less than 32768
236/// bytes, then it is included inline. Values larger than this size are written
237/// into a vmo buffer.
238#[derive(Debug)]
239pub enum ExtendedAttributeValue {
240    Bytes(Vec<u8>),
241    Buffer(fidl::Vmo),
242    #[doc(hidden)]
243    __SourceBreaking {
244        unknown_ordinal: u64,
245    },
246}
247
248/// Pattern that matches an unknown `ExtendedAttributeValue` member.
249#[macro_export]
250macro_rules! ExtendedAttributeValueUnknown {
251    () => {
252        _
253    };
254}
255
256// Custom PartialEq so that unknown variants are not equal to themselves.
257impl PartialEq for ExtendedAttributeValue {
258    fn eq(&self, other: &Self) -> bool {
259        match (self, other) {
260            (Self::Bytes(x), Self::Bytes(y)) => *x == *y,
261            (Self::Buffer(x), Self::Buffer(y)) => *x == *y,
262            _ => false,
263        }
264    }
265}
266
267impl ExtendedAttributeValue {
268    #[inline]
269    pub fn ordinal(&self) -> u64 {
270        match *self {
271            Self::Bytes(_) => 1,
272            Self::Buffer(_) => 2,
273            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
274        }
275    }
276
277    #[inline]
278    pub fn unknown_variant_for_testing() -> Self {
279        Self::__SourceBreaking { unknown_ordinal: 0 }
280    }
281
282    #[inline]
283    pub fn is_unknown(&self) -> bool {
284        match self {
285            Self::__SourceBreaking { .. } => true,
286            _ => false,
287        }
288    }
289}
290
291impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ExtendedAttributeValue {}
292
293#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
294pub enum NodeInfoDeprecated {
295    /// No protocol information was supplied by the connection.
296    Service(Service),
297    /// The connection composes [`File`].
298    File(FileObject),
299    /// The connection composes [`Directory`].
300    Directory(DirectoryObject),
301    /// The connection composes ['Symlink'].
302    Symlink(SymlinkObject),
303}
304
305impl NodeInfoDeprecated {
306    #[inline]
307    pub fn ordinal(&self) -> u64 {
308        match *self {
309            Self::Service(_) => 1,
310            Self::File(_) => 2,
311            Self::Directory(_) => 3,
312            Self::Symlink(_) => 4,
313        }
314    }
315}
316
317impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NodeInfoDeprecated {}
318
319#[derive(Debug)]
320pub enum Representation {
321    /// The [`Node`] protocol was negotiated for this connection.
322    Node(NodeInfo),
323    /// The [`File`] protocol was negotiated for this connection.
324    Directory(DirectoryInfo),
325    /// The [`File`] protocol was negotiated for this connection.
326    File(FileInfo),
327    /// The [`Symlink`] protocol was negotiated for this connection.
328    Symlink(SymlinkInfo),
329    #[doc(hidden)]
330    __SourceBreaking { unknown_ordinal: u64 },
331}
332
333/// Pattern that matches an unknown `Representation` member.
334#[macro_export]
335macro_rules! RepresentationUnknown {
336    () => {
337        _
338    };
339}
340
341// Custom PartialEq so that unknown variants are not equal to themselves.
342impl PartialEq for Representation {
343    fn eq(&self, other: &Self) -> bool {
344        match (self, other) {
345            (Self::Node(x), Self::Node(y)) => *x == *y,
346            (Self::Directory(x), Self::Directory(y)) => *x == *y,
347            (Self::File(x), Self::File(y)) => *x == *y,
348            (Self::Symlink(x), Self::Symlink(y)) => *x == *y,
349            _ => false,
350        }
351    }
352}
353
354impl Representation {
355    #[inline]
356    pub fn ordinal(&self) -> u64 {
357        match *self {
358            Self::Node(_) => 1,
359            Self::Directory(_) => 2,
360            Self::File(_) => 3,
361            Self::Symlink(_) => 4,
362            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
363        }
364    }
365
366    #[inline]
367    pub fn unknown_variant_for_testing() -> Self {
368        Self::__SourceBreaking { unknown_ordinal: 0 }
369    }
370
371    #[inline]
372    pub fn is_unknown(&self) -> bool {
373        match self {
374            Self::__SourceBreaking { .. } => true,
375            _ => false,
376        }
377    }
378}
379
380impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Representation {}
381
382#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
383pub struct AdvisoryLockingMarker;
384
385impl fidl::endpoints::ProtocolMarker for AdvisoryLockingMarker {
386    type Proxy = AdvisoryLockingProxy;
387    type RequestStream = AdvisoryLockingRequestStream;
388    #[cfg(target_os = "fuchsia")]
389    type SynchronousProxy = AdvisoryLockingSynchronousProxy;
390
391    const DEBUG_NAME: &'static str = "(anonymous) AdvisoryLocking";
392}
393pub type AdvisoryLockingAdvisoryLockResult = Result<(), i32>;
394
395pub trait AdvisoryLockingProxyInterface: Send + Sync {
396    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
397        + Send;
398    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
399}
400#[derive(Debug)]
401#[cfg(target_os = "fuchsia")]
402pub struct AdvisoryLockingSynchronousProxy {
403    client: fidl::client::sync::Client,
404}
405
406#[cfg(target_os = "fuchsia")]
407impl fidl::endpoints::SynchronousProxy for AdvisoryLockingSynchronousProxy {
408    type Proxy = AdvisoryLockingProxy;
409    type Protocol = AdvisoryLockingMarker;
410
411    fn from_channel(inner: fidl::Channel) -> Self {
412        Self::new(inner)
413    }
414
415    fn into_channel(self) -> fidl::Channel {
416        self.client.into_channel()
417    }
418
419    fn as_channel(&self) -> &fidl::Channel {
420        self.client.as_channel()
421    }
422}
423
424#[cfg(target_os = "fuchsia")]
425impl AdvisoryLockingSynchronousProxy {
426    pub fn new(channel: fidl::Channel) -> Self {
427        let protocol_name = <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
428        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
429    }
430
431    pub fn into_channel(self) -> fidl::Channel {
432        self.client.into_channel()
433    }
434
435    /// Waits until an event arrives and returns it. It is safe for other
436    /// threads to make concurrent requests while waiting for an event.
437    pub fn wait_for_event(
438        &self,
439        deadline: zx::MonotonicInstant,
440    ) -> Result<AdvisoryLockingEvent, fidl::Error> {
441        AdvisoryLockingEvent::decode(self.client.wait_for_event(deadline)?)
442    }
443
444    /// Acquires an advisory lock on the underlying file.
445    ///
446    /// The lock lasts until either this connection is closed or
447    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
448    /// explicitly.
449    ///
450    /// Advisory locks are purely advisory. They do not prevent actual read or
451    /// write operations from occurring on the file, either through this
452    /// connection or through other connections.
453    ///
454    /// This method requires the following rights:
455    ///
456    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
457    /// * [`Rights.WRITE_BYTES`] if `request.type` is
458    ///   [`AdvisoryLockType.WRITE`].
459    ///
460    /// # Errors
461    ///
462    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
463    ///   example, another connection might hold a conflicting lock type.
464    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
465    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
466    ///   to acquire the given type of lock.
467    pub fn r#advisory_lock(
468        &self,
469        mut request: &AdvisoryLockRequest,
470        ___deadline: zx::MonotonicInstant,
471    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
472        let _response = self.client.send_query::<
473            AdvisoryLockingAdvisoryLockRequest,
474            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
475        >(
476            (request,),
477            0x6ee9c0ad53ec87aa,
478            fidl::encoding::DynamicFlags::empty(),
479            ___deadline,
480        )?;
481        Ok(_response.map(|x| x))
482    }
483}
484
485#[cfg(target_os = "fuchsia")]
486impl From<AdvisoryLockingSynchronousProxy> for zx::NullableHandle {
487    fn from(value: AdvisoryLockingSynchronousProxy) -> Self {
488        value.into_channel().into()
489    }
490}
491
492#[cfg(target_os = "fuchsia")]
493impl From<fidl::Channel> for AdvisoryLockingSynchronousProxy {
494    fn from(value: fidl::Channel) -> Self {
495        Self::new(value)
496    }
497}
498
499#[cfg(target_os = "fuchsia")]
500impl fidl::endpoints::FromClient for AdvisoryLockingSynchronousProxy {
501    type Protocol = AdvisoryLockingMarker;
502
503    fn from_client(value: fidl::endpoints::ClientEnd<AdvisoryLockingMarker>) -> Self {
504        Self::new(value.into_channel())
505    }
506}
507
508#[derive(Debug, Clone)]
509pub struct AdvisoryLockingProxy {
510    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
511}
512
513impl fidl::endpoints::Proxy for AdvisoryLockingProxy {
514    type Protocol = AdvisoryLockingMarker;
515
516    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
517        Self::new(inner)
518    }
519
520    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
521        self.client.into_channel().map_err(|client| Self { client })
522    }
523
524    fn as_channel(&self) -> &::fidl::AsyncChannel {
525        self.client.as_channel()
526    }
527}
528
529impl AdvisoryLockingProxy {
530    /// Create a new Proxy for fuchsia.io/AdvisoryLocking.
531    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
532        let protocol_name = <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
533        Self { client: fidl::client::Client::new(channel, protocol_name) }
534    }
535
536    /// Get a Stream of events from the remote end of the protocol.
537    ///
538    /// # Panics
539    ///
540    /// Panics if the event stream was already taken.
541    pub fn take_event_stream(&self) -> AdvisoryLockingEventStream {
542        AdvisoryLockingEventStream { event_receiver: self.client.take_event_receiver() }
543    }
544
545    /// Acquires an advisory lock on the underlying file.
546    ///
547    /// The lock lasts until either this connection is closed or
548    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
549    /// explicitly.
550    ///
551    /// Advisory locks are purely advisory. They do not prevent actual read or
552    /// write operations from occurring on the file, either through this
553    /// connection or through other connections.
554    ///
555    /// This method requires the following rights:
556    ///
557    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
558    /// * [`Rights.WRITE_BYTES`] if `request.type` is
559    ///   [`AdvisoryLockType.WRITE`].
560    ///
561    /// # Errors
562    ///
563    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
564    ///   example, another connection might hold a conflicting lock type.
565    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
566    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
567    ///   to acquire the given type of lock.
568    pub fn r#advisory_lock(
569        &self,
570        mut request: &AdvisoryLockRequest,
571    ) -> fidl::client::QueryResponseFut<
572        AdvisoryLockingAdvisoryLockResult,
573        fidl::encoding::DefaultFuchsiaResourceDialect,
574    > {
575        AdvisoryLockingProxyInterface::r#advisory_lock(self, request)
576    }
577}
578
579impl AdvisoryLockingProxyInterface for AdvisoryLockingProxy {
580    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
581        AdvisoryLockingAdvisoryLockResult,
582        fidl::encoding::DefaultFuchsiaResourceDialect,
583    >;
584    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
585        fn _decode(
586            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
587        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
588            let _response = fidl::client::decode_transaction_body::<
589                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
590                fidl::encoding::DefaultFuchsiaResourceDialect,
591                0x6ee9c0ad53ec87aa,
592            >(_buf?)?;
593            Ok(_response.map(|x| x))
594        }
595        self.client.send_query_and_decode::<
596            AdvisoryLockingAdvisoryLockRequest,
597            AdvisoryLockingAdvisoryLockResult,
598        >(
599            (request,),
600            0x6ee9c0ad53ec87aa,
601            fidl::encoding::DynamicFlags::empty(),
602            _decode,
603        )
604    }
605}
606
607pub struct AdvisoryLockingEventStream {
608    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
609}
610
611impl std::marker::Unpin for AdvisoryLockingEventStream {}
612
613impl futures::stream::FusedStream for AdvisoryLockingEventStream {
614    fn is_terminated(&self) -> bool {
615        self.event_receiver.is_terminated()
616    }
617}
618
619impl futures::Stream for AdvisoryLockingEventStream {
620    type Item = Result<AdvisoryLockingEvent, fidl::Error>;
621
622    fn poll_next(
623        mut self: std::pin::Pin<&mut Self>,
624        cx: &mut std::task::Context<'_>,
625    ) -> std::task::Poll<Option<Self::Item>> {
626        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
627            &mut self.event_receiver,
628            cx
629        )?) {
630            Some(buf) => std::task::Poll::Ready(Some(AdvisoryLockingEvent::decode(buf))),
631            None => std::task::Poll::Ready(None),
632        }
633    }
634}
635
636#[derive(Debug)]
637pub enum AdvisoryLockingEvent {}
638
639impl AdvisoryLockingEvent {
640    /// Decodes a message buffer as a [`AdvisoryLockingEvent`].
641    fn decode(
642        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
643    ) -> Result<AdvisoryLockingEvent, fidl::Error> {
644        let (bytes, _handles) = buf.split_mut();
645        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
646        debug_assert_eq!(tx_header.tx_id, 0);
647        match tx_header.ordinal {
648            _ => Err(fidl::Error::UnknownOrdinal {
649                ordinal: tx_header.ordinal,
650                protocol_name:
651                    <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
652            }),
653        }
654    }
655}
656
657/// A Stream of incoming requests for fuchsia.io/AdvisoryLocking.
658pub struct AdvisoryLockingRequestStream {
659    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
660    is_terminated: bool,
661}
662
663impl std::marker::Unpin for AdvisoryLockingRequestStream {}
664
665impl futures::stream::FusedStream for AdvisoryLockingRequestStream {
666    fn is_terminated(&self) -> bool {
667        self.is_terminated
668    }
669}
670
671impl fidl::endpoints::RequestStream for AdvisoryLockingRequestStream {
672    type Protocol = AdvisoryLockingMarker;
673    type ControlHandle = AdvisoryLockingControlHandle;
674
675    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
676        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
677    }
678
679    fn control_handle(&self) -> Self::ControlHandle {
680        AdvisoryLockingControlHandle { inner: self.inner.clone() }
681    }
682
683    fn into_inner(
684        self,
685    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
686    {
687        (self.inner, self.is_terminated)
688    }
689
690    fn from_inner(
691        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
692        is_terminated: bool,
693    ) -> Self {
694        Self { inner, is_terminated }
695    }
696}
697
698impl futures::Stream for AdvisoryLockingRequestStream {
699    type Item = Result<AdvisoryLockingRequest, fidl::Error>;
700
701    fn poll_next(
702        mut self: std::pin::Pin<&mut Self>,
703        cx: &mut std::task::Context<'_>,
704    ) -> std::task::Poll<Option<Self::Item>> {
705        let this = &mut *self;
706        if this.inner.check_shutdown(cx) {
707            this.is_terminated = true;
708            return std::task::Poll::Ready(None);
709        }
710        if this.is_terminated {
711            panic!("polled AdvisoryLockingRequestStream after completion");
712        }
713        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
714            |bytes, handles| {
715                match this.inner.channel().read_etc(cx, bytes, handles) {
716                    std::task::Poll::Ready(Ok(())) => {}
717                    std::task::Poll::Pending => return std::task::Poll::Pending,
718                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
719                        this.is_terminated = true;
720                        return std::task::Poll::Ready(None);
721                    }
722                    std::task::Poll::Ready(Err(e)) => {
723                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
724                            e.into(),
725                        ))));
726                    }
727                }
728
729                // A message has been received from the channel
730                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
731
732                std::task::Poll::Ready(Some(match header.ordinal {
733                    0x6ee9c0ad53ec87aa => {
734                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
735                        let mut req = fidl::new_empty!(
736                            AdvisoryLockingAdvisoryLockRequest,
737                            fidl::encoding::DefaultFuchsiaResourceDialect
738                        );
739                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
740                        let control_handle =
741                            AdvisoryLockingControlHandle { inner: this.inner.clone() };
742                        Ok(AdvisoryLockingRequest::AdvisoryLock {
743                            request: req.request,
744
745                            responder: AdvisoryLockingAdvisoryLockResponder {
746                                control_handle: std::mem::ManuallyDrop::new(control_handle),
747                                tx_id: header.tx_id,
748                            },
749                        })
750                    }
751                    _ => Err(fidl::Error::UnknownOrdinal {
752                        ordinal: header.ordinal,
753                        protocol_name:
754                            <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
755                    }),
756                }))
757            },
758        )
759    }
760}
761
762/// Advisory locking protocol.
763///
764/// This protocol is intended to be composed into the |File| protocol to
765/// provide support for advisory locking.
766///
767/// Advisory locks are purely advisory. They do not prevent actual read or
768/// write operations from occurring on the file, either through this
769/// connection or through other connections.
770///
771/// These primitives are designed to support the flock() and fcntl(),
772/// specifically F_SETLK, F_SETLKW, and F_GETLK, functionality that code
773/// running on Fuchsia expects from other operating systems.
774#[derive(Debug)]
775pub enum AdvisoryLockingRequest {
776    /// Acquires an advisory lock on the underlying file.
777    ///
778    /// The lock lasts until either this connection is closed or
779    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
780    /// explicitly.
781    ///
782    /// Advisory locks are purely advisory. They do not prevent actual read or
783    /// write operations from occurring on the file, either through this
784    /// connection or through other connections.
785    ///
786    /// This method requires the following rights:
787    ///
788    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
789    /// * [`Rights.WRITE_BYTES`] if `request.type` is
790    ///   [`AdvisoryLockType.WRITE`].
791    ///
792    /// # Errors
793    ///
794    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
795    ///   example, another connection might hold a conflicting lock type.
796    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
797    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
798    ///   to acquire the given type of lock.
799    AdvisoryLock { request: AdvisoryLockRequest, responder: AdvisoryLockingAdvisoryLockResponder },
800}
801
802impl AdvisoryLockingRequest {
803    #[allow(irrefutable_let_patterns)]
804    pub fn into_advisory_lock(
805        self,
806    ) -> Option<(AdvisoryLockRequest, AdvisoryLockingAdvisoryLockResponder)> {
807        if let AdvisoryLockingRequest::AdvisoryLock { request, responder } = self {
808            Some((request, responder))
809        } else {
810            None
811        }
812    }
813
814    /// Name of the method defined in FIDL
815    pub fn method_name(&self) -> &'static str {
816        match *self {
817            AdvisoryLockingRequest::AdvisoryLock { .. } => "advisory_lock",
818        }
819    }
820}
821
822#[derive(Debug, Clone)]
823pub struct AdvisoryLockingControlHandle {
824    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
825}
826
827impl fidl::endpoints::ControlHandle for AdvisoryLockingControlHandle {
828    fn shutdown(&self) {
829        self.inner.shutdown()
830    }
831    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
832        self.inner.shutdown_with_epitaph(status)
833    }
834
835    fn is_closed(&self) -> bool {
836        self.inner.channel().is_closed()
837    }
838    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
839        self.inner.channel().on_closed()
840    }
841
842    #[cfg(target_os = "fuchsia")]
843    fn signal_peer(
844        &self,
845        clear_mask: zx::Signals,
846        set_mask: zx::Signals,
847    ) -> Result<(), zx_status::Status> {
848        use fidl::Peered;
849        self.inner.channel().signal_peer(clear_mask, set_mask)
850    }
851}
852
853impl AdvisoryLockingControlHandle {}
854
855#[must_use = "FIDL methods require a response to be sent"]
856#[derive(Debug)]
857pub struct AdvisoryLockingAdvisoryLockResponder {
858    control_handle: std::mem::ManuallyDrop<AdvisoryLockingControlHandle>,
859    tx_id: u32,
860}
861
862/// Set the the channel to be shutdown (see [`AdvisoryLockingControlHandle::shutdown`])
863/// if the responder is dropped without sending a response, so that the client
864/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
865impl std::ops::Drop for AdvisoryLockingAdvisoryLockResponder {
866    fn drop(&mut self) {
867        self.control_handle.shutdown();
868        // Safety: drops once, never accessed again
869        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
870    }
871}
872
873impl fidl::endpoints::Responder for AdvisoryLockingAdvisoryLockResponder {
874    type ControlHandle = AdvisoryLockingControlHandle;
875
876    fn control_handle(&self) -> &AdvisoryLockingControlHandle {
877        &self.control_handle
878    }
879
880    fn drop_without_shutdown(mut self) {
881        // Safety: drops once, never accessed again due to mem::forget
882        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
883        // Prevent Drop from running (which would shut down the channel)
884        std::mem::forget(self);
885    }
886}
887
888impl AdvisoryLockingAdvisoryLockResponder {
889    /// Sends a response to the FIDL transaction.
890    ///
891    /// Sets the channel to shutdown if an error occurs.
892    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
893        let _result = self.send_raw(result);
894        if _result.is_err() {
895            self.control_handle.shutdown();
896        }
897        self.drop_without_shutdown();
898        _result
899    }
900
901    /// Similar to "send" but does not shutdown the channel if an error occurs.
902    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
903        let _result = self.send_raw(result);
904        self.drop_without_shutdown();
905        _result
906    }
907
908    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
909        self.control_handle
910            .inner
911            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
912                result,
913                self.tx_id,
914                0x6ee9c0ad53ec87aa,
915                fidl::encoding::DynamicFlags::empty(),
916            )
917    }
918}
919
920#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
921pub struct DirectoryMarker;
922
923impl fidl::endpoints::ProtocolMarker for DirectoryMarker {
924    type Proxy = DirectoryProxy;
925    type RequestStream = DirectoryRequestStream;
926    #[cfg(target_os = "fuchsia")]
927    type SynchronousProxy = DirectorySynchronousProxy;
928
929    const DEBUG_NAME: &'static str = "fuchsia.io.Directory";
930}
931impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryMarker {}
932pub type DirectoryUnlinkResult = Result<(), i32>;
933pub type DirectoryRenameResult = Result<(), i32>;
934pub type DirectoryCreateSymlinkResult = Result<(), i32>;
935
936pub trait DirectoryProxyInterface: Send + Sync {
937    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
938        + Send;
939    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
940    fn r#clone(
941        &self,
942        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
943    ) -> Result<(), fidl::Error>;
944    type CloseResponseFut: std::future::Future<
945            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
946        > + Send;
947    fn r#close(&self) -> Self::CloseResponseFut;
948    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
949    fn r#query(&self) -> Self::QueryResponseFut;
950    fn r#deprecated_clone(
951        &self,
952        flags: OpenFlags,
953        object: fidl::endpoints::ServerEnd<NodeMarker>,
954    ) -> Result<(), fidl::Error>;
955    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
956        + Send;
957    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
958    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
959    fn r#deprecated_set_attr(
960        &self,
961        flags: NodeAttributeFlags,
962        attributes: &NodeAttributes,
963    ) -> Self::DeprecatedSetAttrResponseFut;
964    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
965        + Send;
966    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
967    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
968        + Send;
969    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
970    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
971        + Send;
972    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
973    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
974        + Send;
975    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
976    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
977        + Send;
978    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
979    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
980        + Send;
981    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
982    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
983        + Send;
984    fn r#update_attributes(
985        &self,
986        payload: &MutableNodeAttributes,
987    ) -> Self::UpdateAttributesResponseFut;
988    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
989    fn r#sync(&self) -> Self::SyncResponseFut;
990    fn r#list_extended_attributes(
991        &self,
992        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
993    ) -> Result<(), fidl::Error>;
994    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
995        + Send;
996    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
997    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
998        + Send;
999    fn r#set_extended_attribute(
1000        &self,
1001        name: &[u8],
1002        value: ExtendedAttributeValue,
1003        mode: SetExtendedAttributeMode,
1004    ) -> Self::SetExtendedAttributeResponseFut;
1005    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
1006        + Send;
1007    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
1008    fn r#deprecated_open(
1009        &self,
1010        flags: OpenFlags,
1011        mode: ModeType,
1012        path: &str,
1013        object: fidl::endpoints::ServerEnd<NodeMarker>,
1014    ) -> Result<(), fidl::Error>;
1015    fn r#open(
1016        &self,
1017        path: &str,
1018        flags: Flags,
1019        options: &Options,
1020        object: fidl::Channel,
1021    ) -> Result<(), fidl::Error>;
1022    type ReadDirentsResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>), fidl::Error>>
1023        + Send;
1024    fn r#read_dirents(&self, max_bytes: u64) -> Self::ReadDirentsResponseFut;
1025    type RewindResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1026    fn r#rewind(&self) -> Self::RewindResponseFut;
1027    type GetTokenResponseFut: std::future::Future<Output = Result<(i32, Option<fidl::NullableHandle>), fidl::Error>>
1028        + Send;
1029    fn r#get_token(&self) -> Self::GetTokenResponseFut;
1030    type LinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1031    fn r#link(
1032        &self,
1033        src: &str,
1034        dst_parent_token: fidl::NullableHandle,
1035        dst: &str,
1036    ) -> Self::LinkResponseFut;
1037    type UnlinkResponseFut: std::future::Future<Output = Result<DirectoryUnlinkResult, fidl::Error>>
1038        + Send;
1039    fn r#unlink(&self, name: &str, options: &UnlinkOptions) -> Self::UnlinkResponseFut;
1040    type RenameResponseFut: std::future::Future<Output = Result<DirectoryRenameResult, fidl::Error>>
1041        + Send;
1042    fn r#rename(
1043        &self,
1044        src: &str,
1045        dst_parent_token: fidl::Event,
1046        dst: &str,
1047    ) -> Self::RenameResponseFut;
1048    type CreateSymlinkResponseFut: std::future::Future<Output = Result<DirectoryCreateSymlinkResult, fidl::Error>>
1049        + Send;
1050    fn r#create_symlink(
1051        &self,
1052        name: &str,
1053        target: &[u8],
1054        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1055    ) -> Self::CreateSymlinkResponseFut;
1056    type WatchResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1057    fn r#watch(
1058        &self,
1059        mask: WatchMask,
1060        options: u32,
1061        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1062    ) -> Self::WatchResponseFut;
1063}
1064#[derive(Debug)]
1065#[cfg(target_os = "fuchsia")]
1066pub struct DirectorySynchronousProxy {
1067    client: fidl::client::sync::Client,
1068}
1069
1070#[cfg(target_os = "fuchsia")]
1071impl fidl::endpoints::SynchronousProxy for DirectorySynchronousProxy {
1072    type Proxy = DirectoryProxy;
1073    type Protocol = DirectoryMarker;
1074
1075    fn from_channel(inner: fidl::Channel) -> Self {
1076        Self::new(inner)
1077    }
1078
1079    fn into_channel(self) -> fidl::Channel {
1080        self.client.into_channel()
1081    }
1082
1083    fn as_channel(&self) -> &fidl::Channel {
1084        self.client.as_channel()
1085    }
1086}
1087
1088#[cfg(target_os = "fuchsia")]
1089impl DirectorySynchronousProxy {
1090    pub fn new(channel: fidl::Channel) -> Self {
1091        let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1092        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1093    }
1094
1095    pub fn into_channel(self) -> fidl::Channel {
1096        self.client.into_channel()
1097    }
1098
1099    /// Waits until an event arrives and returns it. It is safe for other
1100    /// threads to make concurrent requests while waiting for an event.
1101    pub fn wait_for_event(
1102        &self,
1103        deadline: zx::MonotonicInstant,
1104    ) -> Result<DirectoryEvent, fidl::Error> {
1105        DirectoryEvent::decode(self.client.wait_for_event(deadline)?)
1106    }
1107
1108    /// Acquires an advisory lock on the underlying file.
1109    ///
1110    /// The lock lasts until either this connection is closed or
1111    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1112    /// explicitly.
1113    ///
1114    /// Advisory locks are purely advisory. They do not prevent actual read or
1115    /// write operations from occurring on the file, either through this
1116    /// connection or through other connections.
1117    ///
1118    /// This method requires the following rights:
1119    ///
1120    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1121    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1122    ///   [`AdvisoryLockType.WRITE`].
1123    ///
1124    /// # Errors
1125    ///
1126    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1127    ///   example, another connection might hold a conflicting lock type.
1128    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1129    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1130    ///   to acquire the given type of lock.
1131    pub fn r#advisory_lock(
1132        &self,
1133        mut request: &AdvisoryLockRequest,
1134        ___deadline: zx::MonotonicInstant,
1135    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
1136        let _response = self.client.send_query::<
1137            AdvisoryLockingAdvisoryLockRequest,
1138            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1139        >(
1140            (request,),
1141            0x6ee9c0ad53ec87aa,
1142            fidl::encoding::DynamicFlags::empty(),
1143            ___deadline,
1144        )?;
1145        Ok(_response.map(|x| x))
1146    }
1147
1148    pub fn r#clone(
1149        &self,
1150        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1151    ) -> Result<(), fidl::Error> {
1152        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
1153            (request,),
1154            0x20d8a7aba2168a79,
1155            fidl::encoding::DynamicFlags::empty(),
1156        )
1157    }
1158
1159    /// Terminates the connection.
1160    ///
1161    /// After calling `Close`, the client must not send any other requests.
1162    ///
1163    /// Servers, after sending the status response, should close the connection
1164    /// regardless of status and without sending an epitaph.
1165    ///
1166    /// Closing the client end of the channel should be semantically equivalent
1167    /// to calling `Close` without knowing when the close has completed or its
1168    /// status.
1169    pub fn r#close(
1170        &self,
1171        ___deadline: zx::MonotonicInstant,
1172    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
1173        let _response = self.client.send_query::<
1174            fidl::encoding::EmptyPayload,
1175            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1176        >(
1177            (),
1178            0x5ac5d459ad7f657e,
1179            fidl::encoding::DynamicFlags::empty(),
1180            ___deadline,
1181        )?;
1182        Ok(_response.map(|x| x))
1183    }
1184
1185    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
1186        let _response = self.client.send_query::<
1187            fidl::encoding::EmptyPayload,
1188            fidl_fuchsia_unknown::QueryableQueryResponse,
1189        >(
1190            (),
1191            0x2658edee9decfc06,
1192            fidl::encoding::DynamicFlags::empty(),
1193            ___deadline,
1194        )?;
1195        Ok(_response.protocol)
1196    }
1197
1198    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1199    pub fn r#deprecated_clone(
1200        &self,
1201        mut flags: OpenFlags,
1202        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1203    ) -> Result<(), fidl::Error> {
1204        self.client.send::<NodeDeprecatedCloneRequest>(
1205            (flags, object),
1206            0x5a61678f293ce16f,
1207            fidl::encoding::DynamicFlags::FLEXIBLE,
1208        )
1209    }
1210
1211    /// DEPRECATED - Use `Node.GetAttributes` instead.
1212    pub fn r#deprecated_get_attr(
1213        &self,
1214        ___deadline: zx::MonotonicInstant,
1215    ) -> Result<(i32, NodeAttributes), fidl::Error> {
1216        let _response =
1217            self.client.send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse>(
1218                (),
1219                0x78985e216314dafd,
1220                fidl::encoding::DynamicFlags::empty(),
1221                ___deadline,
1222            )?;
1223        Ok((_response.s, _response.attributes))
1224    }
1225
1226    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1227    pub fn r#deprecated_set_attr(
1228        &self,
1229        mut flags: NodeAttributeFlags,
1230        mut attributes: &NodeAttributes,
1231        ___deadline: zx::MonotonicInstant,
1232    ) -> Result<i32, fidl::Error> {
1233        let _response =
1234            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
1235                (flags, attributes),
1236                0x4186c0f40d938f46,
1237                fidl::encoding::DynamicFlags::empty(),
1238                ___deadline,
1239            )?;
1240        Ok(_response.s)
1241    }
1242
1243    /// [DEPRECATED - Use new GetFlags method instead.]
1244    pub fn r#deprecated_get_flags(
1245        &self,
1246        ___deadline: zx::MonotonicInstant,
1247    ) -> Result<(i32, OpenFlags), fidl::Error> {
1248        let _response = self
1249            .client
1250            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
1251                (),
1252                0x5b88fffb8eda3aa1,
1253                fidl::encoding::DynamicFlags::empty(),
1254                ___deadline,
1255            )?;
1256        Ok((_response.s, _response.flags))
1257    }
1258
1259    /// [DEPRECATED - Use new SetFlags method instead.]
1260    pub fn r#deprecated_set_flags(
1261        &self,
1262        mut flags: OpenFlags,
1263        ___deadline: zx::MonotonicInstant,
1264    ) -> Result<i32, fidl::Error> {
1265        let _response = self
1266            .client
1267            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
1268                (flags,),
1269                0x5295b76c71fde733,
1270                fidl::encoding::DynamicFlags::empty(),
1271                ___deadline,
1272            )?;
1273        Ok(_response.s)
1274    }
1275
1276    /// Queries the flags that apply to this node after it has been opened/created. This method does
1277    /// not require any rights.
1278    ///
1279    /// Note that the final set of flags that apply to the connection may differ from those
1280    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1281    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1282    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1283    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1284    pub fn r#get_flags(
1285        &self,
1286        ___deadline: zx::MonotonicInstant,
1287    ) -> Result<NodeGetFlagsResult, fidl::Error> {
1288        let _response = self.client.send_query::<
1289            fidl::encoding::EmptyPayload,
1290            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
1291        >(
1292            (),
1293            0x176eb318f64ec23,
1294            fidl::encoding::DynamicFlags::FLEXIBLE,
1295            ___deadline,
1296        )?
1297        .into_result::<DirectoryMarker>("get_flags")?;
1298        Ok(_response.map(|x| x.flags))
1299    }
1300
1301    /// Sets the flags that apply to this node after it has been opened. This method does not
1302    /// require any rights.
1303    ///
1304    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1305    /// clear append mode.
1306    ///
1307    /// Errors:
1308    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1309    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1310    pub fn r#set_flags(
1311        &self,
1312        mut flags: Flags,
1313        ___deadline: zx::MonotonicInstant,
1314    ) -> Result<NodeSetFlagsResult, fidl::Error> {
1315        let _response = self.client.send_query::<
1316            NodeSetFlagsRequest,
1317            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1318        >(
1319            (flags,),
1320            0x55a8028685791ea8,
1321            fidl::encoding::DynamicFlags::FLEXIBLE,
1322            ___deadline,
1323        )?
1324        .into_result::<DirectoryMarker>("set_flags")?;
1325        Ok(_response.map(|x| x))
1326    }
1327
1328    /// Query the filesystem for filesystem-specific information.
1329    pub fn r#query_filesystem(
1330        &self,
1331        ___deadline: zx::MonotonicInstant,
1332    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
1333        let _response =
1334            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
1335                (),
1336                0x6f344a1c6b0a0610,
1337                fidl::encoding::DynamicFlags::empty(),
1338                ___deadline,
1339            )?;
1340        Ok((_response.s, _response.info))
1341    }
1342
1343    /// Acquires information about the node.
1344    ///
1345    /// The attributes of a node should be stable, independent of the
1346    /// specific protocol used to access it.
1347    ///
1348    /// If a particular attribute is not applicable or not supported,
1349    /// filesystems should leave the corresponding field absent.
1350    ///
1351    /// + `query` a bit-mask specifying which attributes to fetch. The server
1352    ///   should not return more than necessary.
1353    /// - `attributes` the returned attributes.
1354    ///
1355    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1356    pub fn r#get_attributes(
1357        &self,
1358        mut query: NodeAttributesQuery,
1359        ___deadline: zx::MonotonicInstant,
1360    ) -> Result<NodeGetAttributesResult, fidl::Error> {
1361        let _response = self.client.send_query::<
1362            NodeGetAttributesRequest,
1363            fidl::encoding::ResultType<NodeAttributes2, i32>,
1364        >(
1365            (query,),
1366            0x3d4396a638ea053b,
1367            fidl::encoding::DynamicFlags::empty(),
1368            ___deadline,
1369        )?;
1370        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
1371    }
1372
1373    /// Updates information about the node.
1374    ///
1375    /// + `attributes` the presence of a table field in `attributes` indicates
1376    /// the intent to update the corresponding attribute.
1377    ///
1378    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
1379    ///
1380    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1381    pub fn r#update_attributes(
1382        &self,
1383        mut payload: &MutableNodeAttributes,
1384        ___deadline: zx::MonotonicInstant,
1385    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
1386        let _response = self.client.send_query::<
1387            MutableNodeAttributes,
1388            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1389        >(
1390            payload,
1391            0x3308c1da5a89bf08,
1392            fidl::encoding::DynamicFlags::empty(),
1393            ___deadline,
1394        )?;
1395        Ok(_response.map(|x| x))
1396    }
1397
1398    /// Synchronizes updates to the node to the underlying media, if it exists.
1399    ///
1400    /// This method will return when the filesystem server has flushed the
1401    /// relevant updates to the underlying media, but does not guarantee the
1402    /// underlying media has persisted the information, nor that any information
1403    /// is committed to hardware. Clients may use `Sync` to ensure ordering
1404    /// between operations.
1405    ///
1406    /// This method does not require any rights.
1407    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
1408        let _response = self.client.send_query::<
1409            fidl::encoding::EmptyPayload,
1410            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1411        >(
1412            (),
1413            0x2c5c27ca0ab5dc49,
1414            fidl::encoding::DynamicFlags::empty(),
1415            ___deadline,
1416        )?;
1417        Ok(_response.map(|x| x))
1418    }
1419
1420    /// Creates an iterator over all the extended attribute names associated
1421    /// with this node. If an error occurs it is returned as an epitaph on the
1422    /// iterator request channel, and then the channel is closed.
1423    ///
1424    /// GetExtendedAttributes can be used with any of these names to retrieve
1425    /// the associated value.
1426    ///
1427    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1428    pub fn r#list_extended_attributes(
1429        &self,
1430        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
1431    ) -> Result<(), fidl::Error> {
1432        self.client.send::<NodeListExtendedAttributesRequest>(
1433            (iterator,),
1434            0x4b61033de007fcd0,
1435            fidl::encoding::DynamicFlags::empty(),
1436        )
1437    }
1438
1439    /// Get the value associated with the given attribute `name` for this node.
1440    ///
1441    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
1442    /// particular structure is imposed on them.
1443    ///
1444    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1445    pub fn r#get_extended_attribute(
1446        &self,
1447        mut name: &[u8],
1448        ___deadline: zx::MonotonicInstant,
1449    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
1450        let _response = self.client.send_query::<
1451            NodeGetExtendedAttributeRequest,
1452            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
1453        >(
1454            (name,),
1455            0x45ffa3ccfdeb76db,
1456            fidl::encoding::DynamicFlags::empty(),
1457            ___deadline,
1458        )?;
1459        Ok(_response.map(|x| x))
1460    }
1461
1462    /// Set the value for the given attribute `name` to `value` for this node.
1463    ///
1464    /// The attribute name may exist, in which case the attribute is updated.
1465    /// If the attribute doesn't exist, it is created. The name should have no
1466    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
1467    ///
1468    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1469    pub fn r#set_extended_attribute(
1470        &self,
1471        mut name: &[u8],
1472        mut value: ExtendedAttributeValue,
1473        mut mode: SetExtendedAttributeMode,
1474        ___deadline: zx::MonotonicInstant,
1475    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
1476        let _response = self.client.send_query::<
1477            NodeSetExtendedAttributeRequest,
1478            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1479        >(
1480            (name, &mut value, mode,),
1481            0x4a951362f681f23c,
1482            fidl::encoding::DynamicFlags::empty(),
1483            ___deadline,
1484        )?;
1485        Ok(_response.map(|x| x))
1486    }
1487
1488    /// Remove the specified extended attribute.
1489    ///
1490    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
1491    ///
1492    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1493    pub fn r#remove_extended_attribute(
1494        &self,
1495        mut name: &[u8],
1496        ___deadline: zx::MonotonicInstant,
1497    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
1498        let _response = self.client.send_query::<
1499            NodeRemoveExtendedAttributeRequest,
1500            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1501        >(
1502            (name,),
1503            0x7a0b9f3a9bf9032d,
1504            fidl::encoding::DynamicFlags::empty(),
1505            ___deadline,
1506        )?;
1507        Ok(_response.map(|x| x))
1508    }
1509
1510    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
1511    pub fn r#deprecated_open(
1512        &self,
1513        mut flags: OpenFlags,
1514        mut mode: ModeType,
1515        mut path: &str,
1516        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1517    ) -> Result<(), fidl::Error> {
1518        self.client.send::<DirectoryDeprecatedOpenRequest>(
1519            (flags, mode, path, object),
1520            0x2c5044561d685ec0,
1521            fidl::encoding::DynamicFlags::FLEXIBLE,
1522        )
1523    }
1524
1525    /// Open (or create) a node relative to this directory. Any errors are communicated via an
1526    /// epitaph sent on the `object` channel.
1527    ///
1528    /// Errors:
1529    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
1530    /// * See [`Flags`] for other errors which may be communicated based on `flags`
1531    pub fn r#open(
1532        &self,
1533        mut path: &str,
1534        mut flags: Flags,
1535        mut options: &Options,
1536        mut object: fidl::Channel,
1537    ) -> Result<(), fidl::Error> {
1538        self.client.send::<DirectoryOpenRequest>(
1539            (path, flags, options, object),
1540            0x568ddcb9a9cbb6d9,
1541            fidl::encoding::DynamicFlags::empty(),
1542        )
1543    }
1544
1545    /// Reads a collection of variably sized dirents into a buffer.
1546    /// The number of dirents in a directory may be very large: akin to
1547    /// calling read multiple times on a file, directories have a seek
1548    /// offset which is updated on subsequent calls to ReadDirents.
1549    /// Each call to ReadDirents will only return whole dirent structures,
1550    /// they will not get split across ReadDirent calls. When the seek
1551    /// offset reaches the end, `dirents` will be empty.
1552    ///
1553    /// These dirents are of the form:
1554    /// ```
1555    /// struct dirent {
1556    ///   // Describes the inode of the entry.
1557    ///   uint64 ino;
1558    ///   // Describes the length of the dirent name in bytes.
1559    ///   uint8 size;
1560    ///   // Describes the type of the entry. Aligned with the
1561    ///   // POSIX d_type values. Use `DirentType` constants.
1562    ///   uint8 type;
1563    ///   // Unterminated name of entry.
1564    ///   char name[0];
1565    /// }
1566    /// ```
1567    ///
1568    /// This method does not require any rights, since one could always probe for
1569    /// directory contents by triggering name conflicts during file creation.
1570    pub fn r#read_dirents(
1571        &self,
1572        mut max_bytes: u64,
1573        ___deadline: zx::MonotonicInstant,
1574    ) -> Result<(i32, Vec<u8>), fidl::Error> {
1575        let _response =
1576            self.client.send_query::<DirectoryReadDirentsRequest, DirectoryReadDirentsResponse>(
1577                (max_bytes,),
1578                0x3582806bf27faa0a,
1579                fidl::encoding::DynamicFlags::empty(),
1580                ___deadline,
1581            )?;
1582        Ok((_response.s, _response.dirents))
1583    }
1584
1585    /// Resets the directory seek offset.
1586    ///
1587    /// This method does not require any rights, similar to ReadDirents.
1588    pub fn r#rewind(&self, ___deadline: zx::MonotonicInstant) -> Result<i32, fidl::Error> {
1589        let _response =
1590            self.client.send_query::<fidl::encoding::EmptyPayload, DirectoryRewindResponse>(
1591                (),
1592                0x16b1202af0f34c71,
1593                fidl::encoding::DynamicFlags::empty(),
1594                ___deadline,
1595            )?;
1596        Ok(_response.s)
1597    }
1598
1599    /// Acquires a token to a Directory which can be used to identify access to it at a later point
1600    /// in time. The token will remain valid for as long as the connection requesting the token
1601    /// remains open.
1602    ///
1603    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1604    /// `ZX_ERR_BAD_HANDLE`.
1605    pub fn r#get_token(
1606        &self,
1607        ___deadline: zx::MonotonicInstant,
1608    ) -> Result<(i32, Option<fidl::NullableHandle>), fidl::Error> {
1609        let _response =
1610            self.client.send_query::<fidl::encoding::EmptyPayload, DirectoryGetTokenResponse>(
1611                (),
1612                0x26ae9d18763c8655,
1613                fidl::encoding::DynamicFlags::empty(),
1614                ___deadline,
1615            )?;
1616        Ok((_response.s, _response.token))
1617    }
1618
1619    /// Creates a link to an object named src by the name dst, within a directory represented by
1620    /// token.
1621    ///
1622    /// `src` must be a resolved object name. Including "/" in the string will
1623    /// return `ZX_ERR_INVALID_ARGS`.
1624    ///
1625    /// `dst` must be a resolved object name. Including "/" in the string will
1626    /// return `ZX_ERR_INVALID_ARGS`.
1627    ///
1628    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
1629    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
1630    ///
1631    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
1632    /// there are two actors operating concurrently, and one actor performs a rename that affects
1633    /// the source within this directory, and the other does a link, each will appear to occur
1634    /// atomically in an unspecified order.
1635    pub fn r#link(
1636        &self,
1637        mut src: &str,
1638        mut dst_parent_token: fidl::NullableHandle,
1639        mut dst: &str,
1640        ___deadline: zx::MonotonicInstant,
1641    ) -> Result<i32, fidl::Error> {
1642        let _response = self.client.send_query::<DirectoryLinkRequest, DirectoryLinkResponse>(
1643            (src, dst_parent_token, dst),
1644            0x740604c0c7c930e7,
1645            fidl::encoding::DynamicFlags::empty(),
1646            ___deadline,
1647        )?;
1648        Ok(_response.s)
1649    }
1650
1651    /// Removes a child node from the this directory's list of entries.
1652    ///
1653    /// Note: this does not guarantee that the underlying object is destroyed.
1654    /// Although the link will be removed from the containing directory,
1655    /// objects with multiple references (such as files which are still open)
1656    /// will not actually be destroyed until all references are closed.
1657    ///
1658    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
1659    ///   [`Rights.WRITE_BYTES`].
1660    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
1661    ///   support writing.
1662    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
1663    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
1664    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
1665    ///   containing a remote channel.
1666    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
1667    ///     something other than a directory was found.
1668    ///
1669    /// Other errors may be returned for filesystem-specific reasons.
1670    ///
1671    /// This method requires the following rights:
1672    ///
1673    /// * [`Rights.ENUMERATE`]
1674    /// * [`Rights.MODIFY_DIRECTORY`]
1675    pub fn r#unlink(
1676        &self,
1677        mut name: &str,
1678        mut options: &UnlinkOptions,
1679        ___deadline: zx::MonotonicInstant,
1680    ) -> Result<DirectoryUnlinkResult, fidl::Error> {
1681        let _response = self.client.send_query::<
1682            DirectoryUnlinkRequest,
1683            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1684        >(
1685            (name, options,),
1686            0x750a0326a78d7bed,
1687            fidl::encoding::DynamicFlags::empty(),
1688            ___deadline,
1689        )?;
1690        Ok(_response.map(|x| x))
1691    }
1692
1693    /// Renames a node named `src` to the name `dst`, in a directory represented
1694    /// by `dst_parent_token`.
1695    ///
1696    /// `src` and `dst` must be valid node names.
1697    /// See [`Name`] for what constitutes a valid name.
1698    ///
1699    /// This method requires the following rights on both the current connection, and the connection
1700    /// identified by `dst_parent_token`:
1701    ///
1702    /// * [`Rights.ENUMERATE`]
1703    /// * [`Rights.MODIFY_DIRECTORY`]
1704    ///
1705    /// The following requirements are necessary to avoid rights escalations.
1706    ///
1707    /// If the source and destination directory differ, the source directory must also have the
1708    /// maximal set of abilities supported for files, which would typically be
1709    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
1710    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
1711    /// right.
1712    ///
1713    /// If `src` refers to a directory, and differs from the destination directory, then the source
1714    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
1715    ///
1716    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
1717    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
1718    pub fn r#rename(
1719        &self,
1720        mut src: &str,
1721        mut dst_parent_token: fidl::Event,
1722        mut dst: &str,
1723        ___deadline: zx::MonotonicInstant,
1724    ) -> Result<DirectoryRenameResult, fidl::Error> {
1725        let _response = self.client.send_query::<
1726            DirectoryRenameRequest,
1727            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1728        >(
1729            (src, dst_parent_token, dst,),
1730            0x7060e7723b9928de,
1731            fidl::encoding::DynamicFlags::empty(),
1732            ___deadline,
1733        )?;
1734        Ok(_response.map(|x| x))
1735    }
1736
1737    /// Creates a symbolic link.
1738    ///
1739    /// `name` is the name to be given to the created symbolic link.
1740    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
1741    /// will perform no validation of `target` except for a server chosen maximum length.
1742    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
1743    /// on the successfully created node.
1744    ///
1745    /// * [`Rights.MODIFY_DIRECTORY`]
1746    ///
1747    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
1748    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
1749    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
1750    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
1751    pub fn r#create_symlink(
1752        &self,
1753        mut name: &str,
1754        mut target: &[u8],
1755        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1756        ___deadline: zx::MonotonicInstant,
1757    ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
1758        let _response = self.client.send_query::<
1759            DirectoryCreateSymlinkRequest,
1760            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1761        >(
1762            (name, target, connection,),
1763            0x21ce0f19ec043889,
1764            fidl::encoding::DynamicFlags::empty(),
1765            ___deadline,
1766        )?;
1767        Ok(_response.map(|x| x))
1768    }
1769
1770    /// Watches a directory, receiving events of added messages on the
1771    /// watcher request channel.
1772    ///
1773    /// Options must be zero; it is reserved.
1774    ///
1775    /// This method does not require any rights, similar to ReadDirents.
1776    pub fn r#watch(
1777        &self,
1778        mut mask: WatchMask,
1779        mut options: u32,
1780        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1781        ___deadline: zx::MonotonicInstant,
1782    ) -> Result<i32, fidl::Error> {
1783        let _response = self.client.send_query::<DirectoryWatchRequest, DirectoryWatchResponse>(
1784            (mask, options, watcher),
1785            0x5717193a59d66d91,
1786            fidl::encoding::DynamicFlags::empty(),
1787            ___deadline,
1788        )?;
1789        Ok(_response.s)
1790    }
1791}
1792
1793#[cfg(target_os = "fuchsia")]
1794impl From<DirectorySynchronousProxy> for zx::NullableHandle {
1795    fn from(value: DirectorySynchronousProxy) -> Self {
1796        value.into_channel().into()
1797    }
1798}
1799
1800#[cfg(target_os = "fuchsia")]
1801impl From<fidl::Channel> for DirectorySynchronousProxy {
1802    fn from(value: fidl::Channel) -> Self {
1803        Self::new(value)
1804    }
1805}
1806
1807#[cfg(target_os = "fuchsia")]
1808impl fidl::endpoints::FromClient for DirectorySynchronousProxy {
1809    type Protocol = DirectoryMarker;
1810
1811    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryMarker>) -> Self {
1812        Self::new(value.into_channel())
1813    }
1814}
1815
1816#[derive(Debug, Clone)]
1817pub struct DirectoryProxy {
1818    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1819}
1820
1821impl fidl::endpoints::Proxy for DirectoryProxy {
1822    type Protocol = DirectoryMarker;
1823
1824    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1825        Self::new(inner)
1826    }
1827
1828    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1829        self.client.into_channel().map_err(|client| Self { client })
1830    }
1831
1832    fn as_channel(&self) -> &::fidl::AsyncChannel {
1833        self.client.as_channel()
1834    }
1835}
1836
1837impl DirectoryProxy {
1838    /// Create a new Proxy for fuchsia.io/Directory.
1839    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1840        let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1841        Self { client: fidl::client::Client::new(channel, protocol_name) }
1842    }
1843
1844    /// Get a Stream of events from the remote end of the protocol.
1845    ///
1846    /// # Panics
1847    ///
1848    /// Panics if the event stream was already taken.
1849    pub fn take_event_stream(&self) -> DirectoryEventStream {
1850        DirectoryEventStream { event_receiver: self.client.take_event_receiver() }
1851    }
1852
1853    /// Acquires an advisory lock on the underlying file.
1854    ///
1855    /// The lock lasts until either this connection is closed or
1856    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1857    /// explicitly.
1858    ///
1859    /// Advisory locks are purely advisory. They do not prevent actual read or
1860    /// write operations from occurring on the file, either through this
1861    /// connection or through other connections.
1862    ///
1863    /// This method requires the following rights:
1864    ///
1865    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1866    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1867    ///   [`AdvisoryLockType.WRITE`].
1868    ///
1869    /// # Errors
1870    ///
1871    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1872    ///   example, another connection might hold a conflicting lock type.
1873    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1874    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1875    ///   to acquire the given type of lock.
1876    pub fn r#advisory_lock(
1877        &self,
1878        mut request: &AdvisoryLockRequest,
1879    ) -> fidl::client::QueryResponseFut<
1880        AdvisoryLockingAdvisoryLockResult,
1881        fidl::encoding::DefaultFuchsiaResourceDialect,
1882    > {
1883        DirectoryProxyInterface::r#advisory_lock(self, request)
1884    }
1885
1886    pub fn r#clone(
1887        &self,
1888        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1889    ) -> Result<(), fidl::Error> {
1890        DirectoryProxyInterface::r#clone(self, request)
1891    }
1892
1893    /// Terminates the connection.
1894    ///
1895    /// After calling `Close`, the client must not send any other requests.
1896    ///
1897    /// Servers, after sending the status response, should close the connection
1898    /// regardless of status and without sending an epitaph.
1899    ///
1900    /// Closing the client end of the channel should be semantically equivalent
1901    /// to calling `Close` without knowing when the close has completed or its
1902    /// status.
1903    pub fn r#close(
1904        &self,
1905    ) -> fidl::client::QueryResponseFut<
1906        fidl_fuchsia_unknown::CloseableCloseResult,
1907        fidl::encoding::DefaultFuchsiaResourceDialect,
1908    > {
1909        DirectoryProxyInterface::r#close(self)
1910    }
1911
1912    pub fn r#query(
1913        &self,
1914    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
1915    {
1916        DirectoryProxyInterface::r#query(self)
1917    }
1918
1919    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1920    pub fn r#deprecated_clone(
1921        &self,
1922        mut flags: OpenFlags,
1923        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1924    ) -> Result<(), fidl::Error> {
1925        DirectoryProxyInterface::r#deprecated_clone(self, flags, object)
1926    }
1927
1928    /// DEPRECATED - Use `Node.GetAttributes` instead.
1929    pub fn r#deprecated_get_attr(
1930        &self,
1931    ) -> fidl::client::QueryResponseFut<
1932        (i32, NodeAttributes),
1933        fidl::encoding::DefaultFuchsiaResourceDialect,
1934    > {
1935        DirectoryProxyInterface::r#deprecated_get_attr(self)
1936    }
1937
1938    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1939    pub fn r#deprecated_set_attr(
1940        &self,
1941        mut flags: NodeAttributeFlags,
1942        mut attributes: &NodeAttributes,
1943    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
1944        DirectoryProxyInterface::r#deprecated_set_attr(self, flags, attributes)
1945    }
1946
1947    /// [DEPRECATED - Use new GetFlags method instead.]
1948    pub fn r#deprecated_get_flags(
1949        &self,
1950    ) -> fidl::client::QueryResponseFut<
1951        (i32, OpenFlags),
1952        fidl::encoding::DefaultFuchsiaResourceDialect,
1953    > {
1954        DirectoryProxyInterface::r#deprecated_get_flags(self)
1955    }
1956
1957    /// [DEPRECATED - Use new SetFlags method instead.]
1958    pub fn r#deprecated_set_flags(
1959        &self,
1960        mut flags: OpenFlags,
1961    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
1962        DirectoryProxyInterface::r#deprecated_set_flags(self, flags)
1963    }
1964
1965    /// Queries the flags that apply to this node after it has been opened/created. This method does
1966    /// not require any rights.
1967    ///
1968    /// Note that the final set of flags that apply to the connection may differ from those
1969    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1970    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1971    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1972    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1973    pub fn r#get_flags(
1974        &self,
1975    ) -> fidl::client::QueryResponseFut<
1976        NodeGetFlagsResult,
1977        fidl::encoding::DefaultFuchsiaResourceDialect,
1978    > {
1979        DirectoryProxyInterface::r#get_flags(self)
1980    }
1981
1982    /// Sets the flags that apply to this node after it has been opened. This method does not
1983    /// require any rights.
1984    ///
1985    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1986    /// clear append mode.
1987    ///
1988    /// Errors:
1989    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1990    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1991    pub fn r#set_flags(
1992        &self,
1993        mut flags: Flags,
1994    ) -> fidl::client::QueryResponseFut<
1995        NodeSetFlagsResult,
1996        fidl::encoding::DefaultFuchsiaResourceDialect,
1997    > {
1998        DirectoryProxyInterface::r#set_flags(self, flags)
1999    }
2000
2001    /// Query the filesystem for filesystem-specific information.
2002    pub fn r#query_filesystem(
2003        &self,
2004    ) -> fidl::client::QueryResponseFut<
2005        (i32, Option<Box<FilesystemInfo>>),
2006        fidl::encoding::DefaultFuchsiaResourceDialect,
2007    > {
2008        DirectoryProxyInterface::r#query_filesystem(self)
2009    }
2010
2011    /// Acquires information about the node.
2012    ///
2013    /// The attributes of a node should be stable, independent of the
2014    /// specific protocol used to access it.
2015    ///
2016    /// If a particular attribute is not applicable or not supported,
2017    /// filesystems should leave the corresponding field absent.
2018    ///
2019    /// + `query` a bit-mask specifying which attributes to fetch. The server
2020    ///   should not return more than necessary.
2021    /// - `attributes` the returned attributes.
2022    ///
2023    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2024    pub fn r#get_attributes(
2025        &self,
2026        mut query: NodeAttributesQuery,
2027    ) -> fidl::client::QueryResponseFut<
2028        NodeGetAttributesResult,
2029        fidl::encoding::DefaultFuchsiaResourceDialect,
2030    > {
2031        DirectoryProxyInterface::r#get_attributes(self, query)
2032    }
2033
2034    /// Updates information about the node.
2035    ///
2036    /// + `attributes` the presence of a table field in `attributes` indicates
2037    /// the intent to update the corresponding attribute.
2038    ///
2039    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
2040    ///
2041    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2042    pub fn r#update_attributes(
2043        &self,
2044        mut payload: &MutableNodeAttributes,
2045    ) -> fidl::client::QueryResponseFut<
2046        NodeUpdateAttributesResult,
2047        fidl::encoding::DefaultFuchsiaResourceDialect,
2048    > {
2049        DirectoryProxyInterface::r#update_attributes(self, payload)
2050    }
2051
2052    /// Synchronizes updates to the node to the underlying media, if it exists.
2053    ///
2054    /// This method will return when the filesystem server has flushed the
2055    /// relevant updates to the underlying media, but does not guarantee the
2056    /// underlying media has persisted the information, nor that any information
2057    /// is committed to hardware. Clients may use `Sync` to ensure ordering
2058    /// between operations.
2059    ///
2060    /// This method does not require any rights.
2061    pub fn r#sync(
2062        &self,
2063    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
2064    {
2065        DirectoryProxyInterface::r#sync(self)
2066    }
2067
2068    /// Creates an iterator over all the extended attribute names associated
2069    /// with this node. If an error occurs it is returned as an epitaph on the
2070    /// iterator request channel, and then the channel is closed.
2071    ///
2072    /// GetExtendedAttributes can be used with any of these names to retrieve
2073    /// the associated value.
2074    ///
2075    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2076    pub fn r#list_extended_attributes(
2077        &self,
2078        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2079    ) -> Result<(), fidl::Error> {
2080        DirectoryProxyInterface::r#list_extended_attributes(self, iterator)
2081    }
2082
2083    /// Get the value associated with the given attribute `name` for this node.
2084    ///
2085    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
2086    /// particular structure is imposed on them.
2087    ///
2088    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2089    pub fn r#get_extended_attribute(
2090        &self,
2091        mut name: &[u8],
2092    ) -> fidl::client::QueryResponseFut<
2093        NodeGetExtendedAttributeResult,
2094        fidl::encoding::DefaultFuchsiaResourceDialect,
2095    > {
2096        DirectoryProxyInterface::r#get_extended_attribute(self, name)
2097    }
2098
2099    /// Set the value for the given attribute `name` to `value` for this node.
2100    ///
2101    /// The attribute name may exist, in which case the attribute is updated.
2102    /// If the attribute doesn't exist, it is created. The name should have no
2103    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
2104    ///
2105    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2106    pub fn r#set_extended_attribute(
2107        &self,
2108        mut name: &[u8],
2109        mut value: ExtendedAttributeValue,
2110        mut mode: SetExtendedAttributeMode,
2111    ) -> fidl::client::QueryResponseFut<
2112        NodeSetExtendedAttributeResult,
2113        fidl::encoding::DefaultFuchsiaResourceDialect,
2114    > {
2115        DirectoryProxyInterface::r#set_extended_attribute(self, name, value, mode)
2116    }
2117
2118    /// Remove the specified extended attribute.
2119    ///
2120    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
2121    ///
2122    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2123    pub fn r#remove_extended_attribute(
2124        &self,
2125        mut name: &[u8],
2126    ) -> fidl::client::QueryResponseFut<
2127        NodeRemoveExtendedAttributeResult,
2128        fidl::encoding::DefaultFuchsiaResourceDialect,
2129    > {
2130        DirectoryProxyInterface::r#remove_extended_attribute(self, name)
2131    }
2132
2133    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
2134    pub fn r#deprecated_open(
2135        &self,
2136        mut flags: OpenFlags,
2137        mut mode: ModeType,
2138        mut path: &str,
2139        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2140    ) -> Result<(), fidl::Error> {
2141        DirectoryProxyInterface::r#deprecated_open(self, flags, mode, path, object)
2142    }
2143
2144    /// Open (or create) a node relative to this directory. Any errors are communicated via an
2145    /// epitaph sent on the `object` channel.
2146    ///
2147    /// Errors:
2148    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
2149    /// * See [`Flags`] for other errors which may be communicated based on `flags`
2150    pub fn r#open(
2151        &self,
2152        mut path: &str,
2153        mut flags: Flags,
2154        mut options: &Options,
2155        mut object: fidl::Channel,
2156    ) -> Result<(), fidl::Error> {
2157        DirectoryProxyInterface::r#open(self, path, flags, options, object)
2158    }
2159
2160    /// Reads a collection of variably sized dirents into a buffer.
2161    /// The number of dirents in a directory may be very large: akin to
2162    /// calling read multiple times on a file, directories have a seek
2163    /// offset which is updated on subsequent calls to ReadDirents.
2164    /// Each call to ReadDirents will only return whole dirent structures,
2165    /// they will not get split across ReadDirent calls. When the seek
2166    /// offset reaches the end, `dirents` will be empty.
2167    ///
2168    /// These dirents are of the form:
2169    /// ```
2170    /// struct dirent {
2171    ///   // Describes the inode of the entry.
2172    ///   uint64 ino;
2173    ///   // Describes the length of the dirent name in bytes.
2174    ///   uint8 size;
2175    ///   // Describes the type of the entry. Aligned with the
2176    ///   // POSIX d_type values. Use `DirentType` constants.
2177    ///   uint8 type;
2178    ///   // Unterminated name of entry.
2179    ///   char name[0];
2180    /// }
2181    /// ```
2182    ///
2183    /// This method does not require any rights, since one could always probe for
2184    /// directory contents by triggering name conflicts during file creation.
2185    pub fn r#read_dirents(
2186        &self,
2187        mut max_bytes: u64,
2188    ) -> fidl::client::QueryResponseFut<(i32, Vec<u8>), fidl::encoding::DefaultFuchsiaResourceDialect>
2189    {
2190        DirectoryProxyInterface::r#read_dirents(self, max_bytes)
2191    }
2192
2193    /// Resets the directory seek offset.
2194    ///
2195    /// This method does not require any rights, similar to ReadDirents.
2196    pub fn r#rewind(
2197        &self,
2198    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2199        DirectoryProxyInterface::r#rewind(self)
2200    }
2201
2202    /// Acquires a token to a Directory which can be used to identify access to it at a later point
2203    /// in time. The token will remain valid for as long as the connection requesting the token
2204    /// remains open.
2205    ///
2206    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
2207    /// `ZX_ERR_BAD_HANDLE`.
2208    pub fn r#get_token(
2209        &self,
2210    ) -> fidl::client::QueryResponseFut<
2211        (i32, Option<fidl::NullableHandle>),
2212        fidl::encoding::DefaultFuchsiaResourceDialect,
2213    > {
2214        DirectoryProxyInterface::r#get_token(self)
2215    }
2216
2217    /// Creates a link to an object named src by the name dst, within a directory represented by
2218    /// token.
2219    ///
2220    /// `src` must be a resolved object name. Including "/" in the string will
2221    /// return `ZX_ERR_INVALID_ARGS`.
2222    ///
2223    /// `dst` must be a resolved object name. Including "/" in the string will
2224    /// return `ZX_ERR_INVALID_ARGS`.
2225    ///
2226    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
2227    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
2228    ///
2229    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
2230    /// there are two actors operating concurrently, and one actor performs a rename that affects
2231    /// the source within this directory, and the other does a link, each will appear to occur
2232    /// atomically in an unspecified order.
2233    pub fn r#link(
2234        &self,
2235        mut src: &str,
2236        mut dst_parent_token: fidl::NullableHandle,
2237        mut dst: &str,
2238    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2239        DirectoryProxyInterface::r#link(self, src, dst_parent_token, dst)
2240    }
2241
2242    /// Removes a child node from the this directory's list of entries.
2243    ///
2244    /// Note: this does not guarantee that the underlying object is destroyed.
2245    /// Although the link will be removed from the containing directory,
2246    /// objects with multiple references (such as files which are still open)
2247    /// will not actually be destroyed until all references are closed.
2248    ///
2249    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
2250    ///   [`Rights.WRITE_BYTES`].
2251    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
2252    ///   support writing.
2253    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
2254    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
2255    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
2256    ///   containing a remote channel.
2257    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
2258    ///     something other than a directory was found.
2259    ///
2260    /// Other errors may be returned for filesystem-specific reasons.
2261    ///
2262    /// This method requires the following rights:
2263    ///
2264    /// * [`Rights.ENUMERATE`]
2265    /// * [`Rights.MODIFY_DIRECTORY`]
2266    pub fn r#unlink(
2267        &self,
2268        mut name: &str,
2269        mut options: &UnlinkOptions,
2270    ) -> fidl::client::QueryResponseFut<
2271        DirectoryUnlinkResult,
2272        fidl::encoding::DefaultFuchsiaResourceDialect,
2273    > {
2274        DirectoryProxyInterface::r#unlink(self, name, options)
2275    }
2276
2277    /// Renames a node named `src` to the name `dst`, in a directory represented
2278    /// by `dst_parent_token`.
2279    ///
2280    /// `src` and `dst` must be valid node names.
2281    /// See [`Name`] for what constitutes a valid name.
2282    ///
2283    /// This method requires the following rights on both the current connection, and the connection
2284    /// identified by `dst_parent_token`:
2285    ///
2286    /// * [`Rights.ENUMERATE`]
2287    /// * [`Rights.MODIFY_DIRECTORY`]
2288    ///
2289    /// The following requirements are necessary to avoid rights escalations.
2290    ///
2291    /// If the source and destination directory differ, the source directory must also have the
2292    /// maximal set of abilities supported for files, which would typically be
2293    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
2294    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
2295    /// right.
2296    ///
2297    /// If `src` refers to a directory, and differs from the destination directory, then the source
2298    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
2299    ///
2300    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
2301    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
2302    pub fn r#rename(
2303        &self,
2304        mut src: &str,
2305        mut dst_parent_token: fidl::Event,
2306        mut dst: &str,
2307    ) -> fidl::client::QueryResponseFut<
2308        DirectoryRenameResult,
2309        fidl::encoding::DefaultFuchsiaResourceDialect,
2310    > {
2311        DirectoryProxyInterface::r#rename(self, src, dst_parent_token, dst)
2312    }
2313
2314    /// Creates a symbolic link.
2315    ///
2316    /// `name` is the name to be given to the created symbolic link.
2317    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
2318    /// will perform no validation of `target` except for a server chosen maximum length.
2319    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
2320    /// on the successfully created node.
2321    ///
2322    /// * [`Rights.MODIFY_DIRECTORY`]
2323    ///
2324    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
2325    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
2326    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
2327    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
2328    pub fn r#create_symlink(
2329        &self,
2330        mut name: &str,
2331        mut target: &[u8],
2332        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
2333    ) -> fidl::client::QueryResponseFut<
2334        DirectoryCreateSymlinkResult,
2335        fidl::encoding::DefaultFuchsiaResourceDialect,
2336    > {
2337        DirectoryProxyInterface::r#create_symlink(self, name, target, connection)
2338    }
2339
2340    /// Watches a directory, receiving events of added messages on the
2341    /// watcher request channel.
2342    ///
2343    /// Options must be zero; it is reserved.
2344    ///
2345    /// This method does not require any rights, similar to ReadDirents.
2346    pub fn r#watch(
2347        &self,
2348        mut mask: WatchMask,
2349        mut options: u32,
2350        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
2351    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2352        DirectoryProxyInterface::r#watch(self, mask, options, watcher)
2353    }
2354}
2355
2356impl DirectoryProxyInterface for DirectoryProxy {
2357    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
2358        AdvisoryLockingAdvisoryLockResult,
2359        fidl::encoding::DefaultFuchsiaResourceDialect,
2360    >;
2361    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
2362        fn _decode(
2363            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2364        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
2365            let _response = fidl::client::decode_transaction_body::<
2366                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2367                fidl::encoding::DefaultFuchsiaResourceDialect,
2368                0x6ee9c0ad53ec87aa,
2369            >(_buf?)?;
2370            Ok(_response.map(|x| x))
2371        }
2372        self.client.send_query_and_decode::<
2373            AdvisoryLockingAdvisoryLockRequest,
2374            AdvisoryLockingAdvisoryLockResult,
2375        >(
2376            (request,),
2377            0x6ee9c0ad53ec87aa,
2378            fidl::encoding::DynamicFlags::empty(),
2379            _decode,
2380        )
2381    }
2382
2383    fn r#clone(
2384        &self,
2385        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
2386    ) -> Result<(), fidl::Error> {
2387        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
2388            (request,),
2389            0x20d8a7aba2168a79,
2390            fidl::encoding::DynamicFlags::empty(),
2391        )
2392    }
2393
2394    type CloseResponseFut = fidl::client::QueryResponseFut<
2395        fidl_fuchsia_unknown::CloseableCloseResult,
2396        fidl::encoding::DefaultFuchsiaResourceDialect,
2397    >;
2398    fn r#close(&self) -> Self::CloseResponseFut {
2399        fn _decode(
2400            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2401        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
2402            let _response = fidl::client::decode_transaction_body::<
2403                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2404                fidl::encoding::DefaultFuchsiaResourceDialect,
2405                0x5ac5d459ad7f657e,
2406            >(_buf?)?;
2407            Ok(_response.map(|x| x))
2408        }
2409        self.client.send_query_and_decode::<
2410            fidl::encoding::EmptyPayload,
2411            fidl_fuchsia_unknown::CloseableCloseResult,
2412        >(
2413            (),
2414            0x5ac5d459ad7f657e,
2415            fidl::encoding::DynamicFlags::empty(),
2416            _decode,
2417        )
2418    }
2419
2420    type QueryResponseFut =
2421        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2422    fn r#query(&self) -> Self::QueryResponseFut {
2423        fn _decode(
2424            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2425        ) -> Result<Vec<u8>, fidl::Error> {
2426            let _response = fidl::client::decode_transaction_body::<
2427                fidl_fuchsia_unknown::QueryableQueryResponse,
2428                fidl::encoding::DefaultFuchsiaResourceDialect,
2429                0x2658edee9decfc06,
2430            >(_buf?)?;
2431            Ok(_response.protocol)
2432        }
2433        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
2434            (),
2435            0x2658edee9decfc06,
2436            fidl::encoding::DynamicFlags::empty(),
2437            _decode,
2438        )
2439    }
2440
2441    fn r#deprecated_clone(
2442        &self,
2443        mut flags: OpenFlags,
2444        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2445    ) -> Result<(), fidl::Error> {
2446        self.client.send::<NodeDeprecatedCloneRequest>(
2447            (flags, object),
2448            0x5a61678f293ce16f,
2449            fidl::encoding::DynamicFlags::FLEXIBLE,
2450        )
2451    }
2452
2453    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
2454        (i32, NodeAttributes),
2455        fidl::encoding::DefaultFuchsiaResourceDialect,
2456    >;
2457    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
2458        fn _decode(
2459            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2460        ) -> Result<(i32, NodeAttributes), fidl::Error> {
2461            let _response = fidl::client::decode_transaction_body::<
2462                NodeDeprecatedGetAttrResponse,
2463                fidl::encoding::DefaultFuchsiaResourceDialect,
2464                0x78985e216314dafd,
2465            >(_buf?)?;
2466            Ok((_response.s, _response.attributes))
2467        }
2468        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
2469            (),
2470            0x78985e216314dafd,
2471            fidl::encoding::DynamicFlags::empty(),
2472            _decode,
2473        )
2474    }
2475
2476    type DeprecatedSetAttrResponseFut =
2477        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2478    fn r#deprecated_set_attr(
2479        &self,
2480        mut flags: NodeAttributeFlags,
2481        mut attributes: &NodeAttributes,
2482    ) -> Self::DeprecatedSetAttrResponseFut {
2483        fn _decode(
2484            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2485        ) -> Result<i32, fidl::Error> {
2486            let _response = fidl::client::decode_transaction_body::<
2487                NodeDeprecatedSetAttrResponse,
2488                fidl::encoding::DefaultFuchsiaResourceDialect,
2489                0x4186c0f40d938f46,
2490            >(_buf?)?;
2491            Ok(_response.s)
2492        }
2493        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
2494            (flags, attributes),
2495            0x4186c0f40d938f46,
2496            fidl::encoding::DynamicFlags::empty(),
2497            _decode,
2498        )
2499    }
2500
2501    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
2502        (i32, OpenFlags),
2503        fidl::encoding::DefaultFuchsiaResourceDialect,
2504    >;
2505    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
2506        fn _decode(
2507            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2508        ) -> Result<(i32, OpenFlags), fidl::Error> {
2509            let _response = fidl::client::decode_transaction_body::<
2510                NodeDeprecatedGetFlagsResponse,
2511                fidl::encoding::DefaultFuchsiaResourceDialect,
2512                0x5b88fffb8eda3aa1,
2513            >(_buf?)?;
2514            Ok((_response.s, _response.flags))
2515        }
2516        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
2517            (),
2518            0x5b88fffb8eda3aa1,
2519            fidl::encoding::DynamicFlags::empty(),
2520            _decode,
2521        )
2522    }
2523
2524    type DeprecatedSetFlagsResponseFut =
2525        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2526    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
2527        fn _decode(
2528            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2529        ) -> Result<i32, fidl::Error> {
2530            let _response = fidl::client::decode_transaction_body::<
2531                NodeDeprecatedSetFlagsResponse,
2532                fidl::encoding::DefaultFuchsiaResourceDialect,
2533                0x5295b76c71fde733,
2534            >(_buf?)?;
2535            Ok(_response.s)
2536        }
2537        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
2538            (flags,),
2539            0x5295b76c71fde733,
2540            fidl::encoding::DynamicFlags::empty(),
2541            _decode,
2542        )
2543    }
2544
2545    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
2546        NodeGetFlagsResult,
2547        fidl::encoding::DefaultFuchsiaResourceDialect,
2548    >;
2549    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
2550        fn _decode(
2551            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2552        ) -> Result<NodeGetFlagsResult, fidl::Error> {
2553            let _response = fidl::client::decode_transaction_body::<
2554                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
2555                fidl::encoding::DefaultFuchsiaResourceDialect,
2556                0x176eb318f64ec23,
2557            >(_buf?)?
2558            .into_result::<DirectoryMarker>("get_flags")?;
2559            Ok(_response.map(|x| x.flags))
2560        }
2561        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
2562            (),
2563            0x176eb318f64ec23,
2564            fidl::encoding::DynamicFlags::FLEXIBLE,
2565            _decode,
2566        )
2567    }
2568
2569    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
2570        NodeSetFlagsResult,
2571        fidl::encoding::DefaultFuchsiaResourceDialect,
2572    >;
2573    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
2574        fn _decode(
2575            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2576        ) -> Result<NodeSetFlagsResult, fidl::Error> {
2577            let _response = fidl::client::decode_transaction_body::<
2578                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2579                fidl::encoding::DefaultFuchsiaResourceDialect,
2580                0x55a8028685791ea8,
2581            >(_buf?)?
2582            .into_result::<DirectoryMarker>("set_flags")?;
2583            Ok(_response.map(|x| x))
2584        }
2585        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
2586            (flags,),
2587            0x55a8028685791ea8,
2588            fidl::encoding::DynamicFlags::FLEXIBLE,
2589            _decode,
2590        )
2591    }
2592
2593    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
2594        (i32, Option<Box<FilesystemInfo>>),
2595        fidl::encoding::DefaultFuchsiaResourceDialect,
2596    >;
2597    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
2598        fn _decode(
2599            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2600        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
2601            let _response = fidl::client::decode_transaction_body::<
2602                NodeQueryFilesystemResponse,
2603                fidl::encoding::DefaultFuchsiaResourceDialect,
2604                0x6f344a1c6b0a0610,
2605            >(_buf?)?;
2606            Ok((_response.s, _response.info))
2607        }
2608        self.client.send_query_and_decode::<
2609            fidl::encoding::EmptyPayload,
2610            (i32, Option<Box<FilesystemInfo>>),
2611        >(
2612            (),
2613            0x6f344a1c6b0a0610,
2614            fidl::encoding::DynamicFlags::empty(),
2615            _decode,
2616        )
2617    }
2618
2619    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
2620        NodeGetAttributesResult,
2621        fidl::encoding::DefaultFuchsiaResourceDialect,
2622    >;
2623    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
2624        fn _decode(
2625            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2626        ) -> Result<NodeGetAttributesResult, fidl::Error> {
2627            let _response = fidl::client::decode_transaction_body::<
2628                fidl::encoding::ResultType<NodeAttributes2, i32>,
2629                fidl::encoding::DefaultFuchsiaResourceDialect,
2630                0x3d4396a638ea053b,
2631            >(_buf?)?;
2632            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
2633        }
2634        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
2635            (query,),
2636            0x3d4396a638ea053b,
2637            fidl::encoding::DynamicFlags::empty(),
2638            _decode,
2639        )
2640    }
2641
2642    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
2643        NodeUpdateAttributesResult,
2644        fidl::encoding::DefaultFuchsiaResourceDialect,
2645    >;
2646    fn r#update_attributes(
2647        &self,
2648        mut payload: &MutableNodeAttributes,
2649    ) -> Self::UpdateAttributesResponseFut {
2650        fn _decode(
2651            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2652        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
2653            let _response = fidl::client::decode_transaction_body::<
2654                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2655                fidl::encoding::DefaultFuchsiaResourceDialect,
2656                0x3308c1da5a89bf08,
2657            >(_buf?)?;
2658            Ok(_response.map(|x| x))
2659        }
2660        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
2661            payload,
2662            0x3308c1da5a89bf08,
2663            fidl::encoding::DynamicFlags::empty(),
2664            _decode,
2665        )
2666    }
2667
2668    type SyncResponseFut = fidl::client::QueryResponseFut<
2669        NodeSyncResult,
2670        fidl::encoding::DefaultFuchsiaResourceDialect,
2671    >;
2672    fn r#sync(&self) -> Self::SyncResponseFut {
2673        fn _decode(
2674            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2675        ) -> Result<NodeSyncResult, fidl::Error> {
2676            let _response = fidl::client::decode_transaction_body::<
2677                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2678                fidl::encoding::DefaultFuchsiaResourceDialect,
2679                0x2c5c27ca0ab5dc49,
2680            >(_buf?)?;
2681            Ok(_response.map(|x| x))
2682        }
2683        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
2684            (),
2685            0x2c5c27ca0ab5dc49,
2686            fidl::encoding::DynamicFlags::empty(),
2687            _decode,
2688        )
2689    }
2690
2691    fn r#list_extended_attributes(
2692        &self,
2693        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2694    ) -> Result<(), fidl::Error> {
2695        self.client.send::<NodeListExtendedAttributesRequest>(
2696            (iterator,),
2697            0x4b61033de007fcd0,
2698            fidl::encoding::DynamicFlags::empty(),
2699        )
2700    }
2701
2702    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2703        NodeGetExtendedAttributeResult,
2704        fidl::encoding::DefaultFuchsiaResourceDialect,
2705    >;
2706    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
2707        fn _decode(
2708            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2709        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
2710            let _response = fidl::client::decode_transaction_body::<
2711                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
2712                fidl::encoding::DefaultFuchsiaResourceDialect,
2713                0x45ffa3ccfdeb76db,
2714            >(_buf?)?;
2715            Ok(_response.map(|x| x))
2716        }
2717        self.client.send_query_and_decode::<
2718            NodeGetExtendedAttributeRequest,
2719            NodeGetExtendedAttributeResult,
2720        >(
2721            (name,),
2722            0x45ffa3ccfdeb76db,
2723            fidl::encoding::DynamicFlags::empty(),
2724            _decode,
2725        )
2726    }
2727
2728    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2729        NodeSetExtendedAttributeResult,
2730        fidl::encoding::DefaultFuchsiaResourceDialect,
2731    >;
2732    fn r#set_extended_attribute(
2733        &self,
2734        mut name: &[u8],
2735        mut value: ExtendedAttributeValue,
2736        mut mode: SetExtendedAttributeMode,
2737    ) -> Self::SetExtendedAttributeResponseFut {
2738        fn _decode(
2739            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2740        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
2741            let _response = fidl::client::decode_transaction_body::<
2742                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2743                fidl::encoding::DefaultFuchsiaResourceDialect,
2744                0x4a951362f681f23c,
2745            >(_buf?)?;
2746            Ok(_response.map(|x| x))
2747        }
2748        self.client.send_query_and_decode::<
2749            NodeSetExtendedAttributeRequest,
2750            NodeSetExtendedAttributeResult,
2751        >(
2752            (name, &mut value, mode,),
2753            0x4a951362f681f23c,
2754            fidl::encoding::DynamicFlags::empty(),
2755            _decode,
2756        )
2757    }
2758
2759    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2760        NodeRemoveExtendedAttributeResult,
2761        fidl::encoding::DefaultFuchsiaResourceDialect,
2762    >;
2763    fn r#remove_extended_attribute(
2764        &self,
2765        mut name: &[u8],
2766    ) -> Self::RemoveExtendedAttributeResponseFut {
2767        fn _decode(
2768            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2769        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
2770            let _response = fidl::client::decode_transaction_body::<
2771                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2772                fidl::encoding::DefaultFuchsiaResourceDialect,
2773                0x7a0b9f3a9bf9032d,
2774            >(_buf?)?;
2775            Ok(_response.map(|x| x))
2776        }
2777        self.client.send_query_and_decode::<
2778            NodeRemoveExtendedAttributeRequest,
2779            NodeRemoveExtendedAttributeResult,
2780        >(
2781            (name,),
2782            0x7a0b9f3a9bf9032d,
2783            fidl::encoding::DynamicFlags::empty(),
2784            _decode,
2785        )
2786    }
2787
2788    fn r#deprecated_open(
2789        &self,
2790        mut flags: OpenFlags,
2791        mut mode: ModeType,
2792        mut path: &str,
2793        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2794    ) -> Result<(), fidl::Error> {
2795        self.client.send::<DirectoryDeprecatedOpenRequest>(
2796            (flags, mode, path, object),
2797            0x2c5044561d685ec0,
2798            fidl::encoding::DynamicFlags::FLEXIBLE,
2799        )
2800    }
2801
2802    fn r#open(
2803        &self,
2804        mut path: &str,
2805        mut flags: Flags,
2806        mut options: &Options,
2807        mut object: fidl::Channel,
2808    ) -> Result<(), fidl::Error> {
2809        self.client.send::<DirectoryOpenRequest>(
2810            (path, flags, options, object),
2811            0x568ddcb9a9cbb6d9,
2812            fidl::encoding::DynamicFlags::empty(),
2813        )
2814    }
2815
2816    type ReadDirentsResponseFut = fidl::client::QueryResponseFut<
2817        (i32, Vec<u8>),
2818        fidl::encoding::DefaultFuchsiaResourceDialect,
2819    >;
2820    fn r#read_dirents(&self, mut max_bytes: u64) -> Self::ReadDirentsResponseFut {
2821        fn _decode(
2822            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2823        ) -> Result<(i32, Vec<u8>), fidl::Error> {
2824            let _response = fidl::client::decode_transaction_body::<
2825                DirectoryReadDirentsResponse,
2826                fidl::encoding::DefaultFuchsiaResourceDialect,
2827                0x3582806bf27faa0a,
2828            >(_buf?)?;
2829            Ok((_response.s, _response.dirents))
2830        }
2831        self.client.send_query_and_decode::<DirectoryReadDirentsRequest, (i32, Vec<u8>)>(
2832            (max_bytes,),
2833            0x3582806bf27faa0a,
2834            fidl::encoding::DynamicFlags::empty(),
2835            _decode,
2836        )
2837    }
2838
2839    type RewindResponseFut =
2840        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2841    fn r#rewind(&self) -> Self::RewindResponseFut {
2842        fn _decode(
2843            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2844        ) -> Result<i32, fidl::Error> {
2845            let _response = fidl::client::decode_transaction_body::<
2846                DirectoryRewindResponse,
2847                fidl::encoding::DefaultFuchsiaResourceDialect,
2848                0x16b1202af0f34c71,
2849            >(_buf?)?;
2850            Ok(_response.s)
2851        }
2852        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
2853            (),
2854            0x16b1202af0f34c71,
2855            fidl::encoding::DynamicFlags::empty(),
2856            _decode,
2857        )
2858    }
2859
2860    type GetTokenResponseFut = fidl::client::QueryResponseFut<
2861        (i32, Option<fidl::NullableHandle>),
2862        fidl::encoding::DefaultFuchsiaResourceDialect,
2863    >;
2864    fn r#get_token(&self) -> Self::GetTokenResponseFut {
2865        fn _decode(
2866            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2867        ) -> Result<(i32, Option<fidl::NullableHandle>), fidl::Error> {
2868            let _response = fidl::client::decode_transaction_body::<
2869                DirectoryGetTokenResponse,
2870                fidl::encoding::DefaultFuchsiaResourceDialect,
2871                0x26ae9d18763c8655,
2872            >(_buf?)?;
2873            Ok((_response.s, _response.token))
2874        }
2875        self.client.send_query_and_decode::<
2876            fidl::encoding::EmptyPayload,
2877            (i32, Option<fidl::NullableHandle>),
2878        >(
2879            (),
2880            0x26ae9d18763c8655,
2881            fidl::encoding::DynamicFlags::empty(),
2882            _decode,
2883        )
2884    }
2885
2886    type LinkResponseFut =
2887        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2888    fn r#link(
2889        &self,
2890        mut src: &str,
2891        mut dst_parent_token: fidl::NullableHandle,
2892        mut dst: &str,
2893    ) -> Self::LinkResponseFut {
2894        fn _decode(
2895            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2896        ) -> Result<i32, fidl::Error> {
2897            let _response = fidl::client::decode_transaction_body::<
2898                DirectoryLinkResponse,
2899                fidl::encoding::DefaultFuchsiaResourceDialect,
2900                0x740604c0c7c930e7,
2901            >(_buf?)?;
2902            Ok(_response.s)
2903        }
2904        self.client.send_query_and_decode::<DirectoryLinkRequest, i32>(
2905            (src, dst_parent_token, dst),
2906            0x740604c0c7c930e7,
2907            fidl::encoding::DynamicFlags::empty(),
2908            _decode,
2909        )
2910    }
2911
2912    type UnlinkResponseFut = fidl::client::QueryResponseFut<
2913        DirectoryUnlinkResult,
2914        fidl::encoding::DefaultFuchsiaResourceDialect,
2915    >;
2916    fn r#unlink(&self, mut name: &str, mut options: &UnlinkOptions) -> Self::UnlinkResponseFut {
2917        fn _decode(
2918            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2919        ) -> Result<DirectoryUnlinkResult, fidl::Error> {
2920            let _response = fidl::client::decode_transaction_body::<
2921                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2922                fidl::encoding::DefaultFuchsiaResourceDialect,
2923                0x750a0326a78d7bed,
2924            >(_buf?)?;
2925            Ok(_response.map(|x| x))
2926        }
2927        self.client.send_query_and_decode::<DirectoryUnlinkRequest, DirectoryUnlinkResult>(
2928            (name, options),
2929            0x750a0326a78d7bed,
2930            fidl::encoding::DynamicFlags::empty(),
2931            _decode,
2932        )
2933    }
2934
2935    type RenameResponseFut = fidl::client::QueryResponseFut<
2936        DirectoryRenameResult,
2937        fidl::encoding::DefaultFuchsiaResourceDialect,
2938    >;
2939    fn r#rename(
2940        &self,
2941        mut src: &str,
2942        mut dst_parent_token: fidl::Event,
2943        mut dst: &str,
2944    ) -> Self::RenameResponseFut {
2945        fn _decode(
2946            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2947        ) -> Result<DirectoryRenameResult, fidl::Error> {
2948            let _response = fidl::client::decode_transaction_body::<
2949                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2950                fidl::encoding::DefaultFuchsiaResourceDialect,
2951                0x7060e7723b9928de,
2952            >(_buf?)?;
2953            Ok(_response.map(|x| x))
2954        }
2955        self.client.send_query_and_decode::<DirectoryRenameRequest, DirectoryRenameResult>(
2956            (src, dst_parent_token, dst),
2957            0x7060e7723b9928de,
2958            fidl::encoding::DynamicFlags::empty(),
2959            _decode,
2960        )
2961    }
2962
2963    type CreateSymlinkResponseFut = fidl::client::QueryResponseFut<
2964        DirectoryCreateSymlinkResult,
2965        fidl::encoding::DefaultFuchsiaResourceDialect,
2966    >;
2967    fn r#create_symlink(
2968        &self,
2969        mut name: &str,
2970        mut target: &[u8],
2971        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
2972    ) -> Self::CreateSymlinkResponseFut {
2973        fn _decode(
2974            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2975        ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
2976            let _response = fidl::client::decode_transaction_body::<
2977                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2978                fidl::encoding::DefaultFuchsiaResourceDialect,
2979                0x21ce0f19ec043889,
2980            >(_buf?)?;
2981            Ok(_response.map(|x| x))
2982        }
2983        self.client
2984            .send_query_and_decode::<DirectoryCreateSymlinkRequest, DirectoryCreateSymlinkResult>(
2985                (name, target, connection),
2986                0x21ce0f19ec043889,
2987                fidl::encoding::DynamicFlags::empty(),
2988                _decode,
2989            )
2990    }
2991
2992    type WatchResponseFut =
2993        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2994    fn r#watch(
2995        &self,
2996        mut mask: WatchMask,
2997        mut options: u32,
2998        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
2999    ) -> Self::WatchResponseFut {
3000        fn _decode(
3001            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3002        ) -> Result<i32, fidl::Error> {
3003            let _response = fidl::client::decode_transaction_body::<
3004                DirectoryWatchResponse,
3005                fidl::encoding::DefaultFuchsiaResourceDialect,
3006                0x5717193a59d66d91,
3007            >(_buf?)?;
3008            Ok(_response.s)
3009        }
3010        self.client.send_query_and_decode::<DirectoryWatchRequest, i32>(
3011            (mask, options, watcher),
3012            0x5717193a59d66d91,
3013            fidl::encoding::DynamicFlags::empty(),
3014            _decode,
3015        )
3016    }
3017}
3018
3019pub struct DirectoryEventStream {
3020    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3021}
3022
3023impl std::marker::Unpin for DirectoryEventStream {}
3024
3025impl futures::stream::FusedStream for DirectoryEventStream {
3026    fn is_terminated(&self) -> bool {
3027        self.event_receiver.is_terminated()
3028    }
3029}
3030
3031impl futures::Stream for DirectoryEventStream {
3032    type Item = Result<DirectoryEvent, fidl::Error>;
3033
3034    fn poll_next(
3035        mut self: std::pin::Pin<&mut Self>,
3036        cx: &mut std::task::Context<'_>,
3037    ) -> std::task::Poll<Option<Self::Item>> {
3038        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3039            &mut self.event_receiver,
3040            cx
3041        )?) {
3042            Some(buf) => std::task::Poll::Ready(Some(DirectoryEvent::decode(buf))),
3043            None => std::task::Poll::Ready(None),
3044        }
3045    }
3046}
3047
3048#[derive(Debug)]
3049pub enum DirectoryEvent {
3050    OnOpen_ {
3051        s: i32,
3052        info: Option<Box<NodeInfoDeprecated>>,
3053    },
3054    OnRepresentation {
3055        payload: Representation,
3056    },
3057    #[non_exhaustive]
3058    _UnknownEvent {
3059        /// Ordinal of the event that was sent.
3060        ordinal: u64,
3061    },
3062}
3063
3064impl DirectoryEvent {
3065    #[allow(irrefutable_let_patterns)]
3066    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
3067        if let DirectoryEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
3068    }
3069    #[allow(irrefutable_let_patterns)]
3070    pub fn into_on_representation(self) -> Option<Representation> {
3071        if let DirectoryEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
3072    }
3073
3074    /// Decodes a message buffer as a [`DirectoryEvent`].
3075    fn decode(
3076        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3077    ) -> Result<DirectoryEvent, fidl::Error> {
3078        let (bytes, _handles) = buf.split_mut();
3079        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3080        debug_assert_eq!(tx_header.tx_id, 0);
3081        match tx_header.ordinal {
3082            0x7fc7bbb1dbfd1972 => {
3083                let mut out = fidl::new_empty!(
3084                    NodeOnOpenRequest,
3085                    fidl::encoding::DefaultFuchsiaResourceDialect
3086                );
3087                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3088                Ok((DirectoryEvent::OnOpen_ { s: out.s, info: out.info }))
3089            }
3090            0x5cb40567d80a510c => {
3091                let mut out =
3092                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
3093                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
3094                Ok((DirectoryEvent::OnRepresentation { payload: out }))
3095            }
3096            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3097                Ok(DirectoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3098            }
3099            _ => Err(fidl::Error::UnknownOrdinal {
3100                ordinal: tx_header.ordinal,
3101                protocol_name: <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3102            }),
3103        }
3104    }
3105}
3106
3107/// A Stream of incoming requests for fuchsia.io/Directory.
3108pub struct DirectoryRequestStream {
3109    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3110    is_terminated: bool,
3111}
3112
3113impl std::marker::Unpin for DirectoryRequestStream {}
3114
3115impl futures::stream::FusedStream for DirectoryRequestStream {
3116    fn is_terminated(&self) -> bool {
3117        self.is_terminated
3118    }
3119}
3120
3121impl fidl::endpoints::RequestStream for DirectoryRequestStream {
3122    type Protocol = DirectoryMarker;
3123    type ControlHandle = DirectoryControlHandle;
3124
3125    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3126        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3127    }
3128
3129    fn control_handle(&self) -> Self::ControlHandle {
3130        DirectoryControlHandle { inner: self.inner.clone() }
3131    }
3132
3133    fn into_inner(
3134        self,
3135    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3136    {
3137        (self.inner, self.is_terminated)
3138    }
3139
3140    fn from_inner(
3141        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3142        is_terminated: bool,
3143    ) -> Self {
3144        Self { inner, is_terminated }
3145    }
3146}
3147
3148impl futures::Stream for DirectoryRequestStream {
3149    type Item = Result<DirectoryRequest, fidl::Error>;
3150
3151    fn poll_next(
3152        mut self: std::pin::Pin<&mut Self>,
3153        cx: &mut std::task::Context<'_>,
3154    ) -> std::task::Poll<Option<Self::Item>> {
3155        let this = &mut *self;
3156        if this.inner.check_shutdown(cx) {
3157            this.is_terminated = true;
3158            return std::task::Poll::Ready(None);
3159        }
3160        if this.is_terminated {
3161            panic!("polled DirectoryRequestStream after completion");
3162        }
3163        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3164            |bytes, handles| {
3165                match this.inner.channel().read_etc(cx, bytes, handles) {
3166                    std::task::Poll::Ready(Ok(())) => {}
3167                    std::task::Poll::Pending => return std::task::Poll::Pending,
3168                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3169                        this.is_terminated = true;
3170                        return std::task::Poll::Ready(None);
3171                    }
3172                    std::task::Poll::Ready(Err(e)) => {
3173                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3174                            e.into(),
3175                        ))));
3176                    }
3177                }
3178
3179                // A message has been received from the channel
3180                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3181
3182                std::task::Poll::Ready(Some(match header.ordinal {
3183                    0x6ee9c0ad53ec87aa => {
3184                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3185                        let mut req = fidl::new_empty!(
3186                            AdvisoryLockingAdvisoryLockRequest,
3187                            fidl::encoding::DefaultFuchsiaResourceDialect
3188                        );
3189                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
3190                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3191                        Ok(DirectoryRequest::AdvisoryLock {
3192                            request: req.request,
3193
3194                            responder: DirectoryAdvisoryLockResponder {
3195                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3196                                tx_id: header.tx_id,
3197                            },
3198                        })
3199                    }
3200                    0x20d8a7aba2168a79 => {
3201                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3202                        let mut req = fidl::new_empty!(
3203                            fidl_fuchsia_unknown::CloneableCloneRequest,
3204                            fidl::encoding::DefaultFuchsiaResourceDialect
3205                        );
3206                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3207                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3208                        Ok(DirectoryRequest::Clone { request: req.request, control_handle })
3209                    }
3210                    0x5ac5d459ad7f657e => {
3211                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3212                        let mut req = fidl::new_empty!(
3213                            fidl::encoding::EmptyPayload,
3214                            fidl::encoding::DefaultFuchsiaResourceDialect
3215                        );
3216                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3217                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3218                        Ok(DirectoryRequest::Close {
3219                            responder: DirectoryCloseResponder {
3220                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3221                                tx_id: header.tx_id,
3222                            },
3223                        })
3224                    }
3225                    0x2658edee9decfc06 => {
3226                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3227                        let mut req = fidl::new_empty!(
3228                            fidl::encoding::EmptyPayload,
3229                            fidl::encoding::DefaultFuchsiaResourceDialect
3230                        );
3231                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3232                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3233                        Ok(DirectoryRequest::Query {
3234                            responder: DirectoryQueryResponder {
3235                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3236                                tx_id: header.tx_id,
3237                            },
3238                        })
3239                    }
3240                    0x5a61678f293ce16f => {
3241                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3242                        let mut req = fidl::new_empty!(
3243                            NodeDeprecatedCloneRequest,
3244                            fidl::encoding::DefaultFuchsiaResourceDialect
3245                        );
3246                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3247                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3248                        Ok(DirectoryRequest::DeprecatedClone {
3249                            flags: req.flags,
3250                            object: req.object,
3251
3252                            control_handle,
3253                        })
3254                    }
3255                    0x78985e216314dafd => {
3256                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3257                        let mut req = fidl::new_empty!(
3258                            fidl::encoding::EmptyPayload,
3259                            fidl::encoding::DefaultFuchsiaResourceDialect
3260                        );
3261                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3262                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3263                        Ok(DirectoryRequest::DeprecatedGetAttr {
3264                            responder: DirectoryDeprecatedGetAttrResponder {
3265                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3266                                tx_id: header.tx_id,
3267                            },
3268                        })
3269                    }
3270                    0x4186c0f40d938f46 => {
3271                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3272                        let mut req = fidl::new_empty!(
3273                            NodeDeprecatedSetAttrRequest,
3274                            fidl::encoding::DefaultFuchsiaResourceDialect
3275                        );
3276                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
3277                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3278                        Ok(DirectoryRequest::DeprecatedSetAttr {
3279                            flags: req.flags,
3280                            attributes: req.attributes,
3281
3282                            responder: DirectoryDeprecatedSetAttrResponder {
3283                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3284                                tx_id: header.tx_id,
3285                            },
3286                        })
3287                    }
3288                    0x5b88fffb8eda3aa1 => {
3289                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3290                        let mut req = fidl::new_empty!(
3291                            fidl::encoding::EmptyPayload,
3292                            fidl::encoding::DefaultFuchsiaResourceDialect
3293                        );
3294                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3295                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3296                        Ok(DirectoryRequest::DeprecatedGetFlags {
3297                            responder: DirectoryDeprecatedGetFlagsResponder {
3298                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3299                                tx_id: header.tx_id,
3300                            },
3301                        })
3302                    }
3303                    0x5295b76c71fde733 => {
3304                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3305                        let mut req = fidl::new_empty!(
3306                            NodeDeprecatedSetFlagsRequest,
3307                            fidl::encoding::DefaultFuchsiaResourceDialect
3308                        );
3309                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3310                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3311                        Ok(DirectoryRequest::DeprecatedSetFlags {
3312                            flags: req.flags,
3313
3314                            responder: DirectoryDeprecatedSetFlagsResponder {
3315                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3316                                tx_id: header.tx_id,
3317                            },
3318                        })
3319                    }
3320                    0x176eb318f64ec23 => {
3321                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3322                        let mut req = fidl::new_empty!(
3323                            fidl::encoding::EmptyPayload,
3324                            fidl::encoding::DefaultFuchsiaResourceDialect
3325                        );
3326                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3327                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3328                        Ok(DirectoryRequest::GetFlags {
3329                            responder: DirectoryGetFlagsResponder {
3330                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3331                                tx_id: header.tx_id,
3332                            },
3333                        })
3334                    }
3335                    0x55a8028685791ea8 => {
3336                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3337                        let mut req = fidl::new_empty!(
3338                            NodeSetFlagsRequest,
3339                            fidl::encoding::DefaultFuchsiaResourceDialect
3340                        );
3341                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3342                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3343                        Ok(DirectoryRequest::SetFlags {
3344                            flags: req.flags,
3345
3346                            responder: DirectorySetFlagsResponder {
3347                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3348                                tx_id: header.tx_id,
3349                            },
3350                        })
3351                    }
3352                    0x6f344a1c6b0a0610 => {
3353                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3354                        let mut req = fidl::new_empty!(
3355                            fidl::encoding::EmptyPayload,
3356                            fidl::encoding::DefaultFuchsiaResourceDialect
3357                        );
3358                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3359                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3360                        Ok(DirectoryRequest::QueryFilesystem {
3361                            responder: DirectoryQueryFilesystemResponder {
3362                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3363                                tx_id: header.tx_id,
3364                            },
3365                        })
3366                    }
3367                    0x3d4396a638ea053b => {
3368                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3369                        let mut req = fidl::new_empty!(
3370                            NodeGetAttributesRequest,
3371                            fidl::encoding::DefaultFuchsiaResourceDialect
3372                        );
3373                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3374                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3375                        Ok(DirectoryRequest::GetAttributes {
3376                            query: req.query,
3377
3378                            responder: DirectoryGetAttributesResponder {
3379                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3380                                tx_id: header.tx_id,
3381                            },
3382                        })
3383                    }
3384                    0x3308c1da5a89bf08 => {
3385                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3386                        let mut req = fidl::new_empty!(
3387                            MutableNodeAttributes,
3388                            fidl::encoding::DefaultFuchsiaResourceDialect
3389                        );
3390                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
3391                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3392                        Ok(DirectoryRequest::UpdateAttributes {
3393                            payload: req,
3394                            responder: DirectoryUpdateAttributesResponder {
3395                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3396                                tx_id: header.tx_id,
3397                            },
3398                        })
3399                    }
3400                    0x2c5c27ca0ab5dc49 => {
3401                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3402                        let mut req = fidl::new_empty!(
3403                            fidl::encoding::EmptyPayload,
3404                            fidl::encoding::DefaultFuchsiaResourceDialect
3405                        );
3406                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3407                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3408                        Ok(DirectoryRequest::Sync {
3409                            responder: DirectorySyncResponder {
3410                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3411                                tx_id: header.tx_id,
3412                            },
3413                        })
3414                    }
3415                    0x4b61033de007fcd0 => {
3416                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3417                        let mut req = fidl::new_empty!(
3418                            NodeListExtendedAttributesRequest,
3419                            fidl::encoding::DefaultFuchsiaResourceDialect
3420                        );
3421                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3422                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3423                        Ok(DirectoryRequest::ListExtendedAttributes {
3424                            iterator: req.iterator,
3425
3426                            control_handle,
3427                        })
3428                    }
3429                    0x45ffa3ccfdeb76db => {
3430                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3431                        let mut req = fidl::new_empty!(
3432                            NodeGetExtendedAttributeRequest,
3433                            fidl::encoding::DefaultFuchsiaResourceDialect
3434                        );
3435                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3436                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3437                        Ok(DirectoryRequest::GetExtendedAttribute {
3438                            name: req.name,
3439
3440                            responder: DirectoryGetExtendedAttributeResponder {
3441                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3442                                tx_id: header.tx_id,
3443                            },
3444                        })
3445                    }
3446                    0x4a951362f681f23c => {
3447                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3448                        let mut req = fidl::new_empty!(
3449                            NodeSetExtendedAttributeRequest,
3450                            fidl::encoding::DefaultFuchsiaResourceDialect
3451                        );
3452                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3453                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3454                        Ok(DirectoryRequest::SetExtendedAttribute {
3455                            name: req.name,
3456                            value: req.value,
3457                            mode: req.mode,
3458
3459                            responder: DirectorySetExtendedAttributeResponder {
3460                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3461                                tx_id: header.tx_id,
3462                            },
3463                        })
3464                    }
3465                    0x7a0b9f3a9bf9032d => {
3466                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3467                        let mut req = fidl::new_empty!(
3468                            NodeRemoveExtendedAttributeRequest,
3469                            fidl::encoding::DefaultFuchsiaResourceDialect
3470                        );
3471                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3472                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3473                        Ok(DirectoryRequest::RemoveExtendedAttribute {
3474                            name: req.name,
3475
3476                            responder: DirectoryRemoveExtendedAttributeResponder {
3477                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3478                                tx_id: header.tx_id,
3479                            },
3480                        })
3481                    }
3482                    0x2c5044561d685ec0 => {
3483                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3484                        let mut req = fidl::new_empty!(
3485                            DirectoryDeprecatedOpenRequest,
3486                            fidl::encoding::DefaultFuchsiaResourceDialect
3487                        );
3488                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryDeprecatedOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3489                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3490                        Ok(DirectoryRequest::DeprecatedOpen {
3491                            flags: req.flags,
3492                            mode: req.mode,
3493                            path: req.path,
3494                            object: req.object,
3495
3496                            control_handle,
3497                        })
3498                    }
3499                    0x568ddcb9a9cbb6d9 => {
3500                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3501                        let mut req = fidl::new_empty!(
3502                            DirectoryOpenRequest,
3503                            fidl::encoding::DefaultFuchsiaResourceDialect
3504                        );
3505                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3506                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3507                        Ok(DirectoryRequest::Open {
3508                            path: req.path,
3509                            flags: req.flags,
3510                            options: req.options,
3511                            object: req.object,
3512
3513                            control_handle,
3514                        })
3515                    }
3516                    0x3582806bf27faa0a => {
3517                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3518                        let mut req = fidl::new_empty!(
3519                            DirectoryReadDirentsRequest,
3520                            fidl::encoding::DefaultFuchsiaResourceDialect
3521                        );
3522                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryReadDirentsRequest>(&header, _body_bytes, handles, &mut req)?;
3523                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3524                        Ok(DirectoryRequest::ReadDirents {
3525                            max_bytes: req.max_bytes,
3526
3527                            responder: DirectoryReadDirentsResponder {
3528                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3529                                tx_id: header.tx_id,
3530                            },
3531                        })
3532                    }
3533                    0x16b1202af0f34c71 => {
3534                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3535                        let mut req = fidl::new_empty!(
3536                            fidl::encoding::EmptyPayload,
3537                            fidl::encoding::DefaultFuchsiaResourceDialect
3538                        );
3539                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3540                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3541                        Ok(DirectoryRequest::Rewind {
3542                            responder: DirectoryRewindResponder {
3543                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3544                                tx_id: header.tx_id,
3545                            },
3546                        })
3547                    }
3548                    0x26ae9d18763c8655 => {
3549                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3550                        let mut req = fidl::new_empty!(
3551                            fidl::encoding::EmptyPayload,
3552                            fidl::encoding::DefaultFuchsiaResourceDialect
3553                        );
3554                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3555                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3556                        Ok(DirectoryRequest::GetToken {
3557                            responder: DirectoryGetTokenResponder {
3558                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3559                                tx_id: header.tx_id,
3560                            },
3561                        })
3562                    }
3563                    0x740604c0c7c930e7 => {
3564                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3565                        let mut req = fidl::new_empty!(
3566                            DirectoryLinkRequest,
3567                            fidl::encoding::DefaultFuchsiaResourceDialect
3568                        );
3569                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryLinkRequest>(&header, _body_bytes, handles, &mut req)?;
3570                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3571                        Ok(DirectoryRequest::Link {
3572                            src: req.src,
3573                            dst_parent_token: req.dst_parent_token,
3574                            dst: req.dst,
3575
3576                            responder: DirectoryLinkResponder {
3577                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3578                                tx_id: header.tx_id,
3579                            },
3580                        })
3581                    }
3582                    0x750a0326a78d7bed => {
3583                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3584                        let mut req = fidl::new_empty!(
3585                            DirectoryUnlinkRequest,
3586                            fidl::encoding::DefaultFuchsiaResourceDialect
3587                        );
3588                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryUnlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3589                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3590                        Ok(DirectoryRequest::Unlink {
3591                            name: req.name,
3592                            options: req.options,
3593
3594                            responder: DirectoryUnlinkResponder {
3595                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3596                                tx_id: header.tx_id,
3597                            },
3598                        })
3599                    }
3600                    0x7060e7723b9928de => {
3601                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3602                        let mut req = fidl::new_empty!(
3603                            DirectoryRenameRequest,
3604                            fidl::encoding::DefaultFuchsiaResourceDialect
3605                        );
3606                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryRenameRequest>(&header, _body_bytes, handles, &mut req)?;
3607                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3608                        Ok(DirectoryRequest::Rename {
3609                            src: req.src,
3610                            dst_parent_token: req.dst_parent_token,
3611                            dst: req.dst,
3612
3613                            responder: DirectoryRenameResponder {
3614                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3615                                tx_id: header.tx_id,
3616                            },
3617                        })
3618                    }
3619                    0x21ce0f19ec043889 => {
3620                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3621                        let mut req = fidl::new_empty!(
3622                            DirectoryCreateSymlinkRequest,
3623                            fidl::encoding::DefaultFuchsiaResourceDialect
3624                        );
3625                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryCreateSymlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3626                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3627                        Ok(DirectoryRequest::CreateSymlink {
3628                            name: req.name,
3629                            target: req.target,
3630                            connection: req.connection,
3631
3632                            responder: DirectoryCreateSymlinkResponder {
3633                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3634                                tx_id: header.tx_id,
3635                            },
3636                        })
3637                    }
3638                    0x5717193a59d66d91 => {
3639                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3640                        let mut req = fidl::new_empty!(
3641                            DirectoryWatchRequest,
3642                            fidl::encoding::DefaultFuchsiaResourceDialect
3643                        );
3644                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryWatchRequest>(&header, _body_bytes, handles, &mut req)?;
3645                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3646                        Ok(DirectoryRequest::Watch {
3647                            mask: req.mask,
3648                            options: req.options,
3649                            watcher: req.watcher,
3650
3651                            responder: DirectoryWatchResponder {
3652                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3653                                tx_id: header.tx_id,
3654                            },
3655                        })
3656                    }
3657                    _ if header.tx_id == 0
3658                        && header
3659                            .dynamic_flags()
3660                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3661                    {
3662                        Ok(DirectoryRequest::_UnknownMethod {
3663                            ordinal: header.ordinal,
3664                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3665                            method_type: fidl::MethodType::OneWay,
3666                        })
3667                    }
3668                    _ if header
3669                        .dynamic_flags()
3670                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3671                    {
3672                        this.inner.send_framework_err(
3673                            fidl::encoding::FrameworkErr::UnknownMethod,
3674                            header.tx_id,
3675                            header.ordinal,
3676                            header.dynamic_flags(),
3677                            (bytes, handles),
3678                        )?;
3679                        Ok(DirectoryRequest::_UnknownMethod {
3680                            ordinal: header.ordinal,
3681                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3682                            method_type: fidl::MethodType::TwoWay,
3683                        })
3684                    }
3685                    _ => Err(fidl::Error::UnknownOrdinal {
3686                        ordinal: header.ordinal,
3687                        protocol_name:
3688                            <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3689                    }),
3690                }))
3691            },
3692        )
3693    }
3694}
3695
3696/// Directory defines a node which is capable of containing other Objects.
3697#[derive(Debug)]
3698pub enum DirectoryRequest {
3699    /// Acquires an advisory lock on the underlying file.
3700    ///
3701    /// The lock lasts until either this connection is closed or
3702    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
3703    /// explicitly.
3704    ///
3705    /// Advisory locks are purely advisory. They do not prevent actual read or
3706    /// write operations from occurring on the file, either through this
3707    /// connection or through other connections.
3708    ///
3709    /// This method requires the following rights:
3710    ///
3711    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
3712    /// * [`Rights.WRITE_BYTES`] if `request.type` is
3713    ///   [`AdvisoryLockType.WRITE`].
3714    ///
3715    /// # Errors
3716    ///
3717    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
3718    ///   example, another connection might hold a conflicting lock type.
3719    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
3720    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
3721    ///   to acquire the given type of lock.
3722    AdvisoryLock {
3723        request: AdvisoryLockRequest,
3724        responder: DirectoryAdvisoryLockResponder,
3725    },
3726    Clone {
3727        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
3728        control_handle: DirectoryControlHandle,
3729    },
3730    /// Terminates the connection.
3731    ///
3732    /// After calling `Close`, the client must not send any other requests.
3733    ///
3734    /// Servers, after sending the status response, should close the connection
3735    /// regardless of status and without sending an epitaph.
3736    ///
3737    /// Closing the client end of the channel should be semantically equivalent
3738    /// to calling `Close` without knowing when the close has completed or its
3739    /// status.
3740    Close {
3741        responder: DirectoryCloseResponder,
3742    },
3743    Query {
3744        responder: DirectoryQueryResponder,
3745    },
3746    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
3747    DeprecatedClone {
3748        flags: OpenFlags,
3749        object: fidl::endpoints::ServerEnd<NodeMarker>,
3750        control_handle: DirectoryControlHandle,
3751    },
3752    /// DEPRECATED - Use `Node.GetAttributes` instead.
3753    DeprecatedGetAttr {
3754        responder: DirectoryDeprecatedGetAttrResponder,
3755    },
3756    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
3757    DeprecatedSetAttr {
3758        flags: NodeAttributeFlags,
3759        attributes: NodeAttributes,
3760        responder: DirectoryDeprecatedSetAttrResponder,
3761    },
3762    /// [DEPRECATED - Use new GetFlags method instead.]
3763    DeprecatedGetFlags {
3764        responder: DirectoryDeprecatedGetFlagsResponder,
3765    },
3766    /// [DEPRECATED - Use new SetFlags method instead.]
3767    DeprecatedSetFlags {
3768        flags: OpenFlags,
3769        responder: DirectoryDeprecatedSetFlagsResponder,
3770    },
3771    /// Queries the flags that apply to this node after it has been opened/created. This method does
3772    /// not require any rights.
3773    ///
3774    /// Note that the final set of flags that apply to the connection may differ from those
3775    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
3776    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
3777    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
3778    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
3779    GetFlags {
3780        responder: DirectoryGetFlagsResponder,
3781    },
3782    /// Sets the flags that apply to this node after it has been opened. This method does not
3783    /// require any rights.
3784    ///
3785    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
3786    /// clear append mode.
3787    ///
3788    /// Errors:
3789    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
3790    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
3791    SetFlags {
3792        flags: Flags,
3793        responder: DirectorySetFlagsResponder,
3794    },
3795    /// Query the filesystem for filesystem-specific information.
3796    QueryFilesystem {
3797        responder: DirectoryQueryFilesystemResponder,
3798    },
3799    /// Acquires information about the node.
3800    ///
3801    /// The attributes of a node should be stable, independent of the
3802    /// specific protocol used to access it.
3803    ///
3804    /// If a particular attribute is not applicable or not supported,
3805    /// filesystems should leave the corresponding field absent.
3806    ///
3807    /// + `query` a bit-mask specifying which attributes to fetch. The server
3808    ///   should not return more than necessary.
3809    /// - `attributes` the returned attributes.
3810    ///
3811    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3812    GetAttributes {
3813        query: NodeAttributesQuery,
3814        responder: DirectoryGetAttributesResponder,
3815    },
3816    /// Updates information about the node.
3817    ///
3818    /// + `attributes` the presence of a table field in `attributes` indicates
3819    /// the intent to update the corresponding attribute.
3820    ///
3821    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
3822    ///
3823    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3824    UpdateAttributes {
3825        payload: MutableNodeAttributes,
3826        responder: DirectoryUpdateAttributesResponder,
3827    },
3828    /// Synchronizes updates to the node to the underlying media, if it exists.
3829    ///
3830    /// This method will return when the filesystem server has flushed the
3831    /// relevant updates to the underlying media, but does not guarantee the
3832    /// underlying media has persisted the information, nor that any information
3833    /// is committed to hardware. Clients may use `Sync` to ensure ordering
3834    /// between operations.
3835    ///
3836    /// This method does not require any rights.
3837    Sync {
3838        responder: DirectorySyncResponder,
3839    },
3840    /// Creates an iterator over all the extended attribute names associated
3841    /// with this node. If an error occurs it is returned as an epitaph on the
3842    /// iterator request channel, and then the channel is closed.
3843    ///
3844    /// GetExtendedAttributes can be used with any of these names to retrieve
3845    /// the associated value.
3846    ///
3847    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3848    ListExtendedAttributes {
3849        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
3850        control_handle: DirectoryControlHandle,
3851    },
3852    /// Get the value associated with the given attribute `name` for this node.
3853    ///
3854    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
3855    /// particular structure is imposed on them.
3856    ///
3857    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3858    GetExtendedAttribute {
3859        name: Vec<u8>,
3860        responder: DirectoryGetExtendedAttributeResponder,
3861    },
3862    /// Set the value for the given attribute `name` to `value` for this node.
3863    ///
3864    /// The attribute name may exist, in which case the attribute is updated.
3865    /// If the attribute doesn't exist, it is created. The name should have no
3866    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
3867    ///
3868    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3869    SetExtendedAttribute {
3870        name: Vec<u8>,
3871        value: ExtendedAttributeValue,
3872        mode: SetExtendedAttributeMode,
3873        responder: DirectorySetExtendedAttributeResponder,
3874    },
3875    /// Remove the specified extended attribute.
3876    ///
3877    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
3878    ///
3879    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3880    RemoveExtendedAttribute {
3881        name: Vec<u8>,
3882        responder: DirectoryRemoveExtendedAttributeResponder,
3883    },
3884    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
3885    DeprecatedOpen {
3886        flags: OpenFlags,
3887        mode: ModeType,
3888        path: String,
3889        object: fidl::endpoints::ServerEnd<NodeMarker>,
3890        control_handle: DirectoryControlHandle,
3891    },
3892    /// Open (or create) a node relative to this directory. Any errors are communicated via an
3893    /// epitaph sent on the `object` channel.
3894    ///
3895    /// Errors:
3896    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
3897    /// * See [`Flags`] for other errors which may be communicated based on `flags`
3898    Open {
3899        path: String,
3900        flags: Flags,
3901        options: Options,
3902        object: fidl::Channel,
3903        control_handle: DirectoryControlHandle,
3904    },
3905    /// Reads a collection of variably sized dirents into a buffer.
3906    /// The number of dirents in a directory may be very large: akin to
3907    /// calling read multiple times on a file, directories have a seek
3908    /// offset which is updated on subsequent calls to ReadDirents.
3909    /// Each call to ReadDirents will only return whole dirent structures,
3910    /// they will not get split across ReadDirent calls. When the seek
3911    /// offset reaches the end, `dirents` will be empty.
3912    ///
3913    /// These dirents are of the form:
3914    /// ```
3915    /// struct dirent {
3916    ///   // Describes the inode of the entry.
3917    ///   uint64 ino;
3918    ///   // Describes the length of the dirent name in bytes.
3919    ///   uint8 size;
3920    ///   // Describes the type of the entry. Aligned with the
3921    ///   // POSIX d_type values. Use `DirentType` constants.
3922    ///   uint8 type;
3923    ///   // Unterminated name of entry.
3924    ///   char name[0];
3925    /// }
3926    /// ```
3927    ///
3928    /// This method does not require any rights, since one could always probe for
3929    /// directory contents by triggering name conflicts during file creation.
3930    ReadDirents {
3931        max_bytes: u64,
3932        responder: DirectoryReadDirentsResponder,
3933    },
3934    /// Resets the directory seek offset.
3935    ///
3936    /// This method does not require any rights, similar to ReadDirents.
3937    Rewind {
3938        responder: DirectoryRewindResponder,
3939    },
3940    /// Acquires a token to a Directory which can be used to identify access to it at a later point
3941    /// in time. The token will remain valid for as long as the connection requesting the token
3942    /// remains open.
3943    ///
3944    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
3945    /// `ZX_ERR_BAD_HANDLE`.
3946    GetToken {
3947        responder: DirectoryGetTokenResponder,
3948    },
3949    /// Creates a link to an object named src by the name dst, within a directory represented by
3950    /// token.
3951    ///
3952    /// `src` must be a resolved object name. Including "/" in the string will
3953    /// return `ZX_ERR_INVALID_ARGS`.
3954    ///
3955    /// `dst` must be a resolved object name. Including "/" in the string will
3956    /// return `ZX_ERR_INVALID_ARGS`.
3957    ///
3958    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
3959    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
3960    ///
3961    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
3962    /// there are two actors operating concurrently, and one actor performs a rename that affects
3963    /// the source within this directory, and the other does a link, each will appear to occur
3964    /// atomically in an unspecified order.
3965    Link {
3966        src: String,
3967        dst_parent_token: fidl::NullableHandle,
3968        dst: String,
3969        responder: DirectoryLinkResponder,
3970    },
3971    /// Removes a child node from the this directory's list of entries.
3972    ///
3973    /// Note: this does not guarantee that the underlying object is destroyed.
3974    /// Although the link will be removed from the containing directory,
3975    /// objects with multiple references (such as files which are still open)
3976    /// will not actually be destroyed until all references are closed.
3977    ///
3978    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
3979    ///   [`Rights.WRITE_BYTES`].
3980    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
3981    ///   support writing.
3982    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
3983    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
3984    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
3985    ///   containing a remote channel.
3986    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
3987    ///     something other than a directory was found.
3988    ///
3989    /// Other errors may be returned for filesystem-specific reasons.
3990    ///
3991    /// This method requires the following rights:
3992    ///
3993    /// * [`Rights.ENUMERATE`]
3994    /// * [`Rights.MODIFY_DIRECTORY`]
3995    Unlink {
3996        name: String,
3997        options: UnlinkOptions,
3998        responder: DirectoryUnlinkResponder,
3999    },
4000    /// Renames a node named `src` to the name `dst`, in a directory represented
4001    /// by `dst_parent_token`.
4002    ///
4003    /// `src` and `dst` must be valid node names.
4004    /// See [`Name`] for what constitutes a valid name.
4005    ///
4006    /// This method requires the following rights on both the current connection, and the connection
4007    /// identified by `dst_parent_token`:
4008    ///
4009    /// * [`Rights.ENUMERATE`]
4010    /// * [`Rights.MODIFY_DIRECTORY`]
4011    ///
4012    /// The following requirements are necessary to avoid rights escalations.
4013    ///
4014    /// If the source and destination directory differ, the source directory must also have the
4015    /// maximal set of abilities supported for files, which would typically be
4016    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
4017    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
4018    /// right.
4019    ///
4020    /// If `src` refers to a directory, and differs from the destination directory, then the source
4021    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
4022    ///
4023    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
4024    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
4025    Rename {
4026        src: String,
4027        dst_parent_token: fidl::Event,
4028        dst: String,
4029        responder: DirectoryRenameResponder,
4030    },
4031    /// Creates a symbolic link.
4032    ///
4033    /// `name` is the name to be given to the created symbolic link.
4034    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
4035    /// will perform no validation of `target` except for a server chosen maximum length.
4036    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
4037    /// on the successfully created node.
4038    ///
4039    /// * [`Rights.MODIFY_DIRECTORY`]
4040    ///
4041    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
4042    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
4043    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
4044    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
4045    CreateSymlink {
4046        name: String,
4047        target: Vec<u8>,
4048        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4049        responder: DirectoryCreateSymlinkResponder,
4050    },
4051    /// Watches a directory, receiving events of added messages on the
4052    /// watcher request channel.
4053    ///
4054    /// Options must be zero; it is reserved.
4055    ///
4056    /// This method does not require any rights, similar to ReadDirents.
4057    Watch {
4058        mask: WatchMask,
4059        options: u32,
4060        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4061        responder: DirectoryWatchResponder,
4062    },
4063    /// An interaction was received which does not match any known method.
4064    #[non_exhaustive]
4065    _UnknownMethod {
4066        /// Ordinal of the method that was called.
4067        ordinal: u64,
4068        control_handle: DirectoryControlHandle,
4069        method_type: fidl::MethodType,
4070    },
4071}
4072
4073impl DirectoryRequest {
4074    #[allow(irrefutable_let_patterns)]
4075    pub fn into_advisory_lock(
4076        self,
4077    ) -> Option<(AdvisoryLockRequest, DirectoryAdvisoryLockResponder)> {
4078        if let DirectoryRequest::AdvisoryLock { request, responder } = self {
4079            Some((request, responder))
4080        } else {
4081            None
4082        }
4083    }
4084
4085    #[allow(irrefutable_let_patterns)]
4086    pub fn into_clone(
4087        self,
4088    ) -> Option<(
4089        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
4090        DirectoryControlHandle,
4091    )> {
4092        if let DirectoryRequest::Clone { request, control_handle } = self {
4093            Some((request, control_handle))
4094        } else {
4095            None
4096        }
4097    }
4098
4099    #[allow(irrefutable_let_patterns)]
4100    pub fn into_close(self) -> Option<(DirectoryCloseResponder)> {
4101        if let DirectoryRequest::Close { responder } = self { Some((responder)) } else { None }
4102    }
4103
4104    #[allow(irrefutable_let_patterns)]
4105    pub fn into_query(self) -> Option<(DirectoryQueryResponder)> {
4106        if let DirectoryRequest::Query { responder } = self { Some((responder)) } else { None }
4107    }
4108
4109    #[allow(irrefutable_let_patterns)]
4110    pub fn into_deprecated_clone(
4111        self,
4112    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, DirectoryControlHandle)> {
4113        if let DirectoryRequest::DeprecatedClone { flags, object, control_handle } = self {
4114            Some((flags, object, control_handle))
4115        } else {
4116            None
4117        }
4118    }
4119
4120    #[allow(irrefutable_let_patterns)]
4121    pub fn into_deprecated_get_attr(self) -> Option<(DirectoryDeprecatedGetAttrResponder)> {
4122        if let DirectoryRequest::DeprecatedGetAttr { responder } = self {
4123            Some((responder))
4124        } else {
4125            None
4126        }
4127    }
4128
4129    #[allow(irrefutable_let_patterns)]
4130    pub fn into_deprecated_set_attr(
4131        self,
4132    ) -> Option<(NodeAttributeFlags, NodeAttributes, DirectoryDeprecatedSetAttrResponder)> {
4133        if let DirectoryRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
4134            Some((flags, attributes, responder))
4135        } else {
4136            None
4137        }
4138    }
4139
4140    #[allow(irrefutable_let_patterns)]
4141    pub fn into_deprecated_get_flags(self) -> Option<(DirectoryDeprecatedGetFlagsResponder)> {
4142        if let DirectoryRequest::DeprecatedGetFlags { responder } = self {
4143            Some((responder))
4144        } else {
4145            None
4146        }
4147    }
4148
4149    #[allow(irrefutable_let_patterns)]
4150    pub fn into_deprecated_set_flags(
4151        self,
4152    ) -> Option<(OpenFlags, DirectoryDeprecatedSetFlagsResponder)> {
4153        if let DirectoryRequest::DeprecatedSetFlags { flags, responder } = self {
4154            Some((flags, responder))
4155        } else {
4156            None
4157        }
4158    }
4159
4160    #[allow(irrefutable_let_patterns)]
4161    pub fn into_get_flags(self) -> Option<(DirectoryGetFlagsResponder)> {
4162        if let DirectoryRequest::GetFlags { responder } = self { Some((responder)) } else { None }
4163    }
4164
4165    #[allow(irrefutable_let_patterns)]
4166    pub fn into_set_flags(self) -> Option<(Flags, DirectorySetFlagsResponder)> {
4167        if let DirectoryRequest::SetFlags { flags, responder } = self {
4168            Some((flags, responder))
4169        } else {
4170            None
4171        }
4172    }
4173
4174    #[allow(irrefutable_let_patterns)]
4175    pub fn into_query_filesystem(self) -> Option<(DirectoryQueryFilesystemResponder)> {
4176        if let DirectoryRequest::QueryFilesystem { responder } = self {
4177            Some((responder))
4178        } else {
4179            None
4180        }
4181    }
4182
4183    #[allow(irrefutable_let_patterns)]
4184    pub fn into_get_attributes(
4185        self,
4186    ) -> Option<(NodeAttributesQuery, DirectoryGetAttributesResponder)> {
4187        if let DirectoryRequest::GetAttributes { query, responder } = self {
4188            Some((query, responder))
4189        } else {
4190            None
4191        }
4192    }
4193
4194    #[allow(irrefutable_let_patterns)]
4195    pub fn into_update_attributes(
4196        self,
4197    ) -> Option<(MutableNodeAttributes, DirectoryUpdateAttributesResponder)> {
4198        if let DirectoryRequest::UpdateAttributes { payload, responder } = self {
4199            Some((payload, responder))
4200        } else {
4201            None
4202        }
4203    }
4204
4205    #[allow(irrefutable_let_patterns)]
4206    pub fn into_sync(self) -> Option<(DirectorySyncResponder)> {
4207        if let DirectoryRequest::Sync { responder } = self { Some((responder)) } else { None }
4208    }
4209
4210    #[allow(irrefutable_let_patterns)]
4211    pub fn into_list_extended_attributes(
4212        self,
4213    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, DirectoryControlHandle)>
4214    {
4215        if let DirectoryRequest::ListExtendedAttributes { iterator, control_handle } = self {
4216            Some((iterator, control_handle))
4217        } else {
4218            None
4219        }
4220    }
4221
4222    #[allow(irrefutable_let_patterns)]
4223    pub fn into_get_extended_attribute(
4224        self,
4225    ) -> Option<(Vec<u8>, DirectoryGetExtendedAttributeResponder)> {
4226        if let DirectoryRequest::GetExtendedAttribute { name, responder } = self {
4227            Some((name, responder))
4228        } else {
4229            None
4230        }
4231    }
4232
4233    #[allow(irrefutable_let_patterns)]
4234    pub fn into_set_extended_attribute(
4235        self,
4236    ) -> Option<(
4237        Vec<u8>,
4238        ExtendedAttributeValue,
4239        SetExtendedAttributeMode,
4240        DirectorySetExtendedAttributeResponder,
4241    )> {
4242        if let DirectoryRequest::SetExtendedAttribute { name, value, mode, responder } = self {
4243            Some((name, value, mode, responder))
4244        } else {
4245            None
4246        }
4247    }
4248
4249    #[allow(irrefutable_let_patterns)]
4250    pub fn into_remove_extended_attribute(
4251        self,
4252    ) -> Option<(Vec<u8>, DirectoryRemoveExtendedAttributeResponder)> {
4253        if let DirectoryRequest::RemoveExtendedAttribute { name, responder } = self {
4254            Some((name, responder))
4255        } else {
4256            None
4257        }
4258    }
4259
4260    #[allow(irrefutable_let_patterns)]
4261    pub fn into_deprecated_open(
4262        self,
4263    ) -> Option<(
4264        OpenFlags,
4265        ModeType,
4266        String,
4267        fidl::endpoints::ServerEnd<NodeMarker>,
4268        DirectoryControlHandle,
4269    )> {
4270        if let DirectoryRequest::DeprecatedOpen { flags, mode, path, object, control_handle } = self
4271        {
4272            Some((flags, mode, path, object, control_handle))
4273        } else {
4274            None
4275        }
4276    }
4277
4278    #[allow(irrefutable_let_patterns)]
4279    pub fn into_open(
4280        self,
4281    ) -> Option<(String, Flags, Options, fidl::Channel, DirectoryControlHandle)> {
4282        if let DirectoryRequest::Open { path, flags, options, object, control_handle } = self {
4283            Some((path, flags, options, object, control_handle))
4284        } else {
4285            None
4286        }
4287    }
4288
4289    #[allow(irrefutable_let_patterns)]
4290    pub fn into_read_dirents(self) -> Option<(u64, DirectoryReadDirentsResponder)> {
4291        if let DirectoryRequest::ReadDirents { max_bytes, responder } = self {
4292            Some((max_bytes, responder))
4293        } else {
4294            None
4295        }
4296    }
4297
4298    #[allow(irrefutable_let_patterns)]
4299    pub fn into_rewind(self) -> Option<(DirectoryRewindResponder)> {
4300        if let DirectoryRequest::Rewind { responder } = self { Some((responder)) } else { None }
4301    }
4302
4303    #[allow(irrefutable_let_patterns)]
4304    pub fn into_get_token(self) -> Option<(DirectoryGetTokenResponder)> {
4305        if let DirectoryRequest::GetToken { responder } = self { Some((responder)) } else { None }
4306    }
4307
4308    #[allow(irrefutable_let_patterns)]
4309    pub fn into_link(
4310        self,
4311    ) -> Option<(String, fidl::NullableHandle, String, DirectoryLinkResponder)> {
4312        if let DirectoryRequest::Link { src, dst_parent_token, dst, responder } = self {
4313            Some((src, dst_parent_token, dst, responder))
4314        } else {
4315            None
4316        }
4317    }
4318
4319    #[allow(irrefutable_let_patterns)]
4320    pub fn into_unlink(self) -> Option<(String, UnlinkOptions, DirectoryUnlinkResponder)> {
4321        if let DirectoryRequest::Unlink { name, options, responder } = self {
4322            Some((name, options, responder))
4323        } else {
4324            None
4325        }
4326    }
4327
4328    #[allow(irrefutable_let_patterns)]
4329    pub fn into_rename(self) -> Option<(String, fidl::Event, String, DirectoryRenameResponder)> {
4330        if let DirectoryRequest::Rename { src, dst_parent_token, dst, responder } = self {
4331            Some((src, dst_parent_token, dst, responder))
4332        } else {
4333            None
4334        }
4335    }
4336
4337    #[allow(irrefutable_let_patterns)]
4338    pub fn into_create_symlink(
4339        self,
4340    ) -> Option<(
4341        String,
4342        Vec<u8>,
4343        Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4344        DirectoryCreateSymlinkResponder,
4345    )> {
4346        if let DirectoryRequest::CreateSymlink { name, target, connection, responder } = self {
4347            Some((name, target, connection, responder))
4348        } else {
4349            None
4350        }
4351    }
4352
4353    #[allow(irrefutable_let_patterns)]
4354    pub fn into_watch(
4355        self,
4356    ) -> Option<(
4357        WatchMask,
4358        u32,
4359        fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4360        DirectoryWatchResponder,
4361    )> {
4362        if let DirectoryRequest::Watch { mask, options, watcher, responder } = self {
4363            Some((mask, options, watcher, responder))
4364        } else {
4365            None
4366        }
4367    }
4368
4369    /// Name of the method defined in FIDL
4370    pub fn method_name(&self) -> &'static str {
4371        match *self {
4372            DirectoryRequest::AdvisoryLock { .. } => "advisory_lock",
4373            DirectoryRequest::Clone { .. } => "clone",
4374            DirectoryRequest::Close { .. } => "close",
4375            DirectoryRequest::Query { .. } => "query",
4376            DirectoryRequest::DeprecatedClone { .. } => "deprecated_clone",
4377            DirectoryRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
4378            DirectoryRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
4379            DirectoryRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
4380            DirectoryRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
4381            DirectoryRequest::GetFlags { .. } => "get_flags",
4382            DirectoryRequest::SetFlags { .. } => "set_flags",
4383            DirectoryRequest::QueryFilesystem { .. } => "query_filesystem",
4384            DirectoryRequest::GetAttributes { .. } => "get_attributes",
4385            DirectoryRequest::UpdateAttributes { .. } => "update_attributes",
4386            DirectoryRequest::Sync { .. } => "sync",
4387            DirectoryRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
4388            DirectoryRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
4389            DirectoryRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
4390            DirectoryRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
4391            DirectoryRequest::DeprecatedOpen { .. } => "deprecated_open",
4392            DirectoryRequest::Open { .. } => "open",
4393            DirectoryRequest::ReadDirents { .. } => "read_dirents",
4394            DirectoryRequest::Rewind { .. } => "rewind",
4395            DirectoryRequest::GetToken { .. } => "get_token",
4396            DirectoryRequest::Link { .. } => "link",
4397            DirectoryRequest::Unlink { .. } => "unlink",
4398            DirectoryRequest::Rename { .. } => "rename",
4399            DirectoryRequest::CreateSymlink { .. } => "create_symlink",
4400            DirectoryRequest::Watch { .. } => "watch",
4401            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4402                "unknown one-way method"
4403            }
4404            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4405                "unknown two-way method"
4406            }
4407        }
4408    }
4409}
4410
4411#[derive(Debug, Clone)]
4412pub struct DirectoryControlHandle {
4413    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4414}
4415
4416impl fidl::endpoints::ControlHandle for DirectoryControlHandle {
4417    fn shutdown(&self) {
4418        self.inner.shutdown()
4419    }
4420    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4421        self.inner.shutdown_with_epitaph(status)
4422    }
4423
4424    fn is_closed(&self) -> bool {
4425        self.inner.channel().is_closed()
4426    }
4427    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4428        self.inner.channel().on_closed()
4429    }
4430
4431    #[cfg(target_os = "fuchsia")]
4432    fn signal_peer(
4433        &self,
4434        clear_mask: zx::Signals,
4435        set_mask: zx::Signals,
4436    ) -> Result<(), zx_status::Status> {
4437        use fidl::Peered;
4438        self.inner.channel().signal_peer(clear_mask, set_mask)
4439    }
4440}
4441
4442impl DirectoryControlHandle {
4443    pub fn send_on_open_(
4444        &self,
4445        mut s: i32,
4446        mut info: Option<NodeInfoDeprecated>,
4447    ) -> Result<(), fidl::Error> {
4448        self.inner.send::<NodeOnOpenRequest>(
4449            (s, info.as_mut()),
4450            0,
4451            0x7fc7bbb1dbfd1972,
4452            fidl::encoding::DynamicFlags::FLEXIBLE,
4453        )
4454    }
4455
4456    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
4457        self.inner.send::<Representation>(
4458            &mut payload,
4459            0,
4460            0x5cb40567d80a510c,
4461            fidl::encoding::DynamicFlags::empty(),
4462        )
4463    }
4464}
4465
4466#[must_use = "FIDL methods require a response to be sent"]
4467#[derive(Debug)]
4468pub struct DirectoryAdvisoryLockResponder {
4469    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4470    tx_id: u32,
4471}
4472
4473/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4474/// if the responder is dropped without sending a response, so that the client
4475/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4476impl std::ops::Drop for DirectoryAdvisoryLockResponder {
4477    fn drop(&mut self) {
4478        self.control_handle.shutdown();
4479        // Safety: drops once, never accessed again
4480        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4481    }
4482}
4483
4484impl fidl::endpoints::Responder for DirectoryAdvisoryLockResponder {
4485    type ControlHandle = DirectoryControlHandle;
4486
4487    fn control_handle(&self) -> &DirectoryControlHandle {
4488        &self.control_handle
4489    }
4490
4491    fn drop_without_shutdown(mut self) {
4492        // Safety: drops once, never accessed again due to mem::forget
4493        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4494        // Prevent Drop from running (which would shut down the channel)
4495        std::mem::forget(self);
4496    }
4497}
4498
4499impl DirectoryAdvisoryLockResponder {
4500    /// Sends a response to the FIDL transaction.
4501    ///
4502    /// Sets the channel to shutdown if an error occurs.
4503    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4504        let _result = self.send_raw(result);
4505        if _result.is_err() {
4506            self.control_handle.shutdown();
4507        }
4508        self.drop_without_shutdown();
4509        _result
4510    }
4511
4512    /// Similar to "send" but does not shutdown the channel if an error occurs.
4513    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4514        let _result = self.send_raw(result);
4515        self.drop_without_shutdown();
4516        _result
4517    }
4518
4519    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4520        self.control_handle
4521            .inner
4522            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4523                result,
4524                self.tx_id,
4525                0x6ee9c0ad53ec87aa,
4526                fidl::encoding::DynamicFlags::empty(),
4527            )
4528    }
4529}
4530
4531#[must_use = "FIDL methods require a response to be sent"]
4532#[derive(Debug)]
4533pub struct DirectoryCloseResponder {
4534    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4535    tx_id: u32,
4536}
4537
4538/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4539/// if the responder is dropped without sending a response, so that the client
4540/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4541impl std::ops::Drop for DirectoryCloseResponder {
4542    fn drop(&mut self) {
4543        self.control_handle.shutdown();
4544        // Safety: drops once, never accessed again
4545        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4546    }
4547}
4548
4549impl fidl::endpoints::Responder for DirectoryCloseResponder {
4550    type ControlHandle = DirectoryControlHandle;
4551
4552    fn control_handle(&self) -> &DirectoryControlHandle {
4553        &self.control_handle
4554    }
4555
4556    fn drop_without_shutdown(mut self) {
4557        // Safety: drops once, never accessed again due to mem::forget
4558        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4559        // Prevent Drop from running (which would shut down the channel)
4560        std::mem::forget(self);
4561    }
4562}
4563
4564impl DirectoryCloseResponder {
4565    /// Sends a response to the FIDL transaction.
4566    ///
4567    /// Sets the channel to shutdown if an error occurs.
4568    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4569        let _result = self.send_raw(result);
4570        if _result.is_err() {
4571            self.control_handle.shutdown();
4572        }
4573        self.drop_without_shutdown();
4574        _result
4575    }
4576
4577    /// Similar to "send" but does not shutdown the channel if an error occurs.
4578    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4579        let _result = self.send_raw(result);
4580        self.drop_without_shutdown();
4581        _result
4582    }
4583
4584    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4585        self.control_handle
4586            .inner
4587            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4588                result,
4589                self.tx_id,
4590                0x5ac5d459ad7f657e,
4591                fidl::encoding::DynamicFlags::empty(),
4592            )
4593    }
4594}
4595
4596#[must_use = "FIDL methods require a response to be sent"]
4597#[derive(Debug)]
4598pub struct DirectoryQueryResponder {
4599    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4600    tx_id: u32,
4601}
4602
4603/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4604/// if the responder is dropped without sending a response, so that the client
4605/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4606impl std::ops::Drop for DirectoryQueryResponder {
4607    fn drop(&mut self) {
4608        self.control_handle.shutdown();
4609        // Safety: drops once, never accessed again
4610        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4611    }
4612}
4613
4614impl fidl::endpoints::Responder for DirectoryQueryResponder {
4615    type ControlHandle = DirectoryControlHandle;
4616
4617    fn control_handle(&self) -> &DirectoryControlHandle {
4618        &self.control_handle
4619    }
4620
4621    fn drop_without_shutdown(mut self) {
4622        // Safety: drops once, never accessed again due to mem::forget
4623        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4624        // Prevent Drop from running (which would shut down the channel)
4625        std::mem::forget(self);
4626    }
4627}
4628
4629impl DirectoryQueryResponder {
4630    /// Sends a response to the FIDL transaction.
4631    ///
4632    /// Sets the channel to shutdown if an error occurs.
4633    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4634        let _result = self.send_raw(protocol);
4635        if _result.is_err() {
4636            self.control_handle.shutdown();
4637        }
4638        self.drop_without_shutdown();
4639        _result
4640    }
4641
4642    /// Similar to "send" but does not shutdown the channel if an error occurs.
4643    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4644        let _result = self.send_raw(protocol);
4645        self.drop_without_shutdown();
4646        _result
4647    }
4648
4649    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4650        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
4651            (protocol,),
4652            self.tx_id,
4653            0x2658edee9decfc06,
4654            fidl::encoding::DynamicFlags::empty(),
4655        )
4656    }
4657}
4658
4659#[must_use = "FIDL methods require a response to be sent"]
4660#[derive(Debug)]
4661pub struct DirectoryDeprecatedGetAttrResponder {
4662    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4663    tx_id: u32,
4664}
4665
4666/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4667/// if the responder is dropped without sending a response, so that the client
4668/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4669impl std::ops::Drop for DirectoryDeprecatedGetAttrResponder {
4670    fn drop(&mut self) {
4671        self.control_handle.shutdown();
4672        // Safety: drops once, never accessed again
4673        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4674    }
4675}
4676
4677impl fidl::endpoints::Responder for DirectoryDeprecatedGetAttrResponder {
4678    type ControlHandle = DirectoryControlHandle;
4679
4680    fn control_handle(&self) -> &DirectoryControlHandle {
4681        &self.control_handle
4682    }
4683
4684    fn drop_without_shutdown(mut self) {
4685        // Safety: drops once, never accessed again due to mem::forget
4686        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4687        // Prevent Drop from running (which would shut down the channel)
4688        std::mem::forget(self);
4689    }
4690}
4691
4692impl DirectoryDeprecatedGetAttrResponder {
4693    /// Sends a response to the FIDL transaction.
4694    ///
4695    /// Sets the channel to shutdown if an error occurs.
4696    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4697        let _result = self.send_raw(s, attributes);
4698        if _result.is_err() {
4699            self.control_handle.shutdown();
4700        }
4701        self.drop_without_shutdown();
4702        _result
4703    }
4704
4705    /// Similar to "send" but does not shutdown the channel if an error occurs.
4706    pub fn send_no_shutdown_on_err(
4707        self,
4708        mut s: i32,
4709        mut attributes: &NodeAttributes,
4710    ) -> Result<(), fidl::Error> {
4711        let _result = self.send_raw(s, attributes);
4712        self.drop_without_shutdown();
4713        _result
4714    }
4715
4716    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4717        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
4718            (s, attributes),
4719            self.tx_id,
4720            0x78985e216314dafd,
4721            fidl::encoding::DynamicFlags::empty(),
4722        )
4723    }
4724}
4725
4726#[must_use = "FIDL methods require a response to be sent"]
4727#[derive(Debug)]
4728pub struct DirectoryDeprecatedSetAttrResponder {
4729    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4730    tx_id: u32,
4731}
4732
4733/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4734/// if the responder is dropped without sending a response, so that the client
4735/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4736impl std::ops::Drop for DirectoryDeprecatedSetAttrResponder {
4737    fn drop(&mut self) {
4738        self.control_handle.shutdown();
4739        // Safety: drops once, never accessed again
4740        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4741    }
4742}
4743
4744impl fidl::endpoints::Responder for DirectoryDeprecatedSetAttrResponder {
4745    type ControlHandle = DirectoryControlHandle;
4746
4747    fn control_handle(&self) -> &DirectoryControlHandle {
4748        &self.control_handle
4749    }
4750
4751    fn drop_without_shutdown(mut self) {
4752        // Safety: drops once, never accessed again due to mem::forget
4753        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4754        // Prevent Drop from running (which would shut down the channel)
4755        std::mem::forget(self);
4756    }
4757}
4758
4759impl DirectoryDeprecatedSetAttrResponder {
4760    /// Sends a response to the FIDL transaction.
4761    ///
4762    /// Sets the channel to shutdown if an error occurs.
4763    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4764        let _result = self.send_raw(s);
4765        if _result.is_err() {
4766            self.control_handle.shutdown();
4767        }
4768        self.drop_without_shutdown();
4769        _result
4770    }
4771
4772    /// Similar to "send" but does not shutdown the channel if an error occurs.
4773    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4774        let _result = self.send_raw(s);
4775        self.drop_without_shutdown();
4776        _result
4777    }
4778
4779    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4780        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
4781            (s,),
4782            self.tx_id,
4783            0x4186c0f40d938f46,
4784            fidl::encoding::DynamicFlags::empty(),
4785        )
4786    }
4787}
4788
4789#[must_use = "FIDL methods require a response to be sent"]
4790#[derive(Debug)]
4791pub struct DirectoryDeprecatedGetFlagsResponder {
4792    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4793    tx_id: u32,
4794}
4795
4796/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4797/// if the responder is dropped without sending a response, so that the client
4798/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4799impl std::ops::Drop for DirectoryDeprecatedGetFlagsResponder {
4800    fn drop(&mut self) {
4801        self.control_handle.shutdown();
4802        // Safety: drops once, never accessed again
4803        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4804    }
4805}
4806
4807impl fidl::endpoints::Responder for DirectoryDeprecatedGetFlagsResponder {
4808    type ControlHandle = DirectoryControlHandle;
4809
4810    fn control_handle(&self) -> &DirectoryControlHandle {
4811        &self.control_handle
4812    }
4813
4814    fn drop_without_shutdown(mut self) {
4815        // Safety: drops once, never accessed again due to mem::forget
4816        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4817        // Prevent Drop from running (which would shut down the channel)
4818        std::mem::forget(self);
4819    }
4820}
4821
4822impl DirectoryDeprecatedGetFlagsResponder {
4823    /// Sends a response to the FIDL transaction.
4824    ///
4825    /// Sets the channel to shutdown if an error occurs.
4826    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4827        let _result = self.send_raw(s, flags);
4828        if _result.is_err() {
4829            self.control_handle.shutdown();
4830        }
4831        self.drop_without_shutdown();
4832        _result
4833    }
4834
4835    /// Similar to "send" but does not shutdown the channel if an error occurs.
4836    pub fn send_no_shutdown_on_err(
4837        self,
4838        mut s: i32,
4839        mut flags: OpenFlags,
4840    ) -> Result<(), fidl::Error> {
4841        let _result = self.send_raw(s, flags);
4842        self.drop_without_shutdown();
4843        _result
4844    }
4845
4846    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4847        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
4848            (s, flags),
4849            self.tx_id,
4850            0x5b88fffb8eda3aa1,
4851            fidl::encoding::DynamicFlags::empty(),
4852        )
4853    }
4854}
4855
4856#[must_use = "FIDL methods require a response to be sent"]
4857#[derive(Debug)]
4858pub struct DirectoryDeprecatedSetFlagsResponder {
4859    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4860    tx_id: u32,
4861}
4862
4863/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4864/// if the responder is dropped without sending a response, so that the client
4865/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4866impl std::ops::Drop for DirectoryDeprecatedSetFlagsResponder {
4867    fn drop(&mut self) {
4868        self.control_handle.shutdown();
4869        // Safety: drops once, never accessed again
4870        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4871    }
4872}
4873
4874impl fidl::endpoints::Responder for DirectoryDeprecatedSetFlagsResponder {
4875    type ControlHandle = DirectoryControlHandle;
4876
4877    fn control_handle(&self) -> &DirectoryControlHandle {
4878        &self.control_handle
4879    }
4880
4881    fn drop_without_shutdown(mut self) {
4882        // Safety: drops once, never accessed again due to mem::forget
4883        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4884        // Prevent Drop from running (which would shut down the channel)
4885        std::mem::forget(self);
4886    }
4887}
4888
4889impl DirectoryDeprecatedSetFlagsResponder {
4890    /// Sends a response to the FIDL transaction.
4891    ///
4892    /// Sets the channel to shutdown if an error occurs.
4893    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4894        let _result = self.send_raw(s);
4895        if _result.is_err() {
4896            self.control_handle.shutdown();
4897        }
4898        self.drop_without_shutdown();
4899        _result
4900    }
4901
4902    /// Similar to "send" but does not shutdown the channel if an error occurs.
4903    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4904        let _result = self.send_raw(s);
4905        self.drop_without_shutdown();
4906        _result
4907    }
4908
4909    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4910        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
4911            (s,),
4912            self.tx_id,
4913            0x5295b76c71fde733,
4914            fidl::encoding::DynamicFlags::empty(),
4915        )
4916    }
4917}
4918
4919#[must_use = "FIDL methods require a response to be sent"]
4920#[derive(Debug)]
4921pub struct DirectoryGetFlagsResponder {
4922    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4923    tx_id: u32,
4924}
4925
4926/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4927/// if the responder is dropped without sending a response, so that the client
4928/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4929impl std::ops::Drop for DirectoryGetFlagsResponder {
4930    fn drop(&mut self) {
4931        self.control_handle.shutdown();
4932        // Safety: drops once, never accessed again
4933        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4934    }
4935}
4936
4937impl fidl::endpoints::Responder for DirectoryGetFlagsResponder {
4938    type ControlHandle = DirectoryControlHandle;
4939
4940    fn control_handle(&self) -> &DirectoryControlHandle {
4941        &self.control_handle
4942    }
4943
4944    fn drop_without_shutdown(mut self) {
4945        // Safety: drops once, never accessed again due to mem::forget
4946        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4947        // Prevent Drop from running (which would shut down the channel)
4948        std::mem::forget(self);
4949    }
4950}
4951
4952impl DirectoryGetFlagsResponder {
4953    /// Sends a response to the FIDL transaction.
4954    ///
4955    /// Sets the channel to shutdown if an error occurs.
4956    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4957        let _result = self.send_raw(result);
4958        if _result.is_err() {
4959            self.control_handle.shutdown();
4960        }
4961        self.drop_without_shutdown();
4962        _result
4963    }
4964
4965    /// Similar to "send" but does not shutdown the channel if an error occurs.
4966    pub fn send_no_shutdown_on_err(
4967        self,
4968        mut result: Result<Flags, i32>,
4969    ) -> Result<(), fidl::Error> {
4970        let _result = self.send_raw(result);
4971        self.drop_without_shutdown();
4972        _result
4973    }
4974
4975    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4976        self.control_handle
4977            .inner
4978            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
4979                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
4980                self.tx_id,
4981                0x176eb318f64ec23,
4982                fidl::encoding::DynamicFlags::FLEXIBLE,
4983            )
4984    }
4985}
4986
4987#[must_use = "FIDL methods require a response to be sent"]
4988#[derive(Debug)]
4989pub struct DirectorySetFlagsResponder {
4990    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4991    tx_id: u32,
4992}
4993
4994/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4995/// if the responder is dropped without sending a response, so that the client
4996/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4997impl std::ops::Drop for DirectorySetFlagsResponder {
4998    fn drop(&mut self) {
4999        self.control_handle.shutdown();
5000        // Safety: drops once, never accessed again
5001        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5002    }
5003}
5004
5005impl fidl::endpoints::Responder for DirectorySetFlagsResponder {
5006    type ControlHandle = DirectoryControlHandle;
5007
5008    fn control_handle(&self) -> &DirectoryControlHandle {
5009        &self.control_handle
5010    }
5011
5012    fn drop_without_shutdown(mut self) {
5013        // Safety: drops once, never accessed again due to mem::forget
5014        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5015        // Prevent Drop from running (which would shut down the channel)
5016        std::mem::forget(self);
5017    }
5018}
5019
5020impl DirectorySetFlagsResponder {
5021    /// Sends a response to the FIDL transaction.
5022    ///
5023    /// Sets the channel to shutdown if an error occurs.
5024    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5025        let _result = self.send_raw(result);
5026        if _result.is_err() {
5027            self.control_handle.shutdown();
5028        }
5029        self.drop_without_shutdown();
5030        _result
5031    }
5032
5033    /// Similar to "send" but does not shutdown the channel if an error occurs.
5034    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5035        let _result = self.send_raw(result);
5036        self.drop_without_shutdown();
5037        _result
5038    }
5039
5040    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5041        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5042            fidl::encoding::EmptyStruct,
5043            i32,
5044        >>(
5045            fidl::encoding::FlexibleResult::new(result),
5046            self.tx_id,
5047            0x55a8028685791ea8,
5048            fidl::encoding::DynamicFlags::FLEXIBLE,
5049        )
5050    }
5051}
5052
5053#[must_use = "FIDL methods require a response to be sent"]
5054#[derive(Debug)]
5055pub struct DirectoryQueryFilesystemResponder {
5056    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5057    tx_id: u32,
5058}
5059
5060/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5061/// if the responder is dropped without sending a response, so that the client
5062/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5063impl std::ops::Drop for DirectoryQueryFilesystemResponder {
5064    fn drop(&mut self) {
5065        self.control_handle.shutdown();
5066        // Safety: drops once, never accessed again
5067        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5068    }
5069}
5070
5071impl fidl::endpoints::Responder for DirectoryQueryFilesystemResponder {
5072    type ControlHandle = DirectoryControlHandle;
5073
5074    fn control_handle(&self) -> &DirectoryControlHandle {
5075        &self.control_handle
5076    }
5077
5078    fn drop_without_shutdown(mut self) {
5079        // Safety: drops once, never accessed again due to mem::forget
5080        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5081        // Prevent Drop from running (which would shut down the channel)
5082        std::mem::forget(self);
5083    }
5084}
5085
5086impl DirectoryQueryFilesystemResponder {
5087    /// Sends a response to the FIDL transaction.
5088    ///
5089    /// Sets the channel to shutdown if an error occurs.
5090    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5091        let _result = self.send_raw(s, info);
5092        if _result.is_err() {
5093            self.control_handle.shutdown();
5094        }
5095        self.drop_without_shutdown();
5096        _result
5097    }
5098
5099    /// Similar to "send" but does not shutdown the channel if an error occurs.
5100    pub fn send_no_shutdown_on_err(
5101        self,
5102        mut s: i32,
5103        mut info: Option<&FilesystemInfo>,
5104    ) -> Result<(), fidl::Error> {
5105        let _result = self.send_raw(s, info);
5106        self.drop_without_shutdown();
5107        _result
5108    }
5109
5110    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5111        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
5112            (s, info),
5113            self.tx_id,
5114            0x6f344a1c6b0a0610,
5115            fidl::encoding::DynamicFlags::empty(),
5116        )
5117    }
5118}
5119
5120#[must_use = "FIDL methods require a response to be sent"]
5121#[derive(Debug)]
5122pub struct DirectoryGetAttributesResponder {
5123    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5124    tx_id: u32,
5125}
5126
5127/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5128/// if the responder is dropped without sending a response, so that the client
5129/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5130impl std::ops::Drop for DirectoryGetAttributesResponder {
5131    fn drop(&mut self) {
5132        self.control_handle.shutdown();
5133        // Safety: drops once, never accessed again
5134        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5135    }
5136}
5137
5138impl fidl::endpoints::Responder for DirectoryGetAttributesResponder {
5139    type ControlHandle = DirectoryControlHandle;
5140
5141    fn control_handle(&self) -> &DirectoryControlHandle {
5142        &self.control_handle
5143    }
5144
5145    fn drop_without_shutdown(mut self) {
5146        // Safety: drops once, never accessed again due to mem::forget
5147        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5148        // Prevent Drop from running (which would shut down the channel)
5149        std::mem::forget(self);
5150    }
5151}
5152
5153impl DirectoryGetAttributesResponder {
5154    /// Sends a response to the FIDL transaction.
5155    ///
5156    /// Sets the channel to shutdown if an error occurs.
5157    pub fn send(
5158        self,
5159        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5160    ) -> Result<(), fidl::Error> {
5161        let _result = self.send_raw(result);
5162        if _result.is_err() {
5163            self.control_handle.shutdown();
5164        }
5165        self.drop_without_shutdown();
5166        _result
5167    }
5168
5169    /// Similar to "send" but does not shutdown the channel if an error occurs.
5170    pub fn send_no_shutdown_on_err(
5171        self,
5172        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5173    ) -> Result<(), fidl::Error> {
5174        let _result = self.send_raw(result);
5175        self.drop_without_shutdown();
5176        _result
5177    }
5178
5179    fn send_raw(
5180        &self,
5181        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5182    ) -> Result<(), fidl::Error> {
5183        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
5184            result,
5185            self.tx_id,
5186            0x3d4396a638ea053b,
5187            fidl::encoding::DynamicFlags::empty(),
5188        )
5189    }
5190}
5191
5192#[must_use = "FIDL methods require a response to be sent"]
5193#[derive(Debug)]
5194pub struct DirectoryUpdateAttributesResponder {
5195    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5196    tx_id: u32,
5197}
5198
5199/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5200/// if the responder is dropped without sending a response, so that the client
5201/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5202impl std::ops::Drop for DirectoryUpdateAttributesResponder {
5203    fn drop(&mut self) {
5204        self.control_handle.shutdown();
5205        // Safety: drops once, never accessed again
5206        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5207    }
5208}
5209
5210impl fidl::endpoints::Responder for DirectoryUpdateAttributesResponder {
5211    type ControlHandle = DirectoryControlHandle;
5212
5213    fn control_handle(&self) -> &DirectoryControlHandle {
5214        &self.control_handle
5215    }
5216
5217    fn drop_without_shutdown(mut self) {
5218        // Safety: drops once, never accessed again due to mem::forget
5219        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5220        // Prevent Drop from running (which would shut down the channel)
5221        std::mem::forget(self);
5222    }
5223}
5224
5225impl DirectoryUpdateAttributesResponder {
5226    /// Sends a response to the FIDL transaction.
5227    ///
5228    /// Sets the channel to shutdown if an error occurs.
5229    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5230        let _result = self.send_raw(result);
5231        if _result.is_err() {
5232            self.control_handle.shutdown();
5233        }
5234        self.drop_without_shutdown();
5235        _result
5236    }
5237
5238    /// Similar to "send" but does not shutdown the channel if an error occurs.
5239    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5240        let _result = self.send_raw(result);
5241        self.drop_without_shutdown();
5242        _result
5243    }
5244
5245    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5246        self.control_handle
5247            .inner
5248            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5249                result,
5250                self.tx_id,
5251                0x3308c1da5a89bf08,
5252                fidl::encoding::DynamicFlags::empty(),
5253            )
5254    }
5255}
5256
5257#[must_use = "FIDL methods require a response to be sent"]
5258#[derive(Debug)]
5259pub struct DirectorySyncResponder {
5260    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5261    tx_id: u32,
5262}
5263
5264/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5265/// if the responder is dropped without sending a response, so that the client
5266/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5267impl std::ops::Drop for DirectorySyncResponder {
5268    fn drop(&mut self) {
5269        self.control_handle.shutdown();
5270        // Safety: drops once, never accessed again
5271        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5272    }
5273}
5274
5275impl fidl::endpoints::Responder for DirectorySyncResponder {
5276    type ControlHandle = DirectoryControlHandle;
5277
5278    fn control_handle(&self) -> &DirectoryControlHandle {
5279        &self.control_handle
5280    }
5281
5282    fn drop_without_shutdown(mut self) {
5283        // Safety: drops once, never accessed again due to mem::forget
5284        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5285        // Prevent Drop from running (which would shut down the channel)
5286        std::mem::forget(self);
5287    }
5288}
5289
5290impl DirectorySyncResponder {
5291    /// Sends a response to the FIDL transaction.
5292    ///
5293    /// Sets the channel to shutdown if an error occurs.
5294    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5295        let _result = self.send_raw(result);
5296        if _result.is_err() {
5297            self.control_handle.shutdown();
5298        }
5299        self.drop_without_shutdown();
5300        _result
5301    }
5302
5303    /// Similar to "send" but does not shutdown the channel if an error occurs.
5304    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5305        let _result = self.send_raw(result);
5306        self.drop_without_shutdown();
5307        _result
5308    }
5309
5310    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5311        self.control_handle
5312            .inner
5313            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5314                result,
5315                self.tx_id,
5316                0x2c5c27ca0ab5dc49,
5317                fidl::encoding::DynamicFlags::empty(),
5318            )
5319    }
5320}
5321
5322#[must_use = "FIDL methods require a response to be sent"]
5323#[derive(Debug)]
5324pub struct DirectoryGetExtendedAttributeResponder {
5325    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5326    tx_id: u32,
5327}
5328
5329/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5330/// if the responder is dropped without sending a response, so that the client
5331/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5332impl std::ops::Drop for DirectoryGetExtendedAttributeResponder {
5333    fn drop(&mut self) {
5334        self.control_handle.shutdown();
5335        // Safety: drops once, never accessed again
5336        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5337    }
5338}
5339
5340impl fidl::endpoints::Responder for DirectoryGetExtendedAttributeResponder {
5341    type ControlHandle = DirectoryControlHandle;
5342
5343    fn control_handle(&self) -> &DirectoryControlHandle {
5344        &self.control_handle
5345    }
5346
5347    fn drop_without_shutdown(mut self) {
5348        // Safety: drops once, never accessed again due to mem::forget
5349        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5350        // Prevent Drop from running (which would shut down the channel)
5351        std::mem::forget(self);
5352    }
5353}
5354
5355impl DirectoryGetExtendedAttributeResponder {
5356    /// Sends a response to the FIDL transaction.
5357    ///
5358    /// Sets the channel to shutdown if an error occurs.
5359    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5360        let _result = self.send_raw(result);
5361        if _result.is_err() {
5362            self.control_handle.shutdown();
5363        }
5364        self.drop_without_shutdown();
5365        _result
5366    }
5367
5368    /// Similar to "send" but does not shutdown the channel if an error occurs.
5369    pub fn send_no_shutdown_on_err(
5370        self,
5371        mut result: Result<ExtendedAttributeValue, i32>,
5372    ) -> Result<(), fidl::Error> {
5373        let _result = self.send_raw(result);
5374        self.drop_without_shutdown();
5375        _result
5376    }
5377
5378    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5379        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
5380            result.as_mut().map_err(|e| *e),
5381            self.tx_id,
5382            0x45ffa3ccfdeb76db,
5383            fidl::encoding::DynamicFlags::empty(),
5384        )
5385    }
5386}
5387
5388#[must_use = "FIDL methods require a response to be sent"]
5389#[derive(Debug)]
5390pub struct DirectorySetExtendedAttributeResponder {
5391    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5392    tx_id: u32,
5393}
5394
5395/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5396/// if the responder is dropped without sending a response, so that the client
5397/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5398impl std::ops::Drop for DirectorySetExtendedAttributeResponder {
5399    fn drop(&mut self) {
5400        self.control_handle.shutdown();
5401        // Safety: drops once, never accessed again
5402        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5403    }
5404}
5405
5406impl fidl::endpoints::Responder for DirectorySetExtendedAttributeResponder {
5407    type ControlHandle = DirectoryControlHandle;
5408
5409    fn control_handle(&self) -> &DirectoryControlHandle {
5410        &self.control_handle
5411    }
5412
5413    fn drop_without_shutdown(mut self) {
5414        // Safety: drops once, never accessed again due to mem::forget
5415        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5416        // Prevent Drop from running (which would shut down the channel)
5417        std::mem::forget(self);
5418    }
5419}
5420
5421impl DirectorySetExtendedAttributeResponder {
5422    /// Sends a response to the FIDL transaction.
5423    ///
5424    /// Sets the channel to shutdown if an error occurs.
5425    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5426        let _result = self.send_raw(result);
5427        if _result.is_err() {
5428            self.control_handle.shutdown();
5429        }
5430        self.drop_without_shutdown();
5431        _result
5432    }
5433
5434    /// Similar to "send" but does not shutdown the channel if an error occurs.
5435    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5436        let _result = self.send_raw(result);
5437        self.drop_without_shutdown();
5438        _result
5439    }
5440
5441    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5442        self.control_handle
5443            .inner
5444            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5445                result,
5446                self.tx_id,
5447                0x4a951362f681f23c,
5448                fidl::encoding::DynamicFlags::empty(),
5449            )
5450    }
5451}
5452
5453#[must_use = "FIDL methods require a response to be sent"]
5454#[derive(Debug)]
5455pub struct DirectoryRemoveExtendedAttributeResponder {
5456    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5457    tx_id: u32,
5458}
5459
5460/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5461/// if the responder is dropped without sending a response, so that the client
5462/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5463impl std::ops::Drop for DirectoryRemoveExtendedAttributeResponder {
5464    fn drop(&mut self) {
5465        self.control_handle.shutdown();
5466        // Safety: drops once, never accessed again
5467        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5468    }
5469}
5470
5471impl fidl::endpoints::Responder for DirectoryRemoveExtendedAttributeResponder {
5472    type ControlHandle = DirectoryControlHandle;
5473
5474    fn control_handle(&self) -> &DirectoryControlHandle {
5475        &self.control_handle
5476    }
5477
5478    fn drop_without_shutdown(mut self) {
5479        // Safety: drops once, never accessed again due to mem::forget
5480        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5481        // Prevent Drop from running (which would shut down the channel)
5482        std::mem::forget(self);
5483    }
5484}
5485
5486impl DirectoryRemoveExtendedAttributeResponder {
5487    /// Sends a response to the FIDL transaction.
5488    ///
5489    /// Sets the channel to shutdown if an error occurs.
5490    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5491        let _result = self.send_raw(result);
5492        if _result.is_err() {
5493            self.control_handle.shutdown();
5494        }
5495        self.drop_without_shutdown();
5496        _result
5497    }
5498
5499    /// Similar to "send" but does not shutdown the channel if an error occurs.
5500    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5501        let _result = self.send_raw(result);
5502        self.drop_without_shutdown();
5503        _result
5504    }
5505
5506    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5507        self.control_handle
5508            .inner
5509            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5510                result,
5511                self.tx_id,
5512                0x7a0b9f3a9bf9032d,
5513                fidl::encoding::DynamicFlags::empty(),
5514            )
5515    }
5516}
5517
5518#[must_use = "FIDL methods require a response to be sent"]
5519#[derive(Debug)]
5520pub struct DirectoryReadDirentsResponder {
5521    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5522    tx_id: u32,
5523}
5524
5525/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5526/// if the responder is dropped without sending a response, so that the client
5527/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5528impl std::ops::Drop for DirectoryReadDirentsResponder {
5529    fn drop(&mut self) {
5530        self.control_handle.shutdown();
5531        // Safety: drops once, never accessed again
5532        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5533    }
5534}
5535
5536impl fidl::endpoints::Responder for DirectoryReadDirentsResponder {
5537    type ControlHandle = DirectoryControlHandle;
5538
5539    fn control_handle(&self) -> &DirectoryControlHandle {
5540        &self.control_handle
5541    }
5542
5543    fn drop_without_shutdown(mut self) {
5544        // Safety: drops once, never accessed again due to mem::forget
5545        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5546        // Prevent Drop from running (which would shut down the channel)
5547        std::mem::forget(self);
5548    }
5549}
5550
5551impl DirectoryReadDirentsResponder {
5552    /// Sends a response to the FIDL transaction.
5553    ///
5554    /// Sets the channel to shutdown if an error occurs.
5555    pub fn send(self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5556        let _result = self.send_raw(s, dirents);
5557        if _result.is_err() {
5558            self.control_handle.shutdown();
5559        }
5560        self.drop_without_shutdown();
5561        _result
5562    }
5563
5564    /// Similar to "send" but does not shutdown the channel if an error occurs.
5565    pub fn send_no_shutdown_on_err(
5566        self,
5567        mut s: i32,
5568        mut dirents: &[u8],
5569    ) -> Result<(), fidl::Error> {
5570        let _result = self.send_raw(s, dirents);
5571        self.drop_without_shutdown();
5572        _result
5573    }
5574
5575    fn send_raw(&self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5576        self.control_handle.inner.send::<DirectoryReadDirentsResponse>(
5577            (s, dirents),
5578            self.tx_id,
5579            0x3582806bf27faa0a,
5580            fidl::encoding::DynamicFlags::empty(),
5581        )
5582    }
5583}
5584
5585#[must_use = "FIDL methods require a response to be sent"]
5586#[derive(Debug)]
5587pub struct DirectoryRewindResponder {
5588    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5589    tx_id: u32,
5590}
5591
5592/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5593/// if the responder is dropped without sending a response, so that the client
5594/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5595impl std::ops::Drop for DirectoryRewindResponder {
5596    fn drop(&mut self) {
5597        self.control_handle.shutdown();
5598        // Safety: drops once, never accessed again
5599        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5600    }
5601}
5602
5603impl fidl::endpoints::Responder for DirectoryRewindResponder {
5604    type ControlHandle = DirectoryControlHandle;
5605
5606    fn control_handle(&self) -> &DirectoryControlHandle {
5607        &self.control_handle
5608    }
5609
5610    fn drop_without_shutdown(mut self) {
5611        // Safety: drops once, never accessed again due to mem::forget
5612        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5613        // Prevent Drop from running (which would shut down the channel)
5614        std::mem::forget(self);
5615    }
5616}
5617
5618impl DirectoryRewindResponder {
5619    /// Sends a response to the FIDL transaction.
5620    ///
5621    /// Sets the channel to shutdown if an error occurs.
5622    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5623        let _result = self.send_raw(s);
5624        if _result.is_err() {
5625            self.control_handle.shutdown();
5626        }
5627        self.drop_without_shutdown();
5628        _result
5629    }
5630
5631    /// Similar to "send" but does not shutdown the channel if an error occurs.
5632    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5633        let _result = self.send_raw(s);
5634        self.drop_without_shutdown();
5635        _result
5636    }
5637
5638    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5639        self.control_handle.inner.send::<DirectoryRewindResponse>(
5640            (s,),
5641            self.tx_id,
5642            0x16b1202af0f34c71,
5643            fidl::encoding::DynamicFlags::empty(),
5644        )
5645    }
5646}
5647
5648#[must_use = "FIDL methods require a response to be sent"]
5649#[derive(Debug)]
5650pub struct DirectoryGetTokenResponder {
5651    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5652    tx_id: u32,
5653}
5654
5655/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5656/// if the responder is dropped without sending a response, so that the client
5657/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5658impl std::ops::Drop for DirectoryGetTokenResponder {
5659    fn drop(&mut self) {
5660        self.control_handle.shutdown();
5661        // Safety: drops once, never accessed again
5662        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5663    }
5664}
5665
5666impl fidl::endpoints::Responder for DirectoryGetTokenResponder {
5667    type ControlHandle = DirectoryControlHandle;
5668
5669    fn control_handle(&self) -> &DirectoryControlHandle {
5670        &self.control_handle
5671    }
5672
5673    fn drop_without_shutdown(mut self) {
5674        // Safety: drops once, never accessed again due to mem::forget
5675        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5676        // Prevent Drop from running (which would shut down the channel)
5677        std::mem::forget(self);
5678    }
5679}
5680
5681impl DirectoryGetTokenResponder {
5682    /// Sends a response to the FIDL transaction.
5683    ///
5684    /// Sets the channel to shutdown if an error occurs.
5685    pub fn send(
5686        self,
5687        mut s: i32,
5688        mut token: Option<fidl::NullableHandle>,
5689    ) -> Result<(), fidl::Error> {
5690        let _result = self.send_raw(s, token);
5691        if _result.is_err() {
5692            self.control_handle.shutdown();
5693        }
5694        self.drop_without_shutdown();
5695        _result
5696    }
5697
5698    /// Similar to "send" but does not shutdown the channel if an error occurs.
5699    pub fn send_no_shutdown_on_err(
5700        self,
5701        mut s: i32,
5702        mut token: Option<fidl::NullableHandle>,
5703    ) -> Result<(), fidl::Error> {
5704        let _result = self.send_raw(s, token);
5705        self.drop_without_shutdown();
5706        _result
5707    }
5708
5709    fn send_raw(
5710        &self,
5711        mut s: i32,
5712        mut token: Option<fidl::NullableHandle>,
5713    ) -> Result<(), fidl::Error> {
5714        self.control_handle.inner.send::<DirectoryGetTokenResponse>(
5715            (s, token),
5716            self.tx_id,
5717            0x26ae9d18763c8655,
5718            fidl::encoding::DynamicFlags::empty(),
5719        )
5720    }
5721}
5722
5723#[must_use = "FIDL methods require a response to be sent"]
5724#[derive(Debug)]
5725pub struct DirectoryLinkResponder {
5726    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5727    tx_id: u32,
5728}
5729
5730/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5731/// if the responder is dropped without sending a response, so that the client
5732/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5733impl std::ops::Drop for DirectoryLinkResponder {
5734    fn drop(&mut self) {
5735        self.control_handle.shutdown();
5736        // Safety: drops once, never accessed again
5737        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5738    }
5739}
5740
5741impl fidl::endpoints::Responder for DirectoryLinkResponder {
5742    type ControlHandle = DirectoryControlHandle;
5743
5744    fn control_handle(&self) -> &DirectoryControlHandle {
5745        &self.control_handle
5746    }
5747
5748    fn drop_without_shutdown(mut self) {
5749        // Safety: drops once, never accessed again due to mem::forget
5750        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5751        // Prevent Drop from running (which would shut down the channel)
5752        std::mem::forget(self);
5753    }
5754}
5755
5756impl DirectoryLinkResponder {
5757    /// Sends a response to the FIDL transaction.
5758    ///
5759    /// Sets the channel to shutdown if an error occurs.
5760    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5761        let _result = self.send_raw(s);
5762        if _result.is_err() {
5763            self.control_handle.shutdown();
5764        }
5765        self.drop_without_shutdown();
5766        _result
5767    }
5768
5769    /// Similar to "send" but does not shutdown the channel if an error occurs.
5770    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5771        let _result = self.send_raw(s);
5772        self.drop_without_shutdown();
5773        _result
5774    }
5775
5776    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5777        self.control_handle.inner.send::<DirectoryLinkResponse>(
5778            (s,),
5779            self.tx_id,
5780            0x740604c0c7c930e7,
5781            fidl::encoding::DynamicFlags::empty(),
5782        )
5783    }
5784}
5785
5786#[must_use = "FIDL methods require a response to be sent"]
5787#[derive(Debug)]
5788pub struct DirectoryUnlinkResponder {
5789    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5790    tx_id: u32,
5791}
5792
5793/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5794/// if the responder is dropped without sending a response, so that the client
5795/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5796impl std::ops::Drop for DirectoryUnlinkResponder {
5797    fn drop(&mut self) {
5798        self.control_handle.shutdown();
5799        // Safety: drops once, never accessed again
5800        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5801    }
5802}
5803
5804impl fidl::endpoints::Responder for DirectoryUnlinkResponder {
5805    type ControlHandle = DirectoryControlHandle;
5806
5807    fn control_handle(&self) -> &DirectoryControlHandle {
5808        &self.control_handle
5809    }
5810
5811    fn drop_without_shutdown(mut self) {
5812        // Safety: drops once, never accessed again due to mem::forget
5813        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5814        // Prevent Drop from running (which would shut down the channel)
5815        std::mem::forget(self);
5816    }
5817}
5818
5819impl DirectoryUnlinkResponder {
5820    /// Sends a response to the FIDL transaction.
5821    ///
5822    /// Sets the channel to shutdown if an error occurs.
5823    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5824        let _result = self.send_raw(result);
5825        if _result.is_err() {
5826            self.control_handle.shutdown();
5827        }
5828        self.drop_without_shutdown();
5829        _result
5830    }
5831
5832    /// Similar to "send" but does not shutdown the channel if an error occurs.
5833    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5834        let _result = self.send_raw(result);
5835        self.drop_without_shutdown();
5836        _result
5837    }
5838
5839    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5840        self.control_handle
5841            .inner
5842            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5843                result,
5844                self.tx_id,
5845                0x750a0326a78d7bed,
5846                fidl::encoding::DynamicFlags::empty(),
5847            )
5848    }
5849}
5850
5851#[must_use = "FIDL methods require a response to be sent"]
5852#[derive(Debug)]
5853pub struct DirectoryRenameResponder {
5854    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5855    tx_id: u32,
5856}
5857
5858/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5859/// if the responder is dropped without sending a response, so that the client
5860/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5861impl std::ops::Drop for DirectoryRenameResponder {
5862    fn drop(&mut self) {
5863        self.control_handle.shutdown();
5864        // Safety: drops once, never accessed again
5865        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5866    }
5867}
5868
5869impl fidl::endpoints::Responder for DirectoryRenameResponder {
5870    type ControlHandle = DirectoryControlHandle;
5871
5872    fn control_handle(&self) -> &DirectoryControlHandle {
5873        &self.control_handle
5874    }
5875
5876    fn drop_without_shutdown(mut self) {
5877        // Safety: drops once, never accessed again due to mem::forget
5878        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5879        // Prevent Drop from running (which would shut down the channel)
5880        std::mem::forget(self);
5881    }
5882}
5883
5884impl DirectoryRenameResponder {
5885    /// Sends a response to the FIDL transaction.
5886    ///
5887    /// Sets the channel to shutdown if an error occurs.
5888    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5889        let _result = self.send_raw(result);
5890        if _result.is_err() {
5891            self.control_handle.shutdown();
5892        }
5893        self.drop_without_shutdown();
5894        _result
5895    }
5896
5897    /// Similar to "send" but does not shutdown the channel if an error occurs.
5898    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5899        let _result = self.send_raw(result);
5900        self.drop_without_shutdown();
5901        _result
5902    }
5903
5904    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5905        self.control_handle
5906            .inner
5907            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5908                result,
5909                self.tx_id,
5910                0x7060e7723b9928de,
5911                fidl::encoding::DynamicFlags::empty(),
5912            )
5913    }
5914}
5915
5916#[must_use = "FIDL methods require a response to be sent"]
5917#[derive(Debug)]
5918pub struct DirectoryCreateSymlinkResponder {
5919    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5920    tx_id: u32,
5921}
5922
5923/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5924/// if the responder is dropped without sending a response, so that the client
5925/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5926impl std::ops::Drop for DirectoryCreateSymlinkResponder {
5927    fn drop(&mut self) {
5928        self.control_handle.shutdown();
5929        // Safety: drops once, never accessed again
5930        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5931    }
5932}
5933
5934impl fidl::endpoints::Responder for DirectoryCreateSymlinkResponder {
5935    type ControlHandle = DirectoryControlHandle;
5936
5937    fn control_handle(&self) -> &DirectoryControlHandle {
5938        &self.control_handle
5939    }
5940
5941    fn drop_without_shutdown(mut self) {
5942        // Safety: drops once, never accessed again due to mem::forget
5943        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5944        // Prevent Drop from running (which would shut down the channel)
5945        std::mem::forget(self);
5946    }
5947}
5948
5949impl DirectoryCreateSymlinkResponder {
5950    /// Sends a response to the FIDL transaction.
5951    ///
5952    /// Sets the channel to shutdown if an error occurs.
5953    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5954        let _result = self.send_raw(result);
5955        if _result.is_err() {
5956            self.control_handle.shutdown();
5957        }
5958        self.drop_without_shutdown();
5959        _result
5960    }
5961
5962    /// Similar to "send" but does not shutdown the channel if an error occurs.
5963    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5964        let _result = self.send_raw(result);
5965        self.drop_without_shutdown();
5966        _result
5967    }
5968
5969    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5970        self.control_handle
5971            .inner
5972            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5973                result,
5974                self.tx_id,
5975                0x21ce0f19ec043889,
5976                fidl::encoding::DynamicFlags::empty(),
5977            )
5978    }
5979}
5980
5981#[must_use = "FIDL methods require a response to be sent"]
5982#[derive(Debug)]
5983pub struct DirectoryWatchResponder {
5984    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5985    tx_id: u32,
5986}
5987
5988/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5989/// if the responder is dropped without sending a response, so that the client
5990/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5991impl std::ops::Drop for DirectoryWatchResponder {
5992    fn drop(&mut self) {
5993        self.control_handle.shutdown();
5994        // Safety: drops once, never accessed again
5995        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5996    }
5997}
5998
5999impl fidl::endpoints::Responder for DirectoryWatchResponder {
6000    type ControlHandle = DirectoryControlHandle;
6001
6002    fn control_handle(&self) -> &DirectoryControlHandle {
6003        &self.control_handle
6004    }
6005
6006    fn drop_without_shutdown(mut self) {
6007        // Safety: drops once, never accessed again due to mem::forget
6008        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6009        // Prevent Drop from running (which would shut down the channel)
6010        std::mem::forget(self);
6011    }
6012}
6013
6014impl DirectoryWatchResponder {
6015    /// Sends a response to the FIDL transaction.
6016    ///
6017    /// Sets the channel to shutdown if an error occurs.
6018    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
6019        let _result = self.send_raw(s);
6020        if _result.is_err() {
6021            self.control_handle.shutdown();
6022        }
6023        self.drop_without_shutdown();
6024        _result
6025    }
6026
6027    /// Similar to "send" but does not shutdown the channel if an error occurs.
6028    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
6029        let _result = self.send_raw(s);
6030        self.drop_without_shutdown();
6031        _result
6032    }
6033
6034    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
6035        self.control_handle.inner.send::<DirectoryWatchResponse>(
6036            (s,),
6037            self.tx_id,
6038            0x5717193a59d66d91,
6039            fidl::encoding::DynamicFlags::empty(),
6040        )
6041    }
6042}
6043
6044#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6045pub struct DirectoryWatcherMarker;
6046
6047impl fidl::endpoints::ProtocolMarker for DirectoryWatcherMarker {
6048    type Proxy = DirectoryWatcherProxy;
6049    type RequestStream = DirectoryWatcherRequestStream;
6050    #[cfg(target_os = "fuchsia")]
6051    type SynchronousProxy = DirectoryWatcherSynchronousProxy;
6052
6053    const DEBUG_NAME: &'static str = "(anonymous) DirectoryWatcher";
6054}
6055
6056pub trait DirectoryWatcherProxyInterface: Send + Sync {}
6057#[derive(Debug)]
6058#[cfg(target_os = "fuchsia")]
6059pub struct DirectoryWatcherSynchronousProxy {
6060    client: fidl::client::sync::Client,
6061}
6062
6063#[cfg(target_os = "fuchsia")]
6064impl fidl::endpoints::SynchronousProxy for DirectoryWatcherSynchronousProxy {
6065    type Proxy = DirectoryWatcherProxy;
6066    type Protocol = DirectoryWatcherMarker;
6067
6068    fn from_channel(inner: fidl::Channel) -> Self {
6069        Self::new(inner)
6070    }
6071
6072    fn into_channel(self) -> fidl::Channel {
6073        self.client.into_channel()
6074    }
6075
6076    fn as_channel(&self) -> &fidl::Channel {
6077        self.client.as_channel()
6078    }
6079}
6080
6081#[cfg(target_os = "fuchsia")]
6082impl DirectoryWatcherSynchronousProxy {
6083    pub fn new(channel: fidl::Channel) -> Self {
6084        let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6085        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6086    }
6087
6088    pub fn into_channel(self) -> fidl::Channel {
6089        self.client.into_channel()
6090    }
6091
6092    /// Waits until an event arrives and returns it. It is safe for other
6093    /// threads to make concurrent requests while waiting for an event.
6094    pub fn wait_for_event(
6095        &self,
6096        deadline: zx::MonotonicInstant,
6097    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6098        DirectoryWatcherEvent::decode(self.client.wait_for_event(deadline)?)
6099    }
6100}
6101
6102#[cfg(target_os = "fuchsia")]
6103impl From<DirectoryWatcherSynchronousProxy> for zx::NullableHandle {
6104    fn from(value: DirectoryWatcherSynchronousProxy) -> Self {
6105        value.into_channel().into()
6106    }
6107}
6108
6109#[cfg(target_os = "fuchsia")]
6110impl From<fidl::Channel> for DirectoryWatcherSynchronousProxy {
6111    fn from(value: fidl::Channel) -> Self {
6112        Self::new(value)
6113    }
6114}
6115
6116#[cfg(target_os = "fuchsia")]
6117impl fidl::endpoints::FromClient for DirectoryWatcherSynchronousProxy {
6118    type Protocol = DirectoryWatcherMarker;
6119
6120    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryWatcherMarker>) -> Self {
6121        Self::new(value.into_channel())
6122    }
6123}
6124
6125#[derive(Debug, Clone)]
6126pub struct DirectoryWatcherProxy {
6127    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6128}
6129
6130impl fidl::endpoints::Proxy for DirectoryWatcherProxy {
6131    type Protocol = DirectoryWatcherMarker;
6132
6133    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6134        Self::new(inner)
6135    }
6136
6137    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6138        self.client.into_channel().map_err(|client| Self { client })
6139    }
6140
6141    fn as_channel(&self) -> &::fidl::AsyncChannel {
6142        self.client.as_channel()
6143    }
6144}
6145
6146impl DirectoryWatcherProxy {
6147    /// Create a new Proxy for fuchsia.io/DirectoryWatcher.
6148    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6149        let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6150        Self { client: fidl::client::Client::new(channel, protocol_name) }
6151    }
6152
6153    /// Get a Stream of events from the remote end of the protocol.
6154    ///
6155    /// # Panics
6156    ///
6157    /// Panics if the event stream was already taken.
6158    pub fn take_event_stream(&self) -> DirectoryWatcherEventStream {
6159        DirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
6160    }
6161}
6162
6163impl DirectoryWatcherProxyInterface for DirectoryWatcherProxy {}
6164
6165pub struct DirectoryWatcherEventStream {
6166    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6167}
6168
6169impl std::marker::Unpin for DirectoryWatcherEventStream {}
6170
6171impl futures::stream::FusedStream for DirectoryWatcherEventStream {
6172    fn is_terminated(&self) -> bool {
6173        self.event_receiver.is_terminated()
6174    }
6175}
6176
6177impl futures::Stream for DirectoryWatcherEventStream {
6178    type Item = Result<DirectoryWatcherEvent, fidl::Error>;
6179
6180    fn poll_next(
6181        mut self: std::pin::Pin<&mut Self>,
6182        cx: &mut std::task::Context<'_>,
6183    ) -> std::task::Poll<Option<Self::Item>> {
6184        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6185            &mut self.event_receiver,
6186            cx
6187        )?) {
6188            Some(buf) => std::task::Poll::Ready(Some(DirectoryWatcherEvent::decode(buf))),
6189            None => std::task::Poll::Ready(None),
6190        }
6191    }
6192}
6193
6194#[derive(Debug)]
6195pub enum DirectoryWatcherEvent {}
6196
6197impl DirectoryWatcherEvent {
6198    /// Decodes a message buffer as a [`DirectoryWatcherEvent`].
6199    fn decode(
6200        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6201    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6202        let (bytes, _handles) = buf.split_mut();
6203        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6204        debug_assert_eq!(tx_header.tx_id, 0);
6205        match tx_header.ordinal {
6206            _ => Err(fidl::Error::UnknownOrdinal {
6207                ordinal: tx_header.ordinal,
6208                protocol_name:
6209                    <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6210            }),
6211        }
6212    }
6213}
6214
6215/// A Stream of incoming requests for fuchsia.io/DirectoryWatcher.
6216pub struct DirectoryWatcherRequestStream {
6217    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6218    is_terminated: bool,
6219}
6220
6221impl std::marker::Unpin for DirectoryWatcherRequestStream {}
6222
6223impl futures::stream::FusedStream for DirectoryWatcherRequestStream {
6224    fn is_terminated(&self) -> bool {
6225        self.is_terminated
6226    }
6227}
6228
6229impl fidl::endpoints::RequestStream for DirectoryWatcherRequestStream {
6230    type Protocol = DirectoryWatcherMarker;
6231    type ControlHandle = DirectoryWatcherControlHandle;
6232
6233    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6234        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6235    }
6236
6237    fn control_handle(&self) -> Self::ControlHandle {
6238        DirectoryWatcherControlHandle { inner: self.inner.clone() }
6239    }
6240
6241    fn into_inner(
6242        self,
6243    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6244    {
6245        (self.inner, self.is_terminated)
6246    }
6247
6248    fn from_inner(
6249        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6250        is_terminated: bool,
6251    ) -> Self {
6252        Self { inner, is_terminated }
6253    }
6254}
6255
6256impl futures::Stream for DirectoryWatcherRequestStream {
6257    type Item = Result<DirectoryWatcherRequest, fidl::Error>;
6258
6259    fn poll_next(
6260        mut self: std::pin::Pin<&mut Self>,
6261        cx: &mut std::task::Context<'_>,
6262    ) -> std::task::Poll<Option<Self::Item>> {
6263        let this = &mut *self;
6264        if this.inner.check_shutdown(cx) {
6265            this.is_terminated = true;
6266            return std::task::Poll::Ready(None);
6267        }
6268        if this.is_terminated {
6269            panic!("polled DirectoryWatcherRequestStream after completion");
6270        }
6271        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6272            |bytes, handles| {
6273                match this.inner.channel().read_etc(cx, bytes, handles) {
6274                    std::task::Poll::Ready(Ok(())) => {}
6275                    std::task::Poll::Pending => return std::task::Poll::Pending,
6276                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6277                        this.is_terminated = true;
6278                        return std::task::Poll::Ready(None);
6279                    }
6280                    std::task::Poll::Ready(Err(e)) => {
6281                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6282                            e.into(),
6283                        ))));
6284                    }
6285                }
6286
6287                // A message has been received from the channel
6288                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6289
6290                std::task::Poll::Ready(Some(match header.ordinal {
6291                    _ => Err(fidl::Error::UnknownOrdinal {
6292                        ordinal: header.ordinal,
6293                        protocol_name:
6294                            <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6295                    }),
6296                }))
6297            },
6298        )
6299    }
6300}
6301
6302/// DirectoryWatcher transmits messages from a filesystem server
6303/// about events happening in the filesystem. Clients can register
6304/// new watchers using the `Directory.Watch` method, where they can
6305/// filter which events they want to receive notifications for.
6306///
6307/// The DirectoryWatcher will send messages of the form:
6308/// ```
6309/// struct {
6310///   uint8 event;
6311///   uint8 len;
6312///   char name[];
6313/// };
6314/// ```
6315/// Where names are NOT null-terminated. The name is the relative
6316/// path to the entry the event is refering to. It will be empty if
6317/// the event isn't referencing a particular entry (e.g. for the
6318/// `IDLE` event).
6319#[derive(Debug)]
6320pub enum DirectoryWatcherRequest {}
6321
6322impl DirectoryWatcherRequest {
6323    /// Name of the method defined in FIDL
6324    pub fn method_name(&self) -> &'static str {
6325        match *self {}
6326    }
6327}
6328
6329#[derive(Debug, Clone)]
6330pub struct DirectoryWatcherControlHandle {
6331    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6332}
6333
6334impl fidl::endpoints::ControlHandle for DirectoryWatcherControlHandle {
6335    fn shutdown(&self) {
6336        self.inner.shutdown()
6337    }
6338    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6339        self.inner.shutdown_with_epitaph(status)
6340    }
6341
6342    fn is_closed(&self) -> bool {
6343        self.inner.channel().is_closed()
6344    }
6345    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6346        self.inner.channel().on_closed()
6347    }
6348
6349    #[cfg(target_os = "fuchsia")]
6350    fn signal_peer(
6351        &self,
6352        clear_mask: zx::Signals,
6353        set_mask: zx::Signals,
6354    ) -> Result<(), zx_status::Status> {
6355        use fidl::Peered;
6356        self.inner.channel().signal_peer(clear_mask, set_mask)
6357    }
6358}
6359
6360impl DirectoryWatcherControlHandle {}
6361
6362#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6363pub struct ExtendedAttributeIteratorMarker;
6364
6365impl fidl::endpoints::ProtocolMarker for ExtendedAttributeIteratorMarker {
6366    type Proxy = ExtendedAttributeIteratorProxy;
6367    type RequestStream = ExtendedAttributeIteratorRequestStream;
6368    #[cfg(target_os = "fuchsia")]
6369    type SynchronousProxy = ExtendedAttributeIteratorSynchronousProxy;
6370
6371    const DEBUG_NAME: &'static str = "(anonymous) ExtendedAttributeIterator";
6372}
6373pub type ExtendedAttributeIteratorGetNextResult = Result<(Vec<Vec<u8>>, bool), i32>;
6374
6375pub trait ExtendedAttributeIteratorProxyInterface: Send + Sync {
6376    type GetNextResponseFut: std::future::Future<Output = Result<ExtendedAttributeIteratorGetNextResult, fidl::Error>>
6377        + Send;
6378    fn r#get_next(&self) -> Self::GetNextResponseFut;
6379}
6380#[derive(Debug)]
6381#[cfg(target_os = "fuchsia")]
6382pub struct ExtendedAttributeIteratorSynchronousProxy {
6383    client: fidl::client::sync::Client,
6384}
6385
6386#[cfg(target_os = "fuchsia")]
6387impl fidl::endpoints::SynchronousProxy for ExtendedAttributeIteratorSynchronousProxy {
6388    type Proxy = ExtendedAttributeIteratorProxy;
6389    type Protocol = ExtendedAttributeIteratorMarker;
6390
6391    fn from_channel(inner: fidl::Channel) -> Self {
6392        Self::new(inner)
6393    }
6394
6395    fn into_channel(self) -> fidl::Channel {
6396        self.client.into_channel()
6397    }
6398
6399    fn as_channel(&self) -> &fidl::Channel {
6400        self.client.as_channel()
6401    }
6402}
6403
6404#[cfg(target_os = "fuchsia")]
6405impl ExtendedAttributeIteratorSynchronousProxy {
6406    pub fn new(channel: fidl::Channel) -> Self {
6407        let protocol_name =
6408            <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6409        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6410    }
6411
6412    pub fn into_channel(self) -> fidl::Channel {
6413        self.client.into_channel()
6414    }
6415
6416    /// Waits until an event arrives and returns it. It is safe for other
6417    /// threads to make concurrent requests while waiting for an event.
6418    pub fn wait_for_event(
6419        &self,
6420        deadline: zx::MonotonicInstant,
6421    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6422        ExtendedAttributeIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6423    }
6424
6425    /// Get the next chunk of extended attribute names. If this is the last
6426    /// chunk, last will be true, and the channel will be closed after the
6427    /// call.
6428    pub fn r#get_next(
6429        &self,
6430        ___deadline: zx::MonotonicInstant,
6431    ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6432        let _response = self.client.send_query::<
6433            fidl::encoding::EmptyPayload,
6434            fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6435        >(
6436            (),
6437            0x3ba664a1c2e45a7,
6438            fidl::encoding::DynamicFlags::empty(),
6439            ___deadline,
6440        )?;
6441        Ok(_response.map(|x| (x.attributes, x.last)))
6442    }
6443}
6444
6445#[cfg(target_os = "fuchsia")]
6446impl From<ExtendedAttributeIteratorSynchronousProxy> for zx::NullableHandle {
6447    fn from(value: ExtendedAttributeIteratorSynchronousProxy) -> Self {
6448        value.into_channel().into()
6449    }
6450}
6451
6452#[cfg(target_os = "fuchsia")]
6453impl From<fidl::Channel> for ExtendedAttributeIteratorSynchronousProxy {
6454    fn from(value: fidl::Channel) -> Self {
6455        Self::new(value)
6456    }
6457}
6458
6459#[cfg(target_os = "fuchsia")]
6460impl fidl::endpoints::FromClient for ExtendedAttributeIteratorSynchronousProxy {
6461    type Protocol = ExtendedAttributeIteratorMarker;
6462
6463    fn from_client(value: fidl::endpoints::ClientEnd<ExtendedAttributeIteratorMarker>) -> Self {
6464        Self::new(value.into_channel())
6465    }
6466}
6467
6468#[derive(Debug, Clone)]
6469pub struct ExtendedAttributeIteratorProxy {
6470    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6471}
6472
6473impl fidl::endpoints::Proxy for ExtendedAttributeIteratorProxy {
6474    type Protocol = ExtendedAttributeIteratorMarker;
6475
6476    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6477        Self::new(inner)
6478    }
6479
6480    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6481        self.client.into_channel().map_err(|client| Self { client })
6482    }
6483
6484    fn as_channel(&self) -> &::fidl::AsyncChannel {
6485        self.client.as_channel()
6486    }
6487}
6488
6489impl ExtendedAttributeIteratorProxy {
6490    /// Create a new Proxy for fuchsia.io/ExtendedAttributeIterator.
6491    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6492        let protocol_name =
6493            <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6494        Self { client: fidl::client::Client::new(channel, protocol_name) }
6495    }
6496
6497    /// Get a Stream of events from the remote end of the protocol.
6498    ///
6499    /// # Panics
6500    ///
6501    /// Panics if the event stream was already taken.
6502    pub fn take_event_stream(&self) -> ExtendedAttributeIteratorEventStream {
6503        ExtendedAttributeIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6504    }
6505
6506    /// Get the next chunk of extended attribute names. If this is the last
6507    /// chunk, last will be true, and the channel will be closed after the
6508    /// call.
6509    pub fn r#get_next(
6510        &self,
6511    ) -> fidl::client::QueryResponseFut<
6512        ExtendedAttributeIteratorGetNextResult,
6513        fidl::encoding::DefaultFuchsiaResourceDialect,
6514    > {
6515        ExtendedAttributeIteratorProxyInterface::r#get_next(self)
6516    }
6517}
6518
6519impl ExtendedAttributeIteratorProxyInterface for ExtendedAttributeIteratorProxy {
6520    type GetNextResponseFut = fidl::client::QueryResponseFut<
6521        ExtendedAttributeIteratorGetNextResult,
6522        fidl::encoding::DefaultFuchsiaResourceDialect,
6523    >;
6524    fn r#get_next(&self) -> Self::GetNextResponseFut {
6525        fn _decode(
6526            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6527        ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6528            let _response = fidl::client::decode_transaction_body::<
6529                fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6530                fidl::encoding::DefaultFuchsiaResourceDialect,
6531                0x3ba664a1c2e45a7,
6532            >(_buf?)?;
6533            Ok(_response.map(|x| (x.attributes, x.last)))
6534        }
6535        self.client.send_query_and_decode::<
6536            fidl::encoding::EmptyPayload,
6537            ExtendedAttributeIteratorGetNextResult,
6538        >(
6539            (),
6540            0x3ba664a1c2e45a7,
6541            fidl::encoding::DynamicFlags::empty(),
6542            _decode,
6543        )
6544    }
6545}
6546
6547pub struct ExtendedAttributeIteratorEventStream {
6548    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6549}
6550
6551impl std::marker::Unpin for ExtendedAttributeIteratorEventStream {}
6552
6553impl futures::stream::FusedStream for ExtendedAttributeIteratorEventStream {
6554    fn is_terminated(&self) -> bool {
6555        self.event_receiver.is_terminated()
6556    }
6557}
6558
6559impl futures::Stream for ExtendedAttributeIteratorEventStream {
6560    type Item = Result<ExtendedAttributeIteratorEvent, fidl::Error>;
6561
6562    fn poll_next(
6563        mut self: std::pin::Pin<&mut Self>,
6564        cx: &mut std::task::Context<'_>,
6565    ) -> std::task::Poll<Option<Self::Item>> {
6566        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6567            &mut self.event_receiver,
6568            cx
6569        )?) {
6570            Some(buf) => std::task::Poll::Ready(Some(ExtendedAttributeIteratorEvent::decode(buf))),
6571            None => std::task::Poll::Ready(None),
6572        }
6573    }
6574}
6575
6576#[derive(Debug)]
6577pub enum ExtendedAttributeIteratorEvent {}
6578
6579impl ExtendedAttributeIteratorEvent {
6580    /// Decodes a message buffer as a [`ExtendedAttributeIteratorEvent`].
6581    fn decode(
6582        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6583    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6584        let (bytes, _handles) = buf.split_mut();
6585        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6586        debug_assert_eq!(tx_header.tx_id, 0);
6587        match tx_header.ordinal {
6588            _ => Err(fidl::Error::UnknownOrdinal {
6589                ordinal: tx_header.ordinal,
6590                protocol_name:
6591                    <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6592            }),
6593        }
6594    }
6595}
6596
6597/// A Stream of incoming requests for fuchsia.io/ExtendedAttributeIterator.
6598pub struct ExtendedAttributeIteratorRequestStream {
6599    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6600    is_terminated: bool,
6601}
6602
6603impl std::marker::Unpin for ExtendedAttributeIteratorRequestStream {}
6604
6605impl futures::stream::FusedStream for ExtendedAttributeIteratorRequestStream {
6606    fn is_terminated(&self) -> bool {
6607        self.is_terminated
6608    }
6609}
6610
6611impl fidl::endpoints::RequestStream for ExtendedAttributeIteratorRequestStream {
6612    type Protocol = ExtendedAttributeIteratorMarker;
6613    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6614
6615    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6616        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6617    }
6618
6619    fn control_handle(&self) -> Self::ControlHandle {
6620        ExtendedAttributeIteratorControlHandle { inner: self.inner.clone() }
6621    }
6622
6623    fn into_inner(
6624        self,
6625    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6626    {
6627        (self.inner, self.is_terminated)
6628    }
6629
6630    fn from_inner(
6631        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6632        is_terminated: bool,
6633    ) -> Self {
6634        Self { inner, is_terminated }
6635    }
6636}
6637
6638impl futures::Stream for ExtendedAttributeIteratorRequestStream {
6639    type Item = Result<ExtendedAttributeIteratorRequest, fidl::Error>;
6640
6641    fn poll_next(
6642        mut self: std::pin::Pin<&mut Self>,
6643        cx: &mut std::task::Context<'_>,
6644    ) -> std::task::Poll<Option<Self::Item>> {
6645        let this = &mut *self;
6646        if this.inner.check_shutdown(cx) {
6647            this.is_terminated = true;
6648            return std::task::Poll::Ready(None);
6649        }
6650        if this.is_terminated {
6651            panic!("polled ExtendedAttributeIteratorRequestStream after completion");
6652        }
6653        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6654            |bytes, handles| {
6655                match this.inner.channel().read_etc(cx, bytes, handles) {
6656                    std::task::Poll::Ready(Ok(())) => {}
6657                    std::task::Poll::Pending => return std::task::Poll::Pending,
6658                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6659                        this.is_terminated = true;
6660                        return std::task::Poll::Ready(None);
6661                    }
6662                    std::task::Poll::Ready(Err(e)) => {
6663                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6664                            e.into(),
6665                        ))));
6666                    }
6667                }
6668
6669                // A message has been received from the channel
6670                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6671
6672                std::task::Poll::Ready(Some(match header.ordinal {
6673                0x3ba664a1c2e45a7 => {
6674                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6675                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6676                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6677                    let control_handle = ExtendedAttributeIteratorControlHandle {
6678                        inner: this.inner.clone(),
6679                    };
6680                    Ok(ExtendedAttributeIteratorRequest::GetNext {
6681                        responder: ExtendedAttributeIteratorGetNextResponder {
6682                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6683                            tx_id: header.tx_id,
6684                        },
6685                    })
6686                }
6687                _ => Err(fidl::Error::UnknownOrdinal {
6688                    ordinal: header.ordinal,
6689                    protocol_name: <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6690                }),
6691            }))
6692            },
6693        )
6694    }
6695}
6696
6697#[derive(Debug)]
6698pub enum ExtendedAttributeIteratorRequest {
6699    /// Get the next chunk of extended attribute names. If this is the last
6700    /// chunk, last will be true, and the channel will be closed after the
6701    /// call.
6702    GetNext { responder: ExtendedAttributeIteratorGetNextResponder },
6703}
6704
6705impl ExtendedAttributeIteratorRequest {
6706    #[allow(irrefutable_let_patterns)]
6707    pub fn into_get_next(self) -> Option<(ExtendedAttributeIteratorGetNextResponder)> {
6708        if let ExtendedAttributeIteratorRequest::GetNext { responder } = self {
6709            Some((responder))
6710        } else {
6711            None
6712        }
6713    }
6714
6715    /// Name of the method defined in FIDL
6716    pub fn method_name(&self) -> &'static str {
6717        match *self {
6718            ExtendedAttributeIteratorRequest::GetNext { .. } => "get_next",
6719        }
6720    }
6721}
6722
6723#[derive(Debug, Clone)]
6724pub struct ExtendedAttributeIteratorControlHandle {
6725    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6726}
6727
6728impl fidl::endpoints::ControlHandle for ExtendedAttributeIteratorControlHandle {
6729    fn shutdown(&self) {
6730        self.inner.shutdown()
6731    }
6732    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6733        self.inner.shutdown_with_epitaph(status)
6734    }
6735
6736    fn is_closed(&self) -> bool {
6737        self.inner.channel().is_closed()
6738    }
6739    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6740        self.inner.channel().on_closed()
6741    }
6742
6743    #[cfg(target_os = "fuchsia")]
6744    fn signal_peer(
6745        &self,
6746        clear_mask: zx::Signals,
6747        set_mask: zx::Signals,
6748    ) -> Result<(), zx_status::Status> {
6749        use fidl::Peered;
6750        self.inner.channel().signal_peer(clear_mask, set_mask)
6751    }
6752}
6753
6754impl ExtendedAttributeIteratorControlHandle {}
6755
6756#[must_use = "FIDL methods require a response to be sent"]
6757#[derive(Debug)]
6758pub struct ExtendedAttributeIteratorGetNextResponder {
6759    control_handle: std::mem::ManuallyDrop<ExtendedAttributeIteratorControlHandle>,
6760    tx_id: u32,
6761}
6762
6763/// Set the the channel to be shutdown (see [`ExtendedAttributeIteratorControlHandle::shutdown`])
6764/// if the responder is dropped without sending a response, so that the client
6765/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6766impl std::ops::Drop for ExtendedAttributeIteratorGetNextResponder {
6767    fn drop(&mut self) {
6768        self.control_handle.shutdown();
6769        // Safety: drops once, never accessed again
6770        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6771    }
6772}
6773
6774impl fidl::endpoints::Responder for ExtendedAttributeIteratorGetNextResponder {
6775    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6776
6777    fn control_handle(&self) -> &ExtendedAttributeIteratorControlHandle {
6778        &self.control_handle
6779    }
6780
6781    fn drop_without_shutdown(mut self) {
6782        // Safety: drops once, never accessed again due to mem::forget
6783        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6784        // Prevent Drop from running (which would shut down the channel)
6785        std::mem::forget(self);
6786    }
6787}
6788
6789impl ExtendedAttributeIteratorGetNextResponder {
6790    /// Sends a response to the FIDL transaction.
6791    ///
6792    /// Sets the channel to shutdown if an error occurs.
6793    pub fn send(self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6794        let _result = self.send_raw(result);
6795        if _result.is_err() {
6796            self.control_handle.shutdown();
6797        }
6798        self.drop_without_shutdown();
6799        _result
6800    }
6801
6802    /// Similar to "send" but does not shutdown the channel if an error occurs.
6803    pub fn send_no_shutdown_on_err(
6804        self,
6805        mut result: Result<(&[Vec<u8>], bool), i32>,
6806    ) -> Result<(), fidl::Error> {
6807        let _result = self.send_raw(result);
6808        self.drop_without_shutdown();
6809        _result
6810    }
6811
6812    fn send_raw(&self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6813        self.control_handle.inner.send::<fidl::encoding::ResultType<
6814            ExtendedAttributeIteratorGetNextResponse,
6815            i32,
6816        >>(
6817            result,
6818            self.tx_id,
6819            0x3ba664a1c2e45a7,
6820            fidl::encoding::DynamicFlags::empty(),
6821        )
6822    }
6823}
6824
6825#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6826pub struct FileMarker;
6827
6828impl fidl::endpoints::ProtocolMarker for FileMarker {
6829    type Proxy = FileProxy;
6830    type RequestStream = FileRequestStream;
6831    #[cfg(target_os = "fuchsia")]
6832    type SynchronousProxy = FileSynchronousProxy;
6833
6834    const DEBUG_NAME: &'static str = "fuchsia.io.File";
6835}
6836impl fidl::endpoints::DiscoverableProtocolMarker for FileMarker {}
6837pub type FileSeekResult = Result<u64, i32>;
6838pub type FileReadAtResult = Result<Vec<u8>, i32>;
6839pub type FileWriteAtResult = Result<u64, i32>;
6840pub type FileResizeResult = Result<(), i32>;
6841pub type FileGetBackingMemoryResult = Result<fidl::Vmo, i32>;
6842pub type FileAllocateResult = Result<(), i32>;
6843pub type FileEnableVerityResult = Result<(), i32>;
6844
6845pub trait FileProxyInterface: Send + Sync {
6846    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
6847        + Send;
6848    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
6849    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
6850        + Send;
6851    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
6852    fn r#clone(
6853        &self,
6854        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
6855    ) -> Result<(), fidl::Error>;
6856    type CloseResponseFut: std::future::Future<
6857            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
6858        > + Send;
6859    fn r#close(&self) -> Self::CloseResponseFut;
6860    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
6861    fn r#query(&self) -> Self::QueryResponseFut;
6862    fn r#deprecated_clone(
6863        &self,
6864        flags: OpenFlags,
6865        object: fidl::endpoints::ServerEnd<NodeMarker>,
6866    ) -> Result<(), fidl::Error>;
6867    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
6868        + Send;
6869    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
6870    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
6871    fn r#deprecated_set_attr(
6872        &self,
6873        flags: NodeAttributeFlags,
6874        attributes: &NodeAttributes,
6875    ) -> Self::DeprecatedSetAttrResponseFut;
6876    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
6877        + Send;
6878    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
6879    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
6880        + Send;
6881    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
6882    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
6883        + Send;
6884    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
6885    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
6886        + Send;
6887    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
6888    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
6889        + Send;
6890    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
6891    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
6892        + Send;
6893    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
6894    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
6895        + Send;
6896    fn r#update_attributes(
6897        &self,
6898        payload: &MutableNodeAttributes,
6899    ) -> Self::UpdateAttributesResponseFut;
6900    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
6901    fn r#sync(&self) -> Self::SyncResponseFut;
6902    fn r#list_extended_attributes(
6903        &self,
6904        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
6905    ) -> Result<(), fidl::Error>;
6906    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
6907        + Send;
6908    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
6909    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
6910        + Send;
6911    fn r#set_extended_attribute(
6912        &self,
6913        name: &[u8],
6914        value: ExtendedAttributeValue,
6915        mode: SetExtendedAttributeMode,
6916    ) -> Self::SetExtendedAttributeResponseFut;
6917    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
6918        + Send;
6919    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
6920    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
6921        + Send;
6922    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
6923    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
6924        + Send;
6925    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
6926    type DescribeResponseFut: std::future::Future<Output = Result<FileInfo, fidl::Error>> + Send;
6927    fn r#describe(&self) -> Self::DescribeResponseFut;
6928    type SeekResponseFut: std::future::Future<Output = Result<FileSeekResult, fidl::Error>> + Send;
6929    fn r#seek(&self, origin: SeekOrigin, offset: i64) -> Self::SeekResponseFut;
6930    type ReadAtResponseFut: std::future::Future<Output = Result<FileReadAtResult, fidl::Error>>
6931        + Send;
6932    fn r#read_at(&self, count: u64, offset: u64) -> Self::ReadAtResponseFut;
6933    type WriteAtResponseFut: std::future::Future<Output = Result<FileWriteAtResult, fidl::Error>>
6934        + Send;
6935    fn r#write_at(&self, data: &[u8], offset: u64) -> Self::WriteAtResponseFut;
6936    type ResizeResponseFut: std::future::Future<Output = Result<FileResizeResult, fidl::Error>>
6937        + Send;
6938    fn r#resize(&self, length: u64) -> Self::ResizeResponseFut;
6939    type GetBackingMemoryResponseFut: std::future::Future<Output = Result<FileGetBackingMemoryResult, fidl::Error>>
6940        + Send;
6941    fn r#get_backing_memory(&self, flags: VmoFlags) -> Self::GetBackingMemoryResponseFut;
6942    type AllocateResponseFut: std::future::Future<Output = Result<FileAllocateResult, fidl::Error>>
6943        + Send;
6944    fn r#allocate(&self, offset: u64, length: u64, mode: AllocateMode)
6945    -> Self::AllocateResponseFut;
6946    type EnableVerityResponseFut: std::future::Future<Output = Result<FileEnableVerityResult, fidl::Error>>
6947        + Send;
6948    fn r#enable_verity(&self, options: &VerificationOptions) -> Self::EnableVerityResponseFut;
6949}
6950#[derive(Debug)]
6951#[cfg(target_os = "fuchsia")]
6952pub struct FileSynchronousProxy {
6953    client: fidl::client::sync::Client,
6954}
6955
6956#[cfg(target_os = "fuchsia")]
6957impl fidl::endpoints::SynchronousProxy for FileSynchronousProxy {
6958    type Proxy = FileProxy;
6959    type Protocol = FileMarker;
6960
6961    fn from_channel(inner: fidl::Channel) -> Self {
6962        Self::new(inner)
6963    }
6964
6965    fn into_channel(self) -> fidl::Channel {
6966        self.client.into_channel()
6967    }
6968
6969    fn as_channel(&self) -> &fidl::Channel {
6970        self.client.as_channel()
6971    }
6972}
6973
6974#[cfg(target_os = "fuchsia")]
6975impl FileSynchronousProxy {
6976    pub fn new(channel: fidl::Channel) -> Self {
6977        let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6978        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6979    }
6980
6981    pub fn into_channel(self) -> fidl::Channel {
6982        self.client.into_channel()
6983    }
6984
6985    /// Waits until an event arrives and returns it. It is safe for other
6986    /// threads to make concurrent requests while waiting for an event.
6987    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<FileEvent, fidl::Error> {
6988        FileEvent::decode(self.client.wait_for_event(deadline)?)
6989    }
6990
6991    /// Acquires an advisory lock on the underlying file.
6992    ///
6993    /// The lock lasts until either this connection is closed or
6994    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
6995    /// explicitly.
6996    ///
6997    /// Advisory locks are purely advisory. They do not prevent actual read or
6998    /// write operations from occurring on the file, either through this
6999    /// connection or through other connections.
7000    ///
7001    /// This method requires the following rights:
7002    ///
7003    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7004    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7005    ///   [`AdvisoryLockType.WRITE`].
7006    ///
7007    /// # Errors
7008    ///
7009    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7010    ///   example, another connection might hold a conflicting lock type.
7011    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7012    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7013    ///   to acquire the given type of lock.
7014    pub fn r#advisory_lock(
7015        &self,
7016        mut request: &AdvisoryLockRequest,
7017        ___deadline: zx::MonotonicInstant,
7018    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
7019        let _response = self.client.send_query::<
7020            AdvisoryLockingAdvisoryLockRequest,
7021            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7022        >(
7023            (request,),
7024            0x6ee9c0ad53ec87aa,
7025            fidl::encoding::DynamicFlags::empty(),
7026            ___deadline,
7027        )?;
7028        Ok(_response.map(|x| x))
7029    }
7030
7031    /// Creates a link to this this object with name `dst` in the directory represented by
7032    /// `dst_parent_token`.
7033    ///
7034    /// `dst` must be a resolved object name. Including "/" in the string will return
7035    /// `ZX_ERR_INVALID_ARGS`.
7036    ///
7037    /// This method requires the maximal set of rights supported by the filesystem for this object.
7038    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7039    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7040    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7041    /// `ZX_ERR_ACCESS_DENIED`.
7042    ///
7043    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7044    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7045    ///
7046    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7047    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7048    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7049    ///
7050    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7051    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7052    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7053    pub fn r#link_into(
7054        &self,
7055        mut dst_parent_token: fidl::Event,
7056        mut dst: &str,
7057        ___deadline: zx::MonotonicInstant,
7058    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
7059        let _response = self.client.send_query::<
7060            LinkableLinkIntoRequest,
7061            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7062        >(
7063            (dst_parent_token, dst,),
7064            0x54f3949246a03e74,
7065            fidl::encoding::DynamicFlags::empty(),
7066            ___deadline,
7067        )?;
7068        Ok(_response.map(|x| x))
7069    }
7070
7071    pub fn r#clone(
7072        &self,
7073        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7074    ) -> Result<(), fidl::Error> {
7075        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
7076            (request,),
7077            0x20d8a7aba2168a79,
7078            fidl::encoding::DynamicFlags::empty(),
7079        )
7080    }
7081
7082    /// Terminates the connection.
7083    ///
7084    /// After calling `Close`, the client must not send any other requests.
7085    ///
7086    /// Servers, after sending the status response, should close the connection
7087    /// regardless of status and without sending an epitaph.
7088    ///
7089    /// Closing the client end of the channel should be semantically equivalent
7090    /// to calling `Close` without knowing when the close has completed or its
7091    /// status.
7092    pub fn r#close(
7093        &self,
7094        ___deadline: zx::MonotonicInstant,
7095    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
7096        let _response = self.client.send_query::<
7097            fidl::encoding::EmptyPayload,
7098            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7099        >(
7100            (),
7101            0x5ac5d459ad7f657e,
7102            fidl::encoding::DynamicFlags::empty(),
7103            ___deadline,
7104        )?;
7105        Ok(_response.map(|x| x))
7106    }
7107
7108    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
7109        let _response = self.client.send_query::<
7110            fidl::encoding::EmptyPayload,
7111            fidl_fuchsia_unknown::QueryableQueryResponse,
7112        >(
7113            (),
7114            0x2658edee9decfc06,
7115            fidl::encoding::DynamicFlags::empty(),
7116            ___deadline,
7117        )?;
7118        Ok(_response.protocol)
7119    }
7120
7121    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7122    pub fn r#deprecated_clone(
7123        &self,
7124        mut flags: OpenFlags,
7125        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
7126    ) -> Result<(), fidl::Error> {
7127        self.client.send::<NodeDeprecatedCloneRequest>(
7128            (flags, object),
7129            0x5a61678f293ce16f,
7130            fidl::encoding::DynamicFlags::FLEXIBLE,
7131        )
7132    }
7133
7134    /// DEPRECATED - Use `Node.GetAttributes` instead.
7135    pub fn r#deprecated_get_attr(
7136        &self,
7137        ___deadline: zx::MonotonicInstant,
7138    ) -> Result<(i32, NodeAttributes), fidl::Error> {
7139        let _response =
7140            self.client.send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse>(
7141                (),
7142                0x78985e216314dafd,
7143                fidl::encoding::DynamicFlags::empty(),
7144                ___deadline,
7145            )?;
7146        Ok((_response.s, _response.attributes))
7147    }
7148
7149    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7150    pub fn r#deprecated_set_attr(
7151        &self,
7152        mut flags: NodeAttributeFlags,
7153        mut attributes: &NodeAttributes,
7154        ___deadline: zx::MonotonicInstant,
7155    ) -> Result<i32, fidl::Error> {
7156        let _response =
7157            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
7158                (flags, attributes),
7159                0x4186c0f40d938f46,
7160                fidl::encoding::DynamicFlags::empty(),
7161                ___deadline,
7162            )?;
7163        Ok(_response.s)
7164    }
7165
7166    /// [DEPRECATED - Use new GetFlags method instead.]
7167    pub fn r#deprecated_get_flags(
7168        &self,
7169        ___deadline: zx::MonotonicInstant,
7170    ) -> Result<(i32, OpenFlags), fidl::Error> {
7171        let _response = self
7172            .client
7173            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
7174                (),
7175                0x5b88fffb8eda3aa1,
7176                fidl::encoding::DynamicFlags::empty(),
7177                ___deadline,
7178            )?;
7179        Ok((_response.s, _response.flags))
7180    }
7181
7182    /// [DEPRECATED - Use new SetFlags method instead.]
7183    pub fn r#deprecated_set_flags(
7184        &self,
7185        mut flags: OpenFlags,
7186        ___deadline: zx::MonotonicInstant,
7187    ) -> Result<i32, fidl::Error> {
7188        let _response = self
7189            .client
7190            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
7191                (flags,),
7192                0x5295b76c71fde733,
7193                fidl::encoding::DynamicFlags::empty(),
7194                ___deadline,
7195            )?;
7196        Ok(_response.s)
7197    }
7198
7199    /// Queries the flags that apply to this node after it has been opened/created. This method does
7200    /// not require any rights.
7201    ///
7202    /// Note that the final set of flags that apply to the connection may differ from those
7203    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
7204    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
7205    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
7206    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
7207    pub fn r#get_flags(
7208        &self,
7209        ___deadline: zx::MonotonicInstant,
7210    ) -> Result<NodeGetFlagsResult, fidl::Error> {
7211        let _response = self.client.send_query::<
7212            fidl::encoding::EmptyPayload,
7213            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
7214        >(
7215            (),
7216            0x176eb318f64ec23,
7217            fidl::encoding::DynamicFlags::FLEXIBLE,
7218            ___deadline,
7219        )?
7220        .into_result::<FileMarker>("get_flags")?;
7221        Ok(_response.map(|x| x.flags))
7222    }
7223
7224    /// Sets the flags that apply to this node after it has been opened. This method does not
7225    /// require any rights.
7226    ///
7227    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
7228    /// clear append mode.
7229    ///
7230    /// Errors:
7231    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
7232    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
7233    pub fn r#set_flags(
7234        &self,
7235        mut flags: Flags,
7236        ___deadline: zx::MonotonicInstant,
7237    ) -> Result<NodeSetFlagsResult, fidl::Error> {
7238        let _response = self.client.send_query::<
7239            NodeSetFlagsRequest,
7240            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7241        >(
7242            (flags,),
7243            0x55a8028685791ea8,
7244            fidl::encoding::DynamicFlags::FLEXIBLE,
7245            ___deadline,
7246        )?
7247        .into_result::<FileMarker>("set_flags")?;
7248        Ok(_response.map(|x| x))
7249    }
7250
7251    /// Query the filesystem for filesystem-specific information.
7252    pub fn r#query_filesystem(
7253        &self,
7254        ___deadline: zx::MonotonicInstant,
7255    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
7256        let _response =
7257            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
7258                (),
7259                0x6f344a1c6b0a0610,
7260                fidl::encoding::DynamicFlags::empty(),
7261                ___deadline,
7262            )?;
7263        Ok((_response.s, _response.info))
7264    }
7265
7266    /// Acquires information about the node.
7267    ///
7268    /// The attributes of a node should be stable, independent of the
7269    /// specific protocol used to access it.
7270    ///
7271    /// If a particular attribute is not applicable or not supported,
7272    /// filesystems should leave the corresponding field absent.
7273    ///
7274    /// + `query` a bit-mask specifying which attributes to fetch. The server
7275    ///   should not return more than necessary.
7276    /// - `attributes` the returned attributes.
7277    ///
7278    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7279    pub fn r#get_attributes(
7280        &self,
7281        mut query: NodeAttributesQuery,
7282        ___deadline: zx::MonotonicInstant,
7283    ) -> Result<NodeGetAttributesResult, fidl::Error> {
7284        let _response = self.client.send_query::<
7285            NodeGetAttributesRequest,
7286            fidl::encoding::ResultType<NodeAttributes2, i32>,
7287        >(
7288            (query,),
7289            0x3d4396a638ea053b,
7290            fidl::encoding::DynamicFlags::empty(),
7291            ___deadline,
7292        )?;
7293        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
7294    }
7295
7296    /// Updates information about the node.
7297    ///
7298    /// + `attributes` the presence of a table field in `attributes` indicates
7299    /// the intent to update the corresponding attribute.
7300    ///
7301    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
7302    ///
7303    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7304    pub fn r#update_attributes(
7305        &self,
7306        mut payload: &MutableNodeAttributes,
7307        ___deadline: zx::MonotonicInstant,
7308    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
7309        let _response = self.client.send_query::<
7310            MutableNodeAttributes,
7311            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7312        >(
7313            payload,
7314            0x3308c1da5a89bf08,
7315            fidl::encoding::DynamicFlags::empty(),
7316            ___deadline,
7317        )?;
7318        Ok(_response.map(|x| x))
7319    }
7320
7321    /// Synchronizes updates to the node to the underlying media, if it exists.
7322    ///
7323    /// This method will return when the filesystem server has flushed the
7324    /// relevant updates to the underlying media, but does not guarantee the
7325    /// underlying media has persisted the information, nor that any information
7326    /// is committed to hardware. Clients may use `Sync` to ensure ordering
7327    /// between operations.
7328    ///
7329    /// This method does not require any rights.
7330    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
7331        let _response = self.client.send_query::<
7332            fidl::encoding::EmptyPayload,
7333            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7334        >(
7335            (),
7336            0x2c5c27ca0ab5dc49,
7337            fidl::encoding::DynamicFlags::empty(),
7338            ___deadline,
7339        )?;
7340        Ok(_response.map(|x| x))
7341    }
7342
7343    /// Creates an iterator over all the extended attribute names associated
7344    /// with this node. If an error occurs it is returned as an epitaph on the
7345    /// iterator request channel, and then the channel is closed.
7346    ///
7347    /// GetExtendedAttributes can be used with any of these names to retrieve
7348    /// the associated value.
7349    ///
7350    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7351    pub fn r#list_extended_attributes(
7352        &self,
7353        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
7354    ) -> Result<(), fidl::Error> {
7355        self.client.send::<NodeListExtendedAttributesRequest>(
7356            (iterator,),
7357            0x4b61033de007fcd0,
7358            fidl::encoding::DynamicFlags::empty(),
7359        )
7360    }
7361
7362    /// Get the value associated with the given attribute `name` for this node.
7363    ///
7364    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
7365    /// particular structure is imposed on them.
7366    ///
7367    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7368    pub fn r#get_extended_attribute(
7369        &self,
7370        mut name: &[u8],
7371        ___deadline: zx::MonotonicInstant,
7372    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
7373        let _response = self.client.send_query::<
7374            NodeGetExtendedAttributeRequest,
7375            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
7376        >(
7377            (name,),
7378            0x45ffa3ccfdeb76db,
7379            fidl::encoding::DynamicFlags::empty(),
7380            ___deadline,
7381        )?;
7382        Ok(_response.map(|x| x))
7383    }
7384
7385    /// Set the value for the given attribute `name` to `value` for this node.
7386    ///
7387    /// The attribute name may exist, in which case the attribute is updated.
7388    /// If the attribute doesn't exist, it is created. The name should have no
7389    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
7390    ///
7391    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7392    pub fn r#set_extended_attribute(
7393        &self,
7394        mut name: &[u8],
7395        mut value: ExtendedAttributeValue,
7396        mut mode: SetExtendedAttributeMode,
7397        ___deadline: zx::MonotonicInstant,
7398    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
7399        let _response = self.client.send_query::<
7400            NodeSetExtendedAttributeRequest,
7401            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7402        >(
7403            (name, &mut value, mode,),
7404            0x4a951362f681f23c,
7405            fidl::encoding::DynamicFlags::empty(),
7406            ___deadline,
7407        )?;
7408        Ok(_response.map(|x| x))
7409    }
7410
7411    /// Remove the specified extended attribute.
7412    ///
7413    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
7414    ///
7415    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7416    pub fn r#remove_extended_attribute(
7417        &self,
7418        mut name: &[u8],
7419        ___deadline: zx::MonotonicInstant,
7420    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
7421        let _response = self.client.send_query::<
7422            NodeRemoveExtendedAttributeRequest,
7423            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7424        >(
7425            (name,),
7426            0x7a0b9f3a9bf9032d,
7427            fidl::encoding::DynamicFlags::empty(),
7428            ___deadline,
7429        )?;
7430        Ok(_response.map(|x| x))
7431    }
7432
7433    /// Reads up to 'count' bytes at the seek offset.
7434    /// The seek offset is moved forward by the number of bytes read.
7435    ///
7436    /// ## Invariants
7437    ///
7438    /// * The returned `data.length` will never be greater than `count`.
7439    /// * If `data.length` is less than `count`, it means that the seek offset
7440    ///   has reached the end of file as part of this operation.
7441    /// * If `data.length` is zero while `count` is not, it means that the
7442    ///   seek offset is already at or beyond the end of file, and no data could
7443    ///   be read.
7444    /// * If `count` is zero, the server should perform all the checks ensuring
7445    ///   read access without actually read anything, and return an empty
7446    ///   `data` vector.
7447    ///
7448    /// This method requires the [`Rights.READ_BYTES`] right.
7449    ///
7450    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7451    pub fn r#read(
7452        &self,
7453        mut count: u64,
7454        ___deadline: zx::MonotonicInstant,
7455    ) -> Result<ReadableReadResult, fidl::Error> {
7456        let _response = self.client.send_query::<
7457            ReadableReadRequest,
7458            fidl::encoding::ResultType<ReadableReadResponse, i32>,
7459        >(
7460            (count,),
7461            0x57e419a298c8ede,
7462            fidl::encoding::DynamicFlags::empty(),
7463            ___deadline,
7464        )?;
7465        Ok(_response.map(|x| x.data))
7466    }
7467
7468    /// Writes data at the seek offset.
7469    /// The seek offset is moved forward by the number of bytes written.
7470    /// If the file is in append mode, the seek offset is first set to the end
7471    /// of the file, followed by the write, in one atomic step.
7472    ///
7473    /// The file size may grow if the seek offset plus `data.length` is beyond
7474    /// the current end of file.
7475    ///
7476    /// + request `data` the byte buffer to write to the file.
7477    /// - response `actual_count` the number of bytes written.
7478    ///
7479    /// ## Invariants
7480    ///
7481    /// * The returned `actual_count` will never be greater than `data.length`.
7482    /// * If the server is unable to write all the data due to e.g. not enough
7483    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7484    ///   could be written, an error is returned.
7485    /// * If `data.length` is zero, the server should perform all the checks
7486    ///   ensuring write access without mutating the file and return a
7487    ///   successful write of zero bytes.  The seek offset is still updated if
7488    ///   in append mode.
7489    ///
7490    /// This method requires the [`Rights.WRITE_BYTES`] right.
7491    pub fn r#write(
7492        &self,
7493        mut data: &[u8],
7494        ___deadline: zx::MonotonicInstant,
7495    ) -> Result<WritableWriteResult, fidl::Error> {
7496        let _response = self.client.send_query::<
7497            WritableWriteRequest,
7498            fidl::encoding::ResultType<WritableWriteResponse, i32>,
7499        >(
7500            (data,),
7501            0x6a31437832469f82,
7502            fidl::encoding::DynamicFlags::empty(),
7503            ___deadline,
7504        )?;
7505        Ok(_response.map(|x| x.actual_count))
7506    }
7507
7508    pub fn r#describe(&self, ___deadline: zx::MonotonicInstant) -> Result<FileInfo, fidl::Error> {
7509        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, FileInfo>(
7510            (),
7511            0x68b5ac00c62906bc,
7512            fidl::encoding::DynamicFlags::empty(),
7513            ___deadline,
7514        )?;
7515        Ok(_response)
7516    }
7517
7518    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
7519    /// will occur. The seek offset is specific to each file connection.
7520    ///
7521    /// + request `origin` the reference point where `offset` will be based on.
7522    /// + request `offset` the number of bytes to seek.
7523    /// - response `offset_from_start` the adjusted seek offset, from the start
7524    ///   of the file.
7525    ///
7526    /// This method does not require any rights.
7527    pub fn r#seek(
7528        &self,
7529        mut origin: SeekOrigin,
7530        mut offset: i64,
7531        ___deadline: zx::MonotonicInstant,
7532    ) -> Result<FileSeekResult, fidl::Error> {
7533        let _response = self
7534            .client
7535            .send_query::<FileSeekRequest, fidl::encoding::ResultType<FileSeekResponse, i32>>(
7536                (origin, offset),
7537                0x78079168162c5207,
7538                fidl::encoding::DynamicFlags::empty(),
7539                ___deadline,
7540            )?;
7541        Ok(_response.map(|x| x.offset_from_start))
7542    }
7543
7544    /// Reads up to 'count' bytes at the provided offset.
7545    /// Does not affect the seek offset.
7546    ///
7547    /// ## Invariants
7548    ///
7549    /// * The returned `data.length` will never be greater than `count`.
7550    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
7551    ///   the end of file as part of this operation.
7552    /// * If `data.length` is zero while `count` is not, it means that `offset`
7553    ///   is at or past the end of file, and no data can be read.
7554    /// * If `count` is zero, the server should perform all the checks ensuring
7555    ///   read access without actually reading anything, and return an empty
7556    ///   `data` vector.
7557    ///
7558    /// This method requires the [`Rights.READ_BYTES`] right.
7559    ///
7560    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7561    pub fn r#read_at(
7562        &self,
7563        mut count: u64,
7564        mut offset: u64,
7565        ___deadline: zx::MonotonicInstant,
7566    ) -> Result<FileReadAtResult, fidl::Error> {
7567        let _response = self
7568            .client
7569            .send_query::<FileReadAtRequest, fidl::encoding::ResultType<FileReadAtResponse, i32>>(
7570                (count, offset),
7571                0x1607a293a60d723e,
7572                fidl::encoding::DynamicFlags::empty(),
7573                ___deadline,
7574            )?;
7575        Ok(_response.map(|x| x.data))
7576    }
7577
7578    /// Writes data at the provided offset.
7579    /// Does not affect the seek offset.
7580    ///
7581    /// The file size may grow if `offset` plus `data.length` is past the
7582    /// current end of file.
7583    ///
7584    /// + request `data` the byte buffer to write to the file.
7585    /// + request `offset` the offset from start of the file to begin writing.
7586    /// - response `actual_count` the number of bytes written.
7587    ///
7588    /// ## Invariants
7589    ///
7590    /// * The returned `actual_count` will never be greater than `data.length`.
7591    /// * If the server is unable to write all the data due to e.g. not enough
7592    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7593    ///   could be written, an error is returned.
7594    /// * If `data.length` is zero, the server should perform all the checks
7595    ///   ensuring write access without mutating the file, and will return a
7596    ///   successful write of zero bytes.
7597    ///
7598    /// This method requires the [`Rights.WRITE_BYTES`] right.
7599    pub fn r#write_at(
7600        &self,
7601        mut data: &[u8],
7602        mut offset: u64,
7603        ___deadline: zx::MonotonicInstant,
7604    ) -> Result<FileWriteAtResult, fidl::Error> {
7605        let _response = self
7606            .client
7607            .send_query::<FileWriteAtRequest, fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
7608                (data, offset),
7609                0x793eefc0045e792b,
7610                fidl::encoding::DynamicFlags::empty(),
7611                ___deadline,
7612            )?;
7613        Ok(_response.map(|x| x.actual_count))
7614    }
7615
7616    /// Shrinks or grows the file size to 'length' bytes.
7617    ///
7618    /// If file size is reduced by this operation, the extra trailing data'
7619    /// is discarded.
7620    /// If file size is increased by this operation, the extended area appears
7621    /// as if it was zeroed.
7622    ///
7623    /// This method requires the [`Rights.WRITE_BYTES`] right.
7624    pub fn r#resize(
7625        &self,
7626        mut length: u64,
7627        ___deadline: zx::MonotonicInstant,
7628    ) -> Result<FileResizeResult, fidl::Error> {
7629        let _response = self.client.send_query::<
7630            FileResizeRequest,
7631            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7632        >(
7633            (length,),
7634            0x2b80825f0535743a,
7635            fidl::encoding::DynamicFlags::empty(),
7636            ___deadline,
7637        )?;
7638        Ok(_response.map(|x| x))
7639    }
7640
7641    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
7642    /// with the requested access rights.
7643    ///
7644    /// Implementations are not required to implement files backed by VMOs so
7645    /// this request may fail. Additionally, implementations may only support
7646    /// a certain subset of the flags. Clients should be prepared with fallback
7647    /// behavior if this request fails.
7648    ///
7649    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
7650    /// implementation is free to choose the semantics of the returned VMO.
7651    ///
7652    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
7653    /// - response `vmo` the requested [`zx.Handle:VMO`].
7654    /// * error a [`zx.Status`] value indicating the failure.
7655    ///
7656    /// This method requires the following rights:
7657    ///
7658    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
7659    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
7660    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
7661    pub fn r#get_backing_memory(
7662        &self,
7663        mut flags: VmoFlags,
7664        ___deadline: zx::MonotonicInstant,
7665    ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
7666        let _response = self.client.send_query::<
7667            FileGetBackingMemoryRequest,
7668            fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
7669        >(
7670            (flags,),
7671            0xa6a9e654cbf62b,
7672            fidl::encoding::DynamicFlags::empty(),
7673            ___deadline,
7674        )?;
7675        Ok(_response.map(|x| x.vmo))
7676    }
7677
7678    /// Pre-allocate on-disk space for this file.
7679    pub fn r#allocate(
7680        &self,
7681        mut offset: u64,
7682        mut length: u64,
7683        mut mode: AllocateMode,
7684        ___deadline: zx::MonotonicInstant,
7685    ) -> Result<FileAllocateResult, fidl::Error> {
7686        let _response = self.client.send_query::<
7687            FileAllocateRequest,
7688            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7689        >(
7690            (offset, length, mode,),
7691            0x77fa0c330b57fd2e,
7692            fidl::encoding::DynamicFlags::FLEXIBLE,
7693            ___deadline,
7694        )?
7695        .into_result::<FileMarker>("allocate")?;
7696        Ok(_response.map(|x| x))
7697    }
7698
7699    /// Enables verification for the file (permanently) which involves computing a merkle tree for
7700    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
7701    /// captured. Future reads will be verified against the computed merkle tree and writes will be
7702    /// rejected. This method can take some time to complete as it depends on the size of the file.
7703    /// This method can be aborted by closing the connection that this method was issued on.
7704    ///
7705    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7706    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
7707    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
7708    /// Also returns any error that might arise from reading the file, or from flushing the file,
7709    /// such as `ZX_ERR_IO`.
7710    pub fn r#enable_verity(
7711        &self,
7712        mut options: &VerificationOptions,
7713        ___deadline: zx::MonotonicInstant,
7714    ) -> Result<FileEnableVerityResult, fidl::Error> {
7715        let _response = self.client.send_query::<
7716            FileEnableVerityRequest,
7717            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7718        >(
7719            (options,),
7720            0x2c421ec3faaeb8bb,
7721            fidl::encoding::DynamicFlags::FLEXIBLE,
7722            ___deadline,
7723        )?
7724        .into_result::<FileMarker>("enable_verity")?;
7725        Ok(_response.map(|x| x))
7726    }
7727}
7728
7729#[cfg(target_os = "fuchsia")]
7730impl From<FileSynchronousProxy> for zx::NullableHandle {
7731    fn from(value: FileSynchronousProxy) -> Self {
7732        value.into_channel().into()
7733    }
7734}
7735
7736#[cfg(target_os = "fuchsia")]
7737impl From<fidl::Channel> for FileSynchronousProxy {
7738    fn from(value: fidl::Channel) -> Self {
7739        Self::new(value)
7740    }
7741}
7742
7743#[cfg(target_os = "fuchsia")]
7744impl fidl::endpoints::FromClient for FileSynchronousProxy {
7745    type Protocol = FileMarker;
7746
7747    fn from_client(value: fidl::endpoints::ClientEnd<FileMarker>) -> Self {
7748        Self::new(value.into_channel())
7749    }
7750}
7751
7752#[derive(Debug, Clone)]
7753pub struct FileProxy {
7754    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7755}
7756
7757impl fidl::endpoints::Proxy for FileProxy {
7758    type Protocol = FileMarker;
7759
7760    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7761        Self::new(inner)
7762    }
7763
7764    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7765        self.client.into_channel().map_err(|client| Self { client })
7766    }
7767
7768    fn as_channel(&self) -> &::fidl::AsyncChannel {
7769        self.client.as_channel()
7770    }
7771}
7772
7773impl FileProxy {
7774    /// Create a new Proxy for fuchsia.io/File.
7775    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7776        let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7777        Self { client: fidl::client::Client::new(channel, protocol_name) }
7778    }
7779
7780    /// Get a Stream of events from the remote end of the protocol.
7781    ///
7782    /// # Panics
7783    ///
7784    /// Panics if the event stream was already taken.
7785    pub fn take_event_stream(&self) -> FileEventStream {
7786        FileEventStream { event_receiver: self.client.take_event_receiver() }
7787    }
7788
7789    /// Acquires an advisory lock on the underlying file.
7790    ///
7791    /// The lock lasts until either this connection is closed or
7792    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7793    /// explicitly.
7794    ///
7795    /// Advisory locks are purely advisory. They do not prevent actual read or
7796    /// write operations from occurring on the file, either through this
7797    /// connection or through other connections.
7798    ///
7799    /// This method requires the following rights:
7800    ///
7801    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7802    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7803    ///   [`AdvisoryLockType.WRITE`].
7804    ///
7805    /// # Errors
7806    ///
7807    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7808    ///   example, another connection might hold a conflicting lock type.
7809    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7810    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7811    ///   to acquire the given type of lock.
7812    pub fn r#advisory_lock(
7813        &self,
7814        mut request: &AdvisoryLockRequest,
7815    ) -> fidl::client::QueryResponseFut<
7816        AdvisoryLockingAdvisoryLockResult,
7817        fidl::encoding::DefaultFuchsiaResourceDialect,
7818    > {
7819        FileProxyInterface::r#advisory_lock(self, request)
7820    }
7821
7822    /// Creates a link to this this object with name `dst` in the directory represented by
7823    /// `dst_parent_token`.
7824    ///
7825    /// `dst` must be a resolved object name. Including "/" in the string will return
7826    /// `ZX_ERR_INVALID_ARGS`.
7827    ///
7828    /// This method requires the maximal set of rights supported by the filesystem for this object.
7829    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7830    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7831    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7832    /// `ZX_ERR_ACCESS_DENIED`.
7833    ///
7834    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7835    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7836    ///
7837    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7838    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7839    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7840    ///
7841    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7842    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7843    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7844    pub fn r#link_into(
7845        &self,
7846        mut dst_parent_token: fidl::Event,
7847        mut dst: &str,
7848    ) -> fidl::client::QueryResponseFut<
7849        LinkableLinkIntoResult,
7850        fidl::encoding::DefaultFuchsiaResourceDialect,
7851    > {
7852        FileProxyInterface::r#link_into(self, dst_parent_token, dst)
7853    }
7854
7855    pub fn r#clone(
7856        &self,
7857        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7858    ) -> Result<(), fidl::Error> {
7859        FileProxyInterface::r#clone(self, request)
7860    }
7861
7862    /// Terminates the connection.
7863    ///
7864    /// After calling `Close`, the client must not send any other requests.
7865    ///
7866    /// Servers, after sending the status response, should close the connection
7867    /// regardless of status and without sending an epitaph.
7868    ///
7869    /// Closing the client end of the channel should be semantically equivalent
7870    /// to calling `Close` without knowing when the close has completed or its
7871    /// status.
7872    pub fn r#close(
7873        &self,
7874    ) -> fidl::client::QueryResponseFut<
7875        fidl_fuchsia_unknown::CloseableCloseResult,
7876        fidl::encoding::DefaultFuchsiaResourceDialect,
7877    > {
7878        FileProxyInterface::r#close(self)
7879    }
7880
7881    pub fn r#query(
7882        &self,
7883    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
7884    {
7885        FileProxyInterface::r#query(self)
7886    }
7887
7888    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7889    pub fn r#deprecated_clone(
7890        &self,
7891        mut flags: OpenFlags,
7892        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
7893    ) -> Result<(), fidl::Error> {
7894        FileProxyInterface::r#deprecated_clone(self, flags, object)
7895    }
7896
7897    /// DEPRECATED - Use `Node.GetAttributes` instead.
7898    pub fn r#deprecated_get_attr(
7899        &self,
7900    ) -> fidl::client::QueryResponseFut<
7901        (i32, NodeAttributes),
7902        fidl::encoding::DefaultFuchsiaResourceDialect,
7903    > {
7904        FileProxyInterface::r#deprecated_get_attr(self)
7905    }
7906
7907    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7908    pub fn r#deprecated_set_attr(
7909        &self,
7910        mut flags: NodeAttributeFlags,
7911        mut attributes: &NodeAttributes,
7912    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
7913        FileProxyInterface::r#deprecated_set_attr(self, flags, attributes)
7914    }
7915
7916    /// [DEPRECATED - Use new GetFlags method instead.]
7917    pub fn r#deprecated_get_flags(
7918        &self,
7919    ) -> fidl::client::QueryResponseFut<
7920        (i32, OpenFlags),
7921        fidl::encoding::DefaultFuchsiaResourceDialect,
7922    > {
7923        FileProxyInterface::r#deprecated_get_flags(self)
7924    }
7925
7926    /// [DEPRECATED - Use new SetFlags method instead.]
7927    pub fn r#deprecated_set_flags(
7928        &self,
7929        mut flags: OpenFlags,
7930    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
7931        FileProxyInterface::r#deprecated_set_flags(self, flags)
7932    }
7933
7934    /// Queries the flags that apply to this node after it has been opened/created. This method does
7935    /// not require any rights.
7936    ///
7937    /// Note that the final set of flags that apply to the connection may differ from those
7938    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
7939    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
7940    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
7941    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
7942    pub fn r#get_flags(
7943        &self,
7944    ) -> fidl::client::QueryResponseFut<
7945        NodeGetFlagsResult,
7946        fidl::encoding::DefaultFuchsiaResourceDialect,
7947    > {
7948        FileProxyInterface::r#get_flags(self)
7949    }
7950
7951    /// Sets the flags that apply to this node after it has been opened. This method does not
7952    /// require any rights.
7953    ///
7954    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
7955    /// clear append mode.
7956    ///
7957    /// Errors:
7958    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
7959    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
7960    pub fn r#set_flags(
7961        &self,
7962        mut flags: Flags,
7963    ) -> fidl::client::QueryResponseFut<
7964        NodeSetFlagsResult,
7965        fidl::encoding::DefaultFuchsiaResourceDialect,
7966    > {
7967        FileProxyInterface::r#set_flags(self, flags)
7968    }
7969
7970    /// Query the filesystem for filesystem-specific information.
7971    pub fn r#query_filesystem(
7972        &self,
7973    ) -> fidl::client::QueryResponseFut<
7974        (i32, Option<Box<FilesystemInfo>>),
7975        fidl::encoding::DefaultFuchsiaResourceDialect,
7976    > {
7977        FileProxyInterface::r#query_filesystem(self)
7978    }
7979
7980    /// Acquires information about the node.
7981    ///
7982    /// The attributes of a node should be stable, independent of the
7983    /// specific protocol used to access it.
7984    ///
7985    /// If a particular attribute is not applicable or not supported,
7986    /// filesystems should leave the corresponding field absent.
7987    ///
7988    /// + `query` a bit-mask specifying which attributes to fetch. The server
7989    ///   should not return more than necessary.
7990    /// - `attributes` the returned attributes.
7991    ///
7992    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7993    pub fn r#get_attributes(
7994        &self,
7995        mut query: NodeAttributesQuery,
7996    ) -> fidl::client::QueryResponseFut<
7997        NodeGetAttributesResult,
7998        fidl::encoding::DefaultFuchsiaResourceDialect,
7999    > {
8000        FileProxyInterface::r#get_attributes(self, query)
8001    }
8002
8003    /// Updates information about the node.
8004    ///
8005    /// + `attributes` the presence of a table field in `attributes` indicates
8006    /// the intent to update the corresponding attribute.
8007    ///
8008    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
8009    ///
8010    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8011    pub fn r#update_attributes(
8012        &self,
8013        mut payload: &MutableNodeAttributes,
8014    ) -> fidl::client::QueryResponseFut<
8015        NodeUpdateAttributesResult,
8016        fidl::encoding::DefaultFuchsiaResourceDialect,
8017    > {
8018        FileProxyInterface::r#update_attributes(self, payload)
8019    }
8020
8021    /// Synchronizes updates to the node to the underlying media, if it exists.
8022    ///
8023    /// This method will return when the filesystem server has flushed the
8024    /// relevant updates to the underlying media, but does not guarantee the
8025    /// underlying media has persisted the information, nor that any information
8026    /// is committed to hardware. Clients may use `Sync` to ensure ordering
8027    /// between operations.
8028    ///
8029    /// This method does not require any rights.
8030    pub fn r#sync(
8031        &self,
8032    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8033    {
8034        FileProxyInterface::r#sync(self)
8035    }
8036
8037    /// Creates an iterator over all the extended attribute names associated
8038    /// with this node. If an error occurs it is returned as an epitaph on the
8039    /// iterator request channel, and then the channel is closed.
8040    ///
8041    /// GetExtendedAttributes can be used with any of these names to retrieve
8042    /// the associated value.
8043    ///
8044    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8045    pub fn r#list_extended_attributes(
8046        &self,
8047        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8048    ) -> Result<(), fidl::Error> {
8049        FileProxyInterface::r#list_extended_attributes(self, iterator)
8050    }
8051
8052    /// Get the value associated with the given attribute `name` for this node.
8053    ///
8054    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
8055    /// particular structure is imposed on them.
8056    ///
8057    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8058    pub fn r#get_extended_attribute(
8059        &self,
8060        mut name: &[u8],
8061    ) -> fidl::client::QueryResponseFut<
8062        NodeGetExtendedAttributeResult,
8063        fidl::encoding::DefaultFuchsiaResourceDialect,
8064    > {
8065        FileProxyInterface::r#get_extended_attribute(self, name)
8066    }
8067
8068    /// Set the value for the given attribute `name` to `value` for this node.
8069    ///
8070    /// The attribute name may exist, in which case the attribute is updated.
8071    /// If the attribute doesn't exist, it is created. The name should have no
8072    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
8073    ///
8074    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8075    pub fn r#set_extended_attribute(
8076        &self,
8077        mut name: &[u8],
8078        mut value: ExtendedAttributeValue,
8079        mut mode: SetExtendedAttributeMode,
8080    ) -> fidl::client::QueryResponseFut<
8081        NodeSetExtendedAttributeResult,
8082        fidl::encoding::DefaultFuchsiaResourceDialect,
8083    > {
8084        FileProxyInterface::r#set_extended_attribute(self, name, value, mode)
8085    }
8086
8087    /// Remove the specified extended attribute.
8088    ///
8089    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
8090    ///
8091    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8092    pub fn r#remove_extended_attribute(
8093        &self,
8094        mut name: &[u8],
8095    ) -> fidl::client::QueryResponseFut<
8096        NodeRemoveExtendedAttributeResult,
8097        fidl::encoding::DefaultFuchsiaResourceDialect,
8098    > {
8099        FileProxyInterface::r#remove_extended_attribute(self, name)
8100    }
8101
8102    /// Reads up to 'count' bytes at the seek offset.
8103    /// The seek offset is moved forward by the number of bytes read.
8104    ///
8105    /// ## Invariants
8106    ///
8107    /// * The returned `data.length` will never be greater than `count`.
8108    /// * If `data.length` is less than `count`, it means that the seek offset
8109    ///   has reached the end of file as part of this operation.
8110    /// * If `data.length` is zero while `count` is not, it means that the
8111    ///   seek offset is already at or beyond the end of file, and no data could
8112    ///   be read.
8113    /// * If `count` is zero, the server should perform all the checks ensuring
8114    ///   read access without actually read anything, and return an empty
8115    ///   `data` vector.
8116    ///
8117    /// This method requires the [`Rights.READ_BYTES`] right.
8118    ///
8119    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8120    pub fn r#read(
8121        &self,
8122        mut count: u64,
8123    ) -> fidl::client::QueryResponseFut<
8124        ReadableReadResult,
8125        fidl::encoding::DefaultFuchsiaResourceDialect,
8126    > {
8127        FileProxyInterface::r#read(self, count)
8128    }
8129
8130    /// Writes data at the seek offset.
8131    /// The seek offset is moved forward by the number of bytes written.
8132    /// If the file is in append mode, the seek offset is first set to the end
8133    /// of the file, followed by the write, in one atomic step.
8134    ///
8135    /// The file size may grow if the seek offset plus `data.length` is beyond
8136    /// the current end of file.
8137    ///
8138    /// + request `data` the byte buffer to write to the file.
8139    /// - response `actual_count` the number of bytes written.
8140    ///
8141    /// ## Invariants
8142    ///
8143    /// * The returned `actual_count` will never be greater than `data.length`.
8144    /// * If the server is unable to write all the data due to e.g. not enough
8145    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8146    ///   could be written, an error is returned.
8147    /// * If `data.length` is zero, the server should perform all the checks
8148    ///   ensuring write access without mutating the file and return a
8149    ///   successful write of zero bytes.  The seek offset is still updated if
8150    ///   in append mode.
8151    ///
8152    /// This method requires the [`Rights.WRITE_BYTES`] right.
8153    pub fn r#write(
8154        &self,
8155        mut data: &[u8],
8156    ) -> fidl::client::QueryResponseFut<
8157        WritableWriteResult,
8158        fidl::encoding::DefaultFuchsiaResourceDialect,
8159    > {
8160        FileProxyInterface::r#write(self, data)
8161    }
8162
8163    pub fn r#describe(
8164        &self,
8165    ) -> fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
8166    {
8167        FileProxyInterface::r#describe(self)
8168    }
8169
8170    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
8171    /// will occur. The seek offset is specific to each file connection.
8172    ///
8173    /// + request `origin` the reference point where `offset` will be based on.
8174    /// + request `offset` the number of bytes to seek.
8175    /// - response `offset_from_start` the adjusted seek offset, from the start
8176    ///   of the file.
8177    ///
8178    /// This method does not require any rights.
8179    pub fn r#seek(
8180        &self,
8181        mut origin: SeekOrigin,
8182        mut offset: i64,
8183    ) -> fidl::client::QueryResponseFut<FileSeekResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8184    {
8185        FileProxyInterface::r#seek(self, origin, offset)
8186    }
8187
8188    /// Reads up to 'count' bytes at the provided offset.
8189    /// Does not affect the seek offset.
8190    ///
8191    /// ## Invariants
8192    ///
8193    /// * The returned `data.length` will never be greater than `count`.
8194    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
8195    ///   the end of file as part of this operation.
8196    /// * If `data.length` is zero while `count` is not, it means that `offset`
8197    ///   is at or past the end of file, and no data can be read.
8198    /// * If `count` is zero, the server should perform all the checks ensuring
8199    ///   read access without actually reading anything, and return an empty
8200    ///   `data` vector.
8201    ///
8202    /// This method requires the [`Rights.READ_BYTES`] right.
8203    ///
8204    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8205    pub fn r#read_at(
8206        &self,
8207        mut count: u64,
8208        mut offset: u64,
8209    ) -> fidl::client::QueryResponseFut<
8210        FileReadAtResult,
8211        fidl::encoding::DefaultFuchsiaResourceDialect,
8212    > {
8213        FileProxyInterface::r#read_at(self, count, offset)
8214    }
8215
8216    /// Writes data at the provided offset.
8217    /// Does not affect the seek offset.
8218    ///
8219    /// The file size may grow if `offset` plus `data.length` is past the
8220    /// current end of file.
8221    ///
8222    /// + request `data` the byte buffer to write to the file.
8223    /// + request `offset` the offset from start of the file to begin writing.
8224    /// - response `actual_count` the number of bytes written.
8225    ///
8226    /// ## Invariants
8227    ///
8228    /// * The returned `actual_count` will never be greater than `data.length`.
8229    /// * If the server is unable to write all the data due to e.g. not enough
8230    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8231    ///   could be written, an error is returned.
8232    /// * If `data.length` is zero, the server should perform all the checks
8233    ///   ensuring write access without mutating the file, and will return a
8234    ///   successful write of zero bytes.
8235    ///
8236    /// This method requires the [`Rights.WRITE_BYTES`] right.
8237    pub fn r#write_at(
8238        &self,
8239        mut data: &[u8],
8240        mut offset: u64,
8241    ) -> fidl::client::QueryResponseFut<
8242        FileWriteAtResult,
8243        fidl::encoding::DefaultFuchsiaResourceDialect,
8244    > {
8245        FileProxyInterface::r#write_at(self, data, offset)
8246    }
8247
8248    /// Shrinks or grows the file size to 'length' bytes.
8249    ///
8250    /// If file size is reduced by this operation, the extra trailing data'
8251    /// is discarded.
8252    /// If file size is increased by this operation, the extended area appears
8253    /// as if it was zeroed.
8254    ///
8255    /// This method requires the [`Rights.WRITE_BYTES`] right.
8256    pub fn r#resize(
8257        &self,
8258        mut length: u64,
8259    ) -> fidl::client::QueryResponseFut<
8260        FileResizeResult,
8261        fidl::encoding::DefaultFuchsiaResourceDialect,
8262    > {
8263        FileProxyInterface::r#resize(self, length)
8264    }
8265
8266    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
8267    /// with the requested access rights.
8268    ///
8269    /// Implementations are not required to implement files backed by VMOs so
8270    /// this request may fail. Additionally, implementations may only support
8271    /// a certain subset of the flags. Clients should be prepared with fallback
8272    /// behavior if this request fails.
8273    ///
8274    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
8275    /// implementation is free to choose the semantics of the returned VMO.
8276    ///
8277    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
8278    /// - response `vmo` the requested [`zx.Handle:VMO`].
8279    /// * error a [`zx.Status`] value indicating the failure.
8280    ///
8281    /// This method requires the following rights:
8282    ///
8283    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
8284    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
8285    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
8286    pub fn r#get_backing_memory(
8287        &self,
8288        mut flags: VmoFlags,
8289    ) -> fidl::client::QueryResponseFut<
8290        FileGetBackingMemoryResult,
8291        fidl::encoding::DefaultFuchsiaResourceDialect,
8292    > {
8293        FileProxyInterface::r#get_backing_memory(self, flags)
8294    }
8295
8296    /// Pre-allocate on-disk space for this file.
8297    pub fn r#allocate(
8298        &self,
8299        mut offset: u64,
8300        mut length: u64,
8301        mut mode: AllocateMode,
8302    ) -> fidl::client::QueryResponseFut<
8303        FileAllocateResult,
8304        fidl::encoding::DefaultFuchsiaResourceDialect,
8305    > {
8306        FileProxyInterface::r#allocate(self, offset, length, mode)
8307    }
8308
8309    /// Enables verification for the file (permanently) which involves computing a merkle tree for
8310    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
8311    /// captured. Future reads will be verified against the computed merkle tree and writes will be
8312    /// rejected. This method can take some time to complete as it depends on the size of the file.
8313    /// This method can be aborted by closing the connection that this method was issued on.
8314    ///
8315    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8316    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
8317    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
8318    /// Also returns any error that might arise from reading the file, or from flushing the file,
8319    /// such as `ZX_ERR_IO`.
8320    pub fn r#enable_verity(
8321        &self,
8322        mut options: &VerificationOptions,
8323    ) -> fidl::client::QueryResponseFut<
8324        FileEnableVerityResult,
8325        fidl::encoding::DefaultFuchsiaResourceDialect,
8326    > {
8327        FileProxyInterface::r#enable_verity(self, options)
8328    }
8329}
8330
8331impl FileProxyInterface for FileProxy {
8332    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
8333        AdvisoryLockingAdvisoryLockResult,
8334        fidl::encoding::DefaultFuchsiaResourceDialect,
8335    >;
8336    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
8337        fn _decode(
8338            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8339        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
8340            let _response = fidl::client::decode_transaction_body::<
8341                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8342                fidl::encoding::DefaultFuchsiaResourceDialect,
8343                0x6ee9c0ad53ec87aa,
8344            >(_buf?)?;
8345            Ok(_response.map(|x| x))
8346        }
8347        self.client.send_query_and_decode::<
8348            AdvisoryLockingAdvisoryLockRequest,
8349            AdvisoryLockingAdvisoryLockResult,
8350        >(
8351            (request,),
8352            0x6ee9c0ad53ec87aa,
8353            fidl::encoding::DynamicFlags::empty(),
8354            _decode,
8355        )
8356    }
8357
8358    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
8359        LinkableLinkIntoResult,
8360        fidl::encoding::DefaultFuchsiaResourceDialect,
8361    >;
8362    fn r#link_into(
8363        &self,
8364        mut dst_parent_token: fidl::Event,
8365        mut dst: &str,
8366    ) -> Self::LinkIntoResponseFut {
8367        fn _decode(
8368            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8369        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
8370            let _response = fidl::client::decode_transaction_body::<
8371                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8372                fidl::encoding::DefaultFuchsiaResourceDialect,
8373                0x54f3949246a03e74,
8374            >(_buf?)?;
8375            Ok(_response.map(|x| x))
8376        }
8377        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
8378            (dst_parent_token, dst),
8379            0x54f3949246a03e74,
8380            fidl::encoding::DynamicFlags::empty(),
8381            _decode,
8382        )
8383    }
8384
8385    fn r#clone(
8386        &self,
8387        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8388    ) -> Result<(), fidl::Error> {
8389        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
8390            (request,),
8391            0x20d8a7aba2168a79,
8392            fidl::encoding::DynamicFlags::empty(),
8393        )
8394    }
8395
8396    type CloseResponseFut = fidl::client::QueryResponseFut<
8397        fidl_fuchsia_unknown::CloseableCloseResult,
8398        fidl::encoding::DefaultFuchsiaResourceDialect,
8399    >;
8400    fn r#close(&self) -> Self::CloseResponseFut {
8401        fn _decode(
8402            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8403        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
8404            let _response = fidl::client::decode_transaction_body::<
8405                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8406                fidl::encoding::DefaultFuchsiaResourceDialect,
8407                0x5ac5d459ad7f657e,
8408            >(_buf?)?;
8409            Ok(_response.map(|x| x))
8410        }
8411        self.client.send_query_and_decode::<
8412            fidl::encoding::EmptyPayload,
8413            fidl_fuchsia_unknown::CloseableCloseResult,
8414        >(
8415            (),
8416            0x5ac5d459ad7f657e,
8417            fidl::encoding::DynamicFlags::empty(),
8418            _decode,
8419        )
8420    }
8421
8422    type QueryResponseFut =
8423        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
8424    fn r#query(&self) -> Self::QueryResponseFut {
8425        fn _decode(
8426            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8427        ) -> Result<Vec<u8>, fidl::Error> {
8428            let _response = fidl::client::decode_transaction_body::<
8429                fidl_fuchsia_unknown::QueryableQueryResponse,
8430                fidl::encoding::DefaultFuchsiaResourceDialect,
8431                0x2658edee9decfc06,
8432            >(_buf?)?;
8433            Ok(_response.protocol)
8434        }
8435        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
8436            (),
8437            0x2658edee9decfc06,
8438            fidl::encoding::DynamicFlags::empty(),
8439            _decode,
8440        )
8441    }
8442
8443    fn r#deprecated_clone(
8444        &self,
8445        mut flags: OpenFlags,
8446        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
8447    ) -> Result<(), fidl::Error> {
8448        self.client.send::<NodeDeprecatedCloneRequest>(
8449            (flags, object),
8450            0x5a61678f293ce16f,
8451            fidl::encoding::DynamicFlags::FLEXIBLE,
8452        )
8453    }
8454
8455    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
8456        (i32, NodeAttributes),
8457        fidl::encoding::DefaultFuchsiaResourceDialect,
8458    >;
8459    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
8460        fn _decode(
8461            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8462        ) -> Result<(i32, NodeAttributes), fidl::Error> {
8463            let _response = fidl::client::decode_transaction_body::<
8464                NodeDeprecatedGetAttrResponse,
8465                fidl::encoding::DefaultFuchsiaResourceDialect,
8466                0x78985e216314dafd,
8467            >(_buf?)?;
8468            Ok((_response.s, _response.attributes))
8469        }
8470        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
8471            (),
8472            0x78985e216314dafd,
8473            fidl::encoding::DynamicFlags::empty(),
8474            _decode,
8475        )
8476    }
8477
8478    type DeprecatedSetAttrResponseFut =
8479        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8480    fn r#deprecated_set_attr(
8481        &self,
8482        mut flags: NodeAttributeFlags,
8483        mut attributes: &NodeAttributes,
8484    ) -> Self::DeprecatedSetAttrResponseFut {
8485        fn _decode(
8486            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8487        ) -> Result<i32, fidl::Error> {
8488            let _response = fidl::client::decode_transaction_body::<
8489                NodeDeprecatedSetAttrResponse,
8490                fidl::encoding::DefaultFuchsiaResourceDialect,
8491                0x4186c0f40d938f46,
8492            >(_buf?)?;
8493            Ok(_response.s)
8494        }
8495        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
8496            (flags, attributes),
8497            0x4186c0f40d938f46,
8498            fidl::encoding::DynamicFlags::empty(),
8499            _decode,
8500        )
8501    }
8502
8503    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
8504        (i32, OpenFlags),
8505        fidl::encoding::DefaultFuchsiaResourceDialect,
8506    >;
8507    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
8508        fn _decode(
8509            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8510        ) -> Result<(i32, OpenFlags), fidl::Error> {
8511            let _response = fidl::client::decode_transaction_body::<
8512                NodeDeprecatedGetFlagsResponse,
8513                fidl::encoding::DefaultFuchsiaResourceDialect,
8514                0x5b88fffb8eda3aa1,
8515            >(_buf?)?;
8516            Ok((_response.s, _response.flags))
8517        }
8518        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
8519            (),
8520            0x5b88fffb8eda3aa1,
8521            fidl::encoding::DynamicFlags::empty(),
8522            _decode,
8523        )
8524    }
8525
8526    type DeprecatedSetFlagsResponseFut =
8527        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8528    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
8529        fn _decode(
8530            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8531        ) -> Result<i32, fidl::Error> {
8532            let _response = fidl::client::decode_transaction_body::<
8533                NodeDeprecatedSetFlagsResponse,
8534                fidl::encoding::DefaultFuchsiaResourceDialect,
8535                0x5295b76c71fde733,
8536            >(_buf?)?;
8537            Ok(_response.s)
8538        }
8539        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
8540            (flags,),
8541            0x5295b76c71fde733,
8542            fidl::encoding::DynamicFlags::empty(),
8543            _decode,
8544        )
8545    }
8546
8547    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
8548        NodeGetFlagsResult,
8549        fidl::encoding::DefaultFuchsiaResourceDialect,
8550    >;
8551    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
8552        fn _decode(
8553            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8554        ) -> Result<NodeGetFlagsResult, fidl::Error> {
8555            let _response = fidl::client::decode_transaction_body::<
8556                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
8557                fidl::encoding::DefaultFuchsiaResourceDialect,
8558                0x176eb318f64ec23,
8559            >(_buf?)?
8560            .into_result::<FileMarker>("get_flags")?;
8561            Ok(_response.map(|x| x.flags))
8562        }
8563        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
8564            (),
8565            0x176eb318f64ec23,
8566            fidl::encoding::DynamicFlags::FLEXIBLE,
8567            _decode,
8568        )
8569    }
8570
8571    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
8572        NodeSetFlagsResult,
8573        fidl::encoding::DefaultFuchsiaResourceDialect,
8574    >;
8575    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
8576        fn _decode(
8577            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8578        ) -> Result<NodeSetFlagsResult, fidl::Error> {
8579            let _response = fidl::client::decode_transaction_body::<
8580                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
8581                fidl::encoding::DefaultFuchsiaResourceDialect,
8582                0x55a8028685791ea8,
8583            >(_buf?)?
8584            .into_result::<FileMarker>("set_flags")?;
8585            Ok(_response.map(|x| x))
8586        }
8587        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
8588            (flags,),
8589            0x55a8028685791ea8,
8590            fidl::encoding::DynamicFlags::FLEXIBLE,
8591            _decode,
8592        )
8593    }
8594
8595    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
8596        (i32, Option<Box<FilesystemInfo>>),
8597        fidl::encoding::DefaultFuchsiaResourceDialect,
8598    >;
8599    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
8600        fn _decode(
8601            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8602        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
8603            let _response = fidl::client::decode_transaction_body::<
8604                NodeQueryFilesystemResponse,
8605                fidl::encoding::DefaultFuchsiaResourceDialect,
8606                0x6f344a1c6b0a0610,
8607            >(_buf?)?;
8608            Ok((_response.s, _response.info))
8609        }
8610        self.client.send_query_and_decode::<
8611            fidl::encoding::EmptyPayload,
8612            (i32, Option<Box<FilesystemInfo>>),
8613        >(
8614            (),
8615            0x6f344a1c6b0a0610,
8616            fidl::encoding::DynamicFlags::empty(),
8617            _decode,
8618        )
8619    }
8620
8621    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
8622        NodeGetAttributesResult,
8623        fidl::encoding::DefaultFuchsiaResourceDialect,
8624    >;
8625    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
8626        fn _decode(
8627            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8628        ) -> Result<NodeGetAttributesResult, fidl::Error> {
8629            let _response = fidl::client::decode_transaction_body::<
8630                fidl::encoding::ResultType<NodeAttributes2, i32>,
8631                fidl::encoding::DefaultFuchsiaResourceDialect,
8632                0x3d4396a638ea053b,
8633            >(_buf?)?;
8634            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
8635        }
8636        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
8637            (query,),
8638            0x3d4396a638ea053b,
8639            fidl::encoding::DynamicFlags::empty(),
8640            _decode,
8641        )
8642    }
8643
8644    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
8645        NodeUpdateAttributesResult,
8646        fidl::encoding::DefaultFuchsiaResourceDialect,
8647    >;
8648    fn r#update_attributes(
8649        &self,
8650        mut payload: &MutableNodeAttributes,
8651    ) -> Self::UpdateAttributesResponseFut {
8652        fn _decode(
8653            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8654        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
8655            let _response = fidl::client::decode_transaction_body::<
8656                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8657                fidl::encoding::DefaultFuchsiaResourceDialect,
8658                0x3308c1da5a89bf08,
8659            >(_buf?)?;
8660            Ok(_response.map(|x| x))
8661        }
8662        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
8663            payload,
8664            0x3308c1da5a89bf08,
8665            fidl::encoding::DynamicFlags::empty(),
8666            _decode,
8667        )
8668    }
8669
8670    type SyncResponseFut = fidl::client::QueryResponseFut<
8671        NodeSyncResult,
8672        fidl::encoding::DefaultFuchsiaResourceDialect,
8673    >;
8674    fn r#sync(&self) -> Self::SyncResponseFut {
8675        fn _decode(
8676            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8677        ) -> Result<NodeSyncResult, fidl::Error> {
8678            let _response = fidl::client::decode_transaction_body::<
8679                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8680                fidl::encoding::DefaultFuchsiaResourceDialect,
8681                0x2c5c27ca0ab5dc49,
8682            >(_buf?)?;
8683            Ok(_response.map(|x| x))
8684        }
8685        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
8686            (),
8687            0x2c5c27ca0ab5dc49,
8688            fidl::encoding::DynamicFlags::empty(),
8689            _decode,
8690        )
8691    }
8692
8693    fn r#list_extended_attributes(
8694        &self,
8695        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8696    ) -> Result<(), fidl::Error> {
8697        self.client.send::<NodeListExtendedAttributesRequest>(
8698            (iterator,),
8699            0x4b61033de007fcd0,
8700            fidl::encoding::DynamicFlags::empty(),
8701        )
8702    }
8703
8704    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8705        NodeGetExtendedAttributeResult,
8706        fidl::encoding::DefaultFuchsiaResourceDialect,
8707    >;
8708    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
8709        fn _decode(
8710            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8711        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
8712            let _response = fidl::client::decode_transaction_body::<
8713                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
8714                fidl::encoding::DefaultFuchsiaResourceDialect,
8715                0x45ffa3ccfdeb76db,
8716            >(_buf?)?;
8717            Ok(_response.map(|x| x))
8718        }
8719        self.client.send_query_and_decode::<
8720            NodeGetExtendedAttributeRequest,
8721            NodeGetExtendedAttributeResult,
8722        >(
8723            (name,),
8724            0x45ffa3ccfdeb76db,
8725            fidl::encoding::DynamicFlags::empty(),
8726            _decode,
8727        )
8728    }
8729
8730    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8731        NodeSetExtendedAttributeResult,
8732        fidl::encoding::DefaultFuchsiaResourceDialect,
8733    >;
8734    fn r#set_extended_attribute(
8735        &self,
8736        mut name: &[u8],
8737        mut value: ExtendedAttributeValue,
8738        mut mode: SetExtendedAttributeMode,
8739    ) -> Self::SetExtendedAttributeResponseFut {
8740        fn _decode(
8741            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8742        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
8743            let _response = fidl::client::decode_transaction_body::<
8744                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8745                fidl::encoding::DefaultFuchsiaResourceDialect,
8746                0x4a951362f681f23c,
8747            >(_buf?)?;
8748            Ok(_response.map(|x| x))
8749        }
8750        self.client.send_query_and_decode::<
8751            NodeSetExtendedAttributeRequest,
8752            NodeSetExtendedAttributeResult,
8753        >(
8754            (name, &mut value, mode,),
8755            0x4a951362f681f23c,
8756            fidl::encoding::DynamicFlags::empty(),
8757            _decode,
8758        )
8759    }
8760
8761    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8762        NodeRemoveExtendedAttributeResult,
8763        fidl::encoding::DefaultFuchsiaResourceDialect,
8764    >;
8765    fn r#remove_extended_attribute(
8766        &self,
8767        mut name: &[u8],
8768    ) -> Self::RemoveExtendedAttributeResponseFut {
8769        fn _decode(
8770            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8771        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
8772            let _response = fidl::client::decode_transaction_body::<
8773                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8774                fidl::encoding::DefaultFuchsiaResourceDialect,
8775                0x7a0b9f3a9bf9032d,
8776            >(_buf?)?;
8777            Ok(_response.map(|x| x))
8778        }
8779        self.client.send_query_and_decode::<
8780            NodeRemoveExtendedAttributeRequest,
8781            NodeRemoveExtendedAttributeResult,
8782        >(
8783            (name,),
8784            0x7a0b9f3a9bf9032d,
8785            fidl::encoding::DynamicFlags::empty(),
8786            _decode,
8787        )
8788    }
8789
8790    type ReadResponseFut = fidl::client::QueryResponseFut<
8791        ReadableReadResult,
8792        fidl::encoding::DefaultFuchsiaResourceDialect,
8793    >;
8794    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
8795        fn _decode(
8796            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8797        ) -> Result<ReadableReadResult, fidl::Error> {
8798            let _response = fidl::client::decode_transaction_body::<
8799                fidl::encoding::ResultType<ReadableReadResponse, i32>,
8800                fidl::encoding::DefaultFuchsiaResourceDialect,
8801                0x57e419a298c8ede,
8802            >(_buf?)?;
8803            Ok(_response.map(|x| x.data))
8804        }
8805        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
8806            (count,),
8807            0x57e419a298c8ede,
8808            fidl::encoding::DynamicFlags::empty(),
8809            _decode,
8810        )
8811    }
8812
8813    type WriteResponseFut = fidl::client::QueryResponseFut<
8814        WritableWriteResult,
8815        fidl::encoding::DefaultFuchsiaResourceDialect,
8816    >;
8817    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
8818        fn _decode(
8819            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8820        ) -> Result<WritableWriteResult, fidl::Error> {
8821            let _response = fidl::client::decode_transaction_body::<
8822                fidl::encoding::ResultType<WritableWriteResponse, i32>,
8823                fidl::encoding::DefaultFuchsiaResourceDialect,
8824                0x6a31437832469f82,
8825            >(_buf?)?;
8826            Ok(_response.map(|x| x.actual_count))
8827        }
8828        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
8829            (data,),
8830            0x6a31437832469f82,
8831            fidl::encoding::DynamicFlags::empty(),
8832            _decode,
8833        )
8834    }
8835
8836    type DescribeResponseFut =
8837        fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
8838    fn r#describe(&self) -> Self::DescribeResponseFut {
8839        fn _decode(
8840            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8841        ) -> Result<FileInfo, fidl::Error> {
8842            let _response = fidl::client::decode_transaction_body::<
8843                FileInfo,
8844                fidl::encoding::DefaultFuchsiaResourceDialect,
8845                0x68b5ac00c62906bc,
8846            >(_buf?)?;
8847            Ok(_response)
8848        }
8849        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FileInfo>(
8850            (),
8851            0x68b5ac00c62906bc,
8852            fidl::encoding::DynamicFlags::empty(),
8853            _decode,
8854        )
8855    }
8856
8857    type SeekResponseFut = fidl::client::QueryResponseFut<
8858        FileSeekResult,
8859        fidl::encoding::DefaultFuchsiaResourceDialect,
8860    >;
8861    fn r#seek(&self, mut origin: SeekOrigin, mut offset: i64) -> Self::SeekResponseFut {
8862        fn _decode(
8863            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8864        ) -> Result<FileSeekResult, fidl::Error> {
8865            let _response = fidl::client::decode_transaction_body::<
8866                fidl::encoding::ResultType<FileSeekResponse, i32>,
8867                fidl::encoding::DefaultFuchsiaResourceDialect,
8868                0x78079168162c5207,
8869            >(_buf?)?;
8870            Ok(_response.map(|x| x.offset_from_start))
8871        }
8872        self.client.send_query_and_decode::<FileSeekRequest, FileSeekResult>(
8873            (origin, offset),
8874            0x78079168162c5207,
8875            fidl::encoding::DynamicFlags::empty(),
8876            _decode,
8877        )
8878    }
8879
8880    type ReadAtResponseFut = fidl::client::QueryResponseFut<
8881        FileReadAtResult,
8882        fidl::encoding::DefaultFuchsiaResourceDialect,
8883    >;
8884    fn r#read_at(&self, mut count: u64, mut offset: u64) -> Self::ReadAtResponseFut {
8885        fn _decode(
8886            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8887        ) -> Result<FileReadAtResult, fidl::Error> {
8888            let _response = fidl::client::decode_transaction_body::<
8889                fidl::encoding::ResultType<FileReadAtResponse, i32>,
8890                fidl::encoding::DefaultFuchsiaResourceDialect,
8891                0x1607a293a60d723e,
8892            >(_buf?)?;
8893            Ok(_response.map(|x| x.data))
8894        }
8895        self.client.send_query_and_decode::<FileReadAtRequest, FileReadAtResult>(
8896            (count, offset),
8897            0x1607a293a60d723e,
8898            fidl::encoding::DynamicFlags::empty(),
8899            _decode,
8900        )
8901    }
8902
8903    type WriteAtResponseFut = fidl::client::QueryResponseFut<
8904        FileWriteAtResult,
8905        fidl::encoding::DefaultFuchsiaResourceDialect,
8906    >;
8907    fn r#write_at(&self, mut data: &[u8], mut offset: u64) -> Self::WriteAtResponseFut {
8908        fn _decode(
8909            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8910        ) -> Result<FileWriteAtResult, fidl::Error> {
8911            let _response = fidl::client::decode_transaction_body::<
8912                fidl::encoding::ResultType<FileWriteAtResponse, i32>,
8913                fidl::encoding::DefaultFuchsiaResourceDialect,
8914                0x793eefc0045e792b,
8915            >(_buf?)?;
8916            Ok(_response.map(|x| x.actual_count))
8917        }
8918        self.client.send_query_and_decode::<FileWriteAtRequest, FileWriteAtResult>(
8919            (data, offset),
8920            0x793eefc0045e792b,
8921            fidl::encoding::DynamicFlags::empty(),
8922            _decode,
8923        )
8924    }
8925
8926    type ResizeResponseFut = fidl::client::QueryResponseFut<
8927        FileResizeResult,
8928        fidl::encoding::DefaultFuchsiaResourceDialect,
8929    >;
8930    fn r#resize(&self, mut length: u64) -> Self::ResizeResponseFut {
8931        fn _decode(
8932            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8933        ) -> Result<FileResizeResult, fidl::Error> {
8934            let _response = fidl::client::decode_transaction_body::<
8935                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8936                fidl::encoding::DefaultFuchsiaResourceDialect,
8937                0x2b80825f0535743a,
8938            >(_buf?)?;
8939            Ok(_response.map(|x| x))
8940        }
8941        self.client.send_query_and_decode::<FileResizeRequest, FileResizeResult>(
8942            (length,),
8943            0x2b80825f0535743a,
8944            fidl::encoding::DynamicFlags::empty(),
8945            _decode,
8946        )
8947    }
8948
8949    type GetBackingMemoryResponseFut = fidl::client::QueryResponseFut<
8950        FileGetBackingMemoryResult,
8951        fidl::encoding::DefaultFuchsiaResourceDialect,
8952    >;
8953    fn r#get_backing_memory(&self, mut flags: VmoFlags) -> Self::GetBackingMemoryResponseFut {
8954        fn _decode(
8955            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8956        ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
8957            let _response = fidl::client::decode_transaction_body::<
8958                fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
8959                fidl::encoding::DefaultFuchsiaResourceDialect,
8960                0xa6a9e654cbf62b,
8961            >(_buf?)?;
8962            Ok(_response.map(|x| x.vmo))
8963        }
8964        self.client
8965            .send_query_and_decode::<FileGetBackingMemoryRequest, FileGetBackingMemoryResult>(
8966                (flags,),
8967                0xa6a9e654cbf62b,
8968                fidl::encoding::DynamicFlags::empty(),
8969                _decode,
8970            )
8971    }
8972
8973    type AllocateResponseFut = fidl::client::QueryResponseFut<
8974        FileAllocateResult,
8975        fidl::encoding::DefaultFuchsiaResourceDialect,
8976    >;
8977    fn r#allocate(
8978        &self,
8979        mut offset: u64,
8980        mut length: u64,
8981        mut mode: AllocateMode,
8982    ) -> Self::AllocateResponseFut {
8983        fn _decode(
8984            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8985        ) -> Result<FileAllocateResult, fidl::Error> {
8986            let _response = fidl::client::decode_transaction_body::<
8987                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
8988                fidl::encoding::DefaultFuchsiaResourceDialect,
8989                0x77fa0c330b57fd2e,
8990            >(_buf?)?
8991            .into_result::<FileMarker>("allocate")?;
8992            Ok(_response.map(|x| x))
8993        }
8994        self.client.send_query_and_decode::<FileAllocateRequest, FileAllocateResult>(
8995            (offset, length, mode),
8996            0x77fa0c330b57fd2e,
8997            fidl::encoding::DynamicFlags::FLEXIBLE,
8998            _decode,
8999        )
9000    }
9001
9002    type EnableVerityResponseFut = fidl::client::QueryResponseFut<
9003        FileEnableVerityResult,
9004        fidl::encoding::DefaultFuchsiaResourceDialect,
9005    >;
9006    fn r#enable_verity(&self, mut options: &VerificationOptions) -> Self::EnableVerityResponseFut {
9007        fn _decode(
9008            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9009        ) -> Result<FileEnableVerityResult, fidl::Error> {
9010            let _response = fidl::client::decode_transaction_body::<
9011                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9012                fidl::encoding::DefaultFuchsiaResourceDialect,
9013                0x2c421ec3faaeb8bb,
9014            >(_buf?)?
9015            .into_result::<FileMarker>("enable_verity")?;
9016            Ok(_response.map(|x| x))
9017        }
9018        self.client.send_query_and_decode::<FileEnableVerityRequest, FileEnableVerityResult>(
9019            (options,),
9020            0x2c421ec3faaeb8bb,
9021            fidl::encoding::DynamicFlags::FLEXIBLE,
9022            _decode,
9023        )
9024    }
9025}
9026
9027pub struct FileEventStream {
9028    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9029}
9030
9031impl std::marker::Unpin for FileEventStream {}
9032
9033impl futures::stream::FusedStream for FileEventStream {
9034    fn is_terminated(&self) -> bool {
9035        self.event_receiver.is_terminated()
9036    }
9037}
9038
9039impl futures::Stream for FileEventStream {
9040    type Item = Result<FileEvent, fidl::Error>;
9041
9042    fn poll_next(
9043        mut self: std::pin::Pin<&mut Self>,
9044        cx: &mut std::task::Context<'_>,
9045    ) -> std::task::Poll<Option<Self::Item>> {
9046        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9047            &mut self.event_receiver,
9048            cx
9049        )?) {
9050            Some(buf) => std::task::Poll::Ready(Some(FileEvent::decode(buf))),
9051            None => std::task::Poll::Ready(None),
9052        }
9053    }
9054}
9055
9056#[derive(Debug)]
9057pub enum FileEvent {
9058    OnOpen_ {
9059        s: i32,
9060        info: Option<Box<NodeInfoDeprecated>>,
9061    },
9062    OnRepresentation {
9063        payload: Representation,
9064    },
9065    #[non_exhaustive]
9066    _UnknownEvent {
9067        /// Ordinal of the event that was sent.
9068        ordinal: u64,
9069    },
9070}
9071
9072impl FileEvent {
9073    #[allow(irrefutable_let_patterns)]
9074    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
9075        if let FileEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
9076    }
9077    #[allow(irrefutable_let_patterns)]
9078    pub fn into_on_representation(self) -> Option<Representation> {
9079        if let FileEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
9080    }
9081
9082    /// Decodes a message buffer as a [`FileEvent`].
9083    fn decode(
9084        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9085    ) -> Result<FileEvent, fidl::Error> {
9086        let (bytes, _handles) = buf.split_mut();
9087        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9088        debug_assert_eq!(tx_header.tx_id, 0);
9089        match tx_header.ordinal {
9090            0x7fc7bbb1dbfd1972 => {
9091                let mut out = fidl::new_empty!(
9092                    NodeOnOpenRequest,
9093                    fidl::encoding::DefaultFuchsiaResourceDialect
9094                );
9095                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
9096                Ok((FileEvent::OnOpen_ { s: out.s, info: out.info }))
9097            }
9098            0x5cb40567d80a510c => {
9099                let mut out =
9100                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
9101                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
9102                Ok((FileEvent::OnRepresentation { payload: out }))
9103            }
9104            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9105                Ok(FileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9106            }
9107            _ => Err(fidl::Error::UnknownOrdinal {
9108                ordinal: tx_header.ordinal,
9109                protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9110            }),
9111        }
9112    }
9113}
9114
9115/// A Stream of incoming requests for fuchsia.io/File.
9116pub struct FileRequestStream {
9117    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9118    is_terminated: bool,
9119}
9120
9121impl std::marker::Unpin for FileRequestStream {}
9122
9123impl futures::stream::FusedStream for FileRequestStream {
9124    fn is_terminated(&self) -> bool {
9125        self.is_terminated
9126    }
9127}
9128
9129impl fidl::endpoints::RequestStream for FileRequestStream {
9130    type Protocol = FileMarker;
9131    type ControlHandle = FileControlHandle;
9132
9133    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9134        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9135    }
9136
9137    fn control_handle(&self) -> Self::ControlHandle {
9138        FileControlHandle { inner: self.inner.clone() }
9139    }
9140
9141    fn into_inner(
9142        self,
9143    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9144    {
9145        (self.inner, self.is_terminated)
9146    }
9147
9148    fn from_inner(
9149        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9150        is_terminated: bool,
9151    ) -> Self {
9152        Self { inner, is_terminated }
9153    }
9154}
9155
9156impl futures::Stream for FileRequestStream {
9157    type Item = Result<FileRequest, fidl::Error>;
9158
9159    fn poll_next(
9160        mut self: std::pin::Pin<&mut Self>,
9161        cx: &mut std::task::Context<'_>,
9162    ) -> std::task::Poll<Option<Self::Item>> {
9163        let this = &mut *self;
9164        if this.inner.check_shutdown(cx) {
9165            this.is_terminated = true;
9166            return std::task::Poll::Ready(None);
9167        }
9168        if this.is_terminated {
9169            panic!("polled FileRequestStream after completion");
9170        }
9171        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9172            |bytes, handles| {
9173                match this.inner.channel().read_etc(cx, bytes, handles) {
9174                    std::task::Poll::Ready(Ok(())) => {}
9175                    std::task::Poll::Pending => return std::task::Poll::Pending,
9176                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9177                        this.is_terminated = true;
9178                        return std::task::Poll::Ready(None);
9179                    }
9180                    std::task::Poll::Ready(Err(e)) => {
9181                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9182                            e.into(),
9183                        ))));
9184                    }
9185                }
9186
9187                // A message has been received from the channel
9188                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9189
9190                std::task::Poll::Ready(Some(match header.ordinal {
9191                    0x6ee9c0ad53ec87aa => {
9192                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9193                        let mut req = fidl::new_empty!(
9194                            AdvisoryLockingAdvisoryLockRequest,
9195                            fidl::encoding::DefaultFuchsiaResourceDialect
9196                        );
9197                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
9198                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9199                        Ok(FileRequest::AdvisoryLock {
9200                            request: req.request,
9201
9202                            responder: FileAdvisoryLockResponder {
9203                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9204                                tx_id: header.tx_id,
9205                            },
9206                        })
9207                    }
9208                    0x54f3949246a03e74 => {
9209                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9210                        let mut req = fidl::new_empty!(
9211                            LinkableLinkIntoRequest,
9212                            fidl::encoding::DefaultFuchsiaResourceDialect
9213                        );
9214                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
9215                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9216                        Ok(FileRequest::LinkInto {
9217                            dst_parent_token: req.dst_parent_token,
9218                            dst: req.dst,
9219
9220                            responder: FileLinkIntoResponder {
9221                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9222                                tx_id: header.tx_id,
9223                            },
9224                        })
9225                    }
9226                    0x20d8a7aba2168a79 => {
9227                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9228                        let mut req = fidl::new_empty!(
9229                            fidl_fuchsia_unknown::CloneableCloneRequest,
9230                            fidl::encoding::DefaultFuchsiaResourceDialect
9231                        );
9232                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9233                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9234                        Ok(FileRequest::Clone { request: req.request, control_handle })
9235                    }
9236                    0x5ac5d459ad7f657e => {
9237                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9238                        let mut req = fidl::new_empty!(
9239                            fidl::encoding::EmptyPayload,
9240                            fidl::encoding::DefaultFuchsiaResourceDialect
9241                        );
9242                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9243                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9244                        Ok(FileRequest::Close {
9245                            responder: FileCloseResponder {
9246                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9247                                tx_id: header.tx_id,
9248                            },
9249                        })
9250                    }
9251                    0x2658edee9decfc06 => {
9252                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9253                        let mut req = fidl::new_empty!(
9254                            fidl::encoding::EmptyPayload,
9255                            fidl::encoding::DefaultFuchsiaResourceDialect
9256                        );
9257                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9258                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9259                        Ok(FileRequest::Query {
9260                            responder: FileQueryResponder {
9261                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9262                                tx_id: header.tx_id,
9263                            },
9264                        })
9265                    }
9266                    0x5a61678f293ce16f => {
9267                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9268                        let mut req = fidl::new_empty!(
9269                            NodeDeprecatedCloneRequest,
9270                            fidl::encoding::DefaultFuchsiaResourceDialect
9271                        );
9272                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9273                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9274                        Ok(FileRequest::DeprecatedClone {
9275                            flags: req.flags,
9276                            object: req.object,
9277
9278                            control_handle,
9279                        })
9280                    }
9281                    0x78985e216314dafd => {
9282                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9283                        let mut req = fidl::new_empty!(
9284                            fidl::encoding::EmptyPayload,
9285                            fidl::encoding::DefaultFuchsiaResourceDialect
9286                        );
9287                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9288                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9289                        Ok(FileRequest::DeprecatedGetAttr {
9290                            responder: FileDeprecatedGetAttrResponder {
9291                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9292                                tx_id: header.tx_id,
9293                            },
9294                        })
9295                    }
9296                    0x4186c0f40d938f46 => {
9297                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9298                        let mut req = fidl::new_empty!(
9299                            NodeDeprecatedSetAttrRequest,
9300                            fidl::encoding::DefaultFuchsiaResourceDialect
9301                        );
9302                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
9303                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9304                        Ok(FileRequest::DeprecatedSetAttr {
9305                            flags: req.flags,
9306                            attributes: req.attributes,
9307
9308                            responder: FileDeprecatedSetAttrResponder {
9309                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9310                                tx_id: header.tx_id,
9311                            },
9312                        })
9313                    }
9314                    0x5b88fffb8eda3aa1 => {
9315                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9316                        let mut req = fidl::new_empty!(
9317                            fidl::encoding::EmptyPayload,
9318                            fidl::encoding::DefaultFuchsiaResourceDialect
9319                        );
9320                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9321                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9322                        Ok(FileRequest::DeprecatedGetFlags {
9323                            responder: FileDeprecatedGetFlagsResponder {
9324                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9325                                tx_id: header.tx_id,
9326                            },
9327                        })
9328                    }
9329                    0x5295b76c71fde733 => {
9330                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9331                        let mut req = fidl::new_empty!(
9332                            NodeDeprecatedSetFlagsRequest,
9333                            fidl::encoding::DefaultFuchsiaResourceDialect
9334                        );
9335                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9336                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9337                        Ok(FileRequest::DeprecatedSetFlags {
9338                            flags: req.flags,
9339
9340                            responder: FileDeprecatedSetFlagsResponder {
9341                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9342                                tx_id: header.tx_id,
9343                            },
9344                        })
9345                    }
9346                    0x176eb318f64ec23 => {
9347                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9348                        let mut req = fidl::new_empty!(
9349                            fidl::encoding::EmptyPayload,
9350                            fidl::encoding::DefaultFuchsiaResourceDialect
9351                        );
9352                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9353                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9354                        Ok(FileRequest::GetFlags {
9355                            responder: FileGetFlagsResponder {
9356                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9357                                tx_id: header.tx_id,
9358                            },
9359                        })
9360                    }
9361                    0x55a8028685791ea8 => {
9362                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9363                        let mut req = fidl::new_empty!(
9364                            NodeSetFlagsRequest,
9365                            fidl::encoding::DefaultFuchsiaResourceDialect
9366                        );
9367                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9368                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9369                        Ok(FileRequest::SetFlags {
9370                            flags: req.flags,
9371
9372                            responder: FileSetFlagsResponder {
9373                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9374                                tx_id: header.tx_id,
9375                            },
9376                        })
9377                    }
9378                    0x6f344a1c6b0a0610 => {
9379                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9380                        let mut req = fidl::new_empty!(
9381                            fidl::encoding::EmptyPayload,
9382                            fidl::encoding::DefaultFuchsiaResourceDialect
9383                        );
9384                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9385                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9386                        Ok(FileRequest::QueryFilesystem {
9387                            responder: FileQueryFilesystemResponder {
9388                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9389                                tx_id: header.tx_id,
9390                            },
9391                        })
9392                    }
9393                    0x3d4396a638ea053b => {
9394                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9395                        let mut req = fidl::new_empty!(
9396                            NodeGetAttributesRequest,
9397                            fidl::encoding::DefaultFuchsiaResourceDialect
9398                        );
9399                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9400                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9401                        Ok(FileRequest::GetAttributes {
9402                            query: req.query,
9403
9404                            responder: FileGetAttributesResponder {
9405                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9406                                tx_id: header.tx_id,
9407                            },
9408                        })
9409                    }
9410                    0x3308c1da5a89bf08 => {
9411                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9412                        let mut req = fidl::new_empty!(
9413                            MutableNodeAttributes,
9414                            fidl::encoding::DefaultFuchsiaResourceDialect
9415                        );
9416                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
9417                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9418                        Ok(FileRequest::UpdateAttributes {
9419                            payload: req,
9420                            responder: FileUpdateAttributesResponder {
9421                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9422                                tx_id: header.tx_id,
9423                            },
9424                        })
9425                    }
9426                    0x2c5c27ca0ab5dc49 => {
9427                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9428                        let mut req = fidl::new_empty!(
9429                            fidl::encoding::EmptyPayload,
9430                            fidl::encoding::DefaultFuchsiaResourceDialect
9431                        );
9432                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9433                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9434                        Ok(FileRequest::Sync {
9435                            responder: FileSyncResponder {
9436                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9437                                tx_id: header.tx_id,
9438                            },
9439                        })
9440                    }
9441                    0x4b61033de007fcd0 => {
9442                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9443                        let mut req = fidl::new_empty!(
9444                            NodeListExtendedAttributesRequest,
9445                            fidl::encoding::DefaultFuchsiaResourceDialect
9446                        );
9447                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9448                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9449                        Ok(FileRequest::ListExtendedAttributes {
9450                            iterator: req.iterator,
9451
9452                            control_handle,
9453                        })
9454                    }
9455                    0x45ffa3ccfdeb76db => {
9456                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9457                        let mut req = fidl::new_empty!(
9458                            NodeGetExtendedAttributeRequest,
9459                            fidl::encoding::DefaultFuchsiaResourceDialect
9460                        );
9461                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9462                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9463                        Ok(FileRequest::GetExtendedAttribute {
9464                            name: req.name,
9465
9466                            responder: FileGetExtendedAttributeResponder {
9467                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9468                                tx_id: header.tx_id,
9469                            },
9470                        })
9471                    }
9472                    0x4a951362f681f23c => {
9473                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9474                        let mut req = fidl::new_empty!(
9475                            NodeSetExtendedAttributeRequest,
9476                            fidl::encoding::DefaultFuchsiaResourceDialect
9477                        );
9478                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9479                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9480                        Ok(FileRequest::SetExtendedAttribute {
9481                            name: req.name,
9482                            value: req.value,
9483                            mode: req.mode,
9484
9485                            responder: FileSetExtendedAttributeResponder {
9486                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9487                                tx_id: header.tx_id,
9488                            },
9489                        })
9490                    }
9491                    0x7a0b9f3a9bf9032d => {
9492                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9493                        let mut req = fidl::new_empty!(
9494                            NodeRemoveExtendedAttributeRequest,
9495                            fidl::encoding::DefaultFuchsiaResourceDialect
9496                        );
9497                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9498                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9499                        Ok(FileRequest::RemoveExtendedAttribute {
9500                            name: req.name,
9501
9502                            responder: FileRemoveExtendedAttributeResponder {
9503                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9504                                tx_id: header.tx_id,
9505                            },
9506                        })
9507                    }
9508                    0x57e419a298c8ede => {
9509                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9510                        let mut req = fidl::new_empty!(
9511                            ReadableReadRequest,
9512                            fidl::encoding::DefaultFuchsiaResourceDialect
9513                        );
9514                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
9515                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9516                        Ok(FileRequest::Read {
9517                            count: req.count,
9518
9519                            responder: FileReadResponder {
9520                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9521                                tx_id: header.tx_id,
9522                            },
9523                        })
9524                    }
9525                    0x6a31437832469f82 => {
9526                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9527                        let mut req = fidl::new_empty!(
9528                            WritableWriteRequest,
9529                            fidl::encoding::DefaultFuchsiaResourceDialect
9530                        );
9531                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
9532                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9533                        Ok(FileRequest::Write {
9534                            data: req.data,
9535
9536                            responder: FileWriteResponder {
9537                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9538                                tx_id: header.tx_id,
9539                            },
9540                        })
9541                    }
9542                    0x68b5ac00c62906bc => {
9543                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9544                        let mut req = fidl::new_empty!(
9545                            fidl::encoding::EmptyPayload,
9546                            fidl::encoding::DefaultFuchsiaResourceDialect
9547                        );
9548                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9549                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9550                        Ok(FileRequest::Describe {
9551                            responder: FileDescribeResponder {
9552                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9553                                tx_id: header.tx_id,
9554                            },
9555                        })
9556                    }
9557                    0x78079168162c5207 => {
9558                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9559                        let mut req = fidl::new_empty!(
9560                            FileSeekRequest,
9561                            fidl::encoding::DefaultFuchsiaResourceDialect
9562                        );
9563                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileSeekRequest>(&header, _body_bytes, handles, &mut req)?;
9564                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9565                        Ok(FileRequest::Seek {
9566                            origin: req.origin,
9567                            offset: req.offset,
9568
9569                            responder: FileSeekResponder {
9570                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9571                                tx_id: header.tx_id,
9572                            },
9573                        })
9574                    }
9575                    0x1607a293a60d723e => {
9576                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9577                        let mut req = fidl::new_empty!(
9578                            FileReadAtRequest,
9579                            fidl::encoding::DefaultFuchsiaResourceDialect
9580                        );
9581                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileReadAtRequest>(&header, _body_bytes, handles, &mut req)?;
9582                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9583                        Ok(FileRequest::ReadAt {
9584                            count: req.count,
9585                            offset: req.offset,
9586
9587                            responder: FileReadAtResponder {
9588                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9589                                tx_id: header.tx_id,
9590                            },
9591                        })
9592                    }
9593                    0x793eefc0045e792b => {
9594                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9595                        let mut req = fidl::new_empty!(
9596                            FileWriteAtRequest,
9597                            fidl::encoding::DefaultFuchsiaResourceDialect
9598                        );
9599                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileWriteAtRequest>(&header, _body_bytes, handles, &mut req)?;
9600                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9601                        Ok(FileRequest::WriteAt {
9602                            data: req.data,
9603                            offset: req.offset,
9604
9605                            responder: FileWriteAtResponder {
9606                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9607                                tx_id: header.tx_id,
9608                            },
9609                        })
9610                    }
9611                    0x2b80825f0535743a => {
9612                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9613                        let mut req = fidl::new_empty!(
9614                            FileResizeRequest,
9615                            fidl::encoding::DefaultFuchsiaResourceDialect
9616                        );
9617                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileResizeRequest>(&header, _body_bytes, handles, &mut req)?;
9618                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9619                        Ok(FileRequest::Resize {
9620                            length: req.length,
9621
9622                            responder: FileResizeResponder {
9623                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9624                                tx_id: header.tx_id,
9625                            },
9626                        })
9627                    }
9628                    0xa6a9e654cbf62b => {
9629                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9630                        let mut req = fidl::new_empty!(
9631                            FileGetBackingMemoryRequest,
9632                            fidl::encoding::DefaultFuchsiaResourceDialect
9633                        );
9634                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileGetBackingMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
9635                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9636                        Ok(FileRequest::GetBackingMemory {
9637                            flags: req.flags,
9638
9639                            responder: FileGetBackingMemoryResponder {
9640                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9641                                tx_id: header.tx_id,
9642                            },
9643                        })
9644                    }
9645                    0x77fa0c330b57fd2e => {
9646                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9647                        let mut req = fidl::new_empty!(
9648                            FileAllocateRequest,
9649                            fidl::encoding::DefaultFuchsiaResourceDialect
9650                        );
9651                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileAllocateRequest>(&header, _body_bytes, handles, &mut req)?;
9652                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9653                        Ok(FileRequest::Allocate {
9654                            offset: req.offset,
9655                            length: req.length,
9656                            mode: req.mode,
9657
9658                            responder: FileAllocateResponder {
9659                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9660                                tx_id: header.tx_id,
9661                            },
9662                        })
9663                    }
9664                    0x2c421ec3faaeb8bb => {
9665                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9666                        let mut req = fidl::new_empty!(
9667                            FileEnableVerityRequest,
9668                            fidl::encoding::DefaultFuchsiaResourceDialect
9669                        );
9670                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileEnableVerityRequest>(&header, _body_bytes, handles, &mut req)?;
9671                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9672                        Ok(FileRequest::EnableVerity {
9673                            options: req.options,
9674
9675                            responder: FileEnableVerityResponder {
9676                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9677                                tx_id: header.tx_id,
9678                            },
9679                        })
9680                    }
9681                    _ if header.tx_id == 0
9682                        && header
9683                            .dynamic_flags()
9684                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9685                    {
9686                        Ok(FileRequest::_UnknownMethod {
9687                            ordinal: header.ordinal,
9688                            control_handle: FileControlHandle { inner: this.inner.clone() },
9689                            method_type: fidl::MethodType::OneWay,
9690                        })
9691                    }
9692                    _ if header
9693                        .dynamic_flags()
9694                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9695                    {
9696                        this.inner.send_framework_err(
9697                            fidl::encoding::FrameworkErr::UnknownMethod,
9698                            header.tx_id,
9699                            header.ordinal,
9700                            header.dynamic_flags(),
9701                            (bytes, handles),
9702                        )?;
9703                        Ok(FileRequest::_UnknownMethod {
9704                            ordinal: header.ordinal,
9705                            control_handle: FileControlHandle { inner: this.inner.clone() },
9706                            method_type: fidl::MethodType::TwoWay,
9707                        })
9708                    }
9709                    _ => Err(fidl::Error::UnknownOrdinal {
9710                        ordinal: header.ordinal,
9711                        protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9712                    }),
9713                }))
9714            },
9715        )
9716    }
9717}
9718
9719/// A [`Node`] which contains a sequence of bytes of definite length.
9720///
9721/// NOTE: cloned connections do not share their seek offset with their source
9722/// connection.
9723#[derive(Debug)]
9724pub enum FileRequest {
9725    /// Acquires an advisory lock on the underlying file.
9726    ///
9727    /// The lock lasts until either this connection is closed or
9728    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
9729    /// explicitly.
9730    ///
9731    /// Advisory locks are purely advisory. They do not prevent actual read or
9732    /// write operations from occurring on the file, either through this
9733    /// connection or through other connections.
9734    ///
9735    /// This method requires the following rights:
9736    ///
9737    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
9738    /// * [`Rights.WRITE_BYTES`] if `request.type` is
9739    ///   [`AdvisoryLockType.WRITE`].
9740    ///
9741    /// # Errors
9742    ///
9743    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
9744    ///   example, another connection might hold a conflicting lock type.
9745    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
9746    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
9747    ///   to acquire the given type of lock.
9748    AdvisoryLock {
9749        request: AdvisoryLockRequest,
9750        responder: FileAdvisoryLockResponder,
9751    },
9752    /// Creates a link to this this object with name `dst` in the directory represented by
9753    /// `dst_parent_token`.
9754    ///
9755    /// `dst` must be a resolved object name. Including "/" in the string will return
9756    /// `ZX_ERR_INVALID_ARGS`.
9757    ///
9758    /// This method requires the maximal set of rights supported by the filesystem for this object.
9759    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
9760    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
9761    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
9762    /// `ZX_ERR_ACCESS_DENIED`.
9763    ///
9764    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
9765    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
9766    ///
9767    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
9768    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
9769    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
9770    ///
9771    /// This method does not have the same atomicity properties has the `Directory::Link` method,
9772    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
9773    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
9774    LinkInto {
9775        dst_parent_token: fidl::Event,
9776        dst: String,
9777        responder: FileLinkIntoResponder,
9778    },
9779    Clone {
9780        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
9781        control_handle: FileControlHandle,
9782    },
9783    /// Terminates the connection.
9784    ///
9785    /// After calling `Close`, the client must not send any other requests.
9786    ///
9787    /// Servers, after sending the status response, should close the connection
9788    /// regardless of status and without sending an epitaph.
9789    ///
9790    /// Closing the client end of the channel should be semantically equivalent
9791    /// to calling `Close` without knowing when the close has completed or its
9792    /// status.
9793    Close {
9794        responder: FileCloseResponder,
9795    },
9796    Query {
9797        responder: FileQueryResponder,
9798    },
9799    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
9800    DeprecatedClone {
9801        flags: OpenFlags,
9802        object: fidl::endpoints::ServerEnd<NodeMarker>,
9803        control_handle: FileControlHandle,
9804    },
9805    /// DEPRECATED - Use `Node.GetAttributes` instead.
9806    DeprecatedGetAttr {
9807        responder: FileDeprecatedGetAttrResponder,
9808    },
9809    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
9810    DeprecatedSetAttr {
9811        flags: NodeAttributeFlags,
9812        attributes: NodeAttributes,
9813        responder: FileDeprecatedSetAttrResponder,
9814    },
9815    /// [DEPRECATED - Use new GetFlags method instead.]
9816    DeprecatedGetFlags {
9817        responder: FileDeprecatedGetFlagsResponder,
9818    },
9819    /// [DEPRECATED - Use new SetFlags method instead.]
9820    DeprecatedSetFlags {
9821        flags: OpenFlags,
9822        responder: FileDeprecatedSetFlagsResponder,
9823    },
9824    /// Queries the flags that apply to this node after it has been opened/created. This method does
9825    /// not require any rights.
9826    ///
9827    /// Note that the final set of flags that apply to the connection may differ from those
9828    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
9829    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
9830    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
9831    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
9832    GetFlags {
9833        responder: FileGetFlagsResponder,
9834    },
9835    /// Sets the flags that apply to this node after it has been opened. This method does not
9836    /// require any rights.
9837    ///
9838    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
9839    /// clear append mode.
9840    ///
9841    /// Errors:
9842    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
9843    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
9844    SetFlags {
9845        flags: Flags,
9846        responder: FileSetFlagsResponder,
9847    },
9848    /// Query the filesystem for filesystem-specific information.
9849    QueryFilesystem {
9850        responder: FileQueryFilesystemResponder,
9851    },
9852    /// Acquires information about the node.
9853    ///
9854    /// The attributes of a node should be stable, independent of the
9855    /// specific protocol used to access it.
9856    ///
9857    /// If a particular attribute is not applicable or not supported,
9858    /// filesystems should leave the corresponding field absent.
9859    ///
9860    /// + `query` a bit-mask specifying which attributes to fetch. The server
9861    ///   should not return more than necessary.
9862    /// - `attributes` the returned attributes.
9863    ///
9864    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9865    GetAttributes {
9866        query: NodeAttributesQuery,
9867        responder: FileGetAttributesResponder,
9868    },
9869    /// Updates information about the node.
9870    ///
9871    /// + `attributes` the presence of a table field in `attributes` indicates
9872    /// the intent to update the corresponding attribute.
9873    ///
9874    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
9875    ///
9876    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
9877    UpdateAttributes {
9878        payload: MutableNodeAttributes,
9879        responder: FileUpdateAttributesResponder,
9880    },
9881    /// Synchronizes updates to the node to the underlying media, if it exists.
9882    ///
9883    /// This method will return when the filesystem server has flushed the
9884    /// relevant updates to the underlying media, but does not guarantee the
9885    /// underlying media has persisted the information, nor that any information
9886    /// is committed to hardware. Clients may use `Sync` to ensure ordering
9887    /// between operations.
9888    ///
9889    /// This method does not require any rights.
9890    Sync {
9891        responder: FileSyncResponder,
9892    },
9893    /// Creates an iterator over all the extended attribute names associated
9894    /// with this node. If an error occurs it is returned as an epitaph on the
9895    /// iterator request channel, and then the channel is closed.
9896    ///
9897    /// GetExtendedAttributes can be used with any of these names to retrieve
9898    /// the associated value.
9899    ///
9900    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9901    ListExtendedAttributes {
9902        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
9903        control_handle: FileControlHandle,
9904    },
9905    /// Get the value associated with the given attribute `name` for this node.
9906    ///
9907    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
9908    /// particular structure is imposed on them.
9909    ///
9910    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9911    GetExtendedAttribute {
9912        name: Vec<u8>,
9913        responder: FileGetExtendedAttributeResponder,
9914    },
9915    /// Set the value for the given attribute `name` to `value` for this node.
9916    ///
9917    /// The attribute name may exist, in which case the attribute is updated.
9918    /// If the attribute doesn't exist, it is created. The name should have no
9919    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
9920    ///
9921    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
9922    SetExtendedAttribute {
9923        name: Vec<u8>,
9924        value: ExtendedAttributeValue,
9925        mode: SetExtendedAttributeMode,
9926        responder: FileSetExtendedAttributeResponder,
9927    },
9928    /// Remove the specified extended attribute.
9929    ///
9930    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
9931    ///
9932    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
9933    RemoveExtendedAttribute {
9934        name: Vec<u8>,
9935        responder: FileRemoveExtendedAttributeResponder,
9936    },
9937    /// Reads up to 'count' bytes at the seek offset.
9938    /// The seek offset is moved forward by the number of bytes read.
9939    ///
9940    /// ## Invariants
9941    ///
9942    /// * The returned `data.length` will never be greater than `count`.
9943    /// * If `data.length` is less than `count`, it means that the seek offset
9944    ///   has reached the end of file as part of this operation.
9945    /// * If `data.length` is zero while `count` is not, it means that the
9946    ///   seek offset is already at or beyond the end of file, and no data could
9947    ///   be read.
9948    /// * If `count` is zero, the server should perform all the checks ensuring
9949    ///   read access without actually read anything, and return an empty
9950    ///   `data` vector.
9951    ///
9952    /// This method requires the [`Rights.READ_BYTES`] right.
9953    ///
9954    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
9955    Read {
9956        count: u64,
9957        responder: FileReadResponder,
9958    },
9959    /// Writes data at the seek offset.
9960    /// The seek offset is moved forward by the number of bytes written.
9961    /// If the file is in append mode, the seek offset is first set to the end
9962    /// of the file, followed by the write, in one atomic step.
9963    ///
9964    /// The file size may grow if the seek offset plus `data.length` is beyond
9965    /// the current end of file.
9966    ///
9967    /// + request `data` the byte buffer to write to the file.
9968    /// - response `actual_count` the number of bytes written.
9969    ///
9970    /// ## Invariants
9971    ///
9972    /// * The returned `actual_count` will never be greater than `data.length`.
9973    /// * If the server is unable to write all the data due to e.g. not enough
9974    ///   space, `actual_count` may be less than `data.length`.  If no bytes
9975    ///   could be written, an error is returned.
9976    /// * If `data.length` is zero, the server should perform all the checks
9977    ///   ensuring write access without mutating the file and return a
9978    ///   successful write of zero bytes.  The seek offset is still updated if
9979    ///   in append mode.
9980    ///
9981    /// This method requires the [`Rights.WRITE_BYTES`] right.
9982    Write {
9983        data: Vec<u8>,
9984        responder: FileWriteResponder,
9985    },
9986    Describe {
9987        responder: FileDescribeResponder,
9988    },
9989    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
9990    /// will occur. The seek offset is specific to each file connection.
9991    ///
9992    /// + request `origin` the reference point where `offset` will be based on.
9993    /// + request `offset` the number of bytes to seek.
9994    /// - response `offset_from_start` the adjusted seek offset, from the start
9995    ///   of the file.
9996    ///
9997    /// This method does not require any rights.
9998    Seek {
9999        origin: SeekOrigin,
10000        offset: i64,
10001        responder: FileSeekResponder,
10002    },
10003    /// Reads up to 'count' bytes at the provided offset.
10004    /// Does not affect the seek offset.
10005    ///
10006    /// ## Invariants
10007    ///
10008    /// * The returned `data.length` will never be greater than `count`.
10009    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
10010    ///   the end of file as part of this operation.
10011    /// * If `data.length` is zero while `count` is not, it means that `offset`
10012    ///   is at or past the end of file, and no data can be read.
10013    /// * If `count` is zero, the server should perform all the checks ensuring
10014    ///   read access without actually reading anything, and return an empty
10015    ///   `data` vector.
10016    ///
10017    /// This method requires the [`Rights.READ_BYTES`] right.
10018    ///
10019    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
10020    ReadAt {
10021        count: u64,
10022        offset: u64,
10023        responder: FileReadAtResponder,
10024    },
10025    /// Writes data at the provided offset.
10026    /// Does not affect the seek offset.
10027    ///
10028    /// The file size may grow if `offset` plus `data.length` is past the
10029    /// current end of file.
10030    ///
10031    /// + request `data` the byte buffer to write to the file.
10032    /// + request `offset` the offset from start of the file to begin writing.
10033    /// - response `actual_count` the number of bytes written.
10034    ///
10035    /// ## Invariants
10036    ///
10037    /// * The returned `actual_count` will never be greater than `data.length`.
10038    /// * If the server is unable to write all the data due to e.g. not enough
10039    ///   space, `actual_count` may be less than `data.length`.  If no bytes
10040    ///   could be written, an error is returned.
10041    /// * If `data.length` is zero, the server should perform all the checks
10042    ///   ensuring write access without mutating the file, and will return a
10043    ///   successful write of zero bytes.
10044    ///
10045    /// This method requires the [`Rights.WRITE_BYTES`] right.
10046    WriteAt {
10047        data: Vec<u8>,
10048        offset: u64,
10049        responder: FileWriteAtResponder,
10050    },
10051    /// Shrinks or grows the file size to 'length' bytes.
10052    ///
10053    /// If file size is reduced by this operation, the extra trailing data'
10054    /// is discarded.
10055    /// If file size is increased by this operation, the extended area appears
10056    /// as if it was zeroed.
10057    ///
10058    /// This method requires the [`Rights.WRITE_BYTES`] right.
10059    Resize {
10060        length: u64,
10061        responder: FileResizeResponder,
10062    },
10063    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
10064    /// with the requested access rights.
10065    ///
10066    /// Implementations are not required to implement files backed by VMOs so
10067    /// this request may fail. Additionally, implementations may only support
10068    /// a certain subset of the flags. Clients should be prepared with fallback
10069    /// behavior if this request fails.
10070    ///
10071    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
10072    /// implementation is free to choose the semantics of the returned VMO.
10073    ///
10074    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
10075    /// - response `vmo` the requested [`zx.Handle:VMO`].
10076    /// * error a [`zx.Status`] value indicating the failure.
10077    ///
10078    /// This method requires the following rights:
10079    ///
10080    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
10081    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
10082    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
10083    GetBackingMemory {
10084        flags: VmoFlags,
10085        responder: FileGetBackingMemoryResponder,
10086    },
10087    /// Pre-allocate on-disk space for this file.
10088    Allocate {
10089        offset: u64,
10090        length: u64,
10091        mode: AllocateMode,
10092        responder: FileAllocateResponder,
10093    },
10094    /// Enables verification for the file (permanently) which involves computing a merkle tree for
10095    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
10096    /// captured. Future reads will be verified against the computed merkle tree and writes will be
10097    /// rejected. This method can take some time to complete as it depends on the size of the file.
10098    /// This method can be aborted by closing the connection that this method was issued on.
10099    ///
10100    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
10101    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
10102    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
10103    /// Also returns any error that might arise from reading the file, or from flushing the file,
10104    /// such as `ZX_ERR_IO`.
10105    EnableVerity {
10106        options: VerificationOptions,
10107        responder: FileEnableVerityResponder,
10108    },
10109    /// An interaction was received which does not match any known method.
10110    #[non_exhaustive]
10111    _UnknownMethod {
10112        /// Ordinal of the method that was called.
10113        ordinal: u64,
10114        control_handle: FileControlHandle,
10115        method_type: fidl::MethodType,
10116    },
10117}
10118
10119impl FileRequest {
10120    #[allow(irrefutable_let_patterns)]
10121    pub fn into_advisory_lock(self) -> Option<(AdvisoryLockRequest, FileAdvisoryLockResponder)> {
10122        if let FileRequest::AdvisoryLock { request, responder } = self {
10123            Some((request, responder))
10124        } else {
10125            None
10126        }
10127    }
10128
10129    #[allow(irrefutable_let_patterns)]
10130    pub fn into_link_into(self) -> Option<(fidl::Event, String, FileLinkIntoResponder)> {
10131        if let FileRequest::LinkInto { dst_parent_token, dst, responder } = self {
10132            Some((dst_parent_token, dst, responder))
10133        } else {
10134            None
10135        }
10136    }
10137
10138    #[allow(irrefutable_let_patterns)]
10139    pub fn into_clone(
10140        self,
10141    ) -> Option<(
10142        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10143        FileControlHandle,
10144    )> {
10145        if let FileRequest::Clone { request, control_handle } = self {
10146            Some((request, control_handle))
10147        } else {
10148            None
10149        }
10150    }
10151
10152    #[allow(irrefutable_let_patterns)]
10153    pub fn into_close(self) -> Option<(FileCloseResponder)> {
10154        if let FileRequest::Close { responder } = self { Some((responder)) } else { None }
10155    }
10156
10157    #[allow(irrefutable_let_patterns)]
10158    pub fn into_query(self) -> Option<(FileQueryResponder)> {
10159        if let FileRequest::Query { responder } = self { Some((responder)) } else { None }
10160    }
10161
10162    #[allow(irrefutable_let_patterns)]
10163    pub fn into_deprecated_clone(
10164        self,
10165    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, FileControlHandle)> {
10166        if let FileRequest::DeprecatedClone { flags, object, control_handle } = self {
10167            Some((flags, object, control_handle))
10168        } else {
10169            None
10170        }
10171    }
10172
10173    #[allow(irrefutable_let_patterns)]
10174    pub fn into_deprecated_get_attr(self) -> Option<(FileDeprecatedGetAttrResponder)> {
10175        if let FileRequest::DeprecatedGetAttr { responder } = self {
10176            Some((responder))
10177        } else {
10178            None
10179        }
10180    }
10181
10182    #[allow(irrefutable_let_patterns)]
10183    pub fn into_deprecated_set_attr(
10184        self,
10185    ) -> Option<(NodeAttributeFlags, NodeAttributes, FileDeprecatedSetAttrResponder)> {
10186        if let FileRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
10187            Some((flags, attributes, responder))
10188        } else {
10189            None
10190        }
10191    }
10192
10193    #[allow(irrefutable_let_patterns)]
10194    pub fn into_deprecated_get_flags(self) -> Option<(FileDeprecatedGetFlagsResponder)> {
10195        if let FileRequest::DeprecatedGetFlags { responder } = self {
10196            Some((responder))
10197        } else {
10198            None
10199        }
10200    }
10201
10202    #[allow(irrefutable_let_patterns)]
10203    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, FileDeprecatedSetFlagsResponder)> {
10204        if let FileRequest::DeprecatedSetFlags { flags, responder } = self {
10205            Some((flags, responder))
10206        } else {
10207            None
10208        }
10209    }
10210
10211    #[allow(irrefutable_let_patterns)]
10212    pub fn into_get_flags(self) -> Option<(FileGetFlagsResponder)> {
10213        if let FileRequest::GetFlags { responder } = self { Some((responder)) } else { None }
10214    }
10215
10216    #[allow(irrefutable_let_patterns)]
10217    pub fn into_set_flags(self) -> Option<(Flags, FileSetFlagsResponder)> {
10218        if let FileRequest::SetFlags { flags, responder } = self {
10219            Some((flags, responder))
10220        } else {
10221            None
10222        }
10223    }
10224
10225    #[allow(irrefutable_let_patterns)]
10226    pub fn into_query_filesystem(self) -> Option<(FileQueryFilesystemResponder)> {
10227        if let FileRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
10228    }
10229
10230    #[allow(irrefutable_let_patterns)]
10231    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, FileGetAttributesResponder)> {
10232        if let FileRequest::GetAttributes { query, responder } = self {
10233            Some((query, responder))
10234        } else {
10235            None
10236        }
10237    }
10238
10239    #[allow(irrefutable_let_patterns)]
10240    pub fn into_update_attributes(
10241        self,
10242    ) -> Option<(MutableNodeAttributes, FileUpdateAttributesResponder)> {
10243        if let FileRequest::UpdateAttributes { payload, responder } = self {
10244            Some((payload, responder))
10245        } else {
10246            None
10247        }
10248    }
10249
10250    #[allow(irrefutable_let_patterns)]
10251    pub fn into_sync(self) -> Option<(FileSyncResponder)> {
10252        if let FileRequest::Sync { responder } = self { Some((responder)) } else { None }
10253    }
10254
10255    #[allow(irrefutable_let_patterns)]
10256    pub fn into_list_extended_attributes(
10257        self,
10258    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, FileControlHandle)>
10259    {
10260        if let FileRequest::ListExtendedAttributes { iterator, control_handle } = self {
10261            Some((iterator, control_handle))
10262        } else {
10263            None
10264        }
10265    }
10266
10267    #[allow(irrefutable_let_patterns)]
10268    pub fn into_get_extended_attribute(
10269        self,
10270    ) -> Option<(Vec<u8>, FileGetExtendedAttributeResponder)> {
10271        if let FileRequest::GetExtendedAttribute { name, responder } = self {
10272            Some((name, responder))
10273        } else {
10274            None
10275        }
10276    }
10277
10278    #[allow(irrefutable_let_patterns)]
10279    pub fn into_set_extended_attribute(
10280        self,
10281    ) -> Option<(
10282        Vec<u8>,
10283        ExtendedAttributeValue,
10284        SetExtendedAttributeMode,
10285        FileSetExtendedAttributeResponder,
10286    )> {
10287        if let FileRequest::SetExtendedAttribute { name, value, mode, responder } = self {
10288            Some((name, value, mode, responder))
10289        } else {
10290            None
10291        }
10292    }
10293
10294    #[allow(irrefutable_let_patterns)]
10295    pub fn into_remove_extended_attribute(
10296        self,
10297    ) -> Option<(Vec<u8>, FileRemoveExtendedAttributeResponder)> {
10298        if let FileRequest::RemoveExtendedAttribute { name, responder } = self {
10299            Some((name, responder))
10300        } else {
10301            None
10302        }
10303    }
10304
10305    #[allow(irrefutable_let_patterns)]
10306    pub fn into_read(self) -> Option<(u64, FileReadResponder)> {
10307        if let FileRequest::Read { count, responder } = self {
10308            Some((count, responder))
10309        } else {
10310            None
10311        }
10312    }
10313
10314    #[allow(irrefutable_let_patterns)]
10315    pub fn into_write(self) -> Option<(Vec<u8>, FileWriteResponder)> {
10316        if let FileRequest::Write { data, responder } = self {
10317            Some((data, responder))
10318        } else {
10319            None
10320        }
10321    }
10322
10323    #[allow(irrefutable_let_patterns)]
10324    pub fn into_describe(self) -> Option<(FileDescribeResponder)> {
10325        if let FileRequest::Describe { responder } = self { Some((responder)) } else { None }
10326    }
10327
10328    #[allow(irrefutable_let_patterns)]
10329    pub fn into_seek(self) -> Option<(SeekOrigin, i64, FileSeekResponder)> {
10330        if let FileRequest::Seek { origin, offset, responder } = self {
10331            Some((origin, offset, responder))
10332        } else {
10333            None
10334        }
10335    }
10336
10337    #[allow(irrefutable_let_patterns)]
10338    pub fn into_read_at(self) -> Option<(u64, u64, FileReadAtResponder)> {
10339        if let FileRequest::ReadAt { count, offset, responder } = self {
10340            Some((count, offset, responder))
10341        } else {
10342            None
10343        }
10344    }
10345
10346    #[allow(irrefutable_let_patterns)]
10347    pub fn into_write_at(self) -> Option<(Vec<u8>, u64, FileWriteAtResponder)> {
10348        if let FileRequest::WriteAt { data, offset, responder } = self {
10349            Some((data, offset, responder))
10350        } else {
10351            None
10352        }
10353    }
10354
10355    #[allow(irrefutable_let_patterns)]
10356    pub fn into_resize(self) -> Option<(u64, FileResizeResponder)> {
10357        if let FileRequest::Resize { length, responder } = self {
10358            Some((length, responder))
10359        } else {
10360            None
10361        }
10362    }
10363
10364    #[allow(irrefutable_let_patterns)]
10365    pub fn into_get_backing_memory(self) -> Option<(VmoFlags, FileGetBackingMemoryResponder)> {
10366        if let FileRequest::GetBackingMemory { flags, responder } = self {
10367            Some((flags, responder))
10368        } else {
10369            None
10370        }
10371    }
10372
10373    #[allow(irrefutable_let_patterns)]
10374    pub fn into_allocate(self) -> Option<(u64, u64, AllocateMode, FileAllocateResponder)> {
10375        if let FileRequest::Allocate { offset, length, mode, responder } = self {
10376            Some((offset, length, mode, responder))
10377        } else {
10378            None
10379        }
10380    }
10381
10382    #[allow(irrefutable_let_patterns)]
10383    pub fn into_enable_verity(self) -> Option<(VerificationOptions, FileEnableVerityResponder)> {
10384        if let FileRequest::EnableVerity { options, responder } = self {
10385            Some((options, responder))
10386        } else {
10387            None
10388        }
10389    }
10390
10391    /// Name of the method defined in FIDL
10392    pub fn method_name(&self) -> &'static str {
10393        match *self {
10394            FileRequest::AdvisoryLock { .. } => "advisory_lock",
10395            FileRequest::LinkInto { .. } => "link_into",
10396            FileRequest::Clone { .. } => "clone",
10397            FileRequest::Close { .. } => "close",
10398            FileRequest::Query { .. } => "query",
10399            FileRequest::DeprecatedClone { .. } => "deprecated_clone",
10400            FileRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
10401            FileRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
10402            FileRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
10403            FileRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
10404            FileRequest::GetFlags { .. } => "get_flags",
10405            FileRequest::SetFlags { .. } => "set_flags",
10406            FileRequest::QueryFilesystem { .. } => "query_filesystem",
10407            FileRequest::GetAttributes { .. } => "get_attributes",
10408            FileRequest::UpdateAttributes { .. } => "update_attributes",
10409            FileRequest::Sync { .. } => "sync",
10410            FileRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
10411            FileRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
10412            FileRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
10413            FileRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
10414            FileRequest::Read { .. } => "read",
10415            FileRequest::Write { .. } => "write",
10416            FileRequest::Describe { .. } => "describe",
10417            FileRequest::Seek { .. } => "seek",
10418            FileRequest::ReadAt { .. } => "read_at",
10419            FileRequest::WriteAt { .. } => "write_at",
10420            FileRequest::Resize { .. } => "resize",
10421            FileRequest::GetBackingMemory { .. } => "get_backing_memory",
10422            FileRequest::Allocate { .. } => "allocate",
10423            FileRequest::EnableVerity { .. } => "enable_verity",
10424            FileRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10425                "unknown one-way method"
10426            }
10427            FileRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10428                "unknown two-way method"
10429            }
10430        }
10431    }
10432}
10433
10434#[derive(Debug, Clone)]
10435pub struct FileControlHandle {
10436    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10437}
10438
10439impl fidl::endpoints::ControlHandle for FileControlHandle {
10440    fn shutdown(&self) {
10441        self.inner.shutdown()
10442    }
10443    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10444        self.inner.shutdown_with_epitaph(status)
10445    }
10446
10447    fn is_closed(&self) -> bool {
10448        self.inner.channel().is_closed()
10449    }
10450    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10451        self.inner.channel().on_closed()
10452    }
10453
10454    #[cfg(target_os = "fuchsia")]
10455    fn signal_peer(
10456        &self,
10457        clear_mask: zx::Signals,
10458        set_mask: zx::Signals,
10459    ) -> Result<(), zx_status::Status> {
10460        use fidl::Peered;
10461        self.inner.channel().signal_peer(clear_mask, set_mask)
10462    }
10463}
10464
10465impl FileControlHandle {
10466    pub fn send_on_open_(
10467        &self,
10468        mut s: i32,
10469        mut info: Option<NodeInfoDeprecated>,
10470    ) -> Result<(), fidl::Error> {
10471        self.inner.send::<NodeOnOpenRequest>(
10472            (s, info.as_mut()),
10473            0,
10474            0x7fc7bbb1dbfd1972,
10475            fidl::encoding::DynamicFlags::FLEXIBLE,
10476        )
10477    }
10478
10479    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
10480        self.inner.send::<Representation>(
10481            &mut payload,
10482            0,
10483            0x5cb40567d80a510c,
10484            fidl::encoding::DynamicFlags::empty(),
10485        )
10486    }
10487}
10488
10489#[must_use = "FIDL methods require a response to be sent"]
10490#[derive(Debug)]
10491pub struct FileAdvisoryLockResponder {
10492    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10493    tx_id: u32,
10494}
10495
10496/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10497/// if the responder is dropped without sending a response, so that the client
10498/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10499impl std::ops::Drop for FileAdvisoryLockResponder {
10500    fn drop(&mut self) {
10501        self.control_handle.shutdown();
10502        // Safety: drops once, never accessed again
10503        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10504    }
10505}
10506
10507impl fidl::endpoints::Responder for FileAdvisoryLockResponder {
10508    type ControlHandle = FileControlHandle;
10509
10510    fn control_handle(&self) -> &FileControlHandle {
10511        &self.control_handle
10512    }
10513
10514    fn drop_without_shutdown(mut self) {
10515        // Safety: drops once, never accessed again due to mem::forget
10516        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10517        // Prevent Drop from running (which would shut down the channel)
10518        std::mem::forget(self);
10519    }
10520}
10521
10522impl FileAdvisoryLockResponder {
10523    /// Sends a response to the FIDL transaction.
10524    ///
10525    /// Sets the channel to shutdown if an error occurs.
10526    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10527        let _result = self.send_raw(result);
10528        if _result.is_err() {
10529            self.control_handle.shutdown();
10530        }
10531        self.drop_without_shutdown();
10532        _result
10533    }
10534
10535    /// Similar to "send" but does not shutdown the channel if an error occurs.
10536    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10537        let _result = self.send_raw(result);
10538        self.drop_without_shutdown();
10539        _result
10540    }
10541
10542    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10543        self.control_handle
10544            .inner
10545            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10546                result,
10547                self.tx_id,
10548                0x6ee9c0ad53ec87aa,
10549                fidl::encoding::DynamicFlags::empty(),
10550            )
10551    }
10552}
10553
10554#[must_use = "FIDL methods require a response to be sent"]
10555#[derive(Debug)]
10556pub struct FileLinkIntoResponder {
10557    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10558    tx_id: u32,
10559}
10560
10561/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10562/// if the responder is dropped without sending a response, so that the client
10563/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10564impl std::ops::Drop for FileLinkIntoResponder {
10565    fn drop(&mut self) {
10566        self.control_handle.shutdown();
10567        // Safety: drops once, never accessed again
10568        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10569    }
10570}
10571
10572impl fidl::endpoints::Responder for FileLinkIntoResponder {
10573    type ControlHandle = FileControlHandle;
10574
10575    fn control_handle(&self) -> &FileControlHandle {
10576        &self.control_handle
10577    }
10578
10579    fn drop_without_shutdown(mut self) {
10580        // Safety: drops once, never accessed again due to mem::forget
10581        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10582        // Prevent Drop from running (which would shut down the channel)
10583        std::mem::forget(self);
10584    }
10585}
10586
10587impl FileLinkIntoResponder {
10588    /// Sends a response to the FIDL transaction.
10589    ///
10590    /// Sets the channel to shutdown if an error occurs.
10591    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10592        let _result = self.send_raw(result);
10593        if _result.is_err() {
10594            self.control_handle.shutdown();
10595        }
10596        self.drop_without_shutdown();
10597        _result
10598    }
10599
10600    /// Similar to "send" but does not shutdown the channel if an error occurs.
10601    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10602        let _result = self.send_raw(result);
10603        self.drop_without_shutdown();
10604        _result
10605    }
10606
10607    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10608        self.control_handle
10609            .inner
10610            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10611                result,
10612                self.tx_id,
10613                0x54f3949246a03e74,
10614                fidl::encoding::DynamicFlags::empty(),
10615            )
10616    }
10617}
10618
10619#[must_use = "FIDL methods require a response to be sent"]
10620#[derive(Debug)]
10621pub struct FileCloseResponder {
10622    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10623    tx_id: u32,
10624}
10625
10626/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10627/// if the responder is dropped without sending a response, so that the client
10628/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10629impl std::ops::Drop for FileCloseResponder {
10630    fn drop(&mut self) {
10631        self.control_handle.shutdown();
10632        // Safety: drops once, never accessed again
10633        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10634    }
10635}
10636
10637impl fidl::endpoints::Responder for FileCloseResponder {
10638    type ControlHandle = FileControlHandle;
10639
10640    fn control_handle(&self) -> &FileControlHandle {
10641        &self.control_handle
10642    }
10643
10644    fn drop_without_shutdown(mut self) {
10645        // Safety: drops once, never accessed again due to mem::forget
10646        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10647        // Prevent Drop from running (which would shut down the channel)
10648        std::mem::forget(self);
10649    }
10650}
10651
10652impl FileCloseResponder {
10653    /// Sends a response to the FIDL transaction.
10654    ///
10655    /// Sets the channel to shutdown if an error occurs.
10656    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10657        let _result = self.send_raw(result);
10658        if _result.is_err() {
10659            self.control_handle.shutdown();
10660        }
10661        self.drop_without_shutdown();
10662        _result
10663    }
10664
10665    /// Similar to "send" but does not shutdown the channel if an error occurs.
10666    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10667        let _result = self.send_raw(result);
10668        self.drop_without_shutdown();
10669        _result
10670    }
10671
10672    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10673        self.control_handle
10674            .inner
10675            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10676                result,
10677                self.tx_id,
10678                0x5ac5d459ad7f657e,
10679                fidl::encoding::DynamicFlags::empty(),
10680            )
10681    }
10682}
10683
10684#[must_use = "FIDL methods require a response to be sent"]
10685#[derive(Debug)]
10686pub struct FileQueryResponder {
10687    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10688    tx_id: u32,
10689}
10690
10691/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10692/// if the responder is dropped without sending a response, so that the client
10693/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10694impl std::ops::Drop for FileQueryResponder {
10695    fn drop(&mut self) {
10696        self.control_handle.shutdown();
10697        // Safety: drops once, never accessed again
10698        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10699    }
10700}
10701
10702impl fidl::endpoints::Responder for FileQueryResponder {
10703    type ControlHandle = FileControlHandle;
10704
10705    fn control_handle(&self) -> &FileControlHandle {
10706        &self.control_handle
10707    }
10708
10709    fn drop_without_shutdown(mut self) {
10710        // Safety: drops once, never accessed again due to mem::forget
10711        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10712        // Prevent Drop from running (which would shut down the channel)
10713        std::mem::forget(self);
10714    }
10715}
10716
10717impl FileQueryResponder {
10718    /// Sends a response to the FIDL transaction.
10719    ///
10720    /// Sets the channel to shutdown if an error occurs.
10721    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10722        let _result = self.send_raw(protocol);
10723        if _result.is_err() {
10724            self.control_handle.shutdown();
10725        }
10726        self.drop_without_shutdown();
10727        _result
10728    }
10729
10730    /// Similar to "send" but does not shutdown the channel if an error occurs.
10731    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10732        let _result = self.send_raw(protocol);
10733        self.drop_without_shutdown();
10734        _result
10735    }
10736
10737    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10738        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
10739            (protocol,),
10740            self.tx_id,
10741            0x2658edee9decfc06,
10742            fidl::encoding::DynamicFlags::empty(),
10743        )
10744    }
10745}
10746
10747#[must_use = "FIDL methods require a response to be sent"]
10748#[derive(Debug)]
10749pub struct FileDeprecatedGetAttrResponder {
10750    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10751    tx_id: u32,
10752}
10753
10754/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10755/// if the responder is dropped without sending a response, so that the client
10756/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10757impl std::ops::Drop for FileDeprecatedGetAttrResponder {
10758    fn drop(&mut self) {
10759        self.control_handle.shutdown();
10760        // Safety: drops once, never accessed again
10761        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10762    }
10763}
10764
10765impl fidl::endpoints::Responder for FileDeprecatedGetAttrResponder {
10766    type ControlHandle = FileControlHandle;
10767
10768    fn control_handle(&self) -> &FileControlHandle {
10769        &self.control_handle
10770    }
10771
10772    fn drop_without_shutdown(mut self) {
10773        // Safety: drops once, never accessed again due to mem::forget
10774        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10775        // Prevent Drop from running (which would shut down the channel)
10776        std::mem::forget(self);
10777    }
10778}
10779
10780impl FileDeprecatedGetAttrResponder {
10781    /// Sends a response to the FIDL transaction.
10782    ///
10783    /// Sets the channel to shutdown if an error occurs.
10784    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
10785        let _result = self.send_raw(s, attributes);
10786        if _result.is_err() {
10787            self.control_handle.shutdown();
10788        }
10789        self.drop_without_shutdown();
10790        _result
10791    }
10792
10793    /// Similar to "send" but does not shutdown the channel if an error occurs.
10794    pub fn send_no_shutdown_on_err(
10795        self,
10796        mut s: i32,
10797        mut attributes: &NodeAttributes,
10798    ) -> Result<(), fidl::Error> {
10799        let _result = self.send_raw(s, attributes);
10800        self.drop_without_shutdown();
10801        _result
10802    }
10803
10804    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
10805        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
10806            (s, attributes),
10807            self.tx_id,
10808            0x78985e216314dafd,
10809            fidl::encoding::DynamicFlags::empty(),
10810        )
10811    }
10812}
10813
10814#[must_use = "FIDL methods require a response to be sent"]
10815#[derive(Debug)]
10816pub struct FileDeprecatedSetAttrResponder {
10817    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10818    tx_id: u32,
10819}
10820
10821/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10822/// if the responder is dropped without sending a response, so that the client
10823/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10824impl std::ops::Drop for FileDeprecatedSetAttrResponder {
10825    fn drop(&mut self) {
10826        self.control_handle.shutdown();
10827        // Safety: drops once, never accessed again
10828        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10829    }
10830}
10831
10832impl fidl::endpoints::Responder for FileDeprecatedSetAttrResponder {
10833    type ControlHandle = FileControlHandle;
10834
10835    fn control_handle(&self) -> &FileControlHandle {
10836        &self.control_handle
10837    }
10838
10839    fn drop_without_shutdown(mut self) {
10840        // Safety: drops once, never accessed again due to mem::forget
10841        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10842        // Prevent Drop from running (which would shut down the channel)
10843        std::mem::forget(self);
10844    }
10845}
10846
10847impl FileDeprecatedSetAttrResponder {
10848    /// Sends a response to the FIDL transaction.
10849    ///
10850    /// Sets the channel to shutdown if an error occurs.
10851    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
10852        let _result = self.send_raw(s);
10853        if _result.is_err() {
10854            self.control_handle.shutdown();
10855        }
10856        self.drop_without_shutdown();
10857        _result
10858    }
10859
10860    /// Similar to "send" but does not shutdown the channel if an error occurs.
10861    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
10862        let _result = self.send_raw(s);
10863        self.drop_without_shutdown();
10864        _result
10865    }
10866
10867    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
10868        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
10869            (s,),
10870            self.tx_id,
10871            0x4186c0f40d938f46,
10872            fidl::encoding::DynamicFlags::empty(),
10873        )
10874    }
10875}
10876
10877#[must_use = "FIDL methods require a response to be sent"]
10878#[derive(Debug)]
10879pub struct FileDeprecatedGetFlagsResponder {
10880    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10881    tx_id: u32,
10882}
10883
10884/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10885/// if the responder is dropped without sending a response, so that the client
10886/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10887impl std::ops::Drop for FileDeprecatedGetFlagsResponder {
10888    fn drop(&mut self) {
10889        self.control_handle.shutdown();
10890        // Safety: drops once, never accessed again
10891        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10892    }
10893}
10894
10895impl fidl::endpoints::Responder for FileDeprecatedGetFlagsResponder {
10896    type ControlHandle = FileControlHandle;
10897
10898    fn control_handle(&self) -> &FileControlHandle {
10899        &self.control_handle
10900    }
10901
10902    fn drop_without_shutdown(mut self) {
10903        // Safety: drops once, never accessed again due to mem::forget
10904        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10905        // Prevent Drop from running (which would shut down the channel)
10906        std::mem::forget(self);
10907    }
10908}
10909
10910impl FileDeprecatedGetFlagsResponder {
10911    /// Sends a response to the FIDL transaction.
10912    ///
10913    /// Sets the channel to shutdown if an error occurs.
10914    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
10915        let _result = self.send_raw(s, flags);
10916        if _result.is_err() {
10917            self.control_handle.shutdown();
10918        }
10919        self.drop_without_shutdown();
10920        _result
10921    }
10922
10923    /// Similar to "send" but does not shutdown the channel if an error occurs.
10924    pub fn send_no_shutdown_on_err(
10925        self,
10926        mut s: i32,
10927        mut flags: OpenFlags,
10928    ) -> Result<(), fidl::Error> {
10929        let _result = self.send_raw(s, flags);
10930        self.drop_without_shutdown();
10931        _result
10932    }
10933
10934    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
10935        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
10936            (s, flags),
10937            self.tx_id,
10938            0x5b88fffb8eda3aa1,
10939            fidl::encoding::DynamicFlags::empty(),
10940        )
10941    }
10942}
10943
10944#[must_use = "FIDL methods require a response to be sent"]
10945#[derive(Debug)]
10946pub struct FileDeprecatedSetFlagsResponder {
10947    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10948    tx_id: u32,
10949}
10950
10951/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10952/// if the responder is dropped without sending a response, so that the client
10953/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10954impl std::ops::Drop for FileDeprecatedSetFlagsResponder {
10955    fn drop(&mut self) {
10956        self.control_handle.shutdown();
10957        // Safety: drops once, never accessed again
10958        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10959    }
10960}
10961
10962impl fidl::endpoints::Responder for FileDeprecatedSetFlagsResponder {
10963    type ControlHandle = FileControlHandle;
10964
10965    fn control_handle(&self) -> &FileControlHandle {
10966        &self.control_handle
10967    }
10968
10969    fn drop_without_shutdown(mut self) {
10970        // Safety: drops once, never accessed again due to mem::forget
10971        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10972        // Prevent Drop from running (which would shut down the channel)
10973        std::mem::forget(self);
10974    }
10975}
10976
10977impl FileDeprecatedSetFlagsResponder {
10978    /// Sends a response to the FIDL transaction.
10979    ///
10980    /// Sets the channel to shutdown if an error occurs.
10981    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
10982        let _result = self.send_raw(s);
10983        if _result.is_err() {
10984            self.control_handle.shutdown();
10985        }
10986        self.drop_without_shutdown();
10987        _result
10988    }
10989
10990    /// Similar to "send" but does not shutdown the channel if an error occurs.
10991    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
10992        let _result = self.send_raw(s);
10993        self.drop_without_shutdown();
10994        _result
10995    }
10996
10997    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
10998        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
10999            (s,),
11000            self.tx_id,
11001            0x5295b76c71fde733,
11002            fidl::encoding::DynamicFlags::empty(),
11003        )
11004    }
11005}
11006
11007#[must_use = "FIDL methods require a response to be sent"]
11008#[derive(Debug)]
11009pub struct FileGetFlagsResponder {
11010    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11011    tx_id: u32,
11012}
11013
11014/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11015/// if the responder is dropped without sending a response, so that the client
11016/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11017impl std::ops::Drop for FileGetFlagsResponder {
11018    fn drop(&mut self) {
11019        self.control_handle.shutdown();
11020        // Safety: drops once, never accessed again
11021        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11022    }
11023}
11024
11025impl fidl::endpoints::Responder for FileGetFlagsResponder {
11026    type ControlHandle = FileControlHandle;
11027
11028    fn control_handle(&self) -> &FileControlHandle {
11029        &self.control_handle
11030    }
11031
11032    fn drop_without_shutdown(mut self) {
11033        // Safety: drops once, never accessed again due to mem::forget
11034        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11035        // Prevent Drop from running (which would shut down the channel)
11036        std::mem::forget(self);
11037    }
11038}
11039
11040impl FileGetFlagsResponder {
11041    /// Sends a response to the FIDL transaction.
11042    ///
11043    /// Sets the channel to shutdown if an error occurs.
11044    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11045        let _result = self.send_raw(result);
11046        if _result.is_err() {
11047            self.control_handle.shutdown();
11048        }
11049        self.drop_without_shutdown();
11050        _result
11051    }
11052
11053    /// Similar to "send" but does not shutdown the channel if an error occurs.
11054    pub fn send_no_shutdown_on_err(
11055        self,
11056        mut result: Result<Flags, i32>,
11057    ) -> Result<(), fidl::Error> {
11058        let _result = self.send_raw(result);
11059        self.drop_without_shutdown();
11060        _result
11061    }
11062
11063    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11064        self.control_handle
11065            .inner
11066            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
11067                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
11068                self.tx_id,
11069                0x176eb318f64ec23,
11070                fidl::encoding::DynamicFlags::FLEXIBLE,
11071            )
11072    }
11073}
11074
11075#[must_use = "FIDL methods require a response to be sent"]
11076#[derive(Debug)]
11077pub struct FileSetFlagsResponder {
11078    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11079    tx_id: u32,
11080}
11081
11082/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11083/// if the responder is dropped without sending a response, so that the client
11084/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11085impl std::ops::Drop for FileSetFlagsResponder {
11086    fn drop(&mut self) {
11087        self.control_handle.shutdown();
11088        // Safety: drops once, never accessed again
11089        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11090    }
11091}
11092
11093impl fidl::endpoints::Responder for FileSetFlagsResponder {
11094    type ControlHandle = FileControlHandle;
11095
11096    fn control_handle(&self) -> &FileControlHandle {
11097        &self.control_handle
11098    }
11099
11100    fn drop_without_shutdown(mut self) {
11101        // Safety: drops once, never accessed again due to mem::forget
11102        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11103        // Prevent Drop from running (which would shut down the channel)
11104        std::mem::forget(self);
11105    }
11106}
11107
11108impl FileSetFlagsResponder {
11109    /// Sends a response to the FIDL transaction.
11110    ///
11111    /// Sets the channel to shutdown if an error occurs.
11112    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11113        let _result = self.send_raw(result);
11114        if _result.is_err() {
11115            self.control_handle.shutdown();
11116        }
11117        self.drop_without_shutdown();
11118        _result
11119    }
11120
11121    /// Similar to "send" but does not shutdown the channel if an error occurs.
11122    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11123        let _result = self.send_raw(result);
11124        self.drop_without_shutdown();
11125        _result
11126    }
11127
11128    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11129        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11130            fidl::encoding::EmptyStruct,
11131            i32,
11132        >>(
11133            fidl::encoding::FlexibleResult::new(result),
11134            self.tx_id,
11135            0x55a8028685791ea8,
11136            fidl::encoding::DynamicFlags::FLEXIBLE,
11137        )
11138    }
11139}
11140
11141#[must_use = "FIDL methods require a response to be sent"]
11142#[derive(Debug)]
11143pub struct FileQueryFilesystemResponder {
11144    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11145    tx_id: u32,
11146}
11147
11148/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11149/// if the responder is dropped without sending a response, so that the client
11150/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11151impl std::ops::Drop for FileQueryFilesystemResponder {
11152    fn drop(&mut self) {
11153        self.control_handle.shutdown();
11154        // Safety: drops once, never accessed again
11155        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11156    }
11157}
11158
11159impl fidl::endpoints::Responder for FileQueryFilesystemResponder {
11160    type ControlHandle = FileControlHandle;
11161
11162    fn control_handle(&self) -> &FileControlHandle {
11163        &self.control_handle
11164    }
11165
11166    fn drop_without_shutdown(mut self) {
11167        // Safety: drops once, never accessed again due to mem::forget
11168        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11169        // Prevent Drop from running (which would shut down the channel)
11170        std::mem::forget(self);
11171    }
11172}
11173
11174impl FileQueryFilesystemResponder {
11175    /// Sends a response to the FIDL transaction.
11176    ///
11177    /// Sets the channel to shutdown if an error occurs.
11178    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11179        let _result = self.send_raw(s, info);
11180        if _result.is_err() {
11181            self.control_handle.shutdown();
11182        }
11183        self.drop_without_shutdown();
11184        _result
11185    }
11186
11187    /// Similar to "send" but does not shutdown the channel if an error occurs.
11188    pub fn send_no_shutdown_on_err(
11189        self,
11190        mut s: i32,
11191        mut info: Option<&FilesystemInfo>,
11192    ) -> Result<(), fidl::Error> {
11193        let _result = self.send_raw(s, info);
11194        self.drop_without_shutdown();
11195        _result
11196    }
11197
11198    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11199        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
11200            (s, info),
11201            self.tx_id,
11202            0x6f344a1c6b0a0610,
11203            fidl::encoding::DynamicFlags::empty(),
11204        )
11205    }
11206}
11207
11208#[must_use = "FIDL methods require a response to be sent"]
11209#[derive(Debug)]
11210pub struct FileGetAttributesResponder {
11211    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11212    tx_id: u32,
11213}
11214
11215/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11216/// if the responder is dropped without sending a response, so that the client
11217/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11218impl std::ops::Drop for FileGetAttributesResponder {
11219    fn drop(&mut self) {
11220        self.control_handle.shutdown();
11221        // Safety: drops once, never accessed again
11222        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11223    }
11224}
11225
11226impl fidl::endpoints::Responder for FileGetAttributesResponder {
11227    type ControlHandle = FileControlHandle;
11228
11229    fn control_handle(&self) -> &FileControlHandle {
11230        &self.control_handle
11231    }
11232
11233    fn drop_without_shutdown(mut self) {
11234        // Safety: drops once, never accessed again due to mem::forget
11235        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11236        // Prevent Drop from running (which would shut down the channel)
11237        std::mem::forget(self);
11238    }
11239}
11240
11241impl FileGetAttributesResponder {
11242    /// Sends a response to the FIDL transaction.
11243    ///
11244    /// Sets the channel to shutdown if an error occurs.
11245    pub fn send(
11246        self,
11247        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11248    ) -> Result<(), fidl::Error> {
11249        let _result = self.send_raw(result);
11250        if _result.is_err() {
11251            self.control_handle.shutdown();
11252        }
11253        self.drop_without_shutdown();
11254        _result
11255    }
11256
11257    /// Similar to "send" but does not shutdown the channel if an error occurs.
11258    pub fn send_no_shutdown_on_err(
11259        self,
11260        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11261    ) -> Result<(), fidl::Error> {
11262        let _result = self.send_raw(result);
11263        self.drop_without_shutdown();
11264        _result
11265    }
11266
11267    fn send_raw(
11268        &self,
11269        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11270    ) -> Result<(), fidl::Error> {
11271        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
11272            result,
11273            self.tx_id,
11274            0x3d4396a638ea053b,
11275            fidl::encoding::DynamicFlags::empty(),
11276        )
11277    }
11278}
11279
11280#[must_use = "FIDL methods require a response to be sent"]
11281#[derive(Debug)]
11282pub struct FileUpdateAttributesResponder {
11283    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11284    tx_id: u32,
11285}
11286
11287/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11288/// if the responder is dropped without sending a response, so that the client
11289/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11290impl std::ops::Drop for FileUpdateAttributesResponder {
11291    fn drop(&mut self) {
11292        self.control_handle.shutdown();
11293        // Safety: drops once, never accessed again
11294        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11295    }
11296}
11297
11298impl fidl::endpoints::Responder for FileUpdateAttributesResponder {
11299    type ControlHandle = FileControlHandle;
11300
11301    fn control_handle(&self) -> &FileControlHandle {
11302        &self.control_handle
11303    }
11304
11305    fn drop_without_shutdown(mut self) {
11306        // Safety: drops once, never accessed again due to mem::forget
11307        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11308        // Prevent Drop from running (which would shut down the channel)
11309        std::mem::forget(self);
11310    }
11311}
11312
11313impl FileUpdateAttributesResponder {
11314    /// Sends a response to the FIDL transaction.
11315    ///
11316    /// Sets the channel to shutdown if an error occurs.
11317    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11318        let _result = self.send_raw(result);
11319        if _result.is_err() {
11320            self.control_handle.shutdown();
11321        }
11322        self.drop_without_shutdown();
11323        _result
11324    }
11325
11326    /// Similar to "send" but does not shutdown the channel if an error occurs.
11327    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11328        let _result = self.send_raw(result);
11329        self.drop_without_shutdown();
11330        _result
11331    }
11332
11333    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11334        self.control_handle
11335            .inner
11336            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11337                result,
11338                self.tx_id,
11339                0x3308c1da5a89bf08,
11340                fidl::encoding::DynamicFlags::empty(),
11341            )
11342    }
11343}
11344
11345#[must_use = "FIDL methods require a response to be sent"]
11346#[derive(Debug)]
11347pub struct FileSyncResponder {
11348    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11349    tx_id: u32,
11350}
11351
11352/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11353/// if the responder is dropped without sending a response, so that the client
11354/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11355impl std::ops::Drop for FileSyncResponder {
11356    fn drop(&mut self) {
11357        self.control_handle.shutdown();
11358        // Safety: drops once, never accessed again
11359        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11360    }
11361}
11362
11363impl fidl::endpoints::Responder for FileSyncResponder {
11364    type ControlHandle = FileControlHandle;
11365
11366    fn control_handle(&self) -> &FileControlHandle {
11367        &self.control_handle
11368    }
11369
11370    fn drop_without_shutdown(mut self) {
11371        // Safety: drops once, never accessed again due to mem::forget
11372        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11373        // Prevent Drop from running (which would shut down the channel)
11374        std::mem::forget(self);
11375    }
11376}
11377
11378impl FileSyncResponder {
11379    /// Sends a response to the FIDL transaction.
11380    ///
11381    /// Sets the channel to shutdown if an error occurs.
11382    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11383        let _result = self.send_raw(result);
11384        if _result.is_err() {
11385            self.control_handle.shutdown();
11386        }
11387        self.drop_without_shutdown();
11388        _result
11389    }
11390
11391    /// Similar to "send" but does not shutdown the channel if an error occurs.
11392    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11393        let _result = self.send_raw(result);
11394        self.drop_without_shutdown();
11395        _result
11396    }
11397
11398    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11399        self.control_handle
11400            .inner
11401            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11402                result,
11403                self.tx_id,
11404                0x2c5c27ca0ab5dc49,
11405                fidl::encoding::DynamicFlags::empty(),
11406            )
11407    }
11408}
11409
11410#[must_use = "FIDL methods require a response to be sent"]
11411#[derive(Debug)]
11412pub struct FileGetExtendedAttributeResponder {
11413    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11414    tx_id: u32,
11415}
11416
11417/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11418/// if the responder is dropped without sending a response, so that the client
11419/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11420impl std::ops::Drop for FileGetExtendedAttributeResponder {
11421    fn drop(&mut self) {
11422        self.control_handle.shutdown();
11423        // Safety: drops once, never accessed again
11424        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11425    }
11426}
11427
11428impl fidl::endpoints::Responder for FileGetExtendedAttributeResponder {
11429    type ControlHandle = FileControlHandle;
11430
11431    fn control_handle(&self) -> &FileControlHandle {
11432        &self.control_handle
11433    }
11434
11435    fn drop_without_shutdown(mut self) {
11436        // Safety: drops once, never accessed again due to mem::forget
11437        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11438        // Prevent Drop from running (which would shut down the channel)
11439        std::mem::forget(self);
11440    }
11441}
11442
11443impl FileGetExtendedAttributeResponder {
11444    /// Sends a response to the FIDL transaction.
11445    ///
11446    /// Sets the channel to shutdown if an error occurs.
11447    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11448        let _result = self.send_raw(result);
11449        if _result.is_err() {
11450            self.control_handle.shutdown();
11451        }
11452        self.drop_without_shutdown();
11453        _result
11454    }
11455
11456    /// Similar to "send" but does not shutdown the channel if an error occurs.
11457    pub fn send_no_shutdown_on_err(
11458        self,
11459        mut result: Result<ExtendedAttributeValue, i32>,
11460    ) -> Result<(), fidl::Error> {
11461        let _result = self.send_raw(result);
11462        self.drop_without_shutdown();
11463        _result
11464    }
11465
11466    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11467        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
11468            result.as_mut().map_err(|e| *e),
11469            self.tx_id,
11470            0x45ffa3ccfdeb76db,
11471            fidl::encoding::DynamicFlags::empty(),
11472        )
11473    }
11474}
11475
11476#[must_use = "FIDL methods require a response to be sent"]
11477#[derive(Debug)]
11478pub struct FileSetExtendedAttributeResponder {
11479    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11480    tx_id: u32,
11481}
11482
11483/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11484/// if the responder is dropped without sending a response, so that the client
11485/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11486impl std::ops::Drop for FileSetExtendedAttributeResponder {
11487    fn drop(&mut self) {
11488        self.control_handle.shutdown();
11489        // Safety: drops once, never accessed again
11490        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11491    }
11492}
11493
11494impl fidl::endpoints::Responder for FileSetExtendedAttributeResponder {
11495    type ControlHandle = FileControlHandle;
11496
11497    fn control_handle(&self) -> &FileControlHandle {
11498        &self.control_handle
11499    }
11500
11501    fn drop_without_shutdown(mut self) {
11502        // Safety: drops once, never accessed again due to mem::forget
11503        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11504        // Prevent Drop from running (which would shut down the channel)
11505        std::mem::forget(self);
11506    }
11507}
11508
11509impl FileSetExtendedAttributeResponder {
11510    /// Sends a response to the FIDL transaction.
11511    ///
11512    /// Sets the channel to shutdown if an error occurs.
11513    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11514        let _result = self.send_raw(result);
11515        if _result.is_err() {
11516            self.control_handle.shutdown();
11517        }
11518        self.drop_without_shutdown();
11519        _result
11520    }
11521
11522    /// Similar to "send" but does not shutdown the channel if an error occurs.
11523    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11524        let _result = self.send_raw(result);
11525        self.drop_without_shutdown();
11526        _result
11527    }
11528
11529    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11530        self.control_handle
11531            .inner
11532            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11533                result,
11534                self.tx_id,
11535                0x4a951362f681f23c,
11536                fidl::encoding::DynamicFlags::empty(),
11537            )
11538    }
11539}
11540
11541#[must_use = "FIDL methods require a response to be sent"]
11542#[derive(Debug)]
11543pub struct FileRemoveExtendedAttributeResponder {
11544    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11545    tx_id: u32,
11546}
11547
11548/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11549/// if the responder is dropped without sending a response, so that the client
11550/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11551impl std::ops::Drop for FileRemoveExtendedAttributeResponder {
11552    fn drop(&mut self) {
11553        self.control_handle.shutdown();
11554        // Safety: drops once, never accessed again
11555        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11556    }
11557}
11558
11559impl fidl::endpoints::Responder for FileRemoveExtendedAttributeResponder {
11560    type ControlHandle = FileControlHandle;
11561
11562    fn control_handle(&self) -> &FileControlHandle {
11563        &self.control_handle
11564    }
11565
11566    fn drop_without_shutdown(mut self) {
11567        // Safety: drops once, never accessed again due to mem::forget
11568        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11569        // Prevent Drop from running (which would shut down the channel)
11570        std::mem::forget(self);
11571    }
11572}
11573
11574impl FileRemoveExtendedAttributeResponder {
11575    /// Sends a response to the FIDL transaction.
11576    ///
11577    /// Sets the channel to shutdown if an error occurs.
11578    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11579        let _result = self.send_raw(result);
11580        if _result.is_err() {
11581            self.control_handle.shutdown();
11582        }
11583        self.drop_without_shutdown();
11584        _result
11585    }
11586
11587    /// Similar to "send" but does not shutdown the channel if an error occurs.
11588    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11589        let _result = self.send_raw(result);
11590        self.drop_without_shutdown();
11591        _result
11592    }
11593
11594    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11595        self.control_handle
11596            .inner
11597            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11598                result,
11599                self.tx_id,
11600                0x7a0b9f3a9bf9032d,
11601                fidl::encoding::DynamicFlags::empty(),
11602            )
11603    }
11604}
11605
11606#[must_use = "FIDL methods require a response to be sent"]
11607#[derive(Debug)]
11608pub struct FileReadResponder {
11609    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11610    tx_id: u32,
11611}
11612
11613/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11614/// if the responder is dropped without sending a response, so that the client
11615/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11616impl std::ops::Drop for FileReadResponder {
11617    fn drop(&mut self) {
11618        self.control_handle.shutdown();
11619        // Safety: drops once, never accessed again
11620        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11621    }
11622}
11623
11624impl fidl::endpoints::Responder for FileReadResponder {
11625    type ControlHandle = FileControlHandle;
11626
11627    fn control_handle(&self) -> &FileControlHandle {
11628        &self.control_handle
11629    }
11630
11631    fn drop_without_shutdown(mut self) {
11632        // Safety: drops once, never accessed again due to mem::forget
11633        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11634        // Prevent Drop from running (which would shut down the channel)
11635        std::mem::forget(self);
11636    }
11637}
11638
11639impl FileReadResponder {
11640    /// Sends a response to the FIDL transaction.
11641    ///
11642    /// Sets the channel to shutdown if an error occurs.
11643    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11644        let _result = self.send_raw(result);
11645        if _result.is_err() {
11646            self.control_handle.shutdown();
11647        }
11648        self.drop_without_shutdown();
11649        _result
11650    }
11651
11652    /// Similar to "send" but does not shutdown the channel if an error occurs.
11653    pub fn send_no_shutdown_on_err(
11654        self,
11655        mut result: Result<&[u8], i32>,
11656    ) -> Result<(), fidl::Error> {
11657        let _result = self.send_raw(result);
11658        self.drop_without_shutdown();
11659        _result
11660    }
11661
11662    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11663        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
11664            result.map(|data| (data,)),
11665            self.tx_id,
11666            0x57e419a298c8ede,
11667            fidl::encoding::DynamicFlags::empty(),
11668        )
11669    }
11670}
11671
11672#[must_use = "FIDL methods require a response to be sent"]
11673#[derive(Debug)]
11674pub struct FileWriteResponder {
11675    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11676    tx_id: u32,
11677}
11678
11679/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11680/// if the responder is dropped without sending a response, so that the client
11681/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11682impl std::ops::Drop for FileWriteResponder {
11683    fn drop(&mut self) {
11684        self.control_handle.shutdown();
11685        // Safety: drops once, never accessed again
11686        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11687    }
11688}
11689
11690impl fidl::endpoints::Responder for FileWriteResponder {
11691    type ControlHandle = FileControlHandle;
11692
11693    fn control_handle(&self) -> &FileControlHandle {
11694        &self.control_handle
11695    }
11696
11697    fn drop_without_shutdown(mut self) {
11698        // Safety: drops once, never accessed again due to mem::forget
11699        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11700        // Prevent Drop from running (which would shut down the channel)
11701        std::mem::forget(self);
11702    }
11703}
11704
11705impl FileWriteResponder {
11706    /// Sends a response to the FIDL transaction.
11707    ///
11708    /// Sets the channel to shutdown if an error occurs.
11709    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11710        let _result = self.send_raw(result);
11711        if _result.is_err() {
11712            self.control_handle.shutdown();
11713        }
11714        self.drop_without_shutdown();
11715        _result
11716    }
11717
11718    /// Similar to "send" but does not shutdown the channel if an error occurs.
11719    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11720        let _result = self.send_raw(result);
11721        self.drop_without_shutdown();
11722        _result
11723    }
11724
11725    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11726        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
11727            result.map(|actual_count| (actual_count,)),
11728            self.tx_id,
11729            0x6a31437832469f82,
11730            fidl::encoding::DynamicFlags::empty(),
11731        )
11732    }
11733}
11734
11735#[must_use = "FIDL methods require a response to be sent"]
11736#[derive(Debug)]
11737pub struct FileDescribeResponder {
11738    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11739    tx_id: u32,
11740}
11741
11742/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11743/// if the responder is dropped without sending a response, so that the client
11744/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11745impl std::ops::Drop for FileDescribeResponder {
11746    fn drop(&mut self) {
11747        self.control_handle.shutdown();
11748        // Safety: drops once, never accessed again
11749        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11750    }
11751}
11752
11753impl fidl::endpoints::Responder for FileDescribeResponder {
11754    type ControlHandle = FileControlHandle;
11755
11756    fn control_handle(&self) -> &FileControlHandle {
11757        &self.control_handle
11758    }
11759
11760    fn drop_without_shutdown(mut self) {
11761        // Safety: drops once, never accessed again due to mem::forget
11762        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11763        // Prevent Drop from running (which would shut down the channel)
11764        std::mem::forget(self);
11765    }
11766}
11767
11768impl FileDescribeResponder {
11769    /// Sends a response to the FIDL transaction.
11770    ///
11771    /// Sets the channel to shutdown if an error occurs.
11772    pub fn send(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11773        let _result = self.send_raw(payload);
11774        if _result.is_err() {
11775            self.control_handle.shutdown();
11776        }
11777        self.drop_without_shutdown();
11778        _result
11779    }
11780
11781    /// Similar to "send" but does not shutdown the channel if an error occurs.
11782    pub fn send_no_shutdown_on_err(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11783        let _result = self.send_raw(payload);
11784        self.drop_without_shutdown();
11785        _result
11786    }
11787
11788    fn send_raw(&self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11789        self.control_handle.inner.send::<FileInfo>(
11790            &mut payload,
11791            self.tx_id,
11792            0x68b5ac00c62906bc,
11793            fidl::encoding::DynamicFlags::empty(),
11794        )
11795    }
11796}
11797
11798#[must_use = "FIDL methods require a response to be sent"]
11799#[derive(Debug)]
11800pub struct FileSeekResponder {
11801    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11802    tx_id: u32,
11803}
11804
11805/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11806/// if the responder is dropped without sending a response, so that the client
11807/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11808impl std::ops::Drop for FileSeekResponder {
11809    fn drop(&mut self) {
11810        self.control_handle.shutdown();
11811        // Safety: drops once, never accessed again
11812        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11813    }
11814}
11815
11816impl fidl::endpoints::Responder for FileSeekResponder {
11817    type ControlHandle = FileControlHandle;
11818
11819    fn control_handle(&self) -> &FileControlHandle {
11820        &self.control_handle
11821    }
11822
11823    fn drop_without_shutdown(mut self) {
11824        // Safety: drops once, never accessed again due to mem::forget
11825        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11826        // Prevent Drop from running (which would shut down the channel)
11827        std::mem::forget(self);
11828    }
11829}
11830
11831impl FileSeekResponder {
11832    /// Sends a response to the FIDL transaction.
11833    ///
11834    /// Sets the channel to shutdown if an error occurs.
11835    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11836        let _result = self.send_raw(result);
11837        if _result.is_err() {
11838            self.control_handle.shutdown();
11839        }
11840        self.drop_without_shutdown();
11841        _result
11842    }
11843
11844    /// Similar to "send" but does not shutdown the channel if an error occurs.
11845    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11846        let _result = self.send_raw(result);
11847        self.drop_without_shutdown();
11848        _result
11849    }
11850
11851    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11852        self.control_handle.inner.send::<fidl::encoding::ResultType<FileSeekResponse, i32>>(
11853            result.map(|offset_from_start| (offset_from_start,)),
11854            self.tx_id,
11855            0x78079168162c5207,
11856            fidl::encoding::DynamicFlags::empty(),
11857        )
11858    }
11859}
11860
11861#[must_use = "FIDL methods require a response to be sent"]
11862#[derive(Debug)]
11863pub struct FileReadAtResponder {
11864    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11865    tx_id: u32,
11866}
11867
11868/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11869/// if the responder is dropped without sending a response, so that the client
11870/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11871impl std::ops::Drop for FileReadAtResponder {
11872    fn drop(&mut self) {
11873        self.control_handle.shutdown();
11874        // Safety: drops once, never accessed again
11875        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11876    }
11877}
11878
11879impl fidl::endpoints::Responder for FileReadAtResponder {
11880    type ControlHandle = FileControlHandle;
11881
11882    fn control_handle(&self) -> &FileControlHandle {
11883        &self.control_handle
11884    }
11885
11886    fn drop_without_shutdown(mut self) {
11887        // Safety: drops once, never accessed again due to mem::forget
11888        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11889        // Prevent Drop from running (which would shut down the channel)
11890        std::mem::forget(self);
11891    }
11892}
11893
11894impl FileReadAtResponder {
11895    /// Sends a response to the FIDL transaction.
11896    ///
11897    /// Sets the channel to shutdown if an error occurs.
11898    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11899        let _result = self.send_raw(result);
11900        if _result.is_err() {
11901            self.control_handle.shutdown();
11902        }
11903        self.drop_without_shutdown();
11904        _result
11905    }
11906
11907    /// Similar to "send" but does not shutdown the channel if an error occurs.
11908    pub fn send_no_shutdown_on_err(
11909        self,
11910        mut result: Result<&[u8], i32>,
11911    ) -> Result<(), fidl::Error> {
11912        let _result = self.send_raw(result);
11913        self.drop_without_shutdown();
11914        _result
11915    }
11916
11917    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11918        self.control_handle.inner.send::<fidl::encoding::ResultType<FileReadAtResponse, i32>>(
11919            result.map(|data| (data,)),
11920            self.tx_id,
11921            0x1607a293a60d723e,
11922            fidl::encoding::DynamicFlags::empty(),
11923        )
11924    }
11925}
11926
11927#[must_use = "FIDL methods require a response to be sent"]
11928#[derive(Debug)]
11929pub struct FileWriteAtResponder {
11930    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11931    tx_id: u32,
11932}
11933
11934/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11935/// if the responder is dropped without sending a response, so that the client
11936/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11937impl std::ops::Drop for FileWriteAtResponder {
11938    fn drop(&mut self) {
11939        self.control_handle.shutdown();
11940        // Safety: drops once, never accessed again
11941        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11942    }
11943}
11944
11945impl fidl::endpoints::Responder for FileWriteAtResponder {
11946    type ControlHandle = FileControlHandle;
11947
11948    fn control_handle(&self) -> &FileControlHandle {
11949        &self.control_handle
11950    }
11951
11952    fn drop_without_shutdown(mut self) {
11953        // Safety: drops once, never accessed again due to mem::forget
11954        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11955        // Prevent Drop from running (which would shut down the channel)
11956        std::mem::forget(self);
11957    }
11958}
11959
11960impl FileWriteAtResponder {
11961    /// Sends a response to the FIDL transaction.
11962    ///
11963    /// Sets the channel to shutdown if an error occurs.
11964    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11965        let _result = self.send_raw(result);
11966        if _result.is_err() {
11967            self.control_handle.shutdown();
11968        }
11969        self.drop_without_shutdown();
11970        _result
11971    }
11972
11973    /// Similar to "send" but does not shutdown the channel if an error occurs.
11974    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11975        let _result = self.send_raw(result);
11976        self.drop_without_shutdown();
11977        _result
11978    }
11979
11980    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11981        self.control_handle.inner.send::<fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
11982            result.map(|actual_count| (actual_count,)),
11983            self.tx_id,
11984            0x793eefc0045e792b,
11985            fidl::encoding::DynamicFlags::empty(),
11986        )
11987    }
11988}
11989
11990#[must_use = "FIDL methods require a response to be sent"]
11991#[derive(Debug)]
11992pub struct FileResizeResponder {
11993    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11994    tx_id: u32,
11995}
11996
11997/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11998/// if the responder is dropped without sending a response, so that the client
11999/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12000impl std::ops::Drop for FileResizeResponder {
12001    fn drop(&mut self) {
12002        self.control_handle.shutdown();
12003        // Safety: drops once, never accessed again
12004        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12005    }
12006}
12007
12008impl fidl::endpoints::Responder for FileResizeResponder {
12009    type ControlHandle = FileControlHandle;
12010
12011    fn control_handle(&self) -> &FileControlHandle {
12012        &self.control_handle
12013    }
12014
12015    fn drop_without_shutdown(mut self) {
12016        // Safety: drops once, never accessed again due to mem::forget
12017        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12018        // Prevent Drop from running (which would shut down the channel)
12019        std::mem::forget(self);
12020    }
12021}
12022
12023impl FileResizeResponder {
12024    /// Sends a response to the FIDL transaction.
12025    ///
12026    /// Sets the channel to shutdown if an error occurs.
12027    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12028        let _result = self.send_raw(result);
12029        if _result.is_err() {
12030            self.control_handle.shutdown();
12031        }
12032        self.drop_without_shutdown();
12033        _result
12034    }
12035
12036    /// Similar to "send" but does not shutdown the channel if an error occurs.
12037    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12038        let _result = self.send_raw(result);
12039        self.drop_without_shutdown();
12040        _result
12041    }
12042
12043    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12044        self.control_handle
12045            .inner
12046            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12047                result,
12048                self.tx_id,
12049                0x2b80825f0535743a,
12050                fidl::encoding::DynamicFlags::empty(),
12051            )
12052    }
12053}
12054
12055#[must_use = "FIDL methods require a response to be sent"]
12056#[derive(Debug)]
12057pub struct FileGetBackingMemoryResponder {
12058    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12059    tx_id: u32,
12060}
12061
12062/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12063/// if the responder is dropped without sending a response, so that the client
12064/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12065impl std::ops::Drop for FileGetBackingMemoryResponder {
12066    fn drop(&mut self) {
12067        self.control_handle.shutdown();
12068        // Safety: drops once, never accessed again
12069        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12070    }
12071}
12072
12073impl fidl::endpoints::Responder for FileGetBackingMemoryResponder {
12074    type ControlHandle = FileControlHandle;
12075
12076    fn control_handle(&self) -> &FileControlHandle {
12077        &self.control_handle
12078    }
12079
12080    fn drop_without_shutdown(mut self) {
12081        // Safety: drops once, never accessed again due to mem::forget
12082        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12083        // Prevent Drop from running (which would shut down the channel)
12084        std::mem::forget(self);
12085    }
12086}
12087
12088impl FileGetBackingMemoryResponder {
12089    /// Sends a response to the FIDL transaction.
12090    ///
12091    /// Sets the channel to shutdown if an error occurs.
12092    pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12093        let _result = self.send_raw(result);
12094        if _result.is_err() {
12095            self.control_handle.shutdown();
12096        }
12097        self.drop_without_shutdown();
12098        _result
12099    }
12100
12101    /// Similar to "send" but does not shutdown the channel if an error occurs.
12102    pub fn send_no_shutdown_on_err(
12103        self,
12104        mut result: Result<fidl::Vmo, i32>,
12105    ) -> Result<(), fidl::Error> {
12106        let _result = self.send_raw(result);
12107        self.drop_without_shutdown();
12108        _result
12109    }
12110
12111    fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12112        self.control_handle
12113            .inner
12114            .send::<fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>>(
12115                result.map(|vmo| (vmo,)),
12116                self.tx_id,
12117                0xa6a9e654cbf62b,
12118                fidl::encoding::DynamicFlags::empty(),
12119            )
12120    }
12121}
12122
12123#[must_use = "FIDL methods require a response to be sent"]
12124#[derive(Debug)]
12125pub struct FileAllocateResponder {
12126    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12127    tx_id: u32,
12128}
12129
12130/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12131/// if the responder is dropped without sending a response, so that the client
12132/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12133impl std::ops::Drop for FileAllocateResponder {
12134    fn drop(&mut self) {
12135        self.control_handle.shutdown();
12136        // Safety: drops once, never accessed again
12137        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12138    }
12139}
12140
12141impl fidl::endpoints::Responder for FileAllocateResponder {
12142    type ControlHandle = FileControlHandle;
12143
12144    fn control_handle(&self) -> &FileControlHandle {
12145        &self.control_handle
12146    }
12147
12148    fn drop_without_shutdown(mut self) {
12149        // Safety: drops once, never accessed again due to mem::forget
12150        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12151        // Prevent Drop from running (which would shut down the channel)
12152        std::mem::forget(self);
12153    }
12154}
12155
12156impl FileAllocateResponder {
12157    /// Sends a response to the FIDL transaction.
12158    ///
12159    /// Sets the channel to shutdown if an error occurs.
12160    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12161        let _result = self.send_raw(result);
12162        if _result.is_err() {
12163            self.control_handle.shutdown();
12164        }
12165        self.drop_without_shutdown();
12166        _result
12167    }
12168
12169    /// Similar to "send" but does not shutdown the channel if an error occurs.
12170    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12171        let _result = self.send_raw(result);
12172        self.drop_without_shutdown();
12173        _result
12174    }
12175
12176    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12177        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12178            fidl::encoding::EmptyStruct,
12179            i32,
12180        >>(
12181            fidl::encoding::FlexibleResult::new(result),
12182            self.tx_id,
12183            0x77fa0c330b57fd2e,
12184            fidl::encoding::DynamicFlags::FLEXIBLE,
12185        )
12186    }
12187}
12188
12189#[must_use = "FIDL methods require a response to be sent"]
12190#[derive(Debug)]
12191pub struct FileEnableVerityResponder {
12192    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12193    tx_id: u32,
12194}
12195
12196/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12197/// if the responder is dropped without sending a response, so that the client
12198/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12199impl std::ops::Drop for FileEnableVerityResponder {
12200    fn drop(&mut self) {
12201        self.control_handle.shutdown();
12202        // Safety: drops once, never accessed again
12203        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12204    }
12205}
12206
12207impl fidl::endpoints::Responder for FileEnableVerityResponder {
12208    type ControlHandle = FileControlHandle;
12209
12210    fn control_handle(&self) -> &FileControlHandle {
12211        &self.control_handle
12212    }
12213
12214    fn drop_without_shutdown(mut self) {
12215        // Safety: drops once, never accessed again due to mem::forget
12216        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12217        // Prevent Drop from running (which would shut down the channel)
12218        std::mem::forget(self);
12219    }
12220}
12221
12222impl FileEnableVerityResponder {
12223    /// Sends a response to the FIDL transaction.
12224    ///
12225    /// Sets the channel to shutdown if an error occurs.
12226    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12227        let _result = self.send_raw(result);
12228        if _result.is_err() {
12229            self.control_handle.shutdown();
12230        }
12231        self.drop_without_shutdown();
12232        _result
12233    }
12234
12235    /// Similar to "send" but does not shutdown the channel if an error occurs.
12236    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12237        let _result = self.send_raw(result);
12238        self.drop_without_shutdown();
12239        _result
12240    }
12241
12242    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12243        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12244            fidl::encoding::EmptyStruct,
12245            i32,
12246        >>(
12247            fidl::encoding::FlexibleResult::new(result),
12248            self.tx_id,
12249            0x2c421ec3faaeb8bb,
12250            fidl::encoding::DynamicFlags::FLEXIBLE,
12251        )
12252    }
12253}
12254
12255#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12256pub struct LinkableMarker;
12257
12258impl fidl::endpoints::ProtocolMarker for LinkableMarker {
12259    type Proxy = LinkableProxy;
12260    type RequestStream = LinkableRequestStream;
12261    #[cfg(target_os = "fuchsia")]
12262    type SynchronousProxy = LinkableSynchronousProxy;
12263
12264    const DEBUG_NAME: &'static str = "(anonymous) Linkable";
12265}
12266pub type LinkableLinkIntoResult = Result<(), i32>;
12267
12268pub trait LinkableProxyInterface: Send + Sync {
12269    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
12270        + Send;
12271    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
12272}
12273#[derive(Debug)]
12274#[cfg(target_os = "fuchsia")]
12275pub struct LinkableSynchronousProxy {
12276    client: fidl::client::sync::Client,
12277}
12278
12279#[cfg(target_os = "fuchsia")]
12280impl fidl::endpoints::SynchronousProxy for LinkableSynchronousProxy {
12281    type Proxy = LinkableProxy;
12282    type Protocol = LinkableMarker;
12283
12284    fn from_channel(inner: fidl::Channel) -> Self {
12285        Self::new(inner)
12286    }
12287
12288    fn into_channel(self) -> fidl::Channel {
12289        self.client.into_channel()
12290    }
12291
12292    fn as_channel(&self) -> &fidl::Channel {
12293        self.client.as_channel()
12294    }
12295}
12296
12297#[cfg(target_os = "fuchsia")]
12298impl LinkableSynchronousProxy {
12299    pub fn new(channel: fidl::Channel) -> Self {
12300        let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12301        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
12302    }
12303
12304    pub fn into_channel(self) -> fidl::Channel {
12305        self.client.into_channel()
12306    }
12307
12308    /// Waits until an event arrives and returns it. It is safe for other
12309    /// threads to make concurrent requests while waiting for an event.
12310    pub fn wait_for_event(
12311        &self,
12312        deadline: zx::MonotonicInstant,
12313    ) -> Result<LinkableEvent, fidl::Error> {
12314        LinkableEvent::decode(self.client.wait_for_event(deadline)?)
12315    }
12316
12317    /// Creates a link to this this object with name `dst` in the directory represented by
12318    /// `dst_parent_token`.
12319    ///
12320    /// `dst` must be a resolved object name. Including "/" in the string will return
12321    /// `ZX_ERR_INVALID_ARGS`.
12322    ///
12323    /// This method requires the maximal set of rights supported by the filesystem for this object.
12324    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12325    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12326    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12327    /// `ZX_ERR_ACCESS_DENIED`.
12328    ///
12329    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12330    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12331    ///
12332    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12333    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12334    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12335    ///
12336    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12337    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12338    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12339    pub fn r#link_into(
12340        &self,
12341        mut dst_parent_token: fidl::Event,
12342        mut dst: &str,
12343        ___deadline: zx::MonotonicInstant,
12344    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12345        let _response = self.client.send_query::<
12346            LinkableLinkIntoRequest,
12347            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12348        >(
12349            (dst_parent_token, dst,),
12350            0x54f3949246a03e74,
12351            fidl::encoding::DynamicFlags::empty(),
12352            ___deadline,
12353        )?;
12354        Ok(_response.map(|x| x))
12355    }
12356}
12357
12358#[cfg(target_os = "fuchsia")]
12359impl From<LinkableSynchronousProxy> for zx::NullableHandle {
12360    fn from(value: LinkableSynchronousProxy) -> Self {
12361        value.into_channel().into()
12362    }
12363}
12364
12365#[cfg(target_os = "fuchsia")]
12366impl From<fidl::Channel> for LinkableSynchronousProxy {
12367    fn from(value: fidl::Channel) -> Self {
12368        Self::new(value)
12369    }
12370}
12371
12372#[cfg(target_os = "fuchsia")]
12373impl fidl::endpoints::FromClient for LinkableSynchronousProxy {
12374    type Protocol = LinkableMarker;
12375
12376    fn from_client(value: fidl::endpoints::ClientEnd<LinkableMarker>) -> Self {
12377        Self::new(value.into_channel())
12378    }
12379}
12380
12381#[derive(Debug, Clone)]
12382pub struct LinkableProxy {
12383    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
12384}
12385
12386impl fidl::endpoints::Proxy for LinkableProxy {
12387    type Protocol = LinkableMarker;
12388
12389    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
12390        Self::new(inner)
12391    }
12392
12393    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
12394        self.client.into_channel().map_err(|client| Self { client })
12395    }
12396
12397    fn as_channel(&self) -> &::fidl::AsyncChannel {
12398        self.client.as_channel()
12399    }
12400}
12401
12402impl LinkableProxy {
12403    /// Create a new Proxy for fuchsia.io/Linkable.
12404    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
12405        let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12406        Self { client: fidl::client::Client::new(channel, protocol_name) }
12407    }
12408
12409    /// Get a Stream of events from the remote end of the protocol.
12410    ///
12411    /// # Panics
12412    ///
12413    /// Panics if the event stream was already taken.
12414    pub fn take_event_stream(&self) -> LinkableEventStream {
12415        LinkableEventStream { event_receiver: self.client.take_event_receiver() }
12416    }
12417
12418    /// Creates a link to this this object with name `dst` in the directory represented by
12419    /// `dst_parent_token`.
12420    ///
12421    /// `dst` must be a resolved object name. Including "/" in the string will return
12422    /// `ZX_ERR_INVALID_ARGS`.
12423    ///
12424    /// This method requires the maximal set of rights supported by the filesystem for this object.
12425    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12426    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12427    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12428    /// `ZX_ERR_ACCESS_DENIED`.
12429    ///
12430    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12431    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12432    ///
12433    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12434    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12435    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12436    ///
12437    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12438    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12439    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12440    pub fn r#link_into(
12441        &self,
12442        mut dst_parent_token: fidl::Event,
12443        mut dst: &str,
12444    ) -> fidl::client::QueryResponseFut<
12445        LinkableLinkIntoResult,
12446        fidl::encoding::DefaultFuchsiaResourceDialect,
12447    > {
12448        LinkableProxyInterface::r#link_into(self, dst_parent_token, dst)
12449    }
12450}
12451
12452impl LinkableProxyInterface for LinkableProxy {
12453    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
12454        LinkableLinkIntoResult,
12455        fidl::encoding::DefaultFuchsiaResourceDialect,
12456    >;
12457    fn r#link_into(
12458        &self,
12459        mut dst_parent_token: fidl::Event,
12460        mut dst: &str,
12461    ) -> Self::LinkIntoResponseFut {
12462        fn _decode(
12463            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
12464        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12465            let _response = fidl::client::decode_transaction_body::<
12466                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12467                fidl::encoding::DefaultFuchsiaResourceDialect,
12468                0x54f3949246a03e74,
12469            >(_buf?)?;
12470            Ok(_response.map(|x| x))
12471        }
12472        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
12473            (dst_parent_token, dst),
12474            0x54f3949246a03e74,
12475            fidl::encoding::DynamicFlags::empty(),
12476            _decode,
12477        )
12478    }
12479}
12480
12481pub struct LinkableEventStream {
12482    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
12483}
12484
12485impl std::marker::Unpin for LinkableEventStream {}
12486
12487impl futures::stream::FusedStream for LinkableEventStream {
12488    fn is_terminated(&self) -> bool {
12489        self.event_receiver.is_terminated()
12490    }
12491}
12492
12493impl futures::Stream for LinkableEventStream {
12494    type Item = Result<LinkableEvent, fidl::Error>;
12495
12496    fn poll_next(
12497        mut self: std::pin::Pin<&mut Self>,
12498        cx: &mut std::task::Context<'_>,
12499    ) -> std::task::Poll<Option<Self::Item>> {
12500        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
12501            &mut self.event_receiver,
12502            cx
12503        )?) {
12504            Some(buf) => std::task::Poll::Ready(Some(LinkableEvent::decode(buf))),
12505            None => std::task::Poll::Ready(None),
12506        }
12507    }
12508}
12509
12510#[derive(Debug)]
12511pub enum LinkableEvent {}
12512
12513impl LinkableEvent {
12514    /// Decodes a message buffer as a [`LinkableEvent`].
12515    fn decode(
12516        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
12517    ) -> Result<LinkableEvent, fidl::Error> {
12518        let (bytes, _handles) = buf.split_mut();
12519        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12520        debug_assert_eq!(tx_header.tx_id, 0);
12521        match tx_header.ordinal {
12522            _ => Err(fidl::Error::UnknownOrdinal {
12523                ordinal: tx_header.ordinal,
12524                protocol_name: <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12525            }),
12526        }
12527    }
12528}
12529
12530/// A Stream of incoming requests for fuchsia.io/Linkable.
12531pub struct LinkableRequestStream {
12532    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12533    is_terminated: bool,
12534}
12535
12536impl std::marker::Unpin for LinkableRequestStream {}
12537
12538impl futures::stream::FusedStream for LinkableRequestStream {
12539    fn is_terminated(&self) -> bool {
12540        self.is_terminated
12541    }
12542}
12543
12544impl fidl::endpoints::RequestStream for LinkableRequestStream {
12545    type Protocol = LinkableMarker;
12546    type ControlHandle = LinkableControlHandle;
12547
12548    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
12549        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
12550    }
12551
12552    fn control_handle(&self) -> Self::ControlHandle {
12553        LinkableControlHandle { inner: self.inner.clone() }
12554    }
12555
12556    fn into_inner(
12557        self,
12558    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
12559    {
12560        (self.inner, self.is_terminated)
12561    }
12562
12563    fn from_inner(
12564        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12565        is_terminated: bool,
12566    ) -> Self {
12567        Self { inner, is_terminated }
12568    }
12569}
12570
12571impl futures::Stream for LinkableRequestStream {
12572    type Item = Result<LinkableRequest, fidl::Error>;
12573
12574    fn poll_next(
12575        mut self: std::pin::Pin<&mut Self>,
12576        cx: &mut std::task::Context<'_>,
12577    ) -> std::task::Poll<Option<Self::Item>> {
12578        let this = &mut *self;
12579        if this.inner.check_shutdown(cx) {
12580            this.is_terminated = true;
12581            return std::task::Poll::Ready(None);
12582        }
12583        if this.is_terminated {
12584            panic!("polled LinkableRequestStream after completion");
12585        }
12586        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
12587            |bytes, handles| {
12588                match this.inner.channel().read_etc(cx, bytes, handles) {
12589                    std::task::Poll::Ready(Ok(())) => {}
12590                    std::task::Poll::Pending => return std::task::Poll::Pending,
12591                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
12592                        this.is_terminated = true;
12593                        return std::task::Poll::Ready(None);
12594                    }
12595                    std::task::Poll::Ready(Err(e)) => {
12596                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
12597                            e.into(),
12598                        ))));
12599                    }
12600                }
12601
12602                // A message has been received from the channel
12603                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12604
12605                std::task::Poll::Ready(Some(match header.ordinal {
12606                    0x54f3949246a03e74 => {
12607                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12608                        let mut req = fidl::new_empty!(
12609                            LinkableLinkIntoRequest,
12610                            fidl::encoding::DefaultFuchsiaResourceDialect
12611                        );
12612                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
12613                        let control_handle = LinkableControlHandle { inner: this.inner.clone() };
12614                        Ok(LinkableRequest::LinkInto {
12615                            dst_parent_token: req.dst_parent_token,
12616                            dst: req.dst,
12617
12618                            responder: LinkableLinkIntoResponder {
12619                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12620                                tx_id: header.tx_id,
12621                            },
12622                        })
12623                    }
12624                    _ => Err(fidl::Error::UnknownOrdinal {
12625                        ordinal: header.ordinal,
12626                        protocol_name:
12627                            <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12628                    }),
12629                }))
12630            },
12631        )
12632    }
12633}
12634
12635#[derive(Debug)]
12636pub enum LinkableRequest {
12637    /// Creates a link to this this object with name `dst` in the directory represented by
12638    /// `dst_parent_token`.
12639    ///
12640    /// `dst` must be a resolved object name. Including "/" in the string will return
12641    /// `ZX_ERR_INVALID_ARGS`.
12642    ///
12643    /// This method requires the maximal set of rights supported by the filesystem for this object.
12644    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12645    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12646    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12647    /// `ZX_ERR_ACCESS_DENIED`.
12648    ///
12649    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12650    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12651    ///
12652    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12653    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12654    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12655    ///
12656    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12657    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12658    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12659    LinkInto { dst_parent_token: fidl::Event, dst: String, responder: LinkableLinkIntoResponder },
12660}
12661
12662impl LinkableRequest {
12663    #[allow(irrefutable_let_patterns)]
12664    pub fn into_link_into(self) -> Option<(fidl::Event, String, LinkableLinkIntoResponder)> {
12665        if let LinkableRequest::LinkInto { dst_parent_token, dst, responder } = self {
12666            Some((dst_parent_token, dst, responder))
12667        } else {
12668            None
12669        }
12670    }
12671
12672    /// Name of the method defined in FIDL
12673    pub fn method_name(&self) -> &'static str {
12674        match *self {
12675            LinkableRequest::LinkInto { .. } => "link_into",
12676        }
12677    }
12678}
12679
12680#[derive(Debug, Clone)]
12681pub struct LinkableControlHandle {
12682    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12683}
12684
12685impl fidl::endpoints::ControlHandle for LinkableControlHandle {
12686    fn shutdown(&self) {
12687        self.inner.shutdown()
12688    }
12689    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
12690        self.inner.shutdown_with_epitaph(status)
12691    }
12692
12693    fn is_closed(&self) -> bool {
12694        self.inner.channel().is_closed()
12695    }
12696    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
12697        self.inner.channel().on_closed()
12698    }
12699
12700    #[cfg(target_os = "fuchsia")]
12701    fn signal_peer(
12702        &self,
12703        clear_mask: zx::Signals,
12704        set_mask: zx::Signals,
12705    ) -> Result<(), zx_status::Status> {
12706        use fidl::Peered;
12707        self.inner.channel().signal_peer(clear_mask, set_mask)
12708    }
12709}
12710
12711impl LinkableControlHandle {}
12712
12713#[must_use = "FIDL methods require a response to be sent"]
12714#[derive(Debug)]
12715pub struct LinkableLinkIntoResponder {
12716    control_handle: std::mem::ManuallyDrop<LinkableControlHandle>,
12717    tx_id: u32,
12718}
12719
12720/// Set the the channel to be shutdown (see [`LinkableControlHandle::shutdown`])
12721/// if the responder is dropped without sending a response, so that the client
12722/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12723impl std::ops::Drop for LinkableLinkIntoResponder {
12724    fn drop(&mut self) {
12725        self.control_handle.shutdown();
12726        // Safety: drops once, never accessed again
12727        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12728    }
12729}
12730
12731impl fidl::endpoints::Responder for LinkableLinkIntoResponder {
12732    type ControlHandle = LinkableControlHandle;
12733
12734    fn control_handle(&self) -> &LinkableControlHandle {
12735        &self.control_handle
12736    }
12737
12738    fn drop_without_shutdown(mut self) {
12739        // Safety: drops once, never accessed again due to mem::forget
12740        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12741        // Prevent Drop from running (which would shut down the channel)
12742        std::mem::forget(self);
12743    }
12744}
12745
12746impl LinkableLinkIntoResponder {
12747    /// Sends a response to the FIDL transaction.
12748    ///
12749    /// Sets the channel to shutdown if an error occurs.
12750    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12751        let _result = self.send_raw(result);
12752        if _result.is_err() {
12753            self.control_handle.shutdown();
12754        }
12755        self.drop_without_shutdown();
12756        _result
12757    }
12758
12759    /// Similar to "send" but does not shutdown the channel if an error occurs.
12760    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12761        let _result = self.send_raw(result);
12762        self.drop_without_shutdown();
12763        _result
12764    }
12765
12766    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12767        self.control_handle
12768            .inner
12769            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12770                result,
12771                self.tx_id,
12772                0x54f3949246a03e74,
12773                fidl::encoding::DynamicFlags::empty(),
12774            )
12775    }
12776}
12777
12778#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12779pub struct NodeMarker;
12780
12781impl fidl::endpoints::ProtocolMarker for NodeMarker {
12782    type Proxy = NodeProxy;
12783    type RequestStream = NodeRequestStream;
12784    #[cfg(target_os = "fuchsia")]
12785    type SynchronousProxy = NodeSynchronousProxy;
12786
12787    const DEBUG_NAME: &'static str = "fuchsia.io.Node";
12788}
12789impl fidl::endpoints::DiscoverableProtocolMarker for NodeMarker {}
12790pub type NodeGetFlagsResult = Result<Flags, i32>;
12791pub type NodeSetFlagsResult = Result<(), i32>;
12792pub type NodeGetAttributesResult = Result<(MutableNodeAttributes, ImmutableNodeAttributes), i32>;
12793pub type NodeUpdateAttributesResult = Result<(), i32>;
12794pub type NodeSyncResult = Result<(), i32>;
12795pub type NodeGetExtendedAttributeResult = Result<ExtendedAttributeValue, i32>;
12796pub type NodeSetExtendedAttributeResult = Result<(), i32>;
12797pub type NodeRemoveExtendedAttributeResult = Result<(), i32>;
12798
12799pub trait NodeProxyInterface: Send + Sync {
12800    fn r#clone(
12801        &self,
12802        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12803    ) -> Result<(), fidl::Error>;
12804    type CloseResponseFut: std::future::Future<
12805            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
12806        > + Send;
12807    fn r#close(&self) -> Self::CloseResponseFut;
12808    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
12809    fn r#query(&self) -> Self::QueryResponseFut;
12810    fn r#deprecated_clone(
12811        &self,
12812        flags: OpenFlags,
12813        object: fidl::endpoints::ServerEnd<NodeMarker>,
12814    ) -> Result<(), fidl::Error>;
12815    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
12816        + Send;
12817    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
12818    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
12819    fn r#deprecated_set_attr(
12820        &self,
12821        flags: NodeAttributeFlags,
12822        attributes: &NodeAttributes,
12823    ) -> Self::DeprecatedSetAttrResponseFut;
12824    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
12825        + Send;
12826    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
12827    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
12828        + Send;
12829    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
12830    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
12831        + Send;
12832    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
12833    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
12834        + Send;
12835    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
12836    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
12837        + Send;
12838    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
12839    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
12840        + Send;
12841    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
12842    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
12843        + Send;
12844    fn r#update_attributes(
12845        &self,
12846        payload: &MutableNodeAttributes,
12847    ) -> Self::UpdateAttributesResponseFut;
12848    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
12849    fn r#sync(&self) -> Self::SyncResponseFut;
12850    fn r#list_extended_attributes(
12851        &self,
12852        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
12853    ) -> Result<(), fidl::Error>;
12854    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
12855        + Send;
12856    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
12857    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
12858        + Send;
12859    fn r#set_extended_attribute(
12860        &self,
12861        name: &[u8],
12862        value: ExtendedAttributeValue,
12863        mode: SetExtendedAttributeMode,
12864    ) -> Self::SetExtendedAttributeResponseFut;
12865    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
12866        + Send;
12867    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
12868}
12869#[derive(Debug)]
12870#[cfg(target_os = "fuchsia")]
12871pub struct NodeSynchronousProxy {
12872    client: fidl::client::sync::Client,
12873}
12874
12875#[cfg(target_os = "fuchsia")]
12876impl fidl::endpoints::SynchronousProxy for NodeSynchronousProxy {
12877    type Proxy = NodeProxy;
12878    type Protocol = NodeMarker;
12879
12880    fn from_channel(inner: fidl::Channel) -> Self {
12881        Self::new(inner)
12882    }
12883
12884    fn into_channel(self) -> fidl::Channel {
12885        self.client.into_channel()
12886    }
12887
12888    fn as_channel(&self) -> &fidl::Channel {
12889        self.client.as_channel()
12890    }
12891}
12892
12893#[cfg(target_os = "fuchsia")]
12894impl NodeSynchronousProxy {
12895    pub fn new(channel: fidl::Channel) -> Self {
12896        let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12897        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
12898    }
12899
12900    pub fn into_channel(self) -> fidl::Channel {
12901        self.client.into_channel()
12902    }
12903
12904    /// Waits until an event arrives and returns it. It is safe for other
12905    /// threads to make concurrent requests while waiting for an event.
12906    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<NodeEvent, fidl::Error> {
12907        NodeEvent::decode(self.client.wait_for_event(deadline)?)
12908    }
12909
12910    pub fn r#clone(
12911        &self,
12912        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12913    ) -> Result<(), fidl::Error> {
12914        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
12915            (request,),
12916            0x20d8a7aba2168a79,
12917            fidl::encoding::DynamicFlags::empty(),
12918        )
12919    }
12920
12921    /// Terminates the connection.
12922    ///
12923    /// After calling `Close`, the client must not send any other requests.
12924    ///
12925    /// Servers, after sending the status response, should close the connection
12926    /// regardless of status and without sending an epitaph.
12927    ///
12928    /// Closing the client end of the channel should be semantically equivalent
12929    /// to calling `Close` without knowing when the close has completed or its
12930    /// status.
12931    pub fn r#close(
12932        &self,
12933        ___deadline: zx::MonotonicInstant,
12934    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
12935        let _response = self.client.send_query::<
12936            fidl::encoding::EmptyPayload,
12937            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12938        >(
12939            (),
12940            0x5ac5d459ad7f657e,
12941            fidl::encoding::DynamicFlags::empty(),
12942            ___deadline,
12943        )?;
12944        Ok(_response.map(|x| x))
12945    }
12946
12947    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
12948        let _response = self.client.send_query::<
12949            fidl::encoding::EmptyPayload,
12950            fidl_fuchsia_unknown::QueryableQueryResponse,
12951        >(
12952            (),
12953            0x2658edee9decfc06,
12954            fidl::encoding::DynamicFlags::empty(),
12955            ___deadline,
12956        )?;
12957        Ok(_response.protocol)
12958    }
12959
12960    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
12961    pub fn r#deprecated_clone(
12962        &self,
12963        mut flags: OpenFlags,
12964        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
12965    ) -> Result<(), fidl::Error> {
12966        self.client.send::<NodeDeprecatedCloneRequest>(
12967            (flags, object),
12968            0x5a61678f293ce16f,
12969            fidl::encoding::DynamicFlags::FLEXIBLE,
12970        )
12971    }
12972
12973    /// DEPRECATED - Use `Node.GetAttributes` instead.
12974    pub fn r#deprecated_get_attr(
12975        &self,
12976        ___deadline: zx::MonotonicInstant,
12977    ) -> Result<(i32, NodeAttributes), fidl::Error> {
12978        let _response =
12979            self.client.send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse>(
12980                (),
12981                0x78985e216314dafd,
12982                fidl::encoding::DynamicFlags::empty(),
12983                ___deadline,
12984            )?;
12985        Ok((_response.s, _response.attributes))
12986    }
12987
12988    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
12989    pub fn r#deprecated_set_attr(
12990        &self,
12991        mut flags: NodeAttributeFlags,
12992        mut attributes: &NodeAttributes,
12993        ___deadline: zx::MonotonicInstant,
12994    ) -> Result<i32, fidl::Error> {
12995        let _response =
12996            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
12997                (flags, attributes),
12998                0x4186c0f40d938f46,
12999                fidl::encoding::DynamicFlags::empty(),
13000                ___deadline,
13001            )?;
13002        Ok(_response.s)
13003    }
13004
13005    /// [DEPRECATED - Use new GetFlags method instead.]
13006    pub fn r#deprecated_get_flags(
13007        &self,
13008        ___deadline: zx::MonotonicInstant,
13009    ) -> Result<(i32, OpenFlags), fidl::Error> {
13010        let _response = self
13011            .client
13012            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
13013                (),
13014                0x5b88fffb8eda3aa1,
13015                fidl::encoding::DynamicFlags::empty(),
13016                ___deadline,
13017            )?;
13018        Ok((_response.s, _response.flags))
13019    }
13020
13021    /// [DEPRECATED - Use new SetFlags method instead.]
13022    pub fn r#deprecated_set_flags(
13023        &self,
13024        mut flags: OpenFlags,
13025        ___deadline: zx::MonotonicInstant,
13026    ) -> Result<i32, fidl::Error> {
13027        let _response = self
13028            .client
13029            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
13030                (flags,),
13031                0x5295b76c71fde733,
13032                fidl::encoding::DynamicFlags::empty(),
13033                ___deadline,
13034            )?;
13035        Ok(_response.s)
13036    }
13037
13038    /// Queries the flags that apply to this node after it has been opened/created. This method does
13039    /// not require any rights.
13040    ///
13041    /// Note that the final set of flags that apply to the connection may differ from those
13042    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13043    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13044    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13045    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13046    pub fn r#get_flags(
13047        &self,
13048        ___deadline: zx::MonotonicInstant,
13049    ) -> Result<NodeGetFlagsResult, fidl::Error> {
13050        let _response = self.client.send_query::<
13051            fidl::encoding::EmptyPayload,
13052            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
13053        >(
13054            (),
13055            0x176eb318f64ec23,
13056            fidl::encoding::DynamicFlags::FLEXIBLE,
13057            ___deadline,
13058        )?
13059        .into_result::<NodeMarker>("get_flags")?;
13060        Ok(_response.map(|x| x.flags))
13061    }
13062
13063    /// Sets the flags that apply to this node after it has been opened. This method does not
13064    /// require any rights.
13065    ///
13066    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13067    /// clear append mode.
13068    ///
13069    /// Errors:
13070    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13071    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13072    pub fn r#set_flags(
13073        &self,
13074        mut flags: Flags,
13075        ___deadline: zx::MonotonicInstant,
13076    ) -> Result<NodeSetFlagsResult, fidl::Error> {
13077        let _response = self.client.send_query::<
13078            NodeSetFlagsRequest,
13079            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
13080        >(
13081            (flags,),
13082            0x55a8028685791ea8,
13083            fidl::encoding::DynamicFlags::FLEXIBLE,
13084            ___deadline,
13085        )?
13086        .into_result::<NodeMarker>("set_flags")?;
13087        Ok(_response.map(|x| x))
13088    }
13089
13090    /// Query the filesystem for filesystem-specific information.
13091    pub fn r#query_filesystem(
13092        &self,
13093        ___deadline: zx::MonotonicInstant,
13094    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
13095        let _response =
13096            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
13097                (),
13098                0x6f344a1c6b0a0610,
13099                fidl::encoding::DynamicFlags::empty(),
13100                ___deadline,
13101            )?;
13102        Ok((_response.s, _response.info))
13103    }
13104
13105    /// Acquires information about the node.
13106    ///
13107    /// The attributes of a node should be stable, independent of the
13108    /// specific protocol used to access it.
13109    ///
13110    /// If a particular attribute is not applicable or not supported,
13111    /// filesystems should leave the corresponding field absent.
13112    ///
13113    /// + `query` a bit-mask specifying which attributes to fetch. The server
13114    ///   should not return more than necessary.
13115    /// - `attributes` the returned attributes.
13116    ///
13117    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13118    pub fn r#get_attributes(
13119        &self,
13120        mut query: NodeAttributesQuery,
13121        ___deadline: zx::MonotonicInstant,
13122    ) -> Result<NodeGetAttributesResult, fidl::Error> {
13123        let _response = self.client.send_query::<
13124            NodeGetAttributesRequest,
13125            fidl::encoding::ResultType<NodeAttributes2, i32>,
13126        >(
13127            (query,),
13128            0x3d4396a638ea053b,
13129            fidl::encoding::DynamicFlags::empty(),
13130            ___deadline,
13131        )?;
13132        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
13133    }
13134
13135    /// Updates information about the node.
13136    ///
13137    /// + `attributes` the presence of a table field in `attributes` indicates
13138    /// the intent to update the corresponding attribute.
13139    ///
13140    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13141    ///
13142    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13143    pub fn r#update_attributes(
13144        &self,
13145        mut payload: &MutableNodeAttributes,
13146        ___deadline: zx::MonotonicInstant,
13147    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
13148        let _response = self.client.send_query::<
13149            MutableNodeAttributes,
13150            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13151        >(
13152            payload,
13153            0x3308c1da5a89bf08,
13154            fidl::encoding::DynamicFlags::empty(),
13155            ___deadline,
13156        )?;
13157        Ok(_response.map(|x| x))
13158    }
13159
13160    /// Synchronizes updates to the node to the underlying media, if it exists.
13161    ///
13162    /// This method will return when the filesystem server has flushed the
13163    /// relevant updates to the underlying media, but does not guarantee the
13164    /// underlying media has persisted the information, nor that any information
13165    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13166    /// between operations.
13167    ///
13168    /// This method does not require any rights.
13169    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
13170        let _response = self.client.send_query::<
13171            fidl::encoding::EmptyPayload,
13172            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13173        >(
13174            (),
13175            0x2c5c27ca0ab5dc49,
13176            fidl::encoding::DynamicFlags::empty(),
13177            ___deadline,
13178        )?;
13179        Ok(_response.map(|x| x))
13180    }
13181
13182    /// Creates an iterator over all the extended attribute names associated
13183    /// with this node. If an error occurs it is returned as an epitaph on the
13184    /// iterator request channel, and then the channel is closed.
13185    ///
13186    /// GetExtendedAttributes can be used with any of these names to retrieve
13187    /// the associated value.
13188    ///
13189    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13190    pub fn r#list_extended_attributes(
13191        &self,
13192        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13193    ) -> Result<(), fidl::Error> {
13194        self.client.send::<NodeListExtendedAttributesRequest>(
13195            (iterator,),
13196            0x4b61033de007fcd0,
13197            fidl::encoding::DynamicFlags::empty(),
13198        )
13199    }
13200
13201    /// Get the value associated with the given attribute `name` for this node.
13202    ///
13203    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13204    /// particular structure is imposed on them.
13205    ///
13206    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13207    pub fn r#get_extended_attribute(
13208        &self,
13209        mut name: &[u8],
13210        ___deadline: zx::MonotonicInstant,
13211    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
13212        let _response = self.client.send_query::<
13213            NodeGetExtendedAttributeRequest,
13214            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
13215        >(
13216            (name,),
13217            0x45ffa3ccfdeb76db,
13218            fidl::encoding::DynamicFlags::empty(),
13219            ___deadline,
13220        )?;
13221        Ok(_response.map(|x| x))
13222    }
13223
13224    /// Set the value for the given attribute `name` to `value` for this node.
13225    ///
13226    /// The attribute name may exist, in which case the attribute is updated.
13227    /// If the attribute doesn't exist, it is created. The name should have no
13228    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13229    ///
13230    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13231    pub fn r#set_extended_attribute(
13232        &self,
13233        mut name: &[u8],
13234        mut value: ExtendedAttributeValue,
13235        mut mode: SetExtendedAttributeMode,
13236        ___deadline: zx::MonotonicInstant,
13237    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
13238        let _response = self.client.send_query::<
13239            NodeSetExtendedAttributeRequest,
13240            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13241        >(
13242            (name, &mut value, mode,),
13243            0x4a951362f681f23c,
13244            fidl::encoding::DynamicFlags::empty(),
13245            ___deadline,
13246        )?;
13247        Ok(_response.map(|x| x))
13248    }
13249
13250    /// Remove the specified extended attribute.
13251    ///
13252    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13253    ///
13254    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13255    pub fn r#remove_extended_attribute(
13256        &self,
13257        mut name: &[u8],
13258        ___deadline: zx::MonotonicInstant,
13259    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
13260        let _response = self.client.send_query::<
13261            NodeRemoveExtendedAttributeRequest,
13262            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13263        >(
13264            (name,),
13265            0x7a0b9f3a9bf9032d,
13266            fidl::encoding::DynamicFlags::empty(),
13267            ___deadline,
13268        )?;
13269        Ok(_response.map(|x| x))
13270    }
13271}
13272
13273#[cfg(target_os = "fuchsia")]
13274impl From<NodeSynchronousProxy> for zx::NullableHandle {
13275    fn from(value: NodeSynchronousProxy) -> Self {
13276        value.into_channel().into()
13277    }
13278}
13279
13280#[cfg(target_os = "fuchsia")]
13281impl From<fidl::Channel> for NodeSynchronousProxy {
13282    fn from(value: fidl::Channel) -> Self {
13283        Self::new(value)
13284    }
13285}
13286
13287#[cfg(target_os = "fuchsia")]
13288impl fidl::endpoints::FromClient for NodeSynchronousProxy {
13289    type Protocol = NodeMarker;
13290
13291    fn from_client(value: fidl::endpoints::ClientEnd<NodeMarker>) -> Self {
13292        Self::new(value.into_channel())
13293    }
13294}
13295
13296#[derive(Debug, Clone)]
13297pub struct NodeProxy {
13298    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
13299}
13300
13301impl fidl::endpoints::Proxy for NodeProxy {
13302    type Protocol = NodeMarker;
13303
13304    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
13305        Self::new(inner)
13306    }
13307
13308    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
13309        self.client.into_channel().map_err(|client| Self { client })
13310    }
13311
13312    fn as_channel(&self) -> &::fidl::AsyncChannel {
13313        self.client.as_channel()
13314    }
13315}
13316
13317impl NodeProxy {
13318    /// Create a new Proxy for fuchsia.io/Node.
13319    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
13320        let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
13321        Self { client: fidl::client::Client::new(channel, protocol_name) }
13322    }
13323
13324    /// Get a Stream of events from the remote end of the protocol.
13325    ///
13326    /// # Panics
13327    ///
13328    /// Panics if the event stream was already taken.
13329    pub fn take_event_stream(&self) -> NodeEventStream {
13330        NodeEventStream { event_receiver: self.client.take_event_receiver() }
13331    }
13332
13333    pub fn r#clone(
13334        &self,
13335        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13336    ) -> Result<(), fidl::Error> {
13337        NodeProxyInterface::r#clone(self, request)
13338    }
13339
13340    /// Terminates the connection.
13341    ///
13342    /// After calling `Close`, the client must not send any other requests.
13343    ///
13344    /// Servers, after sending the status response, should close the connection
13345    /// regardless of status and without sending an epitaph.
13346    ///
13347    /// Closing the client end of the channel should be semantically equivalent
13348    /// to calling `Close` without knowing when the close has completed or its
13349    /// status.
13350    pub fn r#close(
13351        &self,
13352    ) -> fidl::client::QueryResponseFut<
13353        fidl_fuchsia_unknown::CloseableCloseResult,
13354        fidl::encoding::DefaultFuchsiaResourceDialect,
13355    > {
13356        NodeProxyInterface::r#close(self)
13357    }
13358
13359    pub fn r#query(
13360        &self,
13361    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
13362    {
13363        NodeProxyInterface::r#query(self)
13364    }
13365
13366    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
13367    pub fn r#deprecated_clone(
13368        &self,
13369        mut flags: OpenFlags,
13370        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13371    ) -> Result<(), fidl::Error> {
13372        NodeProxyInterface::r#deprecated_clone(self, flags, object)
13373    }
13374
13375    /// DEPRECATED - Use `Node.GetAttributes` instead.
13376    pub fn r#deprecated_get_attr(
13377        &self,
13378    ) -> fidl::client::QueryResponseFut<
13379        (i32, NodeAttributes),
13380        fidl::encoding::DefaultFuchsiaResourceDialect,
13381    > {
13382        NodeProxyInterface::r#deprecated_get_attr(self)
13383    }
13384
13385    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
13386    pub fn r#deprecated_set_attr(
13387        &self,
13388        mut flags: NodeAttributeFlags,
13389        mut attributes: &NodeAttributes,
13390    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13391        NodeProxyInterface::r#deprecated_set_attr(self, flags, attributes)
13392    }
13393
13394    /// [DEPRECATED - Use new GetFlags method instead.]
13395    pub fn r#deprecated_get_flags(
13396        &self,
13397    ) -> fidl::client::QueryResponseFut<
13398        (i32, OpenFlags),
13399        fidl::encoding::DefaultFuchsiaResourceDialect,
13400    > {
13401        NodeProxyInterface::r#deprecated_get_flags(self)
13402    }
13403
13404    /// [DEPRECATED - Use new SetFlags method instead.]
13405    pub fn r#deprecated_set_flags(
13406        &self,
13407        mut flags: OpenFlags,
13408    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13409        NodeProxyInterface::r#deprecated_set_flags(self, flags)
13410    }
13411
13412    /// Queries the flags that apply to this node after it has been opened/created. This method does
13413    /// not require any rights.
13414    ///
13415    /// Note that the final set of flags that apply to the connection may differ from those
13416    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13417    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13418    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13419    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13420    pub fn r#get_flags(
13421        &self,
13422    ) -> fidl::client::QueryResponseFut<
13423        NodeGetFlagsResult,
13424        fidl::encoding::DefaultFuchsiaResourceDialect,
13425    > {
13426        NodeProxyInterface::r#get_flags(self)
13427    }
13428
13429    /// Sets the flags that apply to this node after it has been opened. This method does not
13430    /// require any rights.
13431    ///
13432    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13433    /// clear append mode.
13434    ///
13435    /// Errors:
13436    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13437    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13438    pub fn r#set_flags(
13439        &self,
13440        mut flags: Flags,
13441    ) -> fidl::client::QueryResponseFut<
13442        NodeSetFlagsResult,
13443        fidl::encoding::DefaultFuchsiaResourceDialect,
13444    > {
13445        NodeProxyInterface::r#set_flags(self, flags)
13446    }
13447
13448    /// Query the filesystem for filesystem-specific information.
13449    pub fn r#query_filesystem(
13450        &self,
13451    ) -> fidl::client::QueryResponseFut<
13452        (i32, Option<Box<FilesystemInfo>>),
13453        fidl::encoding::DefaultFuchsiaResourceDialect,
13454    > {
13455        NodeProxyInterface::r#query_filesystem(self)
13456    }
13457
13458    /// Acquires information about the node.
13459    ///
13460    /// The attributes of a node should be stable, independent of the
13461    /// specific protocol used to access it.
13462    ///
13463    /// If a particular attribute is not applicable or not supported,
13464    /// filesystems should leave the corresponding field absent.
13465    ///
13466    /// + `query` a bit-mask specifying which attributes to fetch. The server
13467    ///   should not return more than necessary.
13468    /// - `attributes` the returned attributes.
13469    ///
13470    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13471    pub fn r#get_attributes(
13472        &self,
13473        mut query: NodeAttributesQuery,
13474    ) -> fidl::client::QueryResponseFut<
13475        NodeGetAttributesResult,
13476        fidl::encoding::DefaultFuchsiaResourceDialect,
13477    > {
13478        NodeProxyInterface::r#get_attributes(self, query)
13479    }
13480
13481    /// Updates information about the node.
13482    ///
13483    /// + `attributes` the presence of a table field in `attributes` indicates
13484    /// the intent to update the corresponding attribute.
13485    ///
13486    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13487    ///
13488    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13489    pub fn r#update_attributes(
13490        &self,
13491        mut payload: &MutableNodeAttributes,
13492    ) -> fidl::client::QueryResponseFut<
13493        NodeUpdateAttributesResult,
13494        fidl::encoding::DefaultFuchsiaResourceDialect,
13495    > {
13496        NodeProxyInterface::r#update_attributes(self, payload)
13497    }
13498
13499    /// Synchronizes updates to the node to the underlying media, if it exists.
13500    ///
13501    /// This method will return when the filesystem server has flushed the
13502    /// relevant updates to the underlying media, but does not guarantee the
13503    /// underlying media has persisted the information, nor that any information
13504    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13505    /// between operations.
13506    ///
13507    /// This method does not require any rights.
13508    pub fn r#sync(
13509        &self,
13510    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
13511    {
13512        NodeProxyInterface::r#sync(self)
13513    }
13514
13515    /// Creates an iterator over all the extended attribute names associated
13516    /// with this node. If an error occurs it is returned as an epitaph on the
13517    /// iterator request channel, and then the channel is closed.
13518    ///
13519    /// GetExtendedAttributes can be used with any of these names to retrieve
13520    /// the associated value.
13521    ///
13522    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13523    pub fn r#list_extended_attributes(
13524        &self,
13525        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13526    ) -> Result<(), fidl::Error> {
13527        NodeProxyInterface::r#list_extended_attributes(self, iterator)
13528    }
13529
13530    /// Get the value associated with the given attribute `name` for this node.
13531    ///
13532    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13533    /// particular structure is imposed on them.
13534    ///
13535    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13536    pub fn r#get_extended_attribute(
13537        &self,
13538        mut name: &[u8],
13539    ) -> fidl::client::QueryResponseFut<
13540        NodeGetExtendedAttributeResult,
13541        fidl::encoding::DefaultFuchsiaResourceDialect,
13542    > {
13543        NodeProxyInterface::r#get_extended_attribute(self, name)
13544    }
13545
13546    /// Set the value for the given attribute `name` to `value` for this node.
13547    ///
13548    /// The attribute name may exist, in which case the attribute is updated.
13549    /// If the attribute doesn't exist, it is created. The name should have no
13550    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13551    ///
13552    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13553    pub fn r#set_extended_attribute(
13554        &self,
13555        mut name: &[u8],
13556        mut value: ExtendedAttributeValue,
13557        mut mode: SetExtendedAttributeMode,
13558    ) -> fidl::client::QueryResponseFut<
13559        NodeSetExtendedAttributeResult,
13560        fidl::encoding::DefaultFuchsiaResourceDialect,
13561    > {
13562        NodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
13563    }
13564
13565    /// Remove the specified extended attribute.
13566    ///
13567    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13568    ///
13569    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13570    pub fn r#remove_extended_attribute(
13571        &self,
13572        mut name: &[u8],
13573    ) -> fidl::client::QueryResponseFut<
13574        NodeRemoveExtendedAttributeResult,
13575        fidl::encoding::DefaultFuchsiaResourceDialect,
13576    > {
13577        NodeProxyInterface::r#remove_extended_attribute(self, name)
13578    }
13579}
13580
13581impl NodeProxyInterface for NodeProxy {
13582    fn r#clone(
13583        &self,
13584        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13585    ) -> Result<(), fidl::Error> {
13586        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
13587            (request,),
13588            0x20d8a7aba2168a79,
13589            fidl::encoding::DynamicFlags::empty(),
13590        )
13591    }
13592
13593    type CloseResponseFut = fidl::client::QueryResponseFut<
13594        fidl_fuchsia_unknown::CloseableCloseResult,
13595        fidl::encoding::DefaultFuchsiaResourceDialect,
13596    >;
13597    fn r#close(&self) -> Self::CloseResponseFut {
13598        fn _decode(
13599            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13600        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
13601            let _response = fidl::client::decode_transaction_body::<
13602                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13603                fidl::encoding::DefaultFuchsiaResourceDialect,
13604                0x5ac5d459ad7f657e,
13605            >(_buf?)?;
13606            Ok(_response.map(|x| x))
13607        }
13608        self.client.send_query_and_decode::<
13609            fidl::encoding::EmptyPayload,
13610            fidl_fuchsia_unknown::CloseableCloseResult,
13611        >(
13612            (),
13613            0x5ac5d459ad7f657e,
13614            fidl::encoding::DynamicFlags::empty(),
13615            _decode,
13616        )
13617    }
13618
13619    type QueryResponseFut =
13620        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
13621    fn r#query(&self) -> Self::QueryResponseFut {
13622        fn _decode(
13623            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13624        ) -> Result<Vec<u8>, fidl::Error> {
13625            let _response = fidl::client::decode_transaction_body::<
13626                fidl_fuchsia_unknown::QueryableQueryResponse,
13627                fidl::encoding::DefaultFuchsiaResourceDialect,
13628                0x2658edee9decfc06,
13629            >(_buf?)?;
13630            Ok(_response.protocol)
13631        }
13632        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
13633            (),
13634            0x2658edee9decfc06,
13635            fidl::encoding::DynamicFlags::empty(),
13636            _decode,
13637        )
13638    }
13639
13640    fn r#deprecated_clone(
13641        &self,
13642        mut flags: OpenFlags,
13643        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13644    ) -> Result<(), fidl::Error> {
13645        self.client.send::<NodeDeprecatedCloneRequest>(
13646            (flags, object),
13647            0x5a61678f293ce16f,
13648            fidl::encoding::DynamicFlags::FLEXIBLE,
13649        )
13650    }
13651
13652    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
13653        (i32, NodeAttributes),
13654        fidl::encoding::DefaultFuchsiaResourceDialect,
13655    >;
13656    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
13657        fn _decode(
13658            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13659        ) -> Result<(i32, NodeAttributes), fidl::Error> {
13660            let _response = fidl::client::decode_transaction_body::<
13661                NodeDeprecatedGetAttrResponse,
13662                fidl::encoding::DefaultFuchsiaResourceDialect,
13663                0x78985e216314dafd,
13664            >(_buf?)?;
13665            Ok((_response.s, _response.attributes))
13666        }
13667        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
13668            (),
13669            0x78985e216314dafd,
13670            fidl::encoding::DynamicFlags::empty(),
13671            _decode,
13672        )
13673    }
13674
13675    type DeprecatedSetAttrResponseFut =
13676        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
13677    fn r#deprecated_set_attr(
13678        &self,
13679        mut flags: NodeAttributeFlags,
13680        mut attributes: &NodeAttributes,
13681    ) -> Self::DeprecatedSetAttrResponseFut {
13682        fn _decode(
13683            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13684        ) -> Result<i32, fidl::Error> {
13685            let _response = fidl::client::decode_transaction_body::<
13686                NodeDeprecatedSetAttrResponse,
13687                fidl::encoding::DefaultFuchsiaResourceDialect,
13688                0x4186c0f40d938f46,
13689            >(_buf?)?;
13690            Ok(_response.s)
13691        }
13692        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
13693            (flags, attributes),
13694            0x4186c0f40d938f46,
13695            fidl::encoding::DynamicFlags::empty(),
13696            _decode,
13697        )
13698    }
13699
13700    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
13701        (i32, OpenFlags),
13702        fidl::encoding::DefaultFuchsiaResourceDialect,
13703    >;
13704    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
13705        fn _decode(
13706            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13707        ) -> Result<(i32, OpenFlags), fidl::Error> {
13708            let _response = fidl::client::decode_transaction_body::<
13709                NodeDeprecatedGetFlagsResponse,
13710                fidl::encoding::DefaultFuchsiaResourceDialect,
13711                0x5b88fffb8eda3aa1,
13712            >(_buf?)?;
13713            Ok((_response.s, _response.flags))
13714        }
13715        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
13716            (),
13717            0x5b88fffb8eda3aa1,
13718            fidl::encoding::DynamicFlags::empty(),
13719            _decode,
13720        )
13721    }
13722
13723    type DeprecatedSetFlagsResponseFut =
13724        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
13725    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
13726        fn _decode(
13727            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13728        ) -> Result<i32, fidl::Error> {
13729            let _response = fidl::client::decode_transaction_body::<
13730                NodeDeprecatedSetFlagsResponse,
13731                fidl::encoding::DefaultFuchsiaResourceDialect,
13732                0x5295b76c71fde733,
13733            >(_buf?)?;
13734            Ok(_response.s)
13735        }
13736        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
13737            (flags,),
13738            0x5295b76c71fde733,
13739            fidl::encoding::DynamicFlags::empty(),
13740            _decode,
13741        )
13742    }
13743
13744    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
13745        NodeGetFlagsResult,
13746        fidl::encoding::DefaultFuchsiaResourceDialect,
13747    >;
13748    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
13749        fn _decode(
13750            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13751        ) -> Result<NodeGetFlagsResult, fidl::Error> {
13752            let _response = fidl::client::decode_transaction_body::<
13753                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
13754                fidl::encoding::DefaultFuchsiaResourceDialect,
13755                0x176eb318f64ec23,
13756            >(_buf?)?
13757            .into_result::<NodeMarker>("get_flags")?;
13758            Ok(_response.map(|x| x.flags))
13759        }
13760        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
13761            (),
13762            0x176eb318f64ec23,
13763            fidl::encoding::DynamicFlags::FLEXIBLE,
13764            _decode,
13765        )
13766    }
13767
13768    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
13769        NodeSetFlagsResult,
13770        fidl::encoding::DefaultFuchsiaResourceDialect,
13771    >;
13772    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
13773        fn _decode(
13774            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13775        ) -> Result<NodeSetFlagsResult, fidl::Error> {
13776            let _response = fidl::client::decode_transaction_body::<
13777                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
13778                fidl::encoding::DefaultFuchsiaResourceDialect,
13779                0x55a8028685791ea8,
13780            >(_buf?)?
13781            .into_result::<NodeMarker>("set_flags")?;
13782            Ok(_response.map(|x| x))
13783        }
13784        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
13785            (flags,),
13786            0x55a8028685791ea8,
13787            fidl::encoding::DynamicFlags::FLEXIBLE,
13788            _decode,
13789        )
13790    }
13791
13792    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
13793        (i32, Option<Box<FilesystemInfo>>),
13794        fidl::encoding::DefaultFuchsiaResourceDialect,
13795    >;
13796    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
13797        fn _decode(
13798            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13799        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
13800            let _response = fidl::client::decode_transaction_body::<
13801                NodeQueryFilesystemResponse,
13802                fidl::encoding::DefaultFuchsiaResourceDialect,
13803                0x6f344a1c6b0a0610,
13804            >(_buf?)?;
13805            Ok((_response.s, _response.info))
13806        }
13807        self.client.send_query_and_decode::<
13808            fidl::encoding::EmptyPayload,
13809            (i32, Option<Box<FilesystemInfo>>),
13810        >(
13811            (),
13812            0x6f344a1c6b0a0610,
13813            fidl::encoding::DynamicFlags::empty(),
13814            _decode,
13815        )
13816    }
13817
13818    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
13819        NodeGetAttributesResult,
13820        fidl::encoding::DefaultFuchsiaResourceDialect,
13821    >;
13822    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
13823        fn _decode(
13824            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13825        ) -> Result<NodeGetAttributesResult, fidl::Error> {
13826            let _response = fidl::client::decode_transaction_body::<
13827                fidl::encoding::ResultType<NodeAttributes2, i32>,
13828                fidl::encoding::DefaultFuchsiaResourceDialect,
13829                0x3d4396a638ea053b,
13830            >(_buf?)?;
13831            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
13832        }
13833        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
13834            (query,),
13835            0x3d4396a638ea053b,
13836            fidl::encoding::DynamicFlags::empty(),
13837            _decode,
13838        )
13839    }
13840
13841    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
13842        NodeUpdateAttributesResult,
13843        fidl::encoding::DefaultFuchsiaResourceDialect,
13844    >;
13845    fn r#update_attributes(
13846        &self,
13847        mut payload: &MutableNodeAttributes,
13848    ) -> Self::UpdateAttributesResponseFut {
13849        fn _decode(
13850            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13851        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
13852            let _response = fidl::client::decode_transaction_body::<
13853                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13854                fidl::encoding::DefaultFuchsiaResourceDialect,
13855                0x3308c1da5a89bf08,
13856            >(_buf?)?;
13857            Ok(_response.map(|x| x))
13858        }
13859        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
13860            payload,
13861            0x3308c1da5a89bf08,
13862            fidl::encoding::DynamicFlags::empty(),
13863            _decode,
13864        )
13865    }
13866
13867    type SyncResponseFut = fidl::client::QueryResponseFut<
13868        NodeSyncResult,
13869        fidl::encoding::DefaultFuchsiaResourceDialect,
13870    >;
13871    fn r#sync(&self) -> Self::SyncResponseFut {
13872        fn _decode(
13873            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13874        ) -> Result<NodeSyncResult, fidl::Error> {
13875            let _response = fidl::client::decode_transaction_body::<
13876                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13877                fidl::encoding::DefaultFuchsiaResourceDialect,
13878                0x2c5c27ca0ab5dc49,
13879            >(_buf?)?;
13880            Ok(_response.map(|x| x))
13881        }
13882        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
13883            (),
13884            0x2c5c27ca0ab5dc49,
13885            fidl::encoding::DynamicFlags::empty(),
13886            _decode,
13887        )
13888    }
13889
13890    fn r#list_extended_attributes(
13891        &self,
13892        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13893    ) -> Result<(), fidl::Error> {
13894        self.client.send::<NodeListExtendedAttributesRequest>(
13895            (iterator,),
13896            0x4b61033de007fcd0,
13897            fidl::encoding::DynamicFlags::empty(),
13898        )
13899    }
13900
13901    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
13902        NodeGetExtendedAttributeResult,
13903        fidl::encoding::DefaultFuchsiaResourceDialect,
13904    >;
13905    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
13906        fn _decode(
13907            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13908        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
13909            let _response = fidl::client::decode_transaction_body::<
13910                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
13911                fidl::encoding::DefaultFuchsiaResourceDialect,
13912                0x45ffa3ccfdeb76db,
13913            >(_buf?)?;
13914            Ok(_response.map(|x| x))
13915        }
13916        self.client.send_query_and_decode::<
13917            NodeGetExtendedAttributeRequest,
13918            NodeGetExtendedAttributeResult,
13919        >(
13920            (name,),
13921            0x45ffa3ccfdeb76db,
13922            fidl::encoding::DynamicFlags::empty(),
13923            _decode,
13924        )
13925    }
13926
13927    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
13928        NodeSetExtendedAttributeResult,
13929        fidl::encoding::DefaultFuchsiaResourceDialect,
13930    >;
13931    fn r#set_extended_attribute(
13932        &self,
13933        mut name: &[u8],
13934        mut value: ExtendedAttributeValue,
13935        mut mode: SetExtendedAttributeMode,
13936    ) -> Self::SetExtendedAttributeResponseFut {
13937        fn _decode(
13938            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13939        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
13940            let _response = fidl::client::decode_transaction_body::<
13941                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13942                fidl::encoding::DefaultFuchsiaResourceDialect,
13943                0x4a951362f681f23c,
13944            >(_buf?)?;
13945            Ok(_response.map(|x| x))
13946        }
13947        self.client.send_query_and_decode::<
13948            NodeSetExtendedAttributeRequest,
13949            NodeSetExtendedAttributeResult,
13950        >(
13951            (name, &mut value, mode,),
13952            0x4a951362f681f23c,
13953            fidl::encoding::DynamicFlags::empty(),
13954            _decode,
13955        )
13956    }
13957
13958    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
13959        NodeRemoveExtendedAttributeResult,
13960        fidl::encoding::DefaultFuchsiaResourceDialect,
13961    >;
13962    fn r#remove_extended_attribute(
13963        &self,
13964        mut name: &[u8],
13965    ) -> Self::RemoveExtendedAttributeResponseFut {
13966        fn _decode(
13967            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13968        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
13969            let _response = fidl::client::decode_transaction_body::<
13970                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13971                fidl::encoding::DefaultFuchsiaResourceDialect,
13972                0x7a0b9f3a9bf9032d,
13973            >(_buf?)?;
13974            Ok(_response.map(|x| x))
13975        }
13976        self.client.send_query_and_decode::<
13977            NodeRemoveExtendedAttributeRequest,
13978            NodeRemoveExtendedAttributeResult,
13979        >(
13980            (name,),
13981            0x7a0b9f3a9bf9032d,
13982            fidl::encoding::DynamicFlags::empty(),
13983            _decode,
13984        )
13985    }
13986}
13987
13988pub struct NodeEventStream {
13989    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
13990}
13991
13992impl std::marker::Unpin for NodeEventStream {}
13993
13994impl futures::stream::FusedStream for NodeEventStream {
13995    fn is_terminated(&self) -> bool {
13996        self.event_receiver.is_terminated()
13997    }
13998}
13999
14000impl futures::Stream for NodeEventStream {
14001    type Item = Result<NodeEvent, fidl::Error>;
14002
14003    fn poll_next(
14004        mut self: std::pin::Pin<&mut Self>,
14005        cx: &mut std::task::Context<'_>,
14006    ) -> std::task::Poll<Option<Self::Item>> {
14007        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
14008            &mut self.event_receiver,
14009            cx
14010        )?) {
14011            Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
14012            None => std::task::Poll::Ready(None),
14013        }
14014    }
14015}
14016
14017#[derive(Debug)]
14018pub enum NodeEvent {
14019    OnOpen_ {
14020        s: i32,
14021        info: Option<Box<NodeInfoDeprecated>>,
14022    },
14023    OnRepresentation {
14024        payload: Representation,
14025    },
14026    #[non_exhaustive]
14027    _UnknownEvent {
14028        /// Ordinal of the event that was sent.
14029        ordinal: u64,
14030    },
14031}
14032
14033impl NodeEvent {
14034    #[allow(irrefutable_let_patterns)]
14035    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
14036        if let NodeEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
14037    }
14038    #[allow(irrefutable_let_patterns)]
14039    pub fn into_on_representation(self) -> Option<Representation> {
14040        if let NodeEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
14041    }
14042
14043    /// Decodes a message buffer as a [`NodeEvent`].
14044    fn decode(
14045        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
14046    ) -> Result<NodeEvent, fidl::Error> {
14047        let (bytes, _handles) = buf.split_mut();
14048        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14049        debug_assert_eq!(tx_header.tx_id, 0);
14050        match tx_header.ordinal {
14051            0x7fc7bbb1dbfd1972 => {
14052                let mut out = fidl::new_empty!(
14053                    NodeOnOpenRequest,
14054                    fidl::encoding::DefaultFuchsiaResourceDialect
14055                );
14056                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
14057                Ok((NodeEvent::OnOpen_ { s: out.s, info: out.info }))
14058            }
14059            0x5cb40567d80a510c => {
14060                let mut out =
14061                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
14062                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
14063                Ok((NodeEvent::OnRepresentation { payload: out }))
14064            }
14065            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
14066                Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
14067            }
14068            _ => Err(fidl::Error::UnknownOrdinal {
14069                ordinal: tx_header.ordinal,
14070                protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14071            }),
14072        }
14073    }
14074}
14075
14076/// A Stream of incoming requests for fuchsia.io/Node.
14077pub struct NodeRequestStream {
14078    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14079    is_terminated: bool,
14080}
14081
14082impl std::marker::Unpin for NodeRequestStream {}
14083
14084impl futures::stream::FusedStream for NodeRequestStream {
14085    fn is_terminated(&self) -> bool {
14086        self.is_terminated
14087    }
14088}
14089
14090impl fidl::endpoints::RequestStream for NodeRequestStream {
14091    type Protocol = NodeMarker;
14092    type ControlHandle = NodeControlHandle;
14093
14094    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
14095        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
14096    }
14097
14098    fn control_handle(&self) -> Self::ControlHandle {
14099        NodeControlHandle { inner: self.inner.clone() }
14100    }
14101
14102    fn into_inner(
14103        self,
14104    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
14105    {
14106        (self.inner, self.is_terminated)
14107    }
14108
14109    fn from_inner(
14110        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14111        is_terminated: bool,
14112    ) -> Self {
14113        Self { inner, is_terminated }
14114    }
14115}
14116
14117impl futures::Stream for NodeRequestStream {
14118    type Item = Result<NodeRequest, fidl::Error>;
14119
14120    fn poll_next(
14121        mut self: std::pin::Pin<&mut Self>,
14122        cx: &mut std::task::Context<'_>,
14123    ) -> std::task::Poll<Option<Self::Item>> {
14124        let this = &mut *self;
14125        if this.inner.check_shutdown(cx) {
14126            this.is_terminated = true;
14127            return std::task::Poll::Ready(None);
14128        }
14129        if this.is_terminated {
14130            panic!("polled NodeRequestStream after completion");
14131        }
14132        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
14133            |bytes, handles| {
14134                match this.inner.channel().read_etc(cx, bytes, handles) {
14135                    std::task::Poll::Ready(Ok(())) => {}
14136                    std::task::Poll::Pending => return std::task::Poll::Pending,
14137                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
14138                        this.is_terminated = true;
14139                        return std::task::Poll::Ready(None);
14140                    }
14141                    std::task::Poll::Ready(Err(e)) => {
14142                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
14143                            e.into(),
14144                        ))));
14145                    }
14146                }
14147
14148                // A message has been received from the channel
14149                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14150
14151                std::task::Poll::Ready(Some(match header.ordinal {
14152                    0x20d8a7aba2168a79 => {
14153                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14154                        let mut req = fidl::new_empty!(
14155                            fidl_fuchsia_unknown::CloneableCloneRequest,
14156                            fidl::encoding::DefaultFuchsiaResourceDialect
14157                        );
14158                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14159                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14160                        Ok(NodeRequest::Clone { request: req.request, control_handle })
14161                    }
14162                    0x5ac5d459ad7f657e => {
14163                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14164                        let mut req = fidl::new_empty!(
14165                            fidl::encoding::EmptyPayload,
14166                            fidl::encoding::DefaultFuchsiaResourceDialect
14167                        );
14168                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14169                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14170                        Ok(NodeRequest::Close {
14171                            responder: NodeCloseResponder {
14172                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14173                                tx_id: header.tx_id,
14174                            },
14175                        })
14176                    }
14177                    0x2658edee9decfc06 => {
14178                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14179                        let mut req = fidl::new_empty!(
14180                            fidl::encoding::EmptyPayload,
14181                            fidl::encoding::DefaultFuchsiaResourceDialect
14182                        );
14183                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14184                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14185                        Ok(NodeRequest::Query {
14186                            responder: NodeQueryResponder {
14187                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14188                                tx_id: header.tx_id,
14189                            },
14190                        })
14191                    }
14192                    0x5a61678f293ce16f => {
14193                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14194                        let mut req = fidl::new_empty!(
14195                            NodeDeprecatedCloneRequest,
14196                            fidl::encoding::DefaultFuchsiaResourceDialect
14197                        );
14198                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14199                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14200                        Ok(NodeRequest::DeprecatedClone {
14201                            flags: req.flags,
14202                            object: req.object,
14203
14204                            control_handle,
14205                        })
14206                    }
14207                    0x78985e216314dafd => {
14208                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14209                        let mut req = fidl::new_empty!(
14210                            fidl::encoding::EmptyPayload,
14211                            fidl::encoding::DefaultFuchsiaResourceDialect
14212                        );
14213                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14214                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14215                        Ok(NodeRequest::DeprecatedGetAttr {
14216                            responder: NodeDeprecatedGetAttrResponder {
14217                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14218                                tx_id: header.tx_id,
14219                            },
14220                        })
14221                    }
14222                    0x4186c0f40d938f46 => {
14223                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14224                        let mut req = fidl::new_empty!(
14225                            NodeDeprecatedSetAttrRequest,
14226                            fidl::encoding::DefaultFuchsiaResourceDialect
14227                        );
14228                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
14229                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14230                        Ok(NodeRequest::DeprecatedSetAttr {
14231                            flags: req.flags,
14232                            attributes: req.attributes,
14233
14234                            responder: NodeDeprecatedSetAttrResponder {
14235                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14236                                tx_id: header.tx_id,
14237                            },
14238                        })
14239                    }
14240                    0x5b88fffb8eda3aa1 => {
14241                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14242                        let mut req = fidl::new_empty!(
14243                            fidl::encoding::EmptyPayload,
14244                            fidl::encoding::DefaultFuchsiaResourceDialect
14245                        );
14246                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14247                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14248                        Ok(NodeRequest::DeprecatedGetFlags {
14249                            responder: NodeDeprecatedGetFlagsResponder {
14250                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14251                                tx_id: header.tx_id,
14252                            },
14253                        })
14254                    }
14255                    0x5295b76c71fde733 => {
14256                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14257                        let mut req = fidl::new_empty!(
14258                            NodeDeprecatedSetFlagsRequest,
14259                            fidl::encoding::DefaultFuchsiaResourceDialect
14260                        );
14261                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14262                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14263                        Ok(NodeRequest::DeprecatedSetFlags {
14264                            flags: req.flags,
14265
14266                            responder: NodeDeprecatedSetFlagsResponder {
14267                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14268                                tx_id: header.tx_id,
14269                            },
14270                        })
14271                    }
14272                    0x176eb318f64ec23 => {
14273                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14274                        let mut req = fidl::new_empty!(
14275                            fidl::encoding::EmptyPayload,
14276                            fidl::encoding::DefaultFuchsiaResourceDialect
14277                        );
14278                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14279                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14280                        Ok(NodeRequest::GetFlags {
14281                            responder: NodeGetFlagsResponder {
14282                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14283                                tx_id: header.tx_id,
14284                            },
14285                        })
14286                    }
14287                    0x55a8028685791ea8 => {
14288                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14289                        let mut req = fidl::new_empty!(
14290                            NodeSetFlagsRequest,
14291                            fidl::encoding::DefaultFuchsiaResourceDialect
14292                        );
14293                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14294                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14295                        Ok(NodeRequest::SetFlags {
14296                            flags: req.flags,
14297
14298                            responder: NodeSetFlagsResponder {
14299                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14300                                tx_id: header.tx_id,
14301                            },
14302                        })
14303                    }
14304                    0x6f344a1c6b0a0610 => {
14305                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14306                        let mut req = fidl::new_empty!(
14307                            fidl::encoding::EmptyPayload,
14308                            fidl::encoding::DefaultFuchsiaResourceDialect
14309                        );
14310                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14311                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14312                        Ok(NodeRequest::QueryFilesystem {
14313                            responder: NodeQueryFilesystemResponder {
14314                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14315                                tx_id: header.tx_id,
14316                            },
14317                        })
14318                    }
14319                    0x3d4396a638ea053b => {
14320                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14321                        let mut req = fidl::new_empty!(
14322                            NodeGetAttributesRequest,
14323                            fidl::encoding::DefaultFuchsiaResourceDialect
14324                        );
14325                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14326                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14327                        Ok(NodeRequest::GetAttributes {
14328                            query: req.query,
14329
14330                            responder: NodeGetAttributesResponder {
14331                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14332                                tx_id: header.tx_id,
14333                            },
14334                        })
14335                    }
14336                    0x3308c1da5a89bf08 => {
14337                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14338                        let mut req = fidl::new_empty!(
14339                            MutableNodeAttributes,
14340                            fidl::encoding::DefaultFuchsiaResourceDialect
14341                        );
14342                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
14343                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14344                        Ok(NodeRequest::UpdateAttributes {
14345                            payload: req,
14346                            responder: NodeUpdateAttributesResponder {
14347                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14348                                tx_id: header.tx_id,
14349                            },
14350                        })
14351                    }
14352                    0x2c5c27ca0ab5dc49 => {
14353                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14354                        let mut req = fidl::new_empty!(
14355                            fidl::encoding::EmptyPayload,
14356                            fidl::encoding::DefaultFuchsiaResourceDialect
14357                        );
14358                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14359                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14360                        Ok(NodeRequest::Sync {
14361                            responder: NodeSyncResponder {
14362                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14363                                tx_id: header.tx_id,
14364                            },
14365                        })
14366                    }
14367                    0x4b61033de007fcd0 => {
14368                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14369                        let mut req = fidl::new_empty!(
14370                            NodeListExtendedAttributesRequest,
14371                            fidl::encoding::DefaultFuchsiaResourceDialect
14372                        );
14373                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14374                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14375                        Ok(NodeRequest::ListExtendedAttributes {
14376                            iterator: req.iterator,
14377
14378                            control_handle,
14379                        })
14380                    }
14381                    0x45ffa3ccfdeb76db => {
14382                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14383                        let mut req = fidl::new_empty!(
14384                            NodeGetExtendedAttributeRequest,
14385                            fidl::encoding::DefaultFuchsiaResourceDialect
14386                        );
14387                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14388                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14389                        Ok(NodeRequest::GetExtendedAttribute {
14390                            name: req.name,
14391
14392                            responder: NodeGetExtendedAttributeResponder {
14393                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14394                                tx_id: header.tx_id,
14395                            },
14396                        })
14397                    }
14398                    0x4a951362f681f23c => {
14399                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14400                        let mut req = fidl::new_empty!(
14401                            NodeSetExtendedAttributeRequest,
14402                            fidl::encoding::DefaultFuchsiaResourceDialect
14403                        );
14404                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14405                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14406                        Ok(NodeRequest::SetExtendedAttribute {
14407                            name: req.name,
14408                            value: req.value,
14409                            mode: req.mode,
14410
14411                            responder: NodeSetExtendedAttributeResponder {
14412                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14413                                tx_id: header.tx_id,
14414                            },
14415                        })
14416                    }
14417                    0x7a0b9f3a9bf9032d => {
14418                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14419                        let mut req = fidl::new_empty!(
14420                            NodeRemoveExtendedAttributeRequest,
14421                            fidl::encoding::DefaultFuchsiaResourceDialect
14422                        );
14423                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14424                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14425                        Ok(NodeRequest::RemoveExtendedAttribute {
14426                            name: req.name,
14427
14428                            responder: NodeRemoveExtendedAttributeResponder {
14429                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14430                                tx_id: header.tx_id,
14431                            },
14432                        })
14433                    }
14434                    _ if header.tx_id == 0
14435                        && header
14436                            .dynamic_flags()
14437                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14438                    {
14439                        Ok(NodeRequest::_UnknownMethod {
14440                            ordinal: header.ordinal,
14441                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14442                            method_type: fidl::MethodType::OneWay,
14443                        })
14444                    }
14445                    _ if header
14446                        .dynamic_flags()
14447                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14448                    {
14449                        this.inner.send_framework_err(
14450                            fidl::encoding::FrameworkErr::UnknownMethod,
14451                            header.tx_id,
14452                            header.ordinal,
14453                            header.dynamic_flags(),
14454                            (bytes, handles),
14455                        )?;
14456                        Ok(NodeRequest::_UnknownMethod {
14457                            ordinal: header.ordinal,
14458                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14459                            method_type: fidl::MethodType::TwoWay,
14460                        })
14461                    }
14462                    _ => Err(fidl::Error::UnknownOrdinal {
14463                        ordinal: header.ordinal,
14464                        protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14465                    }),
14466                }))
14467            },
14468        )
14469    }
14470}
14471
14472/// Node defines the minimal interface for entities which can be accessed in a filesystem.
14473#[derive(Debug)]
14474pub enum NodeRequest {
14475    Clone {
14476        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
14477        control_handle: NodeControlHandle,
14478    },
14479    /// Terminates the connection.
14480    ///
14481    /// After calling `Close`, the client must not send any other requests.
14482    ///
14483    /// Servers, after sending the status response, should close the connection
14484    /// regardless of status and without sending an epitaph.
14485    ///
14486    /// Closing the client end of the channel should be semantically equivalent
14487    /// to calling `Close` without knowing when the close has completed or its
14488    /// status.
14489    Close {
14490        responder: NodeCloseResponder,
14491    },
14492    Query {
14493        responder: NodeQueryResponder,
14494    },
14495    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
14496    DeprecatedClone {
14497        flags: OpenFlags,
14498        object: fidl::endpoints::ServerEnd<NodeMarker>,
14499        control_handle: NodeControlHandle,
14500    },
14501    /// DEPRECATED - Use `Node.GetAttributes` instead.
14502    DeprecatedGetAttr {
14503        responder: NodeDeprecatedGetAttrResponder,
14504    },
14505    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
14506    DeprecatedSetAttr {
14507        flags: NodeAttributeFlags,
14508        attributes: NodeAttributes,
14509        responder: NodeDeprecatedSetAttrResponder,
14510    },
14511    /// [DEPRECATED - Use new GetFlags method instead.]
14512    DeprecatedGetFlags {
14513        responder: NodeDeprecatedGetFlagsResponder,
14514    },
14515    /// [DEPRECATED - Use new SetFlags method instead.]
14516    DeprecatedSetFlags {
14517        flags: OpenFlags,
14518        responder: NodeDeprecatedSetFlagsResponder,
14519    },
14520    /// Queries the flags that apply to this node after it has been opened/created. This method does
14521    /// not require any rights.
14522    ///
14523    /// Note that the final set of flags that apply to the connection may differ from those
14524    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
14525    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
14526    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
14527    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
14528    GetFlags {
14529        responder: NodeGetFlagsResponder,
14530    },
14531    /// Sets the flags that apply to this node after it has been opened. This method does not
14532    /// require any rights.
14533    ///
14534    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
14535    /// clear append mode.
14536    ///
14537    /// Errors:
14538    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
14539    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
14540    SetFlags {
14541        flags: Flags,
14542        responder: NodeSetFlagsResponder,
14543    },
14544    /// Query the filesystem for filesystem-specific information.
14545    QueryFilesystem {
14546        responder: NodeQueryFilesystemResponder,
14547    },
14548    /// Acquires information about the node.
14549    ///
14550    /// The attributes of a node should be stable, independent of the
14551    /// specific protocol used to access it.
14552    ///
14553    /// If a particular attribute is not applicable or not supported,
14554    /// filesystems should leave the corresponding field absent.
14555    ///
14556    /// + `query` a bit-mask specifying which attributes to fetch. The server
14557    ///   should not return more than necessary.
14558    /// - `attributes` the returned attributes.
14559    ///
14560    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14561    GetAttributes {
14562        query: NodeAttributesQuery,
14563        responder: NodeGetAttributesResponder,
14564    },
14565    /// Updates information about the node.
14566    ///
14567    /// + `attributes` the presence of a table field in `attributes` indicates
14568    /// the intent to update the corresponding attribute.
14569    ///
14570    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
14571    ///
14572    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14573    UpdateAttributes {
14574        payload: MutableNodeAttributes,
14575        responder: NodeUpdateAttributesResponder,
14576    },
14577    /// Synchronizes updates to the node to the underlying media, if it exists.
14578    ///
14579    /// This method will return when the filesystem server has flushed the
14580    /// relevant updates to the underlying media, but does not guarantee the
14581    /// underlying media has persisted the information, nor that any information
14582    /// is committed to hardware. Clients may use `Sync` to ensure ordering
14583    /// between operations.
14584    ///
14585    /// This method does not require any rights.
14586    Sync {
14587        responder: NodeSyncResponder,
14588    },
14589    /// Creates an iterator over all the extended attribute names associated
14590    /// with this node. If an error occurs it is returned as an epitaph on the
14591    /// iterator request channel, and then the channel is closed.
14592    ///
14593    /// GetExtendedAttributes can be used with any of these names to retrieve
14594    /// the associated value.
14595    ///
14596    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14597    ListExtendedAttributes {
14598        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
14599        control_handle: NodeControlHandle,
14600    },
14601    /// Get the value associated with the given attribute `name` for this node.
14602    ///
14603    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
14604    /// particular structure is imposed on them.
14605    ///
14606    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14607    GetExtendedAttribute {
14608        name: Vec<u8>,
14609        responder: NodeGetExtendedAttributeResponder,
14610    },
14611    /// Set the value for the given attribute `name` to `value` for this node.
14612    ///
14613    /// The attribute name may exist, in which case the attribute is updated.
14614    /// If the attribute doesn't exist, it is created. The name should have no
14615    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
14616    ///
14617    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14618    SetExtendedAttribute {
14619        name: Vec<u8>,
14620        value: ExtendedAttributeValue,
14621        mode: SetExtendedAttributeMode,
14622        responder: NodeSetExtendedAttributeResponder,
14623    },
14624    /// Remove the specified extended attribute.
14625    ///
14626    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
14627    ///
14628    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14629    RemoveExtendedAttribute {
14630        name: Vec<u8>,
14631        responder: NodeRemoveExtendedAttributeResponder,
14632    },
14633    /// An interaction was received which does not match any known method.
14634    #[non_exhaustive]
14635    _UnknownMethod {
14636        /// Ordinal of the method that was called.
14637        ordinal: u64,
14638        control_handle: NodeControlHandle,
14639        method_type: fidl::MethodType,
14640    },
14641}
14642
14643impl NodeRequest {
14644    #[allow(irrefutable_let_patterns)]
14645    pub fn into_clone(
14646        self,
14647    ) -> Option<(
14648        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
14649        NodeControlHandle,
14650    )> {
14651        if let NodeRequest::Clone { request, control_handle } = self {
14652            Some((request, control_handle))
14653        } else {
14654            None
14655        }
14656    }
14657
14658    #[allow(irrefutable_let_patterns)]
14659    pub fn into_close(self) -> Option<(NodeCloseResponder)> {
14660        if let NodeRequest::Close { responder } = self { Some((responder)) } else { None }
14661    }
14662
14663    #[allow(irrefutable_let_patterns)]
14664    pub fn into_query(self) -> Option<(NodeQueryResponder)> {
14665        if let NodeRequest::Query { responder } = self { Some((responder)) } else { None }
14666    }
14667
14668    #[allow(irrefutable_let_patterns)]
14669    pub fn into_deprecated_clone(
14670        self,
14671    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, NodeControlHandle)> {
14672        if let NodeRequest::DeprecatedClone { flags, object, control_handle } = self {
14673            Some((flags, object, control_handle))
14674        } else {
14675            None
14676        }
14677    }
14678
14679    #[allow(irrefutable_let_patterns)]
14680    pub fn into_deprecated_get_attr(self) -> Option<(NodeDeprecatedGetAttrResponder)> {
14681        if let NodeRequest::DeprecatedGetAttr { responder } = self {
14682            Some((responder))
14683        } else {
14684            None
14685        }
14686    }
14687
14688    #[allow(irrefutable_let_patterns)]
14689    pub fn into_deprecated_set_attr(
14690        self,
14691    ) -> Option<(NodeAttributeFlags, NodeAttributes, NodeDeprecatedSetAttrResponder)> {
14692        if let NodeRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
14693            Some((flags, attributes, responder))
14694        } else {
14695            None
14696        }
14697    }
14698
14699    #[allow(irrefutable_let_patterns)]
14700    pub fn into_deprecated_get_flags(self) -> Option<(NodeDeprecatedGetFlagsResponder)> {
14701        if let NodeRequest::DeprecatedGetFlags { responder } = self {
14702            Some((responder))
14703        } else {
14704            None
14705        }
14706    }
14707
14708    #[allow(irrefutable_let_patterns)]
14709    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, NodeDeprecatedSetFlagsResponder)> {
14710        if let NodeRequest::DeprecatedSetFlags { flags, responder } = self {
14711            Some((flags, responder))
14712        } else {
14713            None
14714        }
14715    }
14716
14717    #[allow(irrefutable_let_patterns)]
14718    pub fn into_get_flags(self) -> Option<(NodeGetFlagsResponder)> {
14719        if let NodeRequest::GetFlags { responder } = self { Some((responder)) } else { None }
14720    }
14721
14722    #[allow(irrefutable_let_patterns)]
14723    pub fn into_set_flags(self) -> Option<(Flags, NodeSetFlagsResponder)> {
14724        if let NodeRequest::SetFlags { flags, responder } = self {
14725            Some((flags, responder))
14726        } else {
14727            None
14728        }
14729    }
14730
14731    #[allow(irrefutable_let_patterns)]
14732    pub fn into_query_filesystem(self) -> Option<(NodeQueryFilesystemResponder)> {
14733        if let NodeRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
14734    }
14735
14736    #[allow(irrefutable_let_patterns)]
14737    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, NodeGetAttributesResponder)> {
14738        if let NodeRequest::GetAttributes { query, responder } = self {
14739            Some((query, responder))
14740        } else {
14741            None
14742        }
14743    }
14744
14745    #[allow(irrefutable_let_patterns)]
14746    pub fn into_update_attributes(
14747        self,
14748    ) -> Option<(MutableNodeAttributes, NodeUpdateAttributesResponder)> {
14749        if let NodeRequest::UpdateAttributes { payload, responder } = self {
14750            Some((payload, responder))
14751        } else {
14752            None
14753        }
14754    }
14755
14756    #[allow(irrefutable_let_patterns)]
14757    pub fn into_sync(self) -> Option<(NodeSyncResponder)> {
14758        if let NodeRequest::Sync { responder } = self { Some((responder)) } else { None }
14759    }
14760
14761    #[allow(irrefutable_let_patterns)]
14762    pub fn into_list_extended_attributes(
14763        self,
14764    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, NodeControlHandle)>
14765    {
14766        if let NodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
14767            Some((iterator, control_handle))
14768        } else {
14769            None
14770        }
14771    }
14772
14773    #[allow(irrefutable_let_patterns)]
14774    pub fn into_get_extended_attribute(
14775        self,
14776    ) -> Option<(Vec<u8>, NodeGetExtendedAttributeResponder)> {
14777        if let NodeRequest::GetExtendedAttribute { name, responder } = self {
14778            Some((name, responder))
14779        } else {
14780            None
14781        }
14782    }
14783
14784    #[allow(irrefutable_let_patterns)]
14785    pub fn into_set_extended_attribute(
14786        self,
14787    ) -> Option<(
14788        Vec<u8>,
14789        ExtendedAttributeValue,
14790        SetExtendedAttributeMode,
14791        NodeSetExtendedAttributeResponder,
14792    )> {
14793        if let NodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
14794            Some((name, value, mode, responder))
14795        } else {
14796            None
14797        }
14798    }
14799
14800    #[allow(irrefutable_let_patterns)]
14801    pub fn into_remove_extended_attribute(
14802        self,
14803    ) -> Option<(Vec<u8>, NodeRemoveExtendedAttributeResponder)> {
14804        if let NodeRequest::RemoveExtendedAttribute { name, responder } = self {
14805            Some((name, responder))
14806        } else {
14807            None
14808        }
14809    }
14810
14811    /// Name of the method defined in FIDL
14812    pub fn method_name(&self) -> &'static str {
14813        match *self {
14814            NodeRequest::Clone { .. } => "clone",
14815            NodeRequest::Close { .. } => "close",
14816            NodeRequest::Query { .. } => "query",
14817            NodeRequest::DeprecatedClone { .. } => "deprecated_clone",
14818            NodeRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
14819            NodeRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
14820            NodeRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
14821            NodeRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
14822            NodeRequest::GetFlags { .. } => "get_flags",
14823            NodeRequest::SetFlags { .. } => "set_flags",
14824            NodeRequest::QueryFilesystem { .. } => "query_filesystem",
14825            NodeRequest::GetAttributes { .. } => "get_attributes",
14826            NodeRequest::UpdateAttributes { .. } => "update_attributes",
14827            NodeRequest::Sync { .. } => "sync",
14828            NodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
14829            NodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
14830            NodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
14831            NodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
14832            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
14833                "unknown one-way method"
14834            }
14835            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
14836                "unknown two-way method"
14837            }
14838        }
14839    }
14840}
14841
14842#[derive(Debug, Clone)]
14843pub struct NodeControlHandle {
14844    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14845}
14846
14847impl fidl::endpoints::ControlHandle for NodeControlHandle {
14848    fn shutdown(&self) {
14849        self.inner.shutdown()
14850    }
14851    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
14852        self.inner.shutdown_with_epitaph(status)
14853    }
14854
14855    fn is_closed(&self) -> bool {
14856        self.inner.channel().is_closed()
14857    }
14858    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
14859        self.inner.channel().on_closed()
14860    }
14861
14862    #[cfg(target_os = "fuchsia")]
14863    fn signal_peer(
14864        &self,
14865        clear_mask: zx::Signals,
14866        set_mask: zx::Signals,
14867    ) -> Result<(), zx_status::Status> {
14868        use fidl::Peered;
14869        self.inner.channel().signal_peer(clear_mask, set_mask)
14870    }
14871}
14872
14873impl NodeControlHandle {
14874    pub fn send_on_open_(
14875        &self,
14876        mut s: i32,
14877        mut info: Option<NodeInfoDeprecated>,
14878    ) -> Result<(), fidl::Error> {
14879        self.inner.send::<NodeOnOpenRequest>(
14880            (s, info.as_mut()),
14881            0,
14882            0x7fc7bbb1dbfd1972,
14883            fidl::encoding::DynamicFlags::FLEXIBLE,
14884        )
14885    }
14886
14887    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
14888        self.inner.send::<Representation>(
14889            &mut payload,
14890            0,
14891            0x5cb40567d80a510c,
14892            fidl::encoding::DynamicFlags::empty(),
14893        )
14894    }
14895}
14896
14897#[must_use = "FIDL methods require a response to be sent"]
14898#[derive(Debug)]
14899pub struct NodeCloseResponder {
14900    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
14901    tx_id: u32,
14902}
14903
14904/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
14905/// if the responder is dropped without sending a response, so that the client
14906/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
14907impl std::ops::Drop for NodeCloseResponder {
14908    fn drop(&mut self) {
14909        self.control_handle.shutdown();
14910        // Safety: drops once, never accessed again
14911        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14912    }
14913}
14914
14915impl fidl::endpoints::Responder for NodeCloseResponder {
14916    type ControlHandle = NodeControlHandle;
14917
14918    fn control_handle(&self) -> &NodeControlHandle {
14919        &self.control_handle
14920    }
14921
14922    fn drop_without_shutdown(mut self) {
14923        // Safety: drops once, never accessed again due to mem::forget
14924        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14925        // Prevent Drop from running (which would shut down the channel)
14926        std::mem::forget(self);
14927    }
14928}
14929
14930impl NodeCloseResponder {
14931    /// Sends a response to the FIDL transaction.
14932    ///
14933    /// Sets the channel to shutdown if an error occurs.
14934    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
14935        let _result = self.send_raw(result);
14936        if _result.is_err() {
14937            self.control_handle.shutdown();
14938        }
14939        self.drop_without_shutdown();
14940        _result
14941    }
14942
14943    /// Similar to "send" but does not shutdown the channel if an error occurs.
14944    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
14945        let _result = self.send_raw(result);
14946        self.drop_without_shutdown();
14947        _result
14948    }
14949
14950    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
14951        self.control_handle
14952            .inner
14953            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
14954                result,
14955                self.tx_id,
14956                0x5ac5d459ad7f657e,
14957                fidl::encoding::DynamicFlags::empty(),
14958            )
14959    }
14960}
14961
14962#[must_use = "FIDL methods require a response to be sent"]
14963#[derive(Debug)]
14964pub struct NodeQueryResponder {
14965    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
14966    tx_id: u32,
14967}
14968
14969/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
14970/// if the responder is dropped without sending a response, so that the client
14971/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
14972impl std::ops::Drop for NodeQueryResponder {
14973    fn drop(&mut self) {
14974        self.control_handle.shutdown();
14975        // Safety: drops once, never accessed again
14976        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14977    }
14978}
14979
14980impl fidl::endpoints::Responder for NodeQueryResponder {
14981    type ControlHandle = NodeControlHandle;
14982
14983    fn control_handle(&self) -> &NodeControlHandle {
14984        &self.control_handle
14985    }
14986
14987    fn drop_without_shutdown(mut self) {
14988        // Safety: drops once, never accessed again due to mem::forget
14989        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14990        // Prevent Drop from running (which would shut down the channel)
14991        std::mem::forget(self);
14992    }
14993}
14994
14995impl NodeQueryResponder {
14996    /// Sends a response to the FIDL transaction.
14997    ///
14998    /// Sets the channel to shutdown if an error occurs.
14999    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15000        let _result = self.send_raw(protocol);
15001        if _result.is_err() {
15002            self.control_handle.shutdown();
15003        }
15004        self.drop_without_shutdown();
15005        _result
15006    }
15007
15008    /// Similar to "send" but does not shutdown the channel if an error occurs.
15009    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15010        let _result = self.send_raw(protocol);
15011        self.drop_without_shutdown();
15012        _result
15013    }
15014
15015    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15016        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
15017            (protocol,),
15018            self.tx_id,
15019            0x2658edee9decfc06,
15020            fidl::encoding::DynamicFlags::empty(),
15021        )
15022    }
15023}
15024
15025#[must_use = "FIDL methods require a response to be sent"]
15026#[derive(Debug)]
15027pub struct NodeDeprecatedGetAttrResponder {
15028    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15029    tx_id: u32,
15030}
15031
15032/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15033/// if the responder is dropped without sending a response, so that the client
15034/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15035impl std::ops::Drop for NodeDeprecatedGetAttrResponder {
15036    fn drop(&mut self) {
15037        self.control_handle.shutdown();
15038        // Safety: drops once, never accessed again
15039        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15040    }
15041}
15042
15043impl fidl::endpoints::Responder for NodeDeprecatedGetAttrResponder {
15044    type ControlHandle = NodeControlHandle;
15045
15046    fn control_handle(&self) -> &NodeControlHandle {
15047        &self.control_handle
15048    }
15049
15050    fn drop_without_shutdown(mut self) {
15051        // Safety: drops once, never accessed again due to mem::forget
15052        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15053        // Prevent Drop from running (which would shut down the channel)
15054        std::mem::forget(self);
15055    }
15056}
15057
15058impl NodeDeprecatedGetAttrResponder {
15059    /// Sends a response to the FIDL transaction.
15060    ///
15061    /// Sets the channel to shutdown if an error occurs.
15062    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15063        let _result = self.send_raw(s, attributes);
15064        if _result.is_err() {
15065            self.control_handle.shutdown();
15066        }
15067        self.drop_without_shutdown();
15068        _result
15069    }
15070
15071    /// Similar to "send" but does not shutdown the channel if an error occurs.
15072    pub fn send_no_shutdown_on_err(
15073        self,
15074        mut s: i32,
15075        mut attributes: &NodeAttributes,
15076    ) -> Result<(), fidl::Error> {
15077        let _result = self.send_raw(s, attributes);
15078        self.drop_without_shutdown();
15079        _result
15080    }
15081
15082    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15083        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
15084            (s, attributes),
15085            self.tx_id,
15086            0x78985e216314dafd,
15087            fidl::encoding::DynamicFlags::empty(),
15088        )
15089    }
15090}
15091
15092#[must_use = "FIDL methods require a response to be sent"]
15093#[derive(Debug)]
15094pub struct NodeDeprecatedSetAttrResponder {
15095    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15096    tx_id: u32,
15097}
15098
15099/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15100/// if the responder is dropped without sending a response, so that the client
15101/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15102impl std::ops::Drop for NodeDeprecatedSetAttrResponder {
15103    fn drop(&mut self) {
15104        self.control_handle.shutdown();
15105        // Safety: drops once, never accessed again
15106        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15107    }
15108}
15109
15110impl fidl::endpoints::Responder for NodeDeprecatedSetAttrResponder {
15111    type ControlHandle = NodeControlHandle;
15112
15113    fn control_handle(&self) -> &NodeControlHandle {
15114        &self.control_handle
15115    }
15116
15117    fn drop_without_shutdown(mut self) {
15118        // Safety: drops once, never accessed again due to mem::forget
15119        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15120        // Prevent Drop from running (which would shut down the channel)
15121        std::mem::forget(self);
15122    }
15123}
15124
15125impl NodeDeprecatedSetAttrResponder {
15126    /// Sends a response to the FIDL transaction.
15127    ///
15128    /// Sets the channel to shutdown if an error occurs.
15129    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15130        let _result = self.send_raw(s);
15131        if _result.is_err() {
15132            self.control_handle.shutdown();
15133        }
15134        self.drop_without_shutdown();
15135        _result
15136    }
15137
15138    /// Similar to "send" but does not shutdown the channel if an error occurs.
15139    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15140        let _result = self.send_raw(s);
15141        self.drop_without_shutdown();
15142        _result
15143    }
15144
15145    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15146        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
15147            (s,),
15148            self.tx_id,
15149            0x4186c0f40d938f46,
15150            fidl::encoding::DynamicFlags::empty(),
15151        )
15152    }
15153}
15154
15155#[must_use = "FIDL methods require a response to be sent"]
15156#[derive(Debug)]
15157pub struct NodeDeprecatedGetFlagsResponder {
15158    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15159    tx_id: u32,
15160}
15161
15162/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15163/// if the responder is dropped without sending a response, so that the client
15164/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15165impl std::ops::Drop for NodeDeprecatedGetFlagsResponder {
15166    fn drop(&mut self) {
15167        self.control_handle.shutdown();
15168        // Safety: drops once, never accessed again
15169        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15170    }
15171}
15172
15173impl fidl::endpoints::Responder for NodeDeprecatedGetFlagsResponder {
15174    type ControlHandle = NodeControlHandle;
15175
15176    fn control_handle(&self) -> &NodeControlHandle {
15177        &self.control_handle
15178    }
15179
15180    fn drop_without_shutdown(mut self) {
15181        // Safety: drops once, never accessed again due to mem::forget
15182        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15183        // Prevent Drop from running (which would shut down the channel)
15184        std::mem::forget(self);
15185    }
15186}
15187
15188impl NodeDeprecatedGetFlagsResponder {
15189    /// Sends a response to the FIDL transaction.
15190    ///
15191    /// Sets the channel to shutdown if an error occurs.
15192    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15193        let _result = self.send_raw(s, flags);
15194        if _result.is_err() {
15195            self.control_handle.shutdown();
15196        }
15197        self.drop_without_shutdown();
15198        _result
15199    }
15200
15201    /// Similar to "send" but does not shutdown the channel if an error occurs.
15202    pub fn send_no_shutdown_on_err(
15203        self,
15204        mut s: i32,
15205        mut flags: OpenFlags,
15206    ) -> Result<(), fidl::Error> {
15207        let _result = self.send_raw(s, flags);
15208        self.drop_without_shutdown();
15209        _result
15210    }
15211
15212    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15213        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
15214            (s, flags),
15215            self.tx_id,
15216            0x5b88fffb8eda3aa1,
15217            fidl::encoding::DynamicFlags::empty(),
15218        )
15219    }
15220}
15221
15222#[must_use = "FIDL methods require a response to be sent"]
15223#[derive(Debug)]
15224pub struct NodeDeprecatedSetFlagsResponder {
15225    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15226    tx_id: u32,
15227}
15228
15229/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15230/// if the responder is dropped without sending a response, so that the client
15231/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15232impl std::ops::Drop for NodeDeprecatedSetFlagsResponder {
15233    fn drop(&mut self) {
15234        self.control_handle.shutdown();
15235        // Safety: drops once, never accessed again
15236        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15237    }
15238}
15239
15240impl fidl::endpoints::Responder for NodeDeprecatedSetFlagsResponder {
15241    type ControlHandle = NodeControlHandle;
15242
15243    fn control_handle(&self) -> &NodeControlHandle {
15244        &self.control_handle
15245    }
15246
15247    fn drop_without_shutdown(mut self) {
15248        // Safety: drops once, never accessed again due to mem::forget
15249        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15250        // Prevent Drop from running (which would shut down the channel)
15251        std::mem::forget(self);
15252    }
15253}
15254
15255impl NodeDeprecatedSetFlagsResponder {
15256    /// Sends a response to the FIDL transaction.
15257    ///
15258    /// Sets the channel to shutdown if an error occurs.
15259    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15260        let _result = self.send_raw(s);
15261        if _result.is_err() {
15262            self.control_handle.shutdown();
15263        }
15264        self.drop_without_shutdown();
15265        _result
15266    }
15267
15268    /// Similar to "send" but does not shutdown the channel if an error occurs.
15269    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15270        let _result = self.send_raw(s);
15271        self.drop_without_shutdown();
15272        _result
15273    }
15274
15275    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15276        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
15277            (s,),
15278            self.tx_id,
15279            0x5295b76c71fde733,
15280            fidl::encoding::DynamicFlags::empty(),
15281        )
15282    }
15283}
15284
15285#[must_use = "FIDL methods require a response to be sent"]
15286#[derive(Debug)]
15287pub struct NodeGetFlagsResponder {
15288    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15289    tx_id: u32,
15290}
15291
15292/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15293/// if the responder is dropped without sending a response, so that the client
15294/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15295impl std::ops::Drop for NodeGetFlagsResponder {
15296    fn drop(&mut self) {
15297        self.control_handle.shutdown();
15298        // Safety: drops once, never accessed again
15299        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15300    }
15301}
15302
15303impl fidl::endpoints::Responder for NodeGetFlagsResponder {
15304    type ControlHandle = NodeControlHandle;
15305
15306    fn control_handle(&self) -> &NodeControlHandle {
15307        &self.control_handle
15308    }
15309
15310    fn drop_without_shutdown(mut self) {
15311        // Safety: drops once, never accessed again due to mem::forget
15312        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15313        // Prevent Drop from running (which would shut down the channel)
15314        std::mem::forget(self);
15315    }
15316}
15317
15318impl NodeGetFlagsResponder {
15319    /// Sends a response to the FIDL transaction.
15320    ///
15321    /// Sets the channel to shutdown if an error occurs.
15322    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15323        let _result = self.send_raw(result);
15324        if _result.is_err() {
15325            self.control_handle.shutdown();
15326        }
15327        self.drop_without_shutdown();
15328        _result
15329    }
15330
15331    /// Similar to "send" but does not shutdown the channel if an error occurs.
15332    pub fn send_no_shutdown_on_err(
15333        self,
15334        mut result: Result<Flags, i32>,
15335    ) -> Result<(), fidl::Error> {
15336        let _result = self.send_raw(result);
15337        self.drop_without_shutdown();
15338        _result
15339    }
15340
15341    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15342        self.control_handle
15343            .inner
15344            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
15345                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
15346                self.tx_id,
15347                0x176eb318f64ec23,
15348                fidl::encoding::DynamicFlags::FLEXIBLE,
15349            )
15350    }
15351}
15352
15353#[must_use = "FIDL methods require a response to be sent"]
15354#[derive(Debug)]
15355pub struct NodeSetFlagsResponder {
15356    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15357    tx_id: u32,
15358}
15359
15360/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15361/// if the responder is dropped without sending a response, so that the client
15362/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15363impl std::ops::Drop for NodeSetFlagsResponder {
15364    fn drop(&mut self) {
15365        self.control_handle.shutdown();
15366        // Safety: drops once, never accessed again
15367        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15368    }
15369}
15370
15371impl fidl::endpoints::Responder for NodeSetFlagsResponder {
15372    type ControlHandle = NodeControlHandle;
15373
15374    fn control_handle(&self) -> &NodeControlHandle {
15375        &self.control_handle
15376    }
15377
15378    fn drop_without_shutdown(mut self) {
15379        // Safety: drops once, never accessed again due to mem::forget
15380        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15381        // Prevent Drop from running (which would shut down the channel)
15382        std::mem::forget(self);
15383    }
15384}
15385
15386impl NodeSetFlagsResponder {
15387    /// Sends a response to the FIDL transaction.
15388    ///
15389    /// Sets the channel to shutdown if an error occurs.
15390    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15391        let _result = self.send_raw(result);
15392        if _result.is_err() {
15393            self.control_handle.shutdown();
15394        }
15395        self.drop_without_shutdown();
15396        _result
15397    }
15398
15399    /// Similar to "send" but does not shutdown the channel if an error occurs.
15400    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15401        let _result = self.send_raw(result);
15402        self.drop_without_shutdown();
15403        _result
15404    }
15405
15406    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15407        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
15408            fidl::encoding::EmptyStruct,
15409            i32,
15410        >>(
15411            fidl::encoding::FlexibleResult::new(result),
15412            self.tx_id,
15413            0x55a8028685791ea8,
15414            fidl::encoding::DynamicFlags::FLEXIBLE,
15415        )
15416    }
15417}
15418
15419#[must_use = "FIDL methods require a response to be sent"]
15420#[derive(Debug)]
15421pub struct NodeQueryFilesystemResponder {
15422    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15423    tx_id: u32,
15424}
15425
15426/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15427/// if the responder is dropped without sending a response, so that the client
15428/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15429impl std::ops::Drop for NodeQueryFilesystemResponder {
15430    fn drop(&mut self) {
15431        self.control_handle.shutdown();
15432        // Safety: drops once, never accessed again
15433        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15434    }
15435}
15436
15437impl fidl::endpoints::Responder for NodeQueryFilesystemResponder {
15438    type ControlHandle = NodeControlHandle;
15439
15440    fn control_handle(&self) -> &NodeControlHandle {
15441        &self.control_handle
15442    }
15443
15444    fn drop_without_shutdown(mut self) {
15445        // Safety: drops once, never accessed again due to mem::forget
15446        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15447        // Prevent Drop from running (which would shut down the channel)
15448        std::mem::forget(self);
15449    }
15450}
15451
15452impl NodeQueryFilesystemResponder {
15453    /// Sends a response to the FIDL transaction.
15454    ///
15455    /// Sets the channel to shutdown if an error occurs.
15456    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15457        let _result = self.send_raw(s, info);
15458        if _result.is_err() {
15459            self.control_handle.shutdown();
15460        }
15461        self.drop_without_shutdown();
15462        _result
15463    }
15464
15465    /// Similar to "send" but does not shutdown the channel if an error occurs.
15466    pub fn send_no_shutdown_on_err(
15467        self,
15468        mut s: i32,
15469        mut info: Option<&FilesystemInfo>,
15470    ) -> Result<(), fidl::Error> {
15471        let _result = self.send_raw(s, info);
15472        self.drop_without_shutdown();
15473        _result
15474    }
15475
15476    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15477        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
15478            (s, info),
15479            self.tx_id,
15480            0x6f344a1c6b0a0610,
15481            fidl::encoding::DynamicFlags::empty(),
15482        )
15483    }
15484}
15485
15486#[must_use = "FIDL methods require a response to be sent"]
15487#[derive(Debug)]
15488pub struct NodeGetAttributesResponder {
15489    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15490    tx_id: u32,
15491}
15492
15493/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15494/// if the responder is dropped without sending a response, so that the client
15495/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15496impl std::ops::Drop for NodeGetAttributesResponder {
15497    fn drop(&mut self) {
15498        self.control_handle.shutdown();
15499        // Safety: drops once, never accessed again
15500        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15501    }
15502}
15503
15504impl fidl::endpoints::Responder for NodeGetAttributesResponder {
15505    type ControlHandle = NodeControlHandle;
15506
15507    fn control_handle(&self) -> &NodeControlHandle {
15508        &self.control_handle
15509    }
15510
15511    fn drop_without_shutdown(mut self) {
15512        // Safety: drops once, never accessed again due to mem::forget
15513        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15514        // Prevent Drop from running (which would shut down the channel)
15515        std::mem::forget(self);
15516    }
15517}
15518
15519impl NodeGetAttributesResponder {
15520    /// Sends a response to the FIDL transaction.
15521    ///
15522    /// Sets the channel to shutdown if an error occurs.
15523    pub fn send(
15524        self,
15525        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15526    ) -> Result<(), fidl::Error> {
15527        let _result = self.send_raw(result);
15528        if _result.is_err() {
15529            self.control_handle.shutdown();
15530        }
15531        self.drop_without_shutdown();
15532        _result
15533    }
15534
15535    /// Similar to "send" but does not shutdown the channel if an error occurs.
15536    pub fn send_no_shutdown_on_err(
15537        self,
15538        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15539    ) -> Result<(), fidl::Error> {
15540        let _result = self.send_raw(result);
15541        self.drop_without_shutdown();
15542        _result
15543    }
15544
15545    fn send_raw(
15546        &self,
15547        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15548    ) -> Result<(), fidl::Error> {
15549        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
15550            result,
15551            self.tx_id,
15552            0x3d4396a638ea053b,
15553            fidl::encoding::DynamicFlags::empty(),
15554        )
15555    }
15556}
15557
15558#[must_use = "FIDL methods require a response to be sent"]
15559#[derive(Debug)]
15560pub struct NodeUpdateAttributesResponder {
15561    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15562    tx_id: u32,
15563}
15564
15565/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15566/// if the responder is dropped without sending a response, so that the client
15567/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15568impl std::ops::Drop for NodeUpdateAttributesResponder {
15569    fn drop(&mut self) {
15570        self.control_handle.shutdown();
15571        // Safety: drops once, never accessed again
15572        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15573    }
15574}
15575
15576impl fidl::endpoints::Responder for NodeUpdateAttributesResponder {
15577    type ControlHandle = NodeControlHandle;
15578
15579    fn control_handle(&self) -> &NodeControlHandle {
15580        &self.control_handle
15581    }
15582
15583    fn drop_without_shutdown(mut self) {
15584        // Safety: drops once, never accessed again due to mem::forget
15585        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15586        // Prevent Drop from running (which would shut down the channel)
15587        std::mem::forget(self);
15588    }
15589}
15590
15591impl NodeUpdateAttributesResponder {
15592    /// Sends a response to the FIDL transaction.
15593    ///
15594    /// Sets the channel to shutdown if an error occurs.
15595    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15596        let _result = self.send_raw(result);
15597        if _result.is_err() {
15598            self.control_handle.shutdown();
15599        }
15600        self.drop_without_shutdown();
15601        _result
15602    }
15603
15604    /// Similar to "send" but does not shutdown the channel if an error occurs.
15605    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15606        let _result = self.send_raw(result);
15607        self.drop_without_shutdown();
15608        _result
15609    }
15610
15611    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15612        self.control_handle
15613            .inner
15614            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15615                result,
15616                self.tx_id,
15617                0x3308c1da5a89bf08,
15618                fidl::encoding::DynamicFlags::empty(),
15619            )
15620    }
15621}
15622
15623#[must_use = "FIDL methods require a response to be sent"]
15624#[derive(Debug)]
15625pub struct NodeSyncResponder {
15626    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15627    tx_id: u32,
15628}
15629
15630/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15631/// if the responder is dropped without sending a response, so that the client
15632/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15633impl std::ops::Drop for NodeSyncResponder {
15634    fn drop(&mut self) {
15635        self.control_handle.shutdown();
15636        // Safety: drops once, never accessed again
15637        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15638    }
15639}
15640
15641impl fidl::endpoints::Responder for NodeSyncResponder {
15642    type ControlHandle = NodeControlHandle;
15643
15644    fn control_handle(&self) -> &NodeControlHandle {
15645        &self.control_handle
15646    }
15647
15648    fn drop_without_shutdown(mut self) {
15649        // Safety: drops once, never accessed again due to mem::forget
15650        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15651        // Prevent Drop from running (which would shut down the channel)
15652        std::mem::forget(self);
15653    }
15654}
15655
15656impl NodeSyncResponder {
15657    /// Sends a response to the FIDL transaction.
15658    ///
15659    /// Sets the channel to shutdown if an error occurs.
15660    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15661        let _result = self.send_raw(result);
15662        if _result.is_err() {
15663            self.control_handle.shutdown();
15664        }
15665        self.drop_without_shutdown();
15666        _result
15667    }
15668
15669    /// Similar to "send" but does not shutdown the channel if an error occurs.
15670    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15671        let _result = self.send_raw(result);
15672        self.drop_without_shutdown();
15673        _result
15674    }
15675
15676    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15677        self.control_handle
15678            .inner
15679            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15680                result,
15681                self.tx_id,
15682                0x2c5c27ca0ab5dc49,
15683                fidl::encoding::DynamicFlags::empty(),
15684            )
15685    }
15686}
15687
15688#[must_use = "FIDL methods require a response to be sent"]
15689#[derive(Debug)]
15690pub struct NodeGetExtendedAttributeResponder {
15691    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15692    tx_id: u32,
15693}
15694
15695/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15696/// if the responder is dropped without sending a response, so that the client
15697/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15698impl std::ops::Drop for NodeGetExtendedAttributeResponder {
15699    fn drop(&mut self) {
15700        self.control_handle.shutdown();
15701        // Safety: drops once, never accessed again
15702        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15703    }
15704}
15705
15706impl fidl::endpoints::Responder for NodeGetExtendedAttributeResponder {
15707    type ControlHandle = NodeControlHandle;
15708
15709    fn control_handle(&self) -> &NodeControlHandle {
15710        &self.control_handle
15711    }
15712
15713    fn drop_without_shutdown(mut self) {
15714        // Safety: drops once, never accessed again due to mem::forget
15715        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15716        // Prevent Drop from running (which would shut down the channel)
15717        std::mem::forget(self);
15718    }
15719}
15720
15721impl NodeGetExtendedAttributeResponder {
15722    /// Sends a response to the FIDL transaction.
15723    ///
15724    /// Sets the channel to shutdown if an error occurs.
15725    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
15726        let _result = self.send_raw(result);
15727        if _result.is_err() {
15728            self.control_handle.shutdown();
15729        }
15730        self.drop_without_shutdown();
15731        _result
15732    }
15733
15734    /// Similar to "send" but does not shutdown the channel if an error occurs.
15735    pub fn send_no_shutdown_on_err(
15736        self,
15737        mut result: Result<ExtendedAttributeValue, i32>,
15738    ) -> Result<(), fidl::Error> {
15739        let _result = self.send_raw(result);
15740        self.drop_without_shutdown();
15741        _result
15742    }
15743
15744    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
15745        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
15746            result.as_mut().map_err(|e| *e),
15747            self.tx_id,
15748            0x45ffa3ccfdeb76db,
15749            fidl::encoding::DynamicFlags::empty(),
15750        )
15751    }
15752}
15753
15754#[must_use = "FIDL methods require a response to be sent"]
15755#[derive(Debug)]
15756pub struct NodeSetExtendedAttributeResponder {
15757    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15758    tx_id: u32,
15759}
15760
15761/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15762/// if the responder is dropped without sending a response, so that the client
15763/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15764impl std::ops::Drop for NodeSetExtendedAttributeResponder {
15765    fn drop(&mut self) {
15766        self.control_handle.shutdown();
15767        // Safety: drops once, never accessed again
15768        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15769    }
15770}
15771
15772impl fidl::endpoints::Responder for NodeSetExtendedAttributeResponder {
15773    type ControlHandle = NodeControlHandle;
15774
15775    fn control_handle(&self) -> &NodeControlHandle {
15776        &self.control_handle
15777    }
15778
15779    fn drop_without_shutdown(mut self) {
15780        // Safety: drops once, never accessed again due to mem::forget
15781        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15782        // Prevent Drop from running (which would shut down the channel)
15783        std::mem::forget(self);
15784    }
15785}
15786
15787impl NodeSetExtendedAttributeResponder {
15788    /// Sends a response to the FIDL transaction.
15789    ///
15790    /// Sets the channel to shutdown if an error occurs.
15791    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15792        let _result = self.send_raw(result);
15793        if _result.is_err() {
15794            self.control_handle.shutdown();
15795        }
15796        self.drop_without_shutdown();
15797        _result
15798    }
15799
15800    /// Similar to "send" but does not shutdown the channel if an error occurs.
15801    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15802        let _result = self.send_raw(result);
15803        self.drop_without_shutdown();
15804        _result
15805    }
15806
15807    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15808        self.control_handle
15809            .inner
15810            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15811                result,
15812                self.tx_id,
15813                0x4a951362f681f23c,
15814                fidl::encoding::DynamicFlags::empty(),
15815            )
15816    }
15817}
15818
15819#[must_use = "FIDL methods require a response to be sent"]
15820#[derive(Debug)]
15821pub struct NodeRemoveExtendedAttributeResponder {
15822    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15823    tx_id: u32,
15824}
15825
15826/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15827/// if the responder is dropped without sending a response, so that the client
15828/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15829impl std::ops::Drop for NodeRemoveExtendedAttributeResponder {
15830    fn drop(&mut self) {
15831        self.control_handle.shutdown();
15832        // Safety: drops once, never accessed again
15833        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15834    }
15835}
15836
15837impl fidl::endpoints::Responder for NodeRemoveExtendedAttributeResponder {
15838    type ControlHandle = NodeControlHandle;
15839
15840    fn control_handle(&self) -> &NodeControlHandle {
15841        &self.control_handle
15842    }
15843
15844    fn drop_without_shutdown(mut self) {
15845        // Safety: drops once, never accessed again due to mem::forget
15846        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15847        // Prevent Drop from running (which would shut down the channel)
15848        std::mem::forget(self);
15849    }
15850}
15851
15852impl NodeRemoveExtendedAttributeResponder {
15853    /// Sends a response to the FIDL transaction.
15854    ///
15855    /// Sets the channel to shutdown if an error occurs.
15856    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15857        let _result = self.send_raw(result);
15858        if _result.is_err() {
15859            self.control_handle.shutdown();
15860        }
15861        self.drop_without_shutdown();
15862        _result
15863    }
15864
15865    /// Similar to "send" but does not shutdown the channel if an error occurs.
15866    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15867        let _result = self.send_raw(result);
15868        self.drop_without_shutdown();
15869        _result
15870    }
15871
15872    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15873        self.control_handle
15874            .inner
15875            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15876                result,
15877                self.tx_id,
15878                0x7a0b9f3a9bf9032d,
15879                fidl::encoding::DynamicFlags::empty(),
15880            )
15881    }
15882}
15883
15884#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15885pub struct ReadableMarker;
15886
15887impl fidl::endpoints::ProtocolMarker for ReadableMarker {
15888    type Proxy = ReadableProxy;
15889    type RequestStream = ReadableRequestStream;
15890    #[cfg(target_os = "fuchsia")]
15891    type SynchronousProxy = ReadableSynchronousProxy;
15892
15893    const DEBUG_NAME: &'static str = "(anonymous) Readable";
15894}
15895pub type ReadableReadResult = Result<Vec<u8>, i32>;
15896
15897pub trait ReadableProxyInterface: Send + Sync {
15898    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
15899        + Send;
15900    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
15901}
15902#[derive(Debug)]
15903#[cfg(target_os = "fuchsia")]
15904pub struct ReadableSynchronousProxy {
15905    client: fidl::client::sync::Client,
15906}
15907
15908#[cfg(target_os = "fuchsia")]
15909impl fidl::endpoints::SynchronousProxy for ReadableSynchronousProxy {
15910    type Proxy = ReadableProxy;
15911    type Protocol = ReadableMarker;
15912
15913    fn from_channel(inner: fidl::Channel) -> Self {
15914        Self::new(inner)
15915    }
15916
15917    fn into_channel(self) -> fidl::Channel {
15918        self.client.into_channel()
15919    }
15920
15921    fn as_channel(&self) -> &fidl::Channel {
15922        self.client.as_channel()
15923    }
15924}
15925
15926#[cfg(target_os = "fuchsia")]
15927impl ReadableSynchronousProxy {
15928    pub fn new(channel: fidl::Channel) -> Self {
15929        let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
15930        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
15931    }
15932
15933    pub fn into_channel(self) -> fidl::Channel {
15934        self.client.into_channel()
15935    }
15936
15937    /// Waits until an event arrives and returns it. It is safe for other
15938    /// threads to make concurrent requests while waiting for an event.
15939    pub fn wait_for_event(
15940        &self,
15941        deadline: zx::MonotonicInstant,
15942    ) -> Result<ReadableEvent, fidl::Error> {
15943        ReadableEvent::decode(self.client.wait_for_event(deadline)?)
15944    }
15945
15946    /// Reads up to 'count' bytes at the seek offset.
15947    /// The seek offset is moved forward by the number of bytes read.
15948    ///
15949    /// ## Invariants
15950    ///
15951    /// * The returned `data.length` will never be greater than `count`.
15952    /// * If `data.length` is less than `count`, it means that the seek offset
15953    ///   has reached the end of file as part of this operation.
15954    /// * If `data.length` is zero while `count` is not, it means that the
15955    ///   seek offset is already at or beyond the end of file, and no data could
15956    ///   be read.
15957    /// * If `count` is zero, the server should perform all the checks ensuring
15958    ///   read access without actually read anything, and return an empty
15959    ///   `data` vector.
15960    ///
15961    /// This method requires the [`Rights.READ_BYTES`] right.
15962    ///
15963    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
15964    pub fn r#read(
15965        &self,
15966        mut count: u64,
15967        ___deadline: zx::MonotonicInstant,
15968    ) -> Result<ReadableReadResult, fidl::Error> {
15969        let _response = self.client.send_query::<
15970            ReadableReadRequest,
15971            fidl::encoding::ResultType<ReadableReadResponse, i32>,
15972        >(
15973            (count,),
15974            0x57e419a298c8ede,
15975            fidl::encoding::DynamicFlags::empty(),
15976            ___deadline,
15977        )?;
15978        Ok(_response.map(|x| x.data))
15979    }
15980}
15981
15982#[cfg(target_os = "fuchsia")]
15983impl From<ReadableSynchronousProxy> for zx::NullableHandle {
15984    fn from(value: ReadableSynchronousProxy) -> Self {
15985        value.into_channel().into()
15986    }
15987}
15988
15989#[cfg(target_os = "fuchsia")]
15990impl From<fidl::Channel> for ReadableSynchronousProxy {
15991    fn from(value: fidl::Channel) -> Self {
15992        Self::new(value)
15993    }
15994}
15995
15996#[cfg(target_os = "fuchsia")]
15997impl fidl::endpoints::FromClient for ReadableSynchronousProxy {
15998    type Protocol = ReadableMarker;
15999
16000    fn from_client(value: fidl::endpoints::ClientEnd<ReadableMarker>) -> Self {
16001        Self::new(value.into_channel())
16002    }
16003}
16004
16005#[derive(Debug, Clone)]
16006pub struct ReadableProxy {
16007    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
16008}
16009
16010impl fidl::endpoints::Proxy for ReadableProxy {
16011    type Protocol = ReadableMarker;
16012
16013    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
16014        Self::new(inner)
16015    }
16016
16017    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
16018        self.client.into_channel().map_err(|client| Self { client })
16019    }
16020
16021    fn as_channel(&self) -> &::fidl::AsyncChannel {
16022        self.client.as_channel()
16023    }
16024}
16025
16026impl ReadableProxy {
16027    /// Create a new Proxy for fuchsia.io/Readable.
16028    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
16029        let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16030        Self { client: fidl::client::Client::new(channel, protocol_name) }
16031    }
16032
16033    /// Get a Stream of events from the remote end of the protocol.
16034    ///
16035    /// # Panics
16036    ///
16037    /// Panics if the event stream was already taken.
16038    pub fn take_event_stream(&self) -> ReadableEventStream {
16039        ReadableEventStream { event_receiver: self.client.take_event_receiver() }
16040    }
16041
16042    /// Reads up to 'count' bytes at the seek offset.
16043    /// The seek offset is moved forward by the number of bytes read.
16044    ///
16045    /// ## Invariants
16046    ///
16047    /// * The returned `data.length` will never be greater than `count`.
16048    /// * If `data.length` is less than `count`, it means that the seek offset
16049    ///   has reached the end of file as part of this operation.
16050    /// * If `data.length` is zero while `count` is not, it means that the
16051    ///   seek offset is already at or beyond the end of file, and no data could
16052    ///   be read.
16053    /// * If `count` is zero, the server should perform all the checks ensuring
16054    ///   read access without actually read anything, and return an empty
16055    ///   `data` vector.
16056    ///
16057    /// This method requires the [`Rights.READ_BYTES`] right.
16058    ///
16059    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16060    pub fn r#read(
16061        &self,
16062        mut count: u64,
16063    ) -> fidl::client::QueryResponseFut<
16064        ReadableReadResult,
16065        fidl::encoding::DefaultFuchsiaResourceDialect,
16066    > {
16067        ReadableProxyInterface::r#read(self, count)
16068    }
16069}
16070
16071impl ReadableProxyInterface for ReadableProxy {
16072    type ReadResponseFut = fidl::client::QueryResponseFut<
16073        ReadableReadResult,
16074        fidl::encoding::DefaultFuchsiaResourceDialect,
16075    >;
16076    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
16077        fn _decode(
16078            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
16079        ) -> Result<ReadableReadResult, fidl::Error> {
16080            let _response = fidl::client::decode_transaction_body::<
16081                fidl::encoding::ResultType<ReadableReadResponse, i32>,
16082                fidl::encoding::DefaultFuchsiaResourceDialect,
16083                0x57e419a298c8ede,
16084            >(_buf?)?;
16085            Ok(_response.map(|x| x.data))
16086        }
16087        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
16088            (count,),
16089            0x57e419a298c8ede,
16090            fidl::encoding::DynamicFlags::empty(),
16091            _decode,
16092        )
16093    }
16094}
16095
16096pub struct ReadableEventStream {
16097    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
16098}
16099
16100impl std::marker::Unpin for ReadableEventStream {}
16101
16102impl futures::stream::FusedStream for ReadableEventStream {
16103    fn is_terminated(&self) -> bool {
16104        self.event_receiver.is_terminated()
16105    }
16106}
16107
16108impl futures::Stream for ReadableEventStream {
16109    type Item = Result<ReadableEvent, fidl::Error>;
16110
16111    fn poll_next(
16112        mut self: std::pin::Pin<&mut Self>,
16113        cx: &mut std::task::Context<'_>,
16114    ) -> std::task::Poll<Option<Self::Item>> {
16115        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
16116            &mut self.event_receiver,
16117            cx
16118        )?) {
16119            Some(buf) => std::task::Poll::Ready(Some(ReadableEvent::decode(buf))),
16120            None => std::task::Poll::Ready(None),
16121        }
16122    }
16123}
16124
16125#[derive(Debug)]
16126pub enum ReadableEvent {}
16127
16128impl ReadableEvent {
16129    /// Decodes a message buffer as a [`ReadableEvent`].
16130    fn decode(
16131        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
16132    ) -> Result<ReadableEvent, fidl::Error> {
16133        let (bytes, _handles) = buf.split_mut();
16134        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16135        debug_assert_eq!(tx_header.tx_id, 0);
16136        match tx_header.ordinal {
16137            _ => Err(fidl::Error::UnknownOrdinal {
16138                ordinal: tx_header.ordinal,
16139                protocol_name: <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16140            }),
16141        }
16142    }
16143}
16144
16145/// A Stream of incoming requests for fuchsia.io/Readable.
16146pub struct ReadableRequestStream {
16147    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16148    is_terminated: bool,
16149}
16150
16151impl std::marker::Unpin for ReadableRequestStream {}
16152
16153impl futures::stream::FusedStream for ReadableRequestStream {
16154    fn is_terminated(&self) -> bool {
16155        self.is_terminated
16156    }
16157}
16158
16159impl fidl::endpoints::RequestStream for ReadableRequestStream {
16160    type Protocol = ReadableMarker;
16161    type ControlHandle = ReadableControlHandle;
16162
16163    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
16164        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
16165    }
16166
16167    fn control_handle(&self) -> Self::ControlHandle {
16168        ReadableControlHandle { inner: self.inner.clone() }
16169    }
16170
16171    fn into_inner(
16172        self,
16173    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
16174    {
16175        (self.inner, self.is_terminated)
16176    }
16177
16178    fn from_inner(
16179        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16180        is_terminated: bool,
16181    ) -> Self {
16182        Self { inner, is_terminated }
16183    }
16184}
16185
16186impl futures::Stream for ReadableRequestStream {
16187    type Item = Result<ReadableRequest, fidl::Error>;
16188
16189    fn poll_next(
16190        mut self: std::pin::Pin<&mut Self>,
16191        cx: &mut std::task::Context<'_>,
16192    ) -> std::task::Poll<Option<Self::Item>> {
16193        let this = &mut *self;
16194        if this.inner.check_shutdown(cx) {
16195            this.is_terminated = true;
16196            return std::task::Poll::Ready(None);
16197        }
16198        if this.is_terminated {
16199            panic!("polled ReadableRequestStream after completion");
16200        }
16201        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
16202            |bytes, handles| {
16203                match this.inner.channel().read_etc(cx, bytes, handles) {
16204                    std::task::Poll::Ready(Ok(())) => {}
16205                    std::task::Poll::Pending => return std::task::Poll::Pending,
16206                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
16207                        this.is_terminated = true;
16208                        return std::task::Poll::Ready(None);
16209                    }
16210                    std::task::Poll::Ready(Err(e)) => {
16211                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
16212                            e.into(),
16213                        ))));
16214                    }
16215                }
16216
16217                // A message has been received from the channel
16218                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16219
16220                std::task::Poll::Ready(Some(match header.ordinal {
16221                    0x57e419a298c8ede => {
16222                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
16223                        let mut req = fidl::new_empty!(
16224                            ReadableReadRequest,
16225                            fidl::encoding::DefaultFuchsiaResourceDialect
16226                        );
16227                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
16228                        let control_handle = ReadableControlHandle { inner: this.inner.clone() };
16229                        Ok(ReadableRequest::Read {
16230                            count: req.count,
16231
16232                            responder: ReadableReadResponder {
16233                                control_handle: std::mem::ManuallyDrop::new(control_handle),
16234                                tx_id: header.tx_id,
16235                            },
16236                        })
16237                    }
16238                    _ => Err(fidl::Error::UnknownOrdinal {
16239                        ordinal: header.ordinal,
16240                        protocol_name:
16241                            <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16242                    }),
16243                }))
16244            },
16245        )
16246    }
16247}
16248
16249#[derive(Debug)]
16250pub enum ReadableRequest {
16251    /// Reads up to 'count' bytes at the seek offset.
16252    /// The seek offset is moved forward by the number of bytes read.
16253    ///
16254    /// ## Invariants
16255    ///
16256    /// * The returned `data.length` will never be greater than `count`.
16257    /// * If `data.length` is less than `count`, it means that the seek offset
16258    ///   has reached the end of file as part of this operation.
16259    /// * If `data.length` is zero while `count` is not, it means that the
16260    ///   seek offset is already at or beyond the end of file, and no data could
16261    ///   be read.
16262    /// * If `count` is zero, the server should perform all the checks ensuring
16263    ///   read access without actually read anything, and return an empty
16264    ///   `data` vector.
16265    ///
16266    /// This method requires the [`Rights.READ_BYTES`] right.
16267    ///
16268    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16269    Read { count: u64, responder: ReadableReadResponder },
16270}
16271
16272impl ReadableRequest {
16273    #[allow(irrefutable_let_patterns)]
16274    pub fn into_read(self) -> Option<(u64, ReadableReadResponder)> {
16275        if let ReadableRequest::Read { count, responder } = self {
16276            Some((count, responder))
16277        } else {
16278            None
16279        }
16280    }
16281
16282    /// Name of the method defined in FIDL
16283    pub fn method_name(&self) -> &'static str {
16284        match *self {
16285            ReadableRequest::Read { .. } => "read",
16286        }
16287    }
16288}
16289
16290#[derive(Debug, Clone)]
16291pub struct ReadableControlHandle {
16292    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16293}
16294
16295impl fidl::endpoints::ControlHandle for ReadableControlHandle {
16296    fn shutdown(&self) {
16297        self.inner.shutdown()
16298    }
16299    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
16300        self.inner.shutdown_with_epitaph(status)
16301    }
16302
16303    fn is_closed(&self) -> bool {
16304        self.inner.channel().is_closed()
16305    }
16306    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
16307        self.inner.channel().on_closed()
16308    }
16309
16310    #[cfg(target_os = "fuchsia")]
16311    fn signal_peer(
16312        &self,
16313        clear_mask: zx::Signals,
16314        set_mask: zx::Signals,
16315    ) -> Result<(), zx_status::Status> {
16316        use fidl::Peered;
16317        self.inner.channel().signal_peer(clear_mask, set_mask)
16318    }
16319}
16320
16321impl ReadableControlHandle {}
16322
16323#[must_use = "FIDL methods require a response to be sent"]
16324#[derive(Debug)]
16325pub struct ReadableReadResponder {
16326    control_handle: std::mem::ManuallyDrop<ReadableControlHandle>,
16327    tx_id: u32,
16328}
16329
16330/// Set the the channel to be shutdown (see [`ReadableControlHandle::shutdown`])
16331/// if the responder is dropped without sending a response, so that the client
16332/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16333impl std::ops::Drop for ReadableReadResponder {
16334    fn drop(&mut self) {
16335        self.control_handle.shutdown();
16336        // Safety: drops once, never accessed again
16337        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16338    }
16339}
16340
16341impl fidl::endpoints::Responder for ReadableReadResponder {
16342    type ControlHandle = ReadableControlHandle;
16343
16344    fn control_handle(&self) -> &ReadableControlHandle {
16345        &self.control_handle
16346    }
16347
16348    fn drop_without_shutdown(mut self) {
16349        // Safety: drops once, never accessed again due to mem::forget
16350        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16351        // Prevent Drop from running (which would shut down the channel)
16352        std::mem::forget(self);
16353    }
16354}
16355
16356impl ReadableReadResponder {
16357    /// Sends a response to the FIDL transaction.
16358    ///
16359    /// Sets the channel to shutdown if an error occurs.
16360    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
16361        let _result = self.send_raw(result);
16362        if _result.is_err() {
16363            self.control_handle.shutdown();
16364        }
16365        self.drop_without_shutdown();
16366        _result
16367    }
16368
16369    /// Similar to "send" but does not shutdown the channel if an error occurs.
16370    pub fn send_no_shutdown_on_err(
16371        self,
16372        mut result: Result<&[u8], i32>,
16373    ) -> Result<(), fidl::Error> {
16374        let _result = self.send_raw(result);
16375        self.drop_without_shutdown();
16376        _result
16377    }
16378
16379    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
16380        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
16381            result.map(|data| (data,)),
16382            self.tx_id,
16383            0x57e419a298c8ede,
16384            fidl::encoding::DynamicFlags::empty(),
16385        )
16386    }
16387}
16388
16389#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
16390pub struct SymlinkMarker;
16391
16392impl fidl::endpoints::ProtocolMarker for SymlinkMarker {
16393    type Proxy = SymlinkProxy;
16394    type RequestStream = SymlinkRequestStream;
16395    #[cfg(target_os = "fuchsia")]
16396    type SynchronousProxy = SymlinkSynchronousProxy;
16397
16398    const DEBUG_NAME: &'static str = "fuchsia.io.Symlink";
16399}
16400impl fidl::endpoints::DiscoverableProtocolMarker for SymlinkMarker {}
16401
16402pub trait SymlinkProxyInterface: Send + Sync {
16403    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
16404        + Send;
16405    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
16406    fn r#clone(
16407        &self,
16408        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
16409    ) -> Result<(), fidl::Error>;
16410    type CloseResponseFut: std::future::Future<
16411            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
16412        > + Send;
16413    fn r#close(&self) -> Self::CloseResponseFut;
16414    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
16415    fn r#query(&self) -> Self::QueryResponseFut;
16416    fn r#deprecated_clone(
16417        &self,
16418        flags: OpenFlags,
16419        object: fidl::endpoints::ServerEnd<NodeMarker>,
16420    ) -> Result<(), fidl::Error>;
16421    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
16422        + Send;
16423    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
16424    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
16425    fn r#deprecated_set_attr(
16426        &self,
16427        flags: NodeAttributeFlags,
16428        attributes: &NodeAttributes,
16429    ) -> Self::DeprecatedSetAttrResponseFut;
16430    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
16431        + Send;
16432    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
16433    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
16434        + Send;
16435    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
16436    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
16437        + Send;
16438    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
16439    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
16440        + Send;
16441    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
16442    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
16443        + Send;
16444    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
16445    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
16446        + Send;
16447    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
16448    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
16449        + Send;
16450    fn r#update_attributes(
16451        &self,
16452        payload: &MutableNodeAttributes,
16453    ) -> Self::UpdateAttributesResponseFut;
16454    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
16455    fn r#sync(&self) -> Self::SyncResponseFut;
16456    fn r#list_extended_attributes(
16457        &self,
16458        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
16459    ) -> Result<(), fidl::Error>;
16460    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
16461        + Send;
16462    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
16463    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
16464        + Send;
16465    fn r#set_extended_attribute(
16466        &self,
16467        name: &[u8],
16468        value: ExtendedAttributeValue,
16469        mode: SetExtendedAttributeMode,
16470    ) -> Self::SetExtendedAttributeResponseFut;
16471    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
16472        + Send;
16473    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
16474    type DescribeResponseFut: std::future::Future<Output = Result<SymlinkInfo, fidl::Error>> + Send;
16475    fn r#describe(&self) -> Self::DescribeResponseFut;
16476}
16477#[derive(Debug)]
16478#[cfg(target_os = "fuchsia")]
16479pub struct SymlinkSynchronousProxy {
16480    client: fidl::client::sync::Client,
16481}
16482
16483#[cfg(target_os = "fuchsia")]
16484impl fidl::endpoints::SynchronousProxy for SymlinkSynchronousProxy {
16485    type Proxy = SymlinkProxy;
16486    type Protocol = SymlinkMarker;
16487
16488    fn from_channel(inner: fidl::Channel) -> Self {
16489        Self::new(inner)
16490    }
16491
16492    fn into_channel(self) -> fidl::Channel {
16493        self.client.into_channel()
16494    }
16495
16496    fn as_channel(&self) -> &fidl::Channel {
16497        self.client.as_channel()
16498    }
16499}
16500
16501#[cfg(target_os = "fuchsia")]
16502impl SymlinkSynchronousProxy {
16503    pub fn new(channel: fidl::Channel) -> Self {
16504        let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16505        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
16506    }
16507
16508    pub fn into_channel(self) -> fidl::Channel {
16509        self.client.into_channel()
16510    }
16511
16512    /// Waits until an event arrives and returns it. It is safe for other
16513    /// threads to make concurrent requests while waiting for an event.
16514    pub fn wait_for_event(
16515        &self,
16516        deadline: zx::MonotonicInstant,
16517    ) -> Result<SymlinkEvent, fidl::Error> {
16518        SymlinkEvent::decode(self.client.wait_for_event(deadline)?)
16519    }
16520
16521    /// Creates a link to this this object with name `dst` in the directory represented by
16522    /// `dst_parent_token`.
16523    ///
16524    /// `dst` must be a resolved object name. Including "/" in the string will return
16525    /// `ZX_ERR_INVALID_ARGS`.
16526    ///
16527    /// This method requires the maximal set of rights supported by the filesystem for this object.
16528    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
16529    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
16530    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
16531    /// `ZX_ERR_ACCESS_DENIED`.
16532    ///
16533    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
16534    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
16535    ///
16536    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
16537    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
16538    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
16539    ///
16540    /// This method does not have the same atomicity properties has the `Directory::Link` method,
16541    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
16542    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
16543    pub fn r#link_into(
16544        &self,
16545        mut dst_parent_token: fidl::Event,
16546        mut dst: &str,
16547        ___deadline: zx::MonotonicInstant,
16548    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
16549        let _response = self.client.send_query::<
16550            LinkableLinkIntoRequest,
16551            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16552        >(
16553            (dst_parent_token, dst,),
16554            0x54f3949246a03e74,
16555            fidl::encoding::DynamicFlags::empty(),
16556            ___deadline,
16557        )?;
16558        Ok(_response.map(|x| x))
16559    }
16560
16561    pub fn r#clone(
16562        &self,
16563        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
16564    ) -> Result<(), fidl::Error> {
16565        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
16566            (request,),
16567            0x20d8a7aba2168a79,
16568            fidl::encoding::DynamicFlags::empty(),
16569        )
16570    }
16571
16572    /// Terminates the connection.
16573    ///
16574    /// After calling `Close`, the client must not send any other requests.
16575    ///
16576    /// Servers, after sending the status response, should close the connection
16577    /// regardless of status and without sending an epitaph.
16578    ///
16579    /// Closing the client end of the channel should be semantically equivalent
16580    /// to calling `Close` without knowing when the close has completed or its
16581    /// status.
16582    pub fn r#close(
16583        &self,
16584        ___deadline: zx::MonotonicInstant,
16585    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
16586        let _response = self.client.send_query::<
16587            fidl::encoding::EmptyPayload,
16588            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16589        >(
16590            (),
16591            0x5ac5d459ad7f657e,
16592            fidl::encoding::DynamicFlags::empty(),
16593            ___deadline,
16594        )?;
16595        Ok(_response.map(|x| x))
16596    }
16597
16598    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
16599        let _response = self.client.send_query::<
16600            fidl::encoding::EmptyPayload,
16601            fidl_fuchsia_unknown::QueryableQueryResponse,
16602        >(
16603            (),
16604            0x2658edee9decfc06,
16605            fidl::encoding::DynamicFlags::empty(),
16606            ___deadline,
16607        )?;
16608        Ok(_response.protocol)
16609    }
16610
16611    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
16612    pub fn r#deprecated_clone(
16613        &self,
16614        mut flags: OpenFlags,
16615        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
16616    ) -> Result<(), fidl::Error> {
16617        self.client.send::<NodeDeprecatedCloneRequest>(
16618            (flags, object),
16619            0x5a61678f293ce16f,
16620            fidl::encoding::DynamicFlags::FLEXIBLE,
16621        )
16622    }
16623
16624    /// DEPRECATED - Use `Node.GetAttributes` instead.
16625    pub fn r#deprecated_get_attr(
16626        &self,
16627        ___deadline: zx::MonotonicInstant,
16628    ) -> Result<(i32, NodeAttributes), fidl::Error> {
16629        let _response =
16630            self.client.send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse>(
16631                (),
16632                0x78985e216314dafd,
16633                fidl::encoding::DynamicFlags::empty(),
16634                ___deadline,
16635            )?;
16636        Ok((_response.s, _response.attributes))
16637    }
16638
16639    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
16640    pub fn r#deprecated_set_attr(
16641        &self,
16642        mut flags: NodeAttributeFlags,
16643        mut attributes: &NodeAttributes,
16644        ___deadline: zx::MonotonicInstant,
16645    ) -> Result<i32, fidl::Error> {
16646        let _response =
16647            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
16648                (flags, attributes),
16649                0x4186c0f40d938f46,
16650                fidl::encoding::DynamicFlags::empty(),
16651                ___deadline,
16652            )?;
16653        Ok(_response.s)
16654    }
16655
16656    /// [DEPRECATED - Use new GetFlags method instead.]
16657    pub fn r#deprecated_get_flags(
16658        &self,
16659        ___deadline: zx::MonotonicInstant,
16660    ) -> Result<(i32, OpenFlags), fidl::Error> {
16661        let _response = self
16662            .client
16663            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
16664                (),
16665                0x5b88fffb8eda3aa1,
16666                fidl::encoding::DynamicFlags::empty(),
16667                ___deadline,
16668            )?;
16669        Ok((_response.s, _response.flags))
16670    }
16671
16672    /// [DEPRECATED - Use new SetFlags method instead.]
16673    pub fn r#deprecated_set_flags(
16674        &self,
16675        mut flags: OpenFlags,
16676        ___deadline: zx::MonotonicInstant,
16677    ) -> Result<i32, fidl::Error> {
16678        let _response = self
16679            .client
16680            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
16681                (flags,),
16682                0x5295b76c71fde733,
16683                fidl::encoding::DynamicFlags::empty(),
16684                ___deadline,
16685            )?;
16686        Ok(_response.s)
16687    }
16688
16689    /// Queries the flags that apply to this node after it has been opened/created. This method does
16690    /// not require any rights.
16691    ///
16692    /// Note that the final set of flags that apply to the connection may differ from those
16693    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
16694    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
16695    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
16696    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
16697    pub fn r#get_flags(
16698        &self,
16699        ___deadline: zx::MonotonicInstant,
16700    ) -> Result<NodeGetFlagsResult, fidl::Error> {
16701        let _response = self.client.send_query::<
16702            fidl::encoding::EmptyPayload,
16703            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
16704        >(
16705            (),
16706            0x176eb318f64ec23,
16707            fidl::encoding::DynamicFlags::FLEXIBLE,
16708            ___deadline,
16709        )?
16710        .into_result::<SymlinkMarker>("get_flags")?;
16711        Ok(_response.map(|x| x.flags))
16712    }
16713
16714    /// Sets the flags that apply to this node after it has been opened. This method does not
16715    /// require any rights.
16716    ///
16717    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
16718    /// clear append mode.
16719    ///
16720    /// Errors:
16721    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
16722    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
16723    pub fn r#set_flags(
16724        &self,
16725        mut flags: Flags,
16726        ___deadline: zx::MonotonicInstant,
16727    ) -> Result<NodeSetFlagsResult, fidl::Error> {
16728        let _response = self.client.send_query::<
16729            NodeSetFlagsRequest,
16730            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
16731        >(
16732            (flags,),
16733            0x55a8028685791ea8,
16734            fidl::encoding::DynamicFlags::FLEXIBLE,
16735            ___deadline,
16736        )?
16737        .into_result::<SymlinkMarker>("set_flags")?;
16738        Ok(_response.map(|x| x))
16739    }
16740
16741    /// Query the filesystem for filesystem-specific information.
16742    pub fn r#query_filesystem(
16743        &self,
16744        ___deadline: zx::MonotonicInstant,
16745    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
16746        let _response =
16747            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
16748                (),
16749                0x6f344a1c6b0a0610,
16750                fidl::encoding::DynamicFlags::empty(),
16751                ___deadline,
16752            )?;
16753        Ok((_response.s, _response.info))
16754    }
16755
16756    /// Acquires information about the node.
16757    ///
16758    /// The attributes of a node should be stable, independent of the
16759    /// specific protocol used to access it.
16760    ///
16761    /// If a particular attribute is not applicable or not supported,
16762    /// filesystems should leave the corresponding field absent.
16763    ///
16764    /// + `query` a bit-mask specifying which attributes to fetch. The server
16765    ///   should not return more than necessary.
16766    /// - `attributes` the returned attributes.
16767    ///
16768    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
16769    pub fn r#get_attributes(
16770        &self,
16771        mut query: NodeAttributesQuery,
16772        ___deadline: zx::MonotonicInstant,
16773    ) -> Result<NodeGetAttributesResult, fidl::Error> {
16774        let _response = self.client.send_query::<
16775            NodeGetAttributesRequest,
16776            fidl::encoding::ResultType<NodeAttributes2, i32>,
16777        >(
16778            (query,),
16779            0x3d4396a638ea053b,
16780            fidl::encoding::DynamicFlags::empty(),
16781            ___deadline,
16782        )?;
16783        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
16784    }
16785
16786    /// Updates information about the node.
16787    ///
16788    /// + `attributes` the presence of a table field in `attributes` indicates
16789    /// the intent to update the corresponding attribute.
16790    ///
16791    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
16792    ///
16793    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
16794    pub fn r#update_attributes(
16795        &self,
16796        mut payload: &MutableNodeAttributes,
16797        ___deadline: zx::MonotonicInstant,
16798    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
16799        let _response = self.client.send_query::<
16800            MutableNodeAttributes,
16801            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16802        >(
16803            payload,
16804            0x3308c1da5a89bf08,
16805            fidl::encoding::DynamicFlags::empty(),
16806            ___deadline,
16807        )?;
16808        Ok(_response.map(|x| x))
16809    }
16810
16811    /// Synchronizes updates to the node to the underlying media, if it exists.
16812    ///
16813    /// This method will return when the filesystem server has flushed the
16814    /// relevant updates to the underlying media, but does not guarantee the
16815    /// underlying media has persisted the information, nor that any information
16816    /// is committed to hardware. Clients may use `Sync` to ensure ordering
16817    /// between operations.
16818    ///
16819    /// This method does not require any rights.
16820    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
16821        let _response = self.client.send_query::<
16822            fidl::encoding::EmptyPayload,
16823            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16824        >(
16825            (),
16826            0x2c5c27ca0ab5dc49,
16827            fidl::encoding::DynamicFlags::empty(),
16828            ___deadline,
16829        )?;
16830        Ok(_response.map(|x| x))
16831    }
16832
16833    /// Creates an iterator over all the extended attribute names associated
16834    /// with this node. If an error occurs it is returned as an epitaph on the
16835    /// iterator request channel, and then the channel is closed.
16836    ///
16837    /// GetExtendedAttributes can be used with any of these names to retrieve
16838    /// the associated value.
16839    ///
16840    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
16841    pub fn r#list_extended_attributes(
16842        &self,
16843        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
16844    ) -> Result<(), fidl::Error> {
16845        self.client.send::<NodeListExtendedAttributesRequest>(
16846            (iterator,),
16847            0x4b61033de007fcd0,
16848            fidl::encoding::DynamicFlags::empty(),
16849        )
16850    }
16851
16852    /// Get the value associated with the given attribute `name` for this node.
16853    ///
16854    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
16855    /// particular structure is imposed on them.
16856    ///
16857    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
16858    pub fn r#get_extended_attribute(
16859        &self,
16860        mut name: &[u8],
16861        ___deadline: zx::MonotonicInstant,
16862    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
16863        let _response = self.client.send_query::<
16864            NodeGetExtendedAttributeRequest,
16865            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
16866        >(
16867            (name,),
16868            0x45ffa3ccfdeb76db,
16869            fidl::encoding::DynamicFlags::empty(),
16870            ___deadline,
16871        )?;
16872        Ok(_response.map(|x| x))
16873    }
16874
16875    /// Set the value for the given attribute `name` to `value` for this node.
16876    ///
16877    /// The attribute name may exist, in which case the attribute is updated.
16878    /// If the attribute doesn't exist, it is created. The name should have no
16879    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
16880    ///
16881    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
16882    pub fn r#set_extended_attribute(
16883        &self,
16884        mut name: &[u8],
16885        mut value: ExtendedAttributeValue,
16886        mut mode: SetExtendedAttributeMode,
16887        ___deadline: zx::MonotonicInstant,
16888    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
16889        let _response = self.client.send_query::<
16890            NodeSetExtendedAttributeRequest,
16891            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16892        >(
16893            (name, &mut value, mode,),
16894            0x4a951362f681f23c,
16895            fidl::encoding::DynamicFlags::empty(),
16896            ___deadline,
16897        )?;
16898        Ok(_response.map(|x| x))
16899    }
16900
16901    /// Remove the specified extended attribute.
16902    ///
16903    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
16904    ///
16905    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
16906    pub fn r#remove_extended_attribute(
16907        &self,
16908        mut name: &[u8],
16909        ___deadline: zx::MonotonicInstant,
16910    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
16911        let _response = self.client.send_query::<
16912            NodeRemoveExtendedAttributeRequest,
16913            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16914        >(
16915            (name,),
16916            0x7a0b9f3a9bf9032d,
16917            fidl::encoding::DynamicFlags::empty(),
16918            ___deadline,
16919        )?;
16920        Ok(_response.map(|x| x))
16921    }
16922
16923    pub fn r#describe(
16924        &self,
16925        ___deadline: zx::MonotonicInstant,
16926    ) -> Result<SymlinkInfo, fidl::Error> {
16927        let _response = self
16928            .client
16929            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleType<SymlinkInfo>>(
16930                (),
16931                0x742c2ea5e89831f3,
16932                fidl::encoding::DynamicFlags::FLEXIBLE,
16933                ___deadline,
16934            )?
16935            .into_result::<SymlinkMarker>("describe")?;
16936        Ok(_response)
16937    }
16938}
16939
16940#[cfg(target_os = "fuchsia")]
16941impl From<SymlinkSynchronousProxy> for zx::NullableHandle {
16942    fn from(value: SymlinkSynchronousProxy) -> Self {
16943        value.into_channel().into()
16944    }
16945}
16946
16947#[cfg(target_os = "fuchsia")]
16948impl From<fidl::Channel> for SymlinkSynchronousProxy {
16949    fn from(value: fidl::Channel) -> Self {
16950        Self::new(value)
16951    }
16952}
16953
16954#[cfg(target_os = "fuchsia")]
16955impl fidl::endpoints::FromClient for SymlinkSynchronousProxy {
16956    type Protocol = SymlinkMarker;
16957
16958    fn from_client(value: fidl::endpoints::ClientEnd<SymlinkMarker>) -> Self {
16959        Self::new(value.into_channel())
16960    }
16961}
16962
16963#[derive(Debug, Clone)]
16964pub struct SymlinkProxy {
16965    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
16966}
16967
16968impl fidl::endpoints::Proxy for SymlinkProxy {
16969    type Protocol = SymlinkMarker;
16970
16971    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
16972        Self::new(inner)
16973    }
16974
16975    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
16976        self.client.into_channel().map_err(|client| Self { client })
16977    }
16978
16979    fn as_channel(&self) -> &::fidl::AsyncChannel {
16980        self.client.as_channel()
16981    }
16982}
16983
16984impl SymlinkProxy {
16985    /// Create a new Proxy for fuchsia.io/Symlink.
16986    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
16987        let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16988        Self { client: fidl::client::Client::new(channel, protocol_name) }
16989    }
16990
16991    /// Get a Stream of events from the remote end of the protocol.
16992    ///
16993    /// # Panics
16994    ///
16995    /// Panics if the event stream was already taken.
16996    pub fn take_event_stream(&self) -> SymlinkEventStream {
16997        SymlinkEventStream { event_receiver: self.client.take_event_receiver() }
16998    }
16999
17000    /// Creates a link to this this object with name `dst` in the directory represented by
17001    /// `dst_parent_token`.
17002    ///
17003    /// `dst` must be a resolved object name. Including "/" in the string will return
17004    /// `ZX_ERR_INVALID_ARGS`.
17005    ///
17006    /// This method requires the maximal set of rights supported by the filesystem for this object.
17007    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
17008    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
17009    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
17010    /// `ZX_ERR_ACCESS_DENIED`.
17011    ///
17012    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
17013    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
17014    ///
17015    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
17016    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
17017    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
17018    ///
17019    /// This method does not have the same atomicity properties has the `Directory::Link` method,
17020    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
17021    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
17022    pub fn r#link_into(
17023        &self,
17024        mut dst_parent_token: fidl::Event,
17025        mut dst: &str,
17026    ) -> fidl::client::QueryResponseFut<
17027        LinkableLinkIntoResult,
17028        fidl::encoding::DefaultFuchsiaResourceDialect,
17029    > {
17030        SymlinkProxyInterface::r#link_into(self, dst_parent_token, dst)
17031    }
17032
17033    pub fn r#clone(
17034        &self,
17035        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17036    ) -> Result<(), fidl::Error> {
17037        SymlinkProxyInterface::r#clone(self, request)
17038    }
17039
17040    /// Terminates the connection.
17041    ///
17042    /// After calling `Close`, the client must not send any other requests.
17043    ///
17044    /// Servers, after sending the status response, should close the connection
17045    /// regardless of status and without sending an epitaph.
17046    ///
17047    /// Closing the client end of the channel should be semantically equivalent
17048    /// to calling `Close` without knowing when the close has completed or its
17049    /// status.
17050    pub fn r#close(
17051        &self,
17052    ) -> fidl::client::QueryResponseFut<
17053        fidl_fuchsia_unknown::CloseableCloseResult,
17054        fidl::encoding::DefaultFuchsiaResourceDialect,
17055    > {
17056        SymlinkProxyInterface::r#close(self)
17057    }
17058
17059    pub fn r#query(
17060        &self,
17061    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
17062    {
17063        SymlinkProxyInterface::r#query(self)
17064    }
17065
17066    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
17067    pub fn r#deprecated_clone(
17068        &self,
17069        mut flags: OpenFlags,
17070        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17071    ) -> Result<(), fidl::Error> {
17072        SymlinkProxyInterface::r#deprecated_clone(self, flags, object)
17073    }
17074
17075    /// DEPRECATED - Use `Node.GetAttributes` instead.
17076    pub fn r#deprecated_get_attr(
17077        &self,
17078    ) -> fidl::client::QueryResponseFut<
17079        (i32, NodeAttributes),
17080        fidl::encoding::DefaultFuchsiaResourceDialect,
17081    > {
17082        SymlinkProxyInterface::r#deprecated_get_attr(self)
17083    }
17084
17085    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
17086    pub fn r#deprecated_set_attr(
17087        &self,
17088        mut flags: NodeAttributeFlags,
17089        mut attributes: &NodeAttributes,
17090    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
17091        SymlinkProxyInterface::r#deprecated_set_attr(self, flags, attributes)
17092    }
17093
17094    /// [DEPRECATED - Use new GetFlags method instead.]
17095    pub fn r#deprecated_get_flags(
17096        &self,
17097    ) -> fidl::client::QueryResponseFut<
17098        (i32, OpenFlags),
17099        fidl::encoding::DefaultFuchsiaResourceDialect,
17100    > {
17101        SymlinkProxyInterface::r#deprecated_get_flags(self)
17102    }
17103
17104    /// [DEPRECATED - Use new SetFlags method instead.]
17105    pub fn r#deprecated_set_flags(
17106        &self,
17107        mut flags: OpenFlags,
17108    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
17109        SymlinkProxyInterface::r#deprecated_set_flags(self, flags)
17110    }
17111
17112    /// Queries the flags that apply to this node after it has been opened/created. This method does
17113    /// not require any rights.
17114    ///
17115    /// Note that the final set of flags that apply to the connection may differ from those
17116    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
17117    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
17118    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
17119    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
17120    pub fn r#get_flags(
17121        &self,
17122    ) -> fidl::client::QueryResponseFut<
17123        NodeGetFlagsResult,
17124        fidl::encoding::DefaultFuchsiaResourceDialect,
17125    > {
17126        SymlinkProxyInterface::r#get_flags(self)
17127    }
17128
17129    /// Sets the flags that apply to this node after it has been opened. This method does not
17130    /// require any rights.
17131    ///
17132    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
17133    /// clear append mode.
17134    ///
17135    /// Errors:
17136    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
17137    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
17138    pub fn r#set_flags(
17139        &self,
17140        mut flags: Flags,
17141    ) -> fidl::client::QueryResponseFut<
17142        NodeSetFlagsResult,
17143        fidl::encoding::DefaultFuchsiaResourceDialect,
17144    > {
17145        SymlinkProxyInterface::r#set_flags(self, flags)
17146    }
17147
17148    /// Query the filesystem for filesystem-specific information.
17149    pub fn r#query_filesystem(
17150        &self,
17151    ) -> fidl::client::QueryResponseFut<
17152        (i32, Option<Box<FilesystemInfo>>),
17153        fidl::encoding::DefaultFuchsiaResourceDialect,
17154    > {
17155        SymlinkProxyInterface::r#query_filesystem(self)
17156    }
17157
17158    /// Acquires information about the node.
17159    ///
17160    /// The attributes of a node should be stable, independent of the
17161    /// specific protocol used to access it.
17162    ///
17163    /// If a particular attribute is not applicable or not supported,
17164    /// filesystems should leave the corresponding field absent.
17165    ///
17166    /// + `query` a bit-mask specifying which attributes to fetch. The server
17167    ///   should not return more than necessary.
17168    /// - `attributes` the returned attributes.
17169    ///
17170    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17171    pub fn r#get_attributes(
17172        &self,
17173        mut query: NodeAttributesQuery,
17174    ) -> fidl::client::QueryResponseFut<
17175        NodeGetAttributesResult,
17176        fidl::encoding::DefaultFuchsiaResourceDialect,
17177    > {
17178        SymlinkProxyInterface::r#get_attributes(self, query)
17179    }
17180
17181    /// Updates information about the node.
17182    ///
17183    /// + `attributes` the presence of a table field in `attributes` indicates
17184    /// the intent to update the corresponding attribute.
17185    ///
17186    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
17187    ///
17188    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17189    pub fn r#update_attributes(
17190        &self,
17191        mut payload: &MutableNodeAttributes,
17192    ) -> fidl::client::QueryResponseFut<
17193        NodeUpdateAttributesResult,
17194        fidl::encoding::DefaultFuchsiaResourceDialect,
17195    > {
17196        SymlinkProxyInterface::r#update_attributes(self, payload)
17197    }
17198
17199    /// Synchronizes updates to the node to the underlying media, if it exists.
17200    ///
17201    /// This method will return when the filesystem server has flushed the
17202    /// relevant updates to the underlying media, but does not guarantee the
17203    /// underlying media has persisted the information, nor that any information
17204    /// is committed to hardware. Clients may use `Sync` to ensure ordering
17205    /// between operations.
17206    ///
17207    /// This method does not require any rights.
17208    pub fn r#sync(
17209        &self,
17210    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
17211    {
17212        SymlinkProxyInterface::r#sync(self)
17213    }
17214
17215    /// Creates an iterator over all the extended attribute names associated
17216    /// with this node. If an error occurs it is returned as an epitaph on the
17217    /// iterator request channel, and then the channel is closed.
17218    ///
17219    /// GetExtendedAttributes can be used with any of these names to retrieve
17220    /// the associated value.
17221    ///
17222    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17223    pub fn r#list_extended_attributes(
17224        &self,
17225        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17226    ) -> Result<(), fidl::Error> {
17227        SymlinkProxyInterface::r#list_extended_attributes(self, iterator)
17228    }
17229
17230    /// Get the value associated with the given attribute `name` for this node.
17231    ///
17232    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
17233    /// particular structure is imposed on them.
17234    ///
17235    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17236    pub fn r#get_extended_attribute(
17237        &self,
17238        mut name: &[u8],
17239    ) -> fidl::client::QueryResponseFut<
17240        NodeGetExtendedAttributeResult,
17241        fidl::encoding::DefaultFuchsiaResourceDialect,
17242    > {
17243        SymlinkProxyInterface::r#get_extended_attribute(self, name)
17244    }
17245
17246    /// Set the value for the given attribute `name` to `value` for this node.
17247    ///
17248    /// The attribute name may exist, in which case the attribute is updated.
17249    /// If the attribute doesn't exist, it is created. The name should have no
17250    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
17251    ///
17252    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17253    pub fn r#set_extended_attribute(
17254        &self,
17255        mut name: &[u8],
17256        mut value: ExtendedAttributeValue,
17257        mut mode: SetExtendedAttributeMode,
17258    ) -> fidl::client::QueryResponseFut<
17259        NodeSetExtendedAttributeResult,
17260        fidl::encoding::DefaultFuchsiaResourceDialect,
17261    > {
17262        SymlinkProxyInterface::r#set_extended_attribute(self, name, value, mode)
17263    }
17264
17265    /// Remove the specified extended attribute.
17266    ///
17267    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
17268    ///
17269    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17270    pub fn r#remove_extended_attribute(
17271        &self,
17272        mut name: &[u8],
17273    ) -> fidl::client::QueryResponseFut<
17274        NodeRemoveExtendedAttributeResult,
17275        fidl::encoding::DefaultFuchsiaResourceDialect,
17276    > {
17277        SymlinkProxyInterface::r#remove_extended_attribute(self, name)
17278    }
17279
17280    pub fn r#describe(
17281        &self,
17282    ) -> fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
17283    {
17284        SymlinkProxyInterface::r#describe(self)
17285    }
17286}
17287
17288impl SymlinkProxyInterface for SymlinkProxy {
17289    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
17290        LinkableLinkIntoResult,
17291        fidl::encoding::DefaultFuchsiaResourceDialect,
17292    >;
17293    fn r#link_into(
17294        &self,
17295        mut dst_parent_token: fidl::Event,
17296        mut dst: &str,
17297    ) -> Self::LinkIntoResponseFut {
17298        fn _decode(
17299            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17300        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
17301            let _response = fidl::client::decode_transaction_body::<
17302                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17303                fidl::encoding::DefaultFuchsiaResourceDialect,
17304                0x54f3949246a03e74,
17305            >(_buf?)?;
17306            Ok(_response.map(|x| x))
17307        }
17308        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
17309            (dst_parent_token, dst),
17310            0x54f3949246a03e74,
17311            fidl::encoding::DynamicFlags::empty(),
17312            _decode,
17313        )
17314    }
17315
17316    fn r#clone(
17317        &self,
17318        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17319    ) -> Result<(), fidl::Error> {
17320        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
17321            (request,),
17322            0x20d8a7aba2168a79,
17323            fidl::encoding::DynamicFlags::empty(),
17324        )
17325    }
17326
17327    type CloseResponseFut = fidl::client::QueryResponseFut<
17328        fidl_fuchsia_unknown::CloseableCloseResult,
17329        fidl::encoding::DefaultFuchsiaResourceDialect,
17330    >;
17331    fn r#close(&self) -> Self::CloseResponseFut {
17332        fn _decode(
17333            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17334        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
17335            let _response = fidl::client::decode_transaction_body::<
17336                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17337                fidl::encoding::DefaultFuchsiaResourceDialect,
17338                0x5ac5d459ad7f657e,
17339            >(_buf?)?;
17340            Ok(_response.map(|x| x))
17341        }
17342        self.client.send_query_and_decode::<
17343            fidl::encoding::EmptyPayload,
17344            fidl_fuchsia_unknown::CloseableCloseResult,
17345        >(
17346            (),
17347            0x5ac5d459ad7f657e,
17348            fidl::encoding::DynamicFlags::empty(),
17349            _decode,
17350        )
17351    }
17352
17353    type QueryResponseFut =
17354        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
17355    fn r#query(&self) -> Self::QueryResponseFut {
17356        fn _decode(
17357            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17358        ) -> Result<Vec<u8>, fidl::Error> {
17359            let _response = fidl::client::decode_transaction_body::<
17360                fidl_fuchsia_unknown::QueryableQueryResponse,
17361                fidl::encoding::DefaultFuchsiaResourceDialect,
17362                0x2658edee9decfc06,
17363            >(_buf?)?;
17364            Ok(_response.protocol)
17365        }
17366        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
17367            (),
17368            0x2658edee9decfc06,
17369            fidl::encoding::DynamicFlags::empty(),
17370            _decode,
17371        )
17372    }
17373
17374    fn r#deprecated_clone(
17375        &self,
17376        mut flags: OpenFlags,
17377        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17378    ) -> Result<(), fidl::Error> {
17379        self.client.send::<NodeDeprecatedCloneRequest>(
17380            (flags, object),
17381            0x5a61678f293ce16f,
17382            fidl::encoding::DynamicFlags::FLEXIBLE,
17383        )
17384    }
17385
17386    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
17387        (i32, NodeAttributes),
17388        fidl::encoding::DefaultFuchsiaResourceDialect,
17389    >;
17390    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
17391        fn _decode(
17392            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17393        ) -> Result<(i32, NodeAttributes), fidl::Error> {
17394            let _response = fidl::client::decode_transaction_body::<
17395                NodeDeprecatedGetAttrResponse,
17396                fidl::encoding::DefaultFuchsiaResourceDialect,
17397                0x78985e216314dafd,
17398            >(_buf?)?;
17399            Ok((_response.s, _response.attributes))
17400        }
17401        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
17402            (),
17403            0x78985e216314dafd,
17404            fidl::encoding::DynamicFlags::empty(),
17405            _decode,
17406        )
17407    }
17408
17409    type DeprecatedSetAttrResponseFut =
17410        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
17411    fn r#deprecated_set_attr(
17412        &self,
17413        mut flags: NodeAttributeFlags,
17414        mut attributes: &NodeAttributes,
17415    ) -> Self::DeprecatedSetAttrResponseFut {
17416        fn _decode(
17417            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17418        ) -> Result<i32, fidl::Error> {
17419            let _response = fidl::client::decode_transaction_body::<
17420                NodeDeprecatedSetAttrResponse,
17421                fidl::encoding::DefaultFuchsiaResourceDialect,
17422                0x4186c0f40d938f46,
17423            >(_buf?)?;
17424            Ok(_response.s)
17425        }
17426        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
17427            (flags, attributes),
17428            0x4186c0f40d938f46,
17429            fidl::encoding::DynamicFlags::empty(),
17430            _decode,
17431        )
17432    }
17433
17434    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
17435        (i32, OpenFlags),
17436        fidl::encoding::DefaultFuchsiaResourceDialect,
17437    >;
17438    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
17439        fn _decode(
17440            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17441        ) -> Result<(i32, OpenFlags), fidl::Error> {
17442            let _response = fidl::client::decode_transaction_body::<
17443                NodeDeprecatedGetFlagsResponse,
17444                fidl::encoding::DefaultFuchsiaResourceDialect,
17445                0x5b88fffb8eda3aa1,
17446            >(_buf?)?;
17447            Ok((_response.s, _response.flags))
17448        }
17449        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
17450            (),
17451            0x5b88fffb8eda3aa1,
17452            fidl::encoding::DynamicFlags::empty(),
17453            _decode,
17454        )
17455    }
17456
17457    type DeprecatedSetFlagsResponseFut =
17458        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
17459    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
17460        fn _decode(
17461            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17462        ) -> Result<i32, fidl::Error> {
17463            let _response = fidl::client::decode_transaction_body::<
17464                NodeDeprecatedSetFlagsResponse,
17465                fidl::encoding::DefaultFuchsiaResourceDialect,
17466                0x5295b76c71fde733,
17467            >(_buf?)?;
17468            Ok(_response.s)
17469        }
17470        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
17471            (flags,),
17472            0x5295b76c71fde733,
17473            fidl::encoding::DynamicFlags::empty(),
17474            _decode,
17475        )
17476    }
17477
17478    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
17479        NodeGetFlagsResult,
17480        fidl::encoding::DefaultFuchsiaResourceDialect,
17481    >;
17482    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
17483        fn _decode(
17484            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17485        ) -> Result<NodeGetFlagsResult, fidl::Error> {
17486            let _response = fidl::client::decode_transaction_body::<
17487                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
17488                fidl::encoding::DefaultFuchsiaResourceDialect,
17489                0x176eb318f64ec23,
17490            >(_buf?)?
17491            .into_result::<SymlinkMarker>("get_flags")?;
17492            Ok(_response.map(|x| x.flags))
17493        }
17494        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
17495            (),
17496            0x176eb318f64ec23,
17497            fidl::encoding::DynamicFlags::FLEXIBLE,
17498            _decode,
17499        )
17500    }
17501
17502    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
17503        NodeSetFlagsResult,
17504        fidl::encoding::DefaultFuchsiaResourceDialect,
17505    >;
17506    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
17507        fn _decode(
17508            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17509        ) -> Result<NodeSetFlagsResult, fidl::Error> {
17510            let _response = fidl::client::decode_transaction_body::<
17511                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
17512                fidl::encoding::DefaultFuchsiaResourceDialect,
17513                0x55a8028685791ea8,
17514            >(_buf?)?
17515            .into_result::<SymlinkMarker>("set_flags")?;
17516            Ok(_response.map(|x| x))
17517        }
17518        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
17519            (flags,),
17520            0x55a8028685791ea8,
17521            fidl::encoding::DynamicFlags::FLEXIBLE,
17522            _decode,
17523        )
17524    }
17525
17526    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
17527        (i32, Option<Box<FilesystemInfo>>),
17528        fidl::encoding::DefaultFuchsiaResourceDialect,
17529    >;
17530    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
17531        fn _decode(
17532            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17533        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
17534            let _response = fidl::client::decode_transaction_body::<
17535                NodeQueryFilesystemResponse,
17536                fidl::encoding::DefaultFuchsiaResourceDialect,
17537                0x6f344a1c6b0a0610,
17538            >(_buf?)?;
17539            Ok((_response.s, _response.info))
17540        }
17541        self.client.send_query_and_decode::<
17542            fidl::encoding::EmptyPayload,
17543            (i32, Option<Box<FilesystemInfo>>),
17544        >(
17545            (),
17546            0x6f344a1c6b0a0610,
17547            fidl::encoding::DynamicFlags::empty(),
17548            _decode,
17549        )
17550    }
17551
17552    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
17553        NodeGetAttributesResult,
17554        fidl::encoding::DefaultFuchsiaResourceDialect,
17555    >;
17556    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
17557        fn _decode(
17558            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17559        ) -> Result<NodeGetAttributesResult, fidl::Error> {
17560            let _response = fidl::client::decode_transaction_body::<
17561                fidl::encoding::ResultType<NodeAttributes2, i32>,
17562                fidl::encoding::DefaultFuchsiaResourceDialect,
17563                0x3d4396a638ea053b,
17564            >(_buf?)?;
17565            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
17566        }
17567        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
17568            (query,),
17569            0x3d4396a638ea053b,
17570            fidl::encoding::DynamicFlags::empty(),
17571            _decode,
17572        )
17573    }
17574
17575    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
17576        NodeUpdateAttributesResult,
17577        fidl::encoding::DefaultFuchsiaResourceDialect,
17578    >;
17579    fn r#update_attributes(
17580        &self,
17581        mut payload: &MutableNodeAttributes,
17582    ) -> Self::UpdateAttributesResponseFut {
17583        fn _decode(
17584            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17585        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
17586            let _response = fidl::client::decode_transaction_body::<
17587                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17588                fidl::encoding::DefaultFuchsiaResourceDialect,
17589                0x3308c1da5a89bf08,
17590            >(_buf?)?;
17591            Ok(_response.map(|x| x))
17592        }
17593        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
17594            payload,
17595            0x3308c1da5a89bf08,
17596            fidl::encoding::DynamicFlags::empty(),
17597            _decode,
17598        )
17599    }
17600
17601    type SyncResponseFut = fidl::client::QueryResponseFut<
17602        NodeSyncResult,
17603        fidl::encoding::DefaultFuchsiaResourceDialect,
17604    >;
17605    fn r#sync(&self) -> Self::SyncResponseFut {
17606        fn _decode(
17607            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17608        ) -> Result<NodeSyncResult, fidl::Error> {
17609            let _response = fidl::client::decode_transaction_body::<
17610                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17611                fidl::encoding::DefaultFuchsiaResourceDialect,
17612                0x2c5c27ca0ab5dc49,
17613            >(_buf?)?;
17614            Ok(_response.map(|x| x))
17615        }
17616        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
17617            (),
17618            0x2c5c27ca0ab5dc49,
17619            fidl::encoding::DynamicFlags::empty(),
17620            _decode,
17621        )
17622    }
17623
17624    fn r#list_extended_attributes(
17625        &self,
17626        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17627    ) -> Result<(), fidl::Error> {
17628        self.client.send::<NodeListExtendedAttributesRequest>(
17629            (iterator,),
17630            0x4b61033de007fcd0,
17631            fidl::encoding::DynamicFlags::empty(),
17632        )
17633    }
17634
17635    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
17636        NodeGetExtendedAttributeResult,
17637        fidl::encoding::DefaultFuchsiaResourceDialect,
17638    >;
17639    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
17640        fn _decode(
17641            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17642        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
17643            let _response = fidl::client::decode_transaction_body::<
17644                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
17645                fidl::encoding::DefaultFuchsiaResourceDialect,
17646                0x45ffa3ccfdeb76db,
17647            >(_buf?)?;
17648            Ok(_response.map(|x| x))
17649        }
17650        self.client.send_query_and_decode::<
17651            NodeGetExtendedAttributeRequest,
17652            NodeGetExtendedAttributeResult,
17653        >(
17654            (name,),
17655            0x45ffa3ccfdeb76db,
17656            fidl::encoding::DynamicFlags::empty(),
17657            _decode,
17658        )
17659    }
17660
17661    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
17662        NodeSetExtendedAttributeResult,
17663        fidl::encoding::DefaultFuchsiaResourceDialect,
17664    >;
17665    fn r#set_extended_attribute(
17666        &self,
17667        mut name: &[u8],
17668        mut value: ExtendedAttributeValue,
17669        mut mode: SetExtendedAttributeMode,
17670    ) -> Self::SetExtendedAttributeResponseFut {
17671        fn _decode(
17672            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17673        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
17674            let _response = fidl::client::decode_transaction_body::<
17675                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17676                fidl::encoding::DefaultFuchsiaResourceDialect,
17677                0x4a951362f681f23c,
17678            >(_buf?)?;
17679            Ok(_response.map(|x| x))
17680        }
17681        self.client.send_query_and_decode::<
17682            NodeSetExtendedAttributeRequest,
17683            NodeSetExtendedAttributeResult,
17684        >(
17685            (name, &mut value, mode,),
17686            0x4a951362f681f23c,
17687            fidl::encoding::DynamicFlags::empty(),
17688            _decode,
17689        )
17690    }
17691
17692    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
17693        NodeRemoveExtendedAttributeResult,
17694        fidl::encoding::DefaultFuchsiaResourceDialect,
17695    >;
17696    fn r#remove_extended_attribute(
17697        &self,
17698        mut name: &[u8],
17699    ) -> Self::RemoveExtendedAttributeResponseFut {
17700        fn _decode(
17701            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17702        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
17703            let _response = fidl::client::decode_transaction_body::<
17704                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17705                fidl::encoding::DefaultFuchsiaResourceDialect,
17706                0x7a0b9f3a9bf9032d,
17707            >(_buf?)?;
17708            Ok(_response.map(|x| x))
17709        }
17710        self.client.send_query_and_decode::<
17711            NodeRemoveExtendedAttributeRequest,
17712            NodeRemoveExtendedAttributeResult,
17713        >(
17714            (name,),
17715            0x7a0b9f3a9bf9032d,
17716            fidl::encoding::DynamicFlags::empty(),
17717            _decode,
17718        )
17719    }
17720
17721    type DescribeResponseFut =
17722        fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
17723    fn r#describe(&self) -> Self::DescribeResponseFut {
17724        fn _decode(
17725            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17726        ) -> Result<SymlinkInfo, fidl::Error> {
17727            let _response = fidl::client::decode_transaction_body::<
17728                fidl::encoding::FlexibleType<SymlinkInfo>,
17729                fidl::encoding::DefaultFuchsiaResourceDialect,
17730                0x742c2ea5e89831f3,
17731            >(_buf?)?
17732            .into_result::<SymlinkMarker>("describe")?;
17733            Ok(_response)
17734        }
17735        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SymlinkInfo>(
17736            (),
17737            0x742c2ea5e89831f3,
17738            fidl::encoding::DynamicFlags::FLEXIBLE,
17739            _decode,
17740        )
17741    }
17742}
17743
17744pub struct SymlinkEventStream {
17745    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
17746}
17747
17748impl std::marker::Unpin for SymlinkEventStream {}
17749
17750impl futures::stream::FusedStream for SymlinkEventStream {
17751    fn is_terminated(&self) -> bool {
17752        self.event_receiver.is_terminated()
17753    }
17754}
17755
17756impl futures::Stream for SymlinkEventStream {
17757    type Item = Result<SymlinkEvent, fidl::Error>;
17758
17759    fn poll_next(
17760        mut self: std::pin::Pin<&mut Self>,
17761        cx: &mut std::task::Context<'_>,
17762    ) -> std::task::Poll<Option<Self::Item>> {
17763        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
17764            &mut self.event_receiver,
17765            cx
17766        )?) {
17767            Some(buf) => std::task::Poll::Ready(Some(SymlinkEvent::decode(buf))),
17768            None => std::task::Poll::Ready(None),
17769        }
17770    }
17771}
17772
17773#[derive(Debug)]
17774pub enum SymlinkEvent {
17775    OnOpen_ {
17776        s: i32,
17777        info: Option<Box<NodeInfoDeprecated>>,
17778    },
17779    OnRepresentation {
17780        payload: Representation,
17781    },
17782    #[non_exhaustive]
17783    _UnknownEvent {
17784        /// Ordinal of the event that was sent.
17785        ordinal: u64,
17786    },
17787}
17788
17789impl SymlinkEvent {
17790    #[allow(irrefutable_let_patterns)]
17791    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
17792        if let SymlinkEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
17793    }
17794    #[allow(irrefutable_let_patterns)]
17795    pub fn into_on_representation(self) -> Option<Representation> {
17796        if let SymlinkEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
17797    }
17798
17799    /// Decodes a message buffer as a [`SymlinkEvent`].
17800    fn decode(
17801        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
17802    ) -> Result<SymlinkEvent, fidl::Error> {
17803        let (bytes, _handles) = buf.split_mut();
17804        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17805        debug_assert_eq!(tx_header.tx_id, 0);
17806        match tx_header.ordinal {
17807            0x7fc7bbb1dbfd1972 => {
17808                let mut out = fidl::new_empty!(
17809                    NodeOnOpenRequest,
17810                    fidl::encoding::DefaultFuchsiaResourceDialect
17811                );
17812                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
17813                Ok((SymlinkEvent::OnOpen_ { s: out.s, info: out.info }))
17814            }
17815            0x5cb40567d80a510c => {
17816                let mut out =
17817                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
17818                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
17819                Ok((SymlinkEvent::OnRepresentation { payload: out }))
17820            }
17821            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
17822                Ok(SymlinkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
17823            }
17824            _ => Err(fidl::Error::UnknownOrdinal {
17825                ordinal: tx_header.ordinal,
17826                protocol_name: <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
17827            }),
17828        }
17829    }
17830}
17831
17832/// A Stream of incoming requests for fuchsia.io/Symlink.
17833pub struct SymlinkRequestStream {
17834    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
17835    is_terminated: bool,
17836}
17837
17838impl std::marker::Unpin for SymlinkRequestStream {}
17839
17840impl futures::stream::FusedStream for SymlinkRequestStream {
17841    fn is_terminated(&self) -> bool {
17842        self.is_terminated
17843    }
17844}
17845
17846impl fidl::endpoints::RequestStream for SymlinkRequestStream {
17847    type Protocol = SymlinkMarker;
17848    type ControlHandle = SymlinkControlHandle;
17849
17850    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
17851        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
17852    }
17853
17854    fn control_handle(&self) -> Self::ControlHandle {
17855        SymlinkControlHandle { inner: self.inner.clone() }
17856    }
17857
17858    fn into_inner(
17859        self,
17860    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
17861    {
17862        (self.inner, self.is_terminated)
17863    }
17864
17865    fn from_inner(
17866        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
17867        is_terminated: bool,
17868    ) -> Self {
17869        Self { inner, is_terminated }
17870    }
17871}
17872
17873impl futures::Stream for SymlinkRequestStream {
17874    type Item = Result<SymlinkRequest, fidl::Error>;
17875
17876    fn poll_next(
17877        mut self: std::pin::Pin<&mut Self>,
17878        cx: &mut std::task::Context<'_>,
17879    ) -> std::task::Poll<Option<Self::Item>> {
17880        let this = &mut *self;
17881        if this.inner.check_shutdown(cx) {
17882            this.is_terminated = true;
17883            return std::task::Poll::Ready(None);
17884        }
17885        if this.is_terminated {
17886            panic!("polled SymlinkRequestStream after completion");
17887        }
17888        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
17889            |bytes, handles| {
17890                match this.inner.channel().read_etc(cx, bytes, handles) {
17891                    std::task::Poll::Ready(Ok(())) => {}
17892                    std::task::Poll::Pending => return std::task::Poll::Pending,
17893                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
17894                        this.is_terminated = true;
17895                        return std::task::Poll::Ready(None);
17896                    }
17897                    std::task::Poll::Ready(Err(e)) => {
17898                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
17899                            e.into(),
17900                        ))));
17901                    }
17902                }
17903
17904                // A message has been received from the channel
17905                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17906
17907                std::task::Poll::Ready(Some(match header.ordinal {
17908                    0x54f3949246a03e74 => {
17909                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17910                        let mut req = fidl::new_empty!(
17911                            LinkableLinkIntoRequest,
17912                            fidl::encoding::DefaultFuchsiaResourceDialect
17913                        );
17914                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
17915                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17916                        Ok(SymlinkRequest::LinkInto {
17917                            dst_parent_token: req.dst_parent_token,
17918                            dst: req.dst,
17919
17920                            responder: SymlinkLinkIntoResponder {
17921                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17922                                tx_id: header.tx_id,
17923                            },
17924                        })
17925                    }
17926                    0x20d8a7aba2168a79 => {
17927                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
17928                        let mut req = fidl::new_empty!(
17929                            fidl_fuchsia_unknown::CloneableCloneRequest,
17930                            fidl::encoding::DefaultFuchsiaResourceDialect
17931                        );
17932                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
17933                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17934                        Ok(SymlinkRequest::Clone { request: req.request, control_handle })
17935                    }
17936                    0x5ac5d459ad7f657e => {
17937                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17938                        let mut req = fidl::new_empty!(
17939                            fidl::encoding::EmptyPayload,
17940                            fidl::encoding::DefaultFuchsiaResourceDialect
17941                        );
17942                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
17943                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17944                        Ok(SymlinkRequest::Close {
17945                            responder: SymlinkCloseResponder {
17946                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17947                                tx_id: header.tx_id,
17948                            },
17949                        })
17950                    }
17951                    0x2658edee9decfc06 => {
17952                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17953                        let mut req = fidl::new_empty!(
17954                            fidl::encoding::EmptyPayload,
17955                            fidl::encoding::DefaultFuchsiaResourceDialect
17956                        );
17957                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
17958                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17959                        Ok(SymlinkRequest::Query {
17960                            responder: SymlinkQueryResponder {
17961                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17962                                tx_id: header.tx_id,
17963                            },
17964                        })
17965                    }
17966                    0x5a61678f293ce16f => {
17967                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
17968                        let mut req = fidl::new_empty!(
17969                            NodeDeprecatedCloneRequest,
17970                            fidl::encoding::DefaultFuchsiaResourceDialect
17971                        );
17972                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
17973                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17974                        Ok(SymlinkRequest::DeprecatedClone {
17975                            flags: req.flags,
17976                            object: req.object,
17977
17978                            control_handle,
17979                        })
17980                    }
17981                    0x78985e216314dafd => {
17982                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17983                        let mut req = fidl::new_empty!(
17984                            fidl::encoding::EmptyPayload,
17985                            fidl::encoding::DefaultFuchsiaResourceDialect
17986                        );
17987                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
17988                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17989                        Ok(SymlinkRequest::DeprecatedGetAttr {
17990                            responder: SymlinkDeprecatedGetAttrResponder {
17991                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17992                                tx_id: header.tx_id,
17993                            },
17994                        })
17995                    }
17996                    0x4186c0f40d938f46 => {
17997                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17998                        let mut req = fidl::new_empty!(
17999                            NodeDeprecatedSetAttrRequest,
18000                            fidl::encoding::DefaultFuchsiaResourceDialect
18001                        );
18002                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
18003                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18004                        Ok(SymlinkRequest::DeprecatedSetAttr {
18005                            flags: req.flags,
18006                            attributes: req.attributes,
18007
18008                            responder: SymlinkDeprecatedSetAttrResponder {
18009                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18010                                tx_id: header.tx_id,
18011                            },
18012                        })
18013                    }
18014                    0x5b88fffb8eda3aa1 => {
18015                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18016                        let mut req = fidl::new_empty!(
18017                            fidl::encoding::EmptyPayload,
18018                            fidl::encoding::DefaultFuchsiaResourceDialect
18019                        );
18020                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18021                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18022                        Ok(SymlinkRequest::DeprecatedGetFlags {
18023                            responder: SymlinkDeprecatedGetFlagsResponder {
18024                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18025                                tx_id: header.tx_id,
18026                            },
18027                        })
18028                    }
18029                    0x5295b76c71fde733 => {
18030                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18031                        let mut req = fidl::new_empty!(
18032                            NodeDeprecatedSetFlagsRequest,
18033                            fidl::encoding::DefaultFuchsiaResourceDialect
18034                        );
18035                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
18036                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18037                        Ok(SymlinkRequest::DeprecatedSetFlags {
18038                            flags: req.flags,
18039
18040                            responder: SymlinkDeprecatedSetFlagsResponder {
18041                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18042                                tx_id: header.tx_id,
18043                            },
18044                        })
18045                    }
18046                    0x176eb318f64ec23 => {
18047                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18048                        let mut req = fidl::new_empty!(
18049                            fidl::encoding::EmptyPayload,
18050                            fidl::encoding::DefaultFuchsiaResourceDialect
18051                        );
18052                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18053                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18054                        Ok(SymlinkRequest::GetFlags {
18055                            responder: SymlinkGetFlagsResponder {
18056                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18057                                tx_id: header.tx_id,
18058                            },
18059                        })
18060                    }
18061                    0x55a8028685791ea8 => {
18062                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18063                        let mut req = fidl::new_empty!(
18064                            NodeSetFlagsRequest,
18065                            fidl::encoding::DefaultFuchsiaResourceDialect
18066                        );
18067                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
18068                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18069                        Ok(SymlinkRequest::SetFlags {
18070                            flags: req.flags,
18071
18072                            responder: SymlinkSetFlagsResponder {
18073                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18074                                tx_id: header.tx_id,
18075                            },
18076                        })
18077                    }
18078                    0x6f344a1c6b0a0610 => {
18079                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18080                        let mut req = fidl::new_empty!(
18081                            fidl::encoding::EmptyPayload,
18082                            fidl::encoding::DefaultFuchsiaResourceDialect
18083                        );
18084                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18085                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18086                        Ok(SymlinkRequest::QueryFilesystem {
18087                            responder: SymlinkQueryFilesystemResponder {
18088                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18089                                tx_id: header.tx_id,
18090                            },
18091                        })
18092                    }
18093                    0x3d4396a638ea053b => {
18094                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18095                        let mut req = fidl::new_empty!(
18096                            NodeGetAttributesRequest,
18097                            fidl::encoding::DefaultFuchsiaResourceDialect
18098                        );
18099                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
18100                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18101                        Ok(SymlinkRequest::GetAttributes {
18102                            query: req.query,
18103
18104                            responder: SymlinkGetAttributesResponder {
18105                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18106                                tx_id: header.tx_id,
18107                            },
18108                        })
18109                    }
18110                    0x3308c1da5a89bf08 => {
18111                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18112                        let mut req = fidl::new_empty!(
18113                            MutableNodeAttributes,
18114                            fidl::encoding::DefaultFuchsiaResourceDialect
18115                        );
18116                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
18117                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18118                        Ok(SymlinkRequest::UpdateAttributes {
18119                            payload: req,
18120                            responder: SymlinkUpdateAttributesResponder {
18121                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18122                                tx_id: header.tx_id,
18123                            },
18124                        })
18125                    }
18126                    0x2c5c27ca0ab5dc49 => {
18127                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18128                        let mut req = fidl::new_empty!(
18129                            fidl::encoding::EmptyPayload,
18130                            fidl::encoding::DefaultFuchsiaResourceDialect
18131                        );
18132                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18133                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18134                        Ok(SymlinkRequest::Sync {
18135                            responder: SymlinkSyncResponder {
18136                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18137                                tx_id: header.tx_id,
18138                            },
18139                        })
18140                    }
18141                    0x4b61033de007fcd0 => {
18142                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18143                        let mut req = fidl::new_empty!(
18144                            NodeListExtendedAttributesRequest,
18145                            fidl::encoding::DefaultFuchsiaResourceDialect
18146                        );
18147                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
18148                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18149                        Ok(SymlinkRequest::ListExtendedAttributes {
18150                            iterator: req.iterator,
18151
18152                            control_handle,
18153                        })
18154                    }
18155                    0x45ffa3ccfdeb76db => {
18156                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18157                        let mut req = fidl::new_empty!(
18158                            NodeGetExtendedAttributeRequest,
18159                            fidl::encoding::DefaultFuchsiaResourceDialect
18160                        );
18161                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18162                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18163                        Ok(SymlinkRequest::GetExtendedAttribute {
18164                            name: req.name,
18165
18166                            responder: SymlinkGetExtendedAttributeResponder {
18167                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18168                                tx_id: header.tx_id,
18169                            },
18170                        })
18171                    }
18172                    0x4a951362f681f23c => {
18173                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18174                        let mut req = fidl::new_empty!(
18175                            NodeSetExtendedAttributeRequest,
18176                            fidl::encoding::DefaultFuchsiaResourceDialect
18177                        );
18178                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18179                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18180                        Ok(SymlinkRequest::SetExtendedAttribute {
18181                            name: req.name,
18182                            value: req.value,
18183                            mode: req.mode,
18184
18185                            responder: SymlinkSetExtendedAttributeResponder {
18186                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18187                                tx_id: header.tx_id,
18188                            },
18189                        })
18190                    }
18191                    0x7a0b9f3a9bf9032d => {
18192                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18193                        let mut req = fidl::new_empty!(
18194                            NodeRemoveExtendedAttributeRequest,
18195                            fidl::encoding::DefaultFuchsiaResourceDialect
18196                        );
18197                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18198                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18199                        Ok(SymlinkRequest::RemoveExtendedAttribute {
18200                            name: req.name,
18201
18202                            responder: SymlinkRemoveExtendedAttributeResponder {
18203                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18204                                tx_id: header.tx_id,
18205                            },
18206                        })
18207                    }
18208                    0x742c2ea5e89831f3 => {
18209                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18210                        let mut req = fidl::new_empty!(
18211                            fidl::encoding::EmptyPayload,
18212                            fidl::encoding::DefaultFuchsiaResourceDialect
18213                        );
18214                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18215                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18216                        Ok(SymlinkRequest::Describe {
18217                            responder: SymlinkDescribeResponder {
18218                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18219                                tx_id: header.tx_id,
18220                            },
18221                        })
18222                    }
18223                    _ if header.tx_id == 0
18224                        && header
18225                            .dynamic_flags()
18226                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
18227                    {
18228                        Ok(SymlinkRequest::_UnknownMethod {
18229                            ordinal: header.ordinal,
18230                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
18231                            method_type: fidl::MethodType::OneWay,
18232                        })
18233                    }
18234                    _ if header
18235                        .dynamic_flags()
18236                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
18237                    {
18238                        this.inner.send_framework_err(
18239                            fidl::encoding::FrameworkErr::UnknownMethod,
18240                            header.tx_id,
18241                            header.ordinal,
18242                            header.dynamic_flags(),
18243                            (bytes, handles),
18244                        )?;
18245                        Ok(SymlinkRequest::_UnknownMethod {
18246                            ordinal: header.ordinal,
18247                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
18248                            method_type: fidl::MethodType::TwoWay,
18249                        })
18250                    }
18251                    _ => Err(fidl::Error::UnknownOrdinal {
18252                        ordinal: header.ordinal,
18253                        protocol_name:
18254                            <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
18255                    }),
18256                }))
18257            },
18258        )
18259    }
18260}
18261
18262/// A ['Node'] which contains a symbolic link.
18263#[derive(Debug)]
18264pub enum SymlinkRequest {
18265    /// Creates a link to this this object with name `dst` in the directory represented by
18266    /// `dst_parent_token`.
18267    ///
18268    /// `dst` must be a resolved object name. Including "/" in the string will return
18269    /// `ZX_ERR_INVALID_ARGS`.
18270    ///
18271    /// This method requires the maximal set of rights supported by the filesystem for this object.
18272    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
18273    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
18274    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
18275    /// `ZX_ERR_ACCESS_DENIED`.
18276    ///
18277    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
18278    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
18279    ///
18280    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
18281    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
18282    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
18283    ///
18284    /// This method does not have the same atomicity properties has the `Directory::Link` method,
18285    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
18286    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
18287    LinkInto {
18288        dst_parent_token: fidl::Event,
18289        dst: String,
18290        responder: SymlinkLinkIntoResponder,
18291    },
18292    Clone {
18293        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
18294        control_handle: SymlinkControlHandle,
18295    },
18296    /// Terminates the connection.
18297    ///
18298    /// After calling `Close`, the client must not send any other requests.
18299    ///
18300    /// Servers, after sending the status response, should close the connection
18301    /// regardless of status and without sending an epitaph.
18302    ///
18303    /// Closing the client end of the channel should be semantically equivalent
18304    /// to calling `Close` without knowing when the close has completed or its
18305    /// status.
18306    Close {
18307        responder: SymlinkCloseResponder,
18308    },
18309    Query {
18310        responder: SymlinkQueryResponder,
18311    },
18312    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
18313    DeprecatedClone {
18314        flags: OpenFlags,
18315        object: fidl::endpoints::ServerEnd<NodeMarker>,
18316        control_handle: SymlinkControlHandle,
18317    },
18318    /// DEPRECATED - Use `Node.GetAttributes` instead.
18319    DeprecatedGetAttr {
18320        responder: SymlinkDeprecatedGetAttrResponder,
18321    },
18322    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
18323    DeprecatedSetAttr {
18324        flags: NodeAttributeFlags,
18325        attributes: NodeAttributes,
18326        responder: SymlinkDeprecatedSetAttrResponder,
18327    },
18328    /// [DEPRECATED - Use new GetFlags method instead.]
18329    DeprecatedGetFlags {
18330        responder: SymlinkDeprecatedGetFlagsResponder,
18331    },
18332    /// [DEPRECATED - Use new SetFlags method instead.]
18333    DeprecatedSetFlags {
18334        flags: OpenFlags,
18335        responder: SymlinkDeprecatedSetFlagsResponder,
18336    },
18337    /// Queries the flags that apply to this node after it has been opened/created. This method does
18338    /// not require any rights.
18339    ///
18340    /// Note that the final set of flags that apply to the connection may differ from those
18341    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
18342    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
18343    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
18344    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
18345    GetFlags {
18346        responder: SymlinkGetFlagsResponder,
18347    },
18348    /// Sets the flags that apply to this node after it has been opened. This method does not
18349    /// require any rights.
18350    ///
18351    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
18352    /// clear append mode.
18353    ///
18354    /// Errors:
18355    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
18356    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
18357    SetFlags {
18358        flags: Flags,
18359        responder: SymlinkSetFlagsResponder,
18360    },
18361    /// Query the filesystem for filesystem-specific information.
18362    QueryFilesystem {
18363        responder: SymlinkQueryFilesystemResponder,
18364    },
18365    /// Acquires information about the node.
18366    ///
18367    /// The attributes of a node should be stable, independent of the
18368    /// specific protocol used to access it.
18369    ///
18370    /// If a particular attribute is not applicable or not supported,
18371    /// filesystems should leave the corresponding field absent.
18372    ///
18373    /// + `query` a bit-mask specifying which attributes to fetch. The server
18374    ///   should not return more than necessary.
18375    /// - `attributes` the returned attributes.
18376    ///
18377    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18378    GetAttributes {
18379        query: NodeAttributesQuery,
18380        responder: SymlinkGetAttributesResponder,
18381    },
18382    /// Updates information about the node.
18383    ///
18384    /// + `attributes` the presence of a table field in `attributes` indicates
18385    /// the intent to update the corresponding attribute.
18386    ///
18387    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
18388    ///
18389    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
18390    UpdateAttributes {
18391        payload: MutableNodeAttributes,
18392        responder: SymlinkUpdateAttributesResponder,
18393    },
18394    /// Synchronizes updates to the node to the underlying media, if it exists.
18395    ///
18396    /// This method will return when the filesystem server has flushed the
18397    /// relevant updates to the underlying media, but does not guarantee the
18398    /// underlying media has persisted the information, nor that any information
18399    /// is committed to hardware. Clients may use `Sync` to ensure ordering
18400    /// between operations.
18401    ///
18402    /// This method does not require any rights.
18403    Sync {
18404        responder: SymlinkSyncResponder,
18405    },
18406    /// Creates an iterator over all the extended attribute names associated
18407    /// with this node. If an error occurs it is returned as an epitaph on the
18408    /// iterator request channel, and then the channel is closed.
18409    ///
18410    /// GetExtendedAttributes can be used with any of these names to retrieve
18411    /// the associated value.
18412    ///
18413    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18414    ListExtendedAttributes {
18415        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
18416        control_handle: SymlinkControlHandle,
18417    },
18418    /// Get the value associated with the given attribute `name` for this node.
18419    ///
18420    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
18421    /// particular structure is imposed on them.
18422    ///
18423    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18424    GetExtendedAttribute {
18425        name: Vec<u8>,
18426        responder: SymlinkGetExtendedAttributeResponder,
18427    },
18428    /// Set the value for the given attribute `name` to `value` for this node.
18429    ///
18430    /// The attribute name may exist, in which case the attribute is updated.
18431    /// If the attribute doesn't exist, it is created. The name should have no
18432    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
18433    ///
18434    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
18435    SetExtendedAttribute {
18436        name: Vec<u8>,
18437        value: ExtendedAttributeValue,
18438        mode: SetExtendedAttributeMode,
18439        responder: SymlinkSetExtendedAttributeResponder,
18440    },
18441    /// Remove the specified extended attribute.
18442    ///
18443    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
18444    ///
18445    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
18446    RemoveExtendedAttribute {
18447        name: Vec<u8>,
18448        responder: SymlinkRemoveExtendedAttributeResponder,
18449    },
18450    Describe {
18451        responder: SymlinkDescribeResponder,
18452    },
18453    /// An interaction was received which does not match any known method.
18454    #[non_exhaustive]
18455    _UnknownMethod {
18456        /// Ordinal of the method that was called.
18457        ordinal: u64,
18458        control_handle: SymlinkControlHandle,
18459        method_type: fidl::MethodType,
18460    },
18461}
18462
18463impl SymlinkRequest {
18464    #[allow(irrefutable_let_patterns)]
18465    pub fn into_link_into(self) -> Option<(fidl::Event, String, SymlinkLinkIntoResponder)> {
18466        if let SymlinkRequest::LinkInto { dst_parent_token, dst, responder } = self {
18467            Some((dst_parent_token, dst, responder))
18468        } else {
18469            None
18470        }
18471    }
18472
18473    #[allow(irrefutable_let_patterns)]
18474    pub fn into_clone(
18475        self,
18476    ) -> Option<(
18477        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
18478        SymlinkControlHandle,
18479    )> {
18480        if let SymlinkRequest::Clone { request, control_handle } = self {
18481            Some((request, control_handle))
18482        } else {
18483            None
18484        }
18485    }
18486
18487    #[allow(irrefutable_let_patterns)]
18488    pub fn into_close(self) -> Option<(SymlinkCloseResponder)> {
18489        if let SymlinkRequest::Close { responder } = self { Some((responder)) } else { None }
18490    }
18491
18492    #[allow(irrefutable_let_patterns)]
18493    pub fn into_query(self) -> Option<(SymlinkQueryResponder)> {
18494        if let SymlinkRequest::Query { responder } = self { Some((responder)) } else { None }
18495    }
18496
18497    #[allow(irrefutable_let_patterns)]
18498    pub fn into_deprecated_clone(
18499        self,
18500    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, SymlinkControlHandle)> {
18501        if let SymlinkRequest::DeprecatedClone { flags, object, control_handle } = self {
18502            Some((flags, object, control_handle))
18503        } else {
18504            None
18505        }
18506    }
18507
18508    #[allow(irrefutable_let_patterns)]
18509    pub fn into_deprecated_get_attr(self) -> Option<(SymlinkDeprecatedGetAttrResponder)> {
18510        if let SymlinkRequest::DeprecatedGetAttr { responder } = self {
18511            Some((responder))
18512        } else {
18513            None
18514        }
18515    }
18516
18517    #[allow(irrefutable_let_patterns)]
18518    pub fn into_deprecated_set_attr(
18519        self,
18520    ) -> Option<(NodeAttributeFlags, NodeAttributes, SymlinkDeprecatedSetAttrResponder)> {
18521        if let SymlinkRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
18522            Some((flags, attributes, responder))
18523        } else {
18524            None
18525        }
18526    }
18527
18528    #[allow(irrefutable_let_patterns)]
18529    pub fn into_deprecated_get_flags(self) -> Option<(SymlinkDeprecatedGetFlagsResponder)> {
18530        if let SymlinkRequest::DeprecatedGetFlags { responder } = self {
18531            Some((responder))
18532        } else {
18533            None
18534        }
18535    }
18536
18537    #[allow(irrefutable_let_patterns)]
18538    pub fn into_deprecated_set_flags(
18539        self,
18540    ) -> Option<(OpenFlags, SymlinkDeprecatedSetFlagsResponder)> {
18541        if let SymlinkRequest::DeprecatedSetFlags { flags, responder } = self {
18542            Some((flags, responder))
18543        } else {
18544            None
18545        }
18546    }
18547
18548    #[allow(irrefutable_let_patterns)]
18549    pub fn into_get_flags(self) -> Option<(SymlinkGetFlagsResponder)> {
18550        if let SymlinkRequest::GetFlags { responder } = self { Some((responder)) } else { None }
18551    }
18552
18553    #[allow(irrefutable_let_patterns)]
18554    pub fn into_set_flags(self) -> Option<(Flags, SymlinkSetFlagsResponder)> {
18555        if let SymlinkRequest::SetFlags { flags, responder } = self {
18556            Some((flags, responder))
18557        } else {
18558            None
18559        }
18560    }
18561
18562    #[allow(irrefutable_let_patterns)]
18563    pub fn into_query_filesystem(self) -> Option<(SymlinkQueryFilesystemResponder)> {
18564        if let SymlinkRequest::QueryFilesystem { responder } = self {
18565            Some((responder))
18566        } else {
18567            None
18568        }
18569    }
18570
18571    #[allow(irrefutable_let_patterns)]
18572    pub fn into_get_attributes(
18573        self,
18574    ) -> Option<(NodeAttributesQuery, SymlinkGetAttributesResponder)> {
18575        if let SymlinkRequest::GetAttributes { query, responder } = self {
18576            Some((query, responder))
18577        } else {
18578            None
18579        }
18580    }
18581
18582    #[allow(irrefutable_let_patterns)]
18583    pub fn into_update_attributes(
18584        self,
18585    ) -> Option<(MutableNodeAttributes, SymlinkUpdateAttributesResponder)> {
18586        if let SymlinkRequest::UpdateAttributes { payload, responder } = self {
18587            Some((payload, responder))
18588        } else {
18589            None
18590        }
18591    }
18592
18593    #[allow(irrefutable_let_patterns)]
18594    pub fn into_sync(self) -> Option<(SymlinkSyncResponder)> {
18595        if let SymlinkRequest::Sync { responder } = self { Some((responder)) } else { None }
18596    }
18597
18598    #[allow(irrefutable_let_patterns)]
18599    pub fn into_list_extended_attributes(
18600        self,
18601    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, SymlinkControlHandle)>
18602    {
18603        if let SymlinkRequest::ListExtendedAttributes { iterator, control_handle } = self {
18604            Some((iterator, control_handle))
18605        } else {
18606            None
18607        }
18608    }
18609
18610    #[allow(irrefutable_let_patterns)]
18611    pub fn into_get_extended_attribute(
18612        self,
18613    ) -> Option<(Vec<u8>, SymlinkGetExtendedAttributeResponder)> {
18614        if let SymlinkRequest::GetExtendedAttribute { name, responder } = self {
18615            Some((name, responder))
18616        } else {
18617            None
18618        }
18619    }
18620
18621    #[allow(irrefutable_let_patterns)]
18622    pub fn into_set_extended_attribute(
18623        self,
18624    ) -> Option<(
18625        Vec<u8>,
18626        ExtendedAttributeValue,
18627        SetExtendedAttributeMode,
18628        SymlinkSetExtendedAttributeResponder,
18629    )> {
18630        if let SymlinkRequest::SetExtendedAttribute { name, value, mode, responder } = self {
18631            Some((name, value, mode, responder))
18632        } else {
18633            None
18634        }
18635    }
18636
18637    #[allow(irrefutable_let_patterns)]
18638    pub fn into_remove_extended_attribute(
18639        self,
18640    ) -> Option<(Vec<u8>, SymlinkRemoveExtendedAttributeResponder)> {
18641        if let SymlinkRequest::RemoveExtendedAttribute { name, responder } = self {
18642            Some((name, responder))
18643        } else {
18644            None
18645        }
18646    }
18647
18648    #[allow(irrefutable_let_patterns)]
18649    pub fn into_describe(self) -> Option<(SymlinkDescribeResponder)> {
18650        if let SymlinkRequest::Describe { responder } = self { Some((responder)) } else { None }
18651    }
18652
18653    /// Name of the method defined in FIDL
18654    pub fn method_name(&self) -> &'static str {
18655        match *self {
18656            SymlinkRequest::LinkInto { .. } => "link_into",
18657            SymlinkRequest::Clone { .. } => "clone",
18658            SymlinkRequest::Close { .. } => "close",
18659            SymlinkRequest::Query { .. } => "query",
18660            SymlinkRequest::DeprecatedClone { .. } => "deprecated_clone",
18661            SymlinkRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
18662            SymlinkRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
18663            SymlinkRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
18664            SymlinkRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
18665            SymlinkRequest::GetFlags { .. } => "get_flags",
18666            SymlinkRequest::SetFlags { .. } => "set_flags",
18667            SymlinkRequest::QueryFilesystem { .. } => "query_filesystem",
18668            SymlinkRequest::GetAttributes { .. } => "get_attributes",
18669            SymlinkRequest::UpdateAttributes { .. } => "update_attributes",
18670            SymlinkRequest::Sync { .. } => "sync",
18671            SymlinkRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
18672            SymlinkRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
18673            SymlinkRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
18674            SymlinkRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
18675            SymlinkRequest::Describe { .. } => "describe",
18676            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
18677                "unknown one-way method"
18678            }
18679            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
18680                "unknown two-way method"
18681            }
18682        }
18683    }
18684}
18685
18686#[derive(Debug, Clone)]
18687pub struct SymlinkControlHandle {
18688    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
18689}
18690
18691impl fidl::endpoints::ControlHandle for SymlinkControlHandle {
18692    fn shutdown(&self) {
18693        self.inner.shutdown()
18694    }
18695    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
18696        self.inner.shutdown_with_epitaph(status)
18697    }
18698
18699    fn is_closed(&self) -> bool {
18700        self.inner.channel().is_closed()
18701    }
18702    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
18703        self.inner.channel().on_closed()
18704    }
18705
18706    #[cfg(target_os = "fuchsia")]
18707    fn signal_peer(
18708        &self,
18709        clear_mask: zx::Signals,
18710        set_mask: zx::Signals,
18711    ) -> Result<(), zx_status::Status> {
18712        use fidl::Peered;
18713        self.inner.channel().signal_peer(clear_mask, set_mask)
18714    }
18715}
18716
18717impl SymlinkControlHandle {
18718    pub fn send_on_open_(
18719        &self,
18720        mut s: i32,
18721        mut info: Option<NodeInfoDeprecated>,
18722    ) -> Result<(), fidl::Error> {
18723        self.inner.send::<NodeOnOpenRequest>(
18724            (s, info.as_mut()),
18725            0,
18726            0x7fc7bbb1dbfd1972,
18727            fidl::encoding::DynamicFlags::FLEXIBLE,
18728        )
18729    }
18730
18731    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
18732        self.inner.send::<Representation>(
18733            &mut payload,
18734            0,
18735            0x5cb40567d80a510c,
18736            fidl::encoding::DynamicFlags::empty(),
18737        )
18738    }
18739}
18740
18741#[must_use = "FIDL methods require a response to be sent"]
18742#[derive(Debug)]
18743pub struct SymlinkLinkIntoResponder {
18744    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18745    tx_id: u32,
18746}
18747
18748/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18749/// if the responder is dropped without sending a response, so that the client
18750/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18751impl std::ops::Drop for SymlinkLinkIntoResponder {
18752    fn drop(&mut self) {
18753        self.control_handle.shutdown();
18754        // Safety: drops once, never accessed again
18755        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18756    }
18757}
18758
18759impl fidl::endpoints::Responder for SymlinkLinkIntoResponder {
18760    type ControlHandle = SymlinkControlHandle;
18761
18762    fn control_handle(&self) -> &SymlinkControlHandle {
18763        &self.control_handle
18764    }
18765
18766    fn drop_without_shutdown(mut self) {
18767        // Safety: drops once, never accessed again due to mem::forget
18768        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18769        // Prevent Drop from running (which would shut down the channel)
18770        std::mem::forget(self);
18771    }
18772}
18773
18774impl SymlinkLinkIntoResponder {
18775    /// Sends a response to the FIDL transaction.
18776    ///
18777    /// Sets the channel to shutdown if an error occurs.
18778    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18779        let _result = self.send_raw(result);
18780        if _result.is_err() {
18781            self.control_handle.shutdown();
18782        }
18783        self.drop_without_shutdown();
18784        _result
18785    }
18786
18787    /// Similar to "send" but does not shutdown the channel if an error occurs.
18788    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18789        let _result = self.send_raw(result);
18790        self.drop_without_shutdown();
18791        _result
18792    }
18793
18794    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18795        self.control_handle
18796            .inner
18797            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
18798                result,
18799                self.tx_id,
18800                0x54f3949246a03e74,
18801                fidl::encoding::DynamicFlags::empty(),
18802            )
18803    }
18804}
18805
18806#[must_use = "FIDL methods require a response to be sent"]
18807#[derive(Debug)]
18808pub struct SymlinkCloseResponder {
18809    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18810    tx_id: u32,
18811}
18812
18813/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18814/// if the responder is dropped without sending a response, so that the client
18815/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18816impl std::ops::Drop for SymlinkCloseResponder {
18817    fn drop(&mut self) {
18818        self.control_handle.shutdown();
18819        // Safety: drops once, never accessed again
18820        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18821    }
18822}
18823
18824impl fidl::endpoints::Responder for SymlinkCloseResponder {
18825    type ControlHandle = SymlinkControlHandle;
18826
18827    fn control_handle(&self) -> &SymlinkControlHandle {
18828        &self.control_handle
18829    }
18830
18831    fn drop_without_shutdown(mut self) {
18832        // Safety: drops once, never accessed again due to mem::forget
18833        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18834        // Prevent Drop from running (which would shut down the channel)
18835        std::mem::forget(self);
18836    }
18837}
18838
18839impl SymlinkCloseResponder {
18840    /// Sends a response to the FIDL transaction.
18841    ///
18842    /// Sets the channel to shutdown if an error occurs.
18843    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18844        let _result = self.send_raw(result);
18845        if _result.is_err() {
18846            self.control_handle.shutdown();
18847        }
18848        self.drop_without_shutdown();
18849        _result
18850    }
18851
18852    /// Similar to "send" but does not shutdown the channel if an error occurs.
18853    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18854        let _result = self.send_raw(result);
18855        self.drop_without_shutdown();
18856        _result
18857    }
18858
18859    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18860        self.control_handle
18861            .inner
18862            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
18863                result,
18864                self.tx_id,
18865                0x5ac5d459ad7f657e,
18866                fidl::encoding::DynamicFlags::empty(),
18867            )
18868    }
18869}
18870
18871#[must_use = "FIDL methods require a response to be sent"]
18872#[derive(Debug)]
18873pub struct SymlinkQueryResponder {
18874    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18875    tx_id: u32,
18876}
18877
18878/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18879/// if the responder is dropped without sending a response, so that the client
18880/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18881impl std::ops::Drop for SymlinkQueryResponder {
18882    fn drop(&mut self) {
18883        self.control_handle.shutdown();
18884        // Safety: drops once, never accessed again
18885        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18886    }
18887}
18888
18889impl fidl::endpoints::Responder for SymlinkQueryResponder {
18890    type ControlHandle = SymlinkControlHandle;
18891
18892    fn control_handle(&self) -> &SymlinkControlHandle {
18893        &self.control_handle
18894    }
18895
18896    fn drop_without_shutdown(mut self) {
18897        // Safety: drops once, never accessed again due to mem::forget
18898        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18899        // Prevent Drop from running (which would shut down the channel)
18900        std::mem::forget(self);
18901    }
18902}
18903
18904impl SymlinkQueryResponder {
18905    /// Sends a response to the FIDL transaction.
18906    ///
18907    /// Sets the channel to shutdown if an error occurs.
18908    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
18909        let _result = self.send_raw(protocol);
18910        if _result.is_err() {
18911            self.control_handle.shutdown();
18912        }
18913        self.drop_without_shutdown();
18914        _result
18915    }
18916
18917    /// Similar to "send" but does not shutdown the channel if an error occurs.
18918    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
18919        let _result = self.send_raw(protocol);
18920        self.drop_without_shutdown();
18921        _result
18922    }
18923
18924    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
18925        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
18926            (protocol,),
18927            self.tx_id,
18928            0x2658edee9decfc06,
18929            fidl::encoding::DynamicFlags::empty(),
18930        )
18931    }
18932}
18933
18934#[must_use = "FIDL methods require a response to be sent"]
18935#[derive(Debug)]
18936pub struct SymlinkDeprecatedGetAttrResponder {
18937    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18938    tx_id: u32,
18939}
18940
18941/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18942/// if the responder is dropped without sending a response, so that the client
18943/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18944impl std::ops::Drop for SymlinkDeprecatedGetAttrResponder {
18945    fn drop(&mut self) {
18946        self.control_handle.shutdown();
18947        // Safety: drops once, never accessed again
18948        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18949    }
18950}
18951
18952impl fidl::endpoints::Responder for SymlinkDeprecatedGetAttrResponder {
18953    type ControlHandle = SymlinkControlHandle;
18954
18955    fn control_handle(&self) -> &SymlinkControlHandle {
18956        &self.control_handle
18957    }
18958
18959    fn drop_without_shutdown(mut self) {
18960        // Safety: drops once, never accessed again due to mem::forget
18961        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18962        // Prevent Drop from running (which would shut down the channel)
18963        std::mem::forget(self);
18964    }
18965}
18966
18967impl SymlinkDeprecatedGetAttrResponder {
18968    /// Sends a response to the FIDL transaction.
18969    ///
18970    /// Sets the channel to shutdown if an error occurs.
18971    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
18972        let _result = self.send_raw(s, attributes);
18973        if _result.is_err() {
18974            self.control_handle.shutdown();
18975        }
18976        self.drop_without_shutdown();
18977        _result
18978    }
18979
18980    /// Similar to "send" but does not shutdown the channel if an error occurs.
18981    pub fn send_no_shutdown_on_err(
18982        self,
18983        mut s: i32,
18984        mut attributes: &NodeAttributes,
18985    ) -> Result<(), fidl::Error> {
18986        let _result = self.send_raw(s, attributes);
18987        self.drop_without_shutdown();
18988        _result
18989    }
18990
18991    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
18992        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
18993            (s, attributes),
18994            self.tx_id,
18995            0x78985e216314dafd,
18996            fidl::encoding::DynamicFlags::empty(),
18997        )
18998    }
18999}
19000
19001#[must_use = "FIDL methods require a response to be sent"]
19002#[derive(Debug)]
19003pub struct SymlinkDeprecatedSetAttrResponder {
19004    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19005    tx_id: u32,
19006}
19007
19008/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19009/// if the responder is dropped without sending a response, so that the client
19010/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19011impl std::ops::Drop for SymlinkDeprecatedSetAttrResponder {
19012    fn drop(&mut self) {
19013        self.control_handle.shutdown();
19014        // Safety: drops once, never accessed again
19015        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19016    }
19017}
19018
19019impl fidl::endpoints::Responder for SymlinkDeprecatedSetAttrResponder {
19020    type ControlHandle = SymlinkControlHandle;
19021
19022    fn control_handle(&self) -> &SymlinkControlHandle {
19023        &self.control_handle
19024    }
19025
19026    fn drop_without_shutdown(mut self) {
19027        // Safety: drops once, never accessed again due to mem::forget
19028        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19029        // Prevent Drop from running (which would shut down the channel)
19030        std::mem::forget(self);
19031    }
19032}
19033
19034impl SymlinkDeprecatedSetAttrResponder {
19035    /// Sends a response to the FIDL transaction.
19036    ///
19037    /// Sets the channel to shutdown if an error occurs.
19038    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
19039        let _result = self.send_raw(s);
19040        if _result.is_err() {
19041            self.control_handle.shutdown();
19042        }
19043        self.drop_without_shutdown();
19044        _result
19045    }
19046
19047    /// Similar to "send" but does not shutdown the channel if an error occurs.
19048    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
19049        let _result = self.send_raw(s);
19050        self.drop_without_shutdown();
19051        _result
19052    }
19053
19054    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
19055        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
19056            (s,),
19057            self.tx_id,
19058            0x4186c0f40d938f46,
19059            fidl::encoding::DynamicFlags::empty(),
19060        )
19061    }
19062}
19063
19064#[must_use = "FIDL methods require a response to be sent"]
19065#[derive(Debug)]
19066pub struct SymlinkDeprecatedGetFlagsResponder {
19067    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19068    tx_id: u32,
19069}
19070
19071/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19072/// if the responder is dropped without sending a response, so that the client
19073/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19074impl std::ops::Drop for SymlinkDeprecatedGetFlagsResponder {
19075    fn drop(&mut self) {
19076        self.control_handle.shutdown();
19077        // Safety: drops once, never accessed again
19078        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19079    }
19080}
19081
19082impl fidl::endpoints::Responder for SymlinkDeprecatedGetFlagsResponder {
19083    type ControlHandle = SymlinkControlHandle;
19084
19085    fn control_handle(&self) -> &SymlinkControlHandle {
19086        &self.control_handle
19087    }
19088
19089    fn drop_without_shutdown(mut self) {
19090        // Safety: drops once, never accessed again due to mem::forget
19091        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19092        // Prevent Drop from running (which would shut down the channel)
19093        std::mem::forget(self);
19094    }
19095}
19096
19097impl SymlinkDeprecatedGetFlagsResponder {
19098    /// Sends a response to the FIDL transaction.
19099    ///
19100    /// Sets the channel to shutdown if an error occurs.
19101    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
19102        let _result = self.send_raw(s, flags);
19103        if _result.is_err() {
19104            self.control_handle.shutdown();
19105        }
19106        self.drop_without_shutdown();
19107        _result
19108    }
19109
19110    /// Similar to "send" but does not shutdown the channel if an error occurs.
19111    pub fn send_no_shutdown_on_err(
19112        self,
19113        mut s: i32,
19114        mut flags: OpenFlags,
19115    ) -> Result<(), fidl::Error> {
19116        let _result = self.send_raw(s, flags);
19117        self.drop_without_shutdown();
19118        _result
19119    }
19120
19121    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
19122        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
19123            (s, flags),
19124            self.tx_id,
19125            0x5b88fffb8eda3aa1,
19126            fidl::encoding::DynamicFlags::empty(),
19127        )
19128    }
19129}
19130
19131#[must_use = "FIDL methods require a response to be sent"]
19132#[derive(Debug)]
19133pub struct SymlinkDeprecatedSetFlagsResponder {
19134    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19135    tx_id: u32,
19136}
19137
19138/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19139/// if the responder is dropped without sending a response, so that the client
19140/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19141impl std::ops::Drop for SymlinkDeprecatedSetFlagsResponder {
19142    fn drop(&mut self) {
19143        self.control_handle.shutdown();
19144        // Safety: drops once, never accessed again
19145        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19146    }
19147}
19148
19149impl fidl::endpoints::Responder for SymlinkDeprecatedSetFlagsResponder {
19150    type ControlHandle = SymlinkControlHandle;
19151
19152    fn control_handle(&self) -> &SymlinkControlHandle {
19153        &self.control_handle
19154    }
19155
19156    fn drop_without_shutdown(mut self) {
19157        // Safety: drops once, never accessed again due to mem::forget
19158        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19159        // Prevent Drop from running (which would shut down the channel)
19160        std::mem::forget(self);
19161    }
19162}
19163
19164impl SymlinkDeprecatedSetFlagsResponder {
19165    /// Sends a response to the FIDL transaction.
19166    ///
19167    /// Sets the channel to shutdown if an error occurs.
19168    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
19169        let _result = self.send_raw(s);
19170        if _result.is_err() {
19171            self.control_handle.shutdown();
19172        }
19173        self.drop_without_shutdown();
19174        _result
19175    }
19176
19177    /// Similar to "send" but does not shutdown the channel if an error occurs.
19178    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
19179        let _result = self.send_raw(s);
19180        self.drop_without_shutdown();
19181        _result
19182    }
19183
19184    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
19185        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
19186            (s,),
19187            self.tx_id,
19188            0x5295b76c71fde733,
19189            fidl::encoding::DynamicFlags::empty(),
19190        )
19191    }
19192}
19193
19194#[must_use = "FIDL methods require a response to be sent"]
19195#[derive(Debug)]
19196pub struct SymlinkGetFlagsResponder {
19197    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19198    tx_id: u32,
19199}
19200
19201/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19202/// if the responder is dropped without sending a response, so that the client
19203/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19204impl std::ops::Drop for SymlinkGetFlagsResponder {
19205    fn drop(&mut self) {
19206        self.control_handle.shutdown();
19207        // Safety: drops once, never accessed again
19208        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19209    }
19210}
19211
19212impl fidl::endpoints::Responder for SymlinkGetFlagsResponder {
19213    type ControlHandle = SymlinkControlHandle;
19214
19215    fn control_handle(&self) -> &SymlinkControlHandle {
19216        &self.control_handle
19217    }
19218
19219    fn drop_without_shutdown(mut self) {
19220        // Safety: drops once, never accessed again due to mem::forget
19221        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19222        // Prevent Drop from running (which would shut down the channel)
19223        std::mem::forget(self);
19224    }
19225}
19226
19227impl SymlinkGetFlagsResponder {
19228    /// Sends a response to the FIDL transaction.
19229    ///
19230    /// Sets the channel to shutdown if an error occurs.
19231    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
19232        let _result = self.send_raw(result);
19233        if _result.is_err() {
19234            self.control_handle.shutdown();
19235        }
19236        self.drop_without_shutdown();
19237        _result
19238    }
19239
19240    /// Similar to "send" but does not shutdown the channel if an error occurs.
19241    pub fn send_no_shutdown_on_err(
19242        self,
19243        mut result: Result<Flags, i32>,
19244    ) -> Result<(), fidl::Error> {
19245        let _result = self.send_raw(result);
19246        self.drop_without_shutdown();
19247        _result
19248    }
19249
19250    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
19251        self.control_handle
19252            .inner
19253            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
19254                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
19255                self.tx_id,
19256                0x176eb318f64ec23,
19257                fidl::encoding::DynamicFlags::FLEXIBLE,
19258            )
19259    }
19260}
19261
19262#[must_use = "FIDL methods require a response to be sent"]
19263#[derive(Debug)]
19264pub struct SymlinkSetFlagsResponder {
19265    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19266    tx_id: u32,
19267}
19268
19269/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19270/// if the responder is dropped without sending a response, so that the client
19271/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19272impl std::ops::Drop for SymlinkSetFlagsResponder {
19273    fn drop(&mut self) {
19274        self.control_handle.shutdown();
19275        // Safety: drops once, never accessed again
19276        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19277    }
19278}
19279
19280impl fidl::endpoints::Responder for SymlinkSetFlagsResponder {
19281    type ControlHandle = SymlinkControlHandle;
19282
19283    fn control_handle(&self) -> &SymlinkControlHandle {
19284        &self.control_handle
19285    }
19286
19287    fn drop_without_shutdown(mut self) {
19288        // Safety: drops once, never accessed again due to mem::forget
19289        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19290        // Prevent Drop from running (which would shut down the channel)
19291        std::mem::forget(self);
19292    }
19293}
19294
19295impl SymlinkSetFlagsResponder {
19296    /// Sends a response to the FIDL transaction.
19297    ///
19298    /// Sets the channel to shutdown if an error occurs.
19299    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19300        let _result = self.send_raw(result);
19301        if _result.is_err() {
19302            self.control_handle.shutdown();
19303        }
19304        self.drop_without_shutdown();
19305        _result
19306    }
19307
19308    /// Similar to "send" but does not shutdown the channel if an error occurs.
19309    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19310        let _result = self.send_raw(result);
19311        self.drop_without_shutdown();
19312        _result
19313    }
19314
19315    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19316        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
19317            fidl::encoding::EmptyStruct,
19318            i32,
19319        >>(
19320            fidl::encoding::FlexibleResult::new(result),
19321            self.tx_id,
19322            0x55a8028685791ea8,
19323            fidl::encoding::DynamicFlags::FLEXIBLE,
19324        )
19325    }
19326}
19327
19328#[must_use = "FIDL methods require a response to be sent"]
19329#[derive(Debug)]
19330pub struct SymlinkQueryFilesystemResponder {
19331    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19332    tx_id: u32,
19333}
19334
19335/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19336/// if the responder is dropped without sending a response, so that the client
19337/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19338impl std::ops::Drop for SymlinkQueryFilesystemResponder {
19339    fn drop(&mut self) {
19340        self.control_handle.shutdown();
19341        // Safety: drops once, never accessed again
19342        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19343    }
19344}
19345
19346impl fidl::endpoints::Responder for SymlinkQueryFilesystemResponder {
19347    type ControlHandle = SymlinkControlHandle;
19348
19349    fn control_handle(&self) -> &SymlinkControlHandle {
19350        &self.control_handle
19351    }
19352
19353    fn drop_without_shutdown(mut self) {
19354        // Safety: drops once, never accessed again due to mem::forget
19355        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19356        // Prevent Drop from running (which would shut down the channel)
19357        std::mem::forget(self);
19358    }
19359}
19360
19361impl SymlinkQueryFilesystemResponder {
19362    /// Sends a response to the FIDL transaction.
19363    ///
19364    /// Sets the channel to shutdown if an error occurs.
19365    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
19366        let _result = self.send_raw(s, info);
19367        if _result.is_err() {
19368            self.control_handle.shutdown();
19369        }
19370        self.drop_without_shutdown();
19371        _result
19372    }
19373
19374    /// Similar to "send" but does not shutdown the channel if an error occurs.
19375    pub fn send_no_shutdown_on_err(
19376        self,
19377        mut s: i32,
19378        mut info: Option<&FilesystemInfo>,
19379    ) -> Result<(), fidl::Error> {
19380        let _result = self.send_raw(s, info);
19381        self.drop_without_shutdown();
19382        _result
19383    }
19384
19385    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
19386        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
19387            (s, info),
19388            self.tx_id,
19389            0x6f344a1c6b0a0610,
19390            fidl::encoding::DynamicFlags::empty(),
19391        )
19392    }
19393}
19394
19395#[must_use = "FIDL methods require a response to be sent"]
19396#[derive(Debug)]
19397pub struct SymlinkGetAttributesResponder {
19398    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19399    tx_id: u32,
19400}
19401
19402/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19403/// if the responder is dropped without sending a response, so that the client
19404/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19405impl std::ops::Drop for SymlinkGetAttributesResponder {
19406    fn drop(&mut self) {
19407        self.control_handle.shutdown();
19408        // Safety: drops once, never accessed again
19409        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19410    }
19411}
19412
19413impl fidl::endpoints::Responder for SymlinkGetAttributesResponder {
19414    type ControlHandle = SymlinkControlHandle;
19415
19416    fn control_handle(&self) -> &SymlinkControlHandle {
19417        &self.control_handle
19418    }
19419
19420    fn drop_without_shutdown(mut self) {
19421        // Safety: drops once, never accessed again due to mem::forget
19422        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19423        // Prevent Drop from running (which would shut down the channel)
19424        std::mem::forget(self);
19425    }
19426}
19427
19428impl SymlinkGetAttributesResponder {
19429    /// Sends a response to the FIDL transaction.
19430    ///
19431    /// Sets the channel to shutdown if an error occurs.
19432    pub fn send(
19433        self,
19434        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
19435    ) -> Result<(), fidl::Error> {
19436        let _result = self.send_raw(result);
19437        if _result.is_err() {
19438            self.control_handle.shutdown();
19439        }
19440        self.drop_without_shutdown();
19441        _result
19442    }
19443
19444    /// Similar to "send" but does not shutdown the channel if an error occurs.
19445    pub fn send_no_shutdown_on_err(
19446        self,
19447        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
19448    ) -> Result<(), fidl::Error> {
19449        let _result = self.send_raw(result);
19450        self.drop_without_shutdown();
19451        _result
19452    }
19453
19454    fn send_raw(
19455        &self,
19456        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
19457    ) -> Result<(), fidl::Error> {
19458        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
19459            result,
19460            self.tx_id,
19461            0x3d4396a638ea053b,
19462            fidl::encoding::DynamicFlags::empty(),
19463        )
19464    }
19465}
19466
19467#[must_use = "FIDL methods require a response to be sent"]
19468#[derive(Debug)]
19469pub struct SymlinkUpdateAttributesResponder {
19470    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19471    tx_id: u32,
19472}
19473
19474/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19475/// if the responder is dropped without sending a response, so that the client
19476/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19477impl std::ops::Drop for SymlinkUpdateAttributesResponder {
19478    fn drop(&mut self) {
19479        self.control_handle.shutdown();
19480        // Safety: drops once, never accessed again
19481        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19482    }
19483}
19484
19485impl fidl::endpoints::Responder for SymlinkUpdateAttributesResponder {
19486    type ControlHandle = SymlinkControlHandle;
19487
19488    fn control_handle(&self) -> &SymlinkControlHandle {
19489        &self.control_handle
19490    }
19491
19492    fn drop_without_shutdown(mut self) {
19493        // Safety: drops once, never accessed again due to mem::forget
19494        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19495        // Prevent Drop from running (which would shut down the channel)
19496        std::mem::forget(self);
19497    }
19498}
19499
19500impl SymlinkUpdateAttributesResponder {
19501    /// Sends a response to the FIDL transaction.
19502    ///
19503    /// Sets the channel to shutdown if an error occurs.
19504    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19505        let _result = self.send_raw(result);
19506        if _result.is_err() {
19507            self.control_handle.shutdown();
19508        }
19509        self.drop_without_shutdown();
19510        _result
19511    }
19512
19513    /// Similar to "send" but does not shutdown the channel if an error occurs.
19514    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19515        let _result = self.send_raw(result);
19516        self.drop_without_shutdown();
19517        _result
19518    }
19519
19520    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19521        self.control_handle
19522            .inner
19523            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19524                result,
19525                self.tx_id,
19526                0x3308c1da5a89bf08,
19527                fidl::encoding::DynamicFlags::empty(),
19528            )
19529    }
19530}
19531
19532#[must_use = "FIDL methods require a response to be sent"]
19533#[derive(Debug)]
19534pub struct SymlinkSyncResponder {
19535    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19536    tx_id: u32,
19537}
19538
19539/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19540/// if the responder is dropped without sending a response, so that the client
19541/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19542impl std::ops::Drop for SymlinkSyncResponder {
19543    fn drop(&mut self) {
19544        self.control_handle.shutdown();
19545        // Safety: drops once, never accessed again
19546        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19547    }
19548}
19549
19550impl fidl::endpoints::Responder for SymlinkSyncResponder {
19551    type ControlHandle = SymlinkControlHandle;
19552
19553    fn control_handle(&self) -> &SymlinkControlHandle {
19554        &self.control_handle
19555    }
19556
19557    fn drop_without_shutdown(mut self) {
19558        // Safety: drops once, never accessed again due to mem::forget
19559        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19560        // Prevent Drop from running (which would shut down the channel)
19561        std::mem::forget(self);
19562    }
19563}
19564
19565impl SymlinkSyncResponder {
19566    /// Sends a response to the FIDL transaction.
19567    ///
19568    /// Sets the channel to shutdown if an error occurs.
19569    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19570        let _result = self.send_raw(result);
19571        if _result.is_err() {
19572            self.control_handle.shutdown();
19573        }
19574        self.drop_without_shutdown();
19575        _result
19576    }
19577
19578    /// Similar to "send" but does not shutdown the channel if an error occurs.
19579    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19580        let _result = self.send_raw(result);
19581        self.drop_without_shutdown();
19582        _result
19583    }
19584
19585    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19586        self.control_handle
19587            .inner
19588            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19589                result,
19590                self.tx_id,
19591                0x2c5c27ca0ab5dc49,
19592                fidl::encoding::DynamicFlags::empty(),
19593            )
19594    }
19595}
19596
19597#[must_use = "FIDL methods require a response to be sent"]
19598#[derive(Debug)]
19599pub struct SymlinkGetExtendedAttributeResponder {
19600    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19601    tx_id: u32,
19602}
19603
19604/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19605/// if the responder is dropped without sending a response, so that the client
19606/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19607impl std::ops::Drop for SymlinkGetExtendedAttributeResponder {
19608    fn drop(&mut self) {
19609        self.control_handle.shutdown();
19610        // Safety: drops once, never accessed again
19611        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19612    }
19613}
19614
19615impl fidl::endpoints::Responder for SymlinkGetExtendedAttributeResponder {
19616    type ControlHandle = SymlinkControlHandle;
19617
19618    fn control_handle(&self) -> &SymlinkControlHandle {
19619        &self.control_handle
19620    }
19621
19622    fn drop_without_shutdown(mut self) {
19623        // Safety: drops once, never accessed again due to mem::forget
19624        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19625        // Prevent Drop from running (which would shut down the channel)
19626        std::mem::forget(self);
19627    }
19628}
19629
19630impl SymlinkGetExtendedAttributeResponder {
19631    /// Sends a response to the FIDL transaction.
19632    ///
19633    /// Sets the channel to shutdown if an error occurs.
19634    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
19635        let _result = self.send_raw(result);
19636        if _result.is_err() {
19637            self.control_handle.shutdown();
19638        }
19639        self.drop_without_shutdown();
19640        _result
19641    }
19642
19643    /// Similar to "send" but does not shutdown the channel if an error occurs.
19644    pub fn send_no_shutdown_on_err(
19645        self,
19646        mut result: Result<ExtendedAttributeValue, i32>,
19647    ) -> Result<(), fidl::Error> {
19648        let _result = self.send_raw(result);
19649        self.drop_without_shutdown();
19650        _result
19651    }
19652
19653    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
19654        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
19655            result.as_mut().map_err(|e| *e),
19656            self.tx_id,
19657            0x45ffa3ccfdeb76db,
19658            fidl::encoding::DynamicFlags::empty(),
19659        )
19660    }
19661}
19662
19663#[must_use = "FIDL methods require a response to be sent"]
19664#[derive(Debug)]
19665pub struct SymlinkSetExtendedAttributeResponder {
19666    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19667    tx_id: u32,
19668}
19669
19670/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19671/// if the responder is dropped without sending a response, so that the client
19672/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19673impl std::ops::Drop for SymlinkSetExtendedAttributeResponder {
19674    fn drop(&mut self) {
19675        self.control_handle.shutdown();
19676        // Safety: drops once, never accessed again
19677        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19678    }
19679}
19680
19681impl fidl::endpoints::Responder for SymlinkSetExtendedAttributeResponder {
19682    type ControlHandle = SymlinkControlHandle;
19683
19684    fn control_handle(&self) -> &SymlinkControlHandle {
19685        &self.control_handle
19686    }
19687
19688    fn drop_without_shutdown(mut self) {
19689        // Safety: drops once, never accessed again due to mem::forget
19690        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19691        // Prevent Drop from running (which would shut down the channel)
19692        std::mem::forget(self);
19693    }
19694}
19695
19696impl SymlinkSetExtendedAttributeResponder {
19697    /// Sends a response to the FIDL transaction.
19698    ///
19699    /// Sets the channel to shutdown if an error occurs.
19700    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19701        let _result = self.send_raw(result);
19702        if _result.is_err() {
19703            self.control_handle.shutdown();
19704        }
19705        self.drop_without_shutdown();
19706        _result
19707    }
19708
19709    /// Similar to "send" but does not shutdown the channel if an error occurs.
19710    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19711        let _result = self.send_raw(result);
19712        self.drop_without_shutdown();
19713        _result
19714    }
19715
19716    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19717        self.control_handle
19718            .inner
19719            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19720                result,
19721                self.tx_id,
19722                0x4a951362f681f23c,
19723                fidl::encoding::DynamicFlags::empty(),
19724            )
19725    }
19726}
19727
19728#[must_use = "FIDL methods require a response to be sent"]
19729#[derive(Debug)]
19730pub struct SymlinkRemoveExtendedAttributeResponder {
19731    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19732    tx_id: u32,
19733}
19734
19735/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19736/// if the responder is dropped without sending a response, so that the client
19737/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19738impl std::ops::Drop for SymlinkRemoveExtendedAttributeResponder {
19739    fn drop(&mut self) {
19740        self.control_handle.shutdown();
19741        // Safety: drops once, never accessed again
19742        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19743    }
19744}
19745
19746impl fidl::endpoints::Responder for SymlinkRemoveExtendedAttributeResponder {
19747    type ControlHandle = SymlinkControlHandle;
19748
19749    fn control_handle(&self) -> &SymlinkControlHandle {
19750        &self.control_handle
19751    }
19752
19753    fn drop_without_shutdown(mut self) {
19754        // Safety: drops once, never accessed again due to mem::forget
19755        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19756        // Prevent Drop from running (which would shut down the channel)
19757        std::mem::forget(self);
19758    }
19759}
19760
19761impl SymlinkRemoveExtendedAttributeResponder {
19762    /// Sends a response to the FIDL transaction.
19763    ///
19764    /// Sets the channel to shutdown if an error occurs.
19765    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19766        let _result = self.send_raw(result);
19767        if _result.is_err() {
19768            self.control_handle.shutdown();
19769        }
19770        self.drop_without_shutdown();
19771        _result
19772    }
19773
19774    /// Similar to "send" but does not shutdown the channel if an error occurs.
19775    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19776        let _result = self.send_raw(result);
19777        self.drop_without_shutdown();
19778        _result
19779    }
19780
19781    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19782        self.control_handle
19783            .inner
19784            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19785                result,
19786                self.tx_id,
19787                0x7a0b9f3a9bf9032d,
19788                fidl::encoding::DynamicFlags::empty(),
19789            )
19790    }
19791}
19792
19793#[must_use = "FIDL methods require a response to be sent"]
19794#[derive(Debug)]
19795pub struct SymlinkDescribeResponder {
19796    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19797    tx_id: u32,
19798}
19799
19800/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19801/// if the responder is dropped without sending a response, so that the client
19802/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19803impl std::ops::Drop for SymlinkDescribeResponder {
19804    fn drop(&mut self) {
19805        self.control_handle.shutdown();
19806        // Safety: drops once, never accessed again
19807        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19808    }
19809}
19810
19811impl fidl::endpoints::Responder for SymlinkDescribeResponder {
19812    type ControlHandle = SymlinkControlHandle;
19813
19814    fn control_handle(&self) -> &SymlinkControlHandle {
19815        &self.control_handle
19816    }
19817
19818    fn drop_without_shutdown(mut self) {
19819        // Safety: drops once, never accessed again due to mem::forget
19820        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19821        // Prevent Drop from running (which would shut down the channel)
19822        std::mem::forget(self);
19823    }
19824}
19825
19826impl SymlinkDescribeResponder {
19827    /// Sends a response to the FIDL transaction.
19828    ///
19829    /// Sets the channel to shutdown if an error occurs.
19830    pub fn send(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
19831        let _result = self.send_raw(payload);
19832        if _result.is_err() {
19833            self.control_handle.shutdown();
19834        }
19835        self.drop_without_shutdown();
19836        _result
19837    }
19838
19839    /// Similar to "send" but does not shutdown the channel if an error occurs.
19840    pub fn send_no_shutdown_on_err(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
19841        let _result = self.send_raw(payload);
19842        self.drop_without_shutdown();
19843        _result
19844    }
19845
19846    fn send_raw(&self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
19847        self.control_handle.inner.send::<fidl::encoding::FlexibleType<SymlinkInfo>>(
19848            fidl::encoding::Flexible::new(payload),
19849            self.tx_id,
19850            0x742c2ea5e89831f3,
19851            fidl::encoding::DynamicFlags::FLEXIBLE,
19852        )
19853    }
19854}
19855
19856#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
19857pub struct WritableMarker;
19858
19859impl fidl::endpoints::ProtocolMarker for WritableMarker {
19860    type Proxy = WritableProxy;
19861    type RequestStream = WritableRequestStream;
19862    #[cfg(target_os = "fuchsia")]
19863    type SynchronousProxy = WritableSynchronousProxy;
19864
19865    const DEBUG_NAME: &'static str = "(anonymous) Writable";
19866}
19867pub type WritableWriteResult = Result<u64, i32>;
19868
19869pub trait WritableProxyInterface: Send + Sync {
19870    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
19871        + Send;
19872    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
19873}
19874#[derive(Debug)]
19875#[cfg(target_os = "fuchsia")]
19876pub struct WritableSynchronousProxy {
19877    client: fidl::client::sync::Client,
19878}
19879
19880#[cfg(target_os = "fuchsia")]
19881impl fidl::endpoints::SynchronousProxy for WritableSynchronousProxy {
19882    type Proxy = WritableProxy;
19883    type Protocol = WritableMarker;
19884
19885    fn from_channel(inner: fidl::Channel) -> Self {
19886        Self::new(inner)
19887    }
19888
19889    fn into_channel(self) -> fidl::Channel {
19890        self.client.into_channel()
19891    }
19892
19893    fn as_channel(&self) -> &fidl::Channel {
19894        self.client.as_channel()
19895    }
19896}
19897
19898#[cfg(target_os = "fuchsia")]
19899impl WritableSynchronousProxy {
19900    pub fn new(channel: fidl::Channel) -> Self {
19901        let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
19902        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
19903    }
19904
19905    pub fn into_channel(self) -> fidl::Channel {
19906        self.client.into_channel()
19907    }
19908
19909    /// Waits until an event arrives and returns it. It is safe for other
19910    /// threads to make concurrent requests while waiting for an event.
19911    pub fn wait_for_event(
19912        &self,
19913        deadline: zx::MonotonicInstant,
19914    ) -> Result<WritableEvent, fidl::Error> {
19915        WritableEvent::decode(self.client.wait_for_event(deadline)?)
19916    }
19917
19918    /// Writes data at the seek offset.
19919    /// The seek offset is moved forward by the number of bytes written.
19920    /// If the file is in append mode, the seek offset is first set to the end
19921    /// of the file, followed by the write, in one atomic step.
19922    ///
19923    /// The file size may grow if the seek offset plus `data.length` is beyond
19924    /// the current end of file.
19925    ///
19926    /// + request `data` the byte buffer to write to the file.
19927    /// - response `actual_count` the number of bytes written.
19928    ///
19929    /// ## Invariants
19930    ///
19931    /// * The returned `actual_count` will never be greater than `data.length`.
19932    /// * If the server is unable to write all the data due to e.g. not enough
19933    ///   space, `actual_count` may be less than `data.length`.  If no bytes
19934    ///   could be written, an error is returned.
19935    /// * If `data.length` is zero, the server should perform all the checks
19936    ///   ensuring write access without mutating the file and return a
19937    ///   successful write of zero bytes.  The seek offset is still updated if
19938    ///   in append mode.
19939    ///
19940    /// This method requires the [`Rights.WRITE_BYTES`] right.
19941    pub fn r#write(
19942        &self,
19943        mut data: &[u8],
19944        ___deadline: zx::MonotonicInstant,
19945    ) -> Result<WritableWriteResult, fidl::Error> {
19946        let _response = self.client.send_query::<
19947            WritableWriteRequest,
19948            fidl::encoding::ResultType<WritableWriteResponse, i32>,
19949        >(
19950            (data,),
19951            0x6a31437832469f82,
19952            fidl::encoding::DynamicFlags::empty(),
19953            ___deadline,
19954        )?;
19955        Ok(_response.map(|x| x.actual_count))
19956    }
19957}
19958
19959#[cfg(target_os = "fuchsia")]
19960impl From<WritableSynchronousProxy> for zx::NullableHandle {
19961    fn from(value: WritableSynchronousProxy) -> Self {
19962        value.into_channel().into()
19963    }
19964}
19965
19966#[cfg(target_os = "fuchsia")]
19967impl From<fidl::Channel> for WritableSynchronousProxy {
19968    fn from(value: fidl::Channel) -> Self {
19969        Self::new(value)
19970    }
19971}
19972
19973#[cfg(target_os = "fuchsia")]
19974impl fidl::endpoints::FromClient for WritableSynchronousProxy {
19975    type Protocol = WritableMarker;
19976
19977    fn from_client(value: fidl::endpoints::ClientEnd<WritableMarker>) -> Self {
19978        Self::new(value.into_channel())
19979    }
19980}
19981
19982#[derive(Debug, Clone)]
19983pub struct WritableProxy {
19984    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
19985}
19986
19987impl fidl::endpoints::Proxy for WritableProxy {
19988    type Protocol = WritableMarker;
19989
19990    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
19991        Self::new(inner)
19992    }
19993
19994    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
19995        self.client.into_channel().map_err(|client| Self { client })
19996    }
19997
19998    fn as_channel(&self) -> &::fidl::AsyncChannel {
19999        self.client.as_channel()
20000    }
20001}
20002
20003impl WritableProxy {
20004    /// Create a new Proxy for fuchsia.io/Writable.
20005    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
20006        let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
20007        Self { client: fidl::client::Client::new(channel, protocol_name) }
20008    }
20009
20010    /// Get a Stream of events from the remote end of the protocol.
20011    ///
20012    /// # Panics
20013    ///
20014    /// Panics if the event stream was already taken.
20015    pub fn take_event_stream(&self) -> WritableEventStream {
20016        WritableEventStream { event_receiver: self.client.take_event_receiver() }
20017    }
20018
20019    /// Writes data at the seek offset.
20020    /// The seek offset is moved forward by the number of bytes written.
20021    /// If the file is in append mode, the seek offset is first set to the end
20022    /// of the file, followed by the write, in one atomic step.
20023    ///
20024    /// The file size may grow if the seek offset plus `data.length` is beyond
20025    /// the current end of file.
20026    ///
20027    /// + request `data` the byte buffer to write to the file.
20028    /// - response `actual_count` the number of bytes written.
20029    ///
20030    /// ## Invariants
20031    ///
20032    /// * The returned `actual_count` will never be greater than `data.length`.
20033    /// * If the server is unable to write all the data due to e.g. not enough
20034    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20035    ///   could be written, an error is returned.
20036    /// * If `data.length` is zero, the server should perform all the checks
20037    ///   ensuring write access without mutating the file and return a
20038    ///   successful write of zero bytes.  The seek offset is still updated if
20039    ///   in append mode.
20040    ///
20041    /// This method requires the [`Rights.WRITE_BYTES`] right.
20042    pub fn r#write(
20043        &self,
20044        mut data: &[u8],
20045    ) -> fidl::client::QueryResponseFut<
20046        WritableWriteResult,
20047        fidl::encoding::DefaultFuchsiaResourceDialect,
20048    > {
20049        WritableProxyInterface::r#write(self, data)
20050    }
20051}
20052
20053impl WritableProxyInterface for WritableProxy {
20054    type WriteResponseFut = fidl::client::QueryResponseFut<
20055        WritableWriteResult,
20056        fidl::encoding::DefaultFuchsiaResourceDialect,
20057    >;
20058    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
20059        fn _decode(
20060            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
20061        ) -> Result<WritableWriteResult, fidl::Error> {
20062            let _response = fidl::client::decode_transaction_body::<
20063                fidl::encoding::ResultType<WritableWriteResponse, i32>,
20064                fidl::encoding::DefaultFuchsiaResourceDialect,
20065                0x6a31437832469f82,
20066            >(_buf?)?;
20067            Ok(_response.map(|x| x.actual_count))
20068        }
20069        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
20070            (data,),
20071            0x6a31437832469f82,
20072            fidl::encoding::DynamicFlags::empty(),
20073            _decode,
20074        )
20075    }
20076}
20077
20078pub struct WritableEventStream {
20079    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
20080}
20081
20082impl std::marker::Unpin for WritableEventStream {}
20083
20084impl futures::stream::FusedStream for WritableEventStream {
20085    fn is_terminated(&self) -> bool {
20086        self.event_receiver.is_terminated()
20087    }
20088}
20089
20090impl futures::Stream for WritableEventStream {
20091    type Item = Result<WritableEvent, fidl::Error>;
20092
20093    fn poll_next(
20094        mut self: std::pin::Pin<&mut Self>,
20095        cx: &mut std::task::Context<'_>,
20096    ) -> std::task::Poll<Option<Self::Item>> {
20097        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
20098            &mut self.event_receiver,
20099            cx
20100        )?) {
20101            Some(buf) => std::task::Poll::Ready(Some(WritableEvent::decode(buf))),
20102            None => std::task::Poll::Ready(None),
20103        }
20104    }
20105}
20106
20107#[derive(Debug)]
20108pub enum WritableEvent {}
20109
20110impl WritableEvent {
20111    /// Decodes a message buffer as a [`WritableEvent`].
20112    fn decode(
20113        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
20114    ) -> Result<WritableEvent, fidl::Error> {
20115        let (bytes, _handles) = buf.split_mut();
20116        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
20117        debug_assert_eq!(tx_header.tx_id, 0);
20118        match tx_header.ordinal {
20119            _ => Err(fidl::Error::UnknownOrdinal {
20120                ordinal: tx_header.ordinal,
20121                protocol_name: <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
20122            }),
20123        }
20124    }
20125}
20126
20127/// A Stream of incoming requests for fuchsia.io/Writable.
20128pub struct WritableRequestStream {
20129    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20130    is_terminated: bool,
20131}
20132
20133impl std::marker::Unpin for WritableRequestStream {}
20134
20135impl futures::stream::FusedStream for WritableRequestStream {
20136    fn is_terminated(&self) -> bool {
20137        self.is_terminated
20138    }
20139}
20140
20141impl fidl::endpoints::RequestStream for WritableRequestStream {
20142    type Protocol = WritableMarker;
20143    type ControlHandle = WritableControlHandle;
20144
20145    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
20146        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
20147    }
20148
20149    fn control_handle(&self) -> Self::ControlHandle {
20150        WritableControlHandle { inner: self.inner.clone() }
20151    }
20152
20153    fn into_inner(
20154        self,
20155    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
20156    {
20157        (self.inner, self.is_terminated)
20158    }
20159
20160    fn from_inner(
20161        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20162        is_terminated: bool,
20163    ) -> Self {
20164        Self { inner, is_terminated }
20165    }
20166}
20167
20168impl futures::Stream for WritableRequestStream {
20169    type Item = Result<WritableRequest, fidl::Error>;
20170
20171    fn poll_next(
20172        mut self: std::pin::Pin<&mut Self>,
20173        cx: &mut std::task::Context<'_>,
20174    ) -> std::task::Poll<Option<Self::Item>> {
20175        let this = &mut *self;
20176        if this.inner.check_shutdown(cx) {
20177            this.is_terminated = true;
20178            return std::task::Poll::Ready(None);
20179        }
20180        if this.is_terminated {
20181            panic!("polled WritableRequestStream after completion");
20182        }
20183        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
20184            |bytes, handles| {
20185                match this.inner.channel().read_etc(cx, bytes, handles) {
20186                    std::task::Poll::Ready(Ok(())) => {}
20187                    std::task::Poll::Pending => return std::task::Poll::Pending,
20188                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
20189                        this.is_terminated = true;
20190                        return std::task::Poll::Ready(None);
20191                    }
20192                    std::task::Poll::Ready(Err(e)) => {
20193                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
20194                            e.into(),
20195                        ))));
20196                    }
20197                }
20198
20199                // A message has been received from the channel
20200                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
20201
20202                std::task::Poll::Ready(Some(match header.ordinal {
20203                    0x6a31437832469f82 => {
20204                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
20205                        let mut req = fidl::new_empty!(
20206                            WritableWriteRequest,
20207                            fidl::encoding::DefaultFuchsiaResourceDialect
20208                        );
20209                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
20210                        let control_handle = WritableControlHandle { inner: this.inner.clone() };
20211                        Ok(WritableRequest::Write {
20212                            data: req.data,
20213
20214                            responder: WritableWriteResponder {
20215                                control_handle: std::mem::ManuallyDrop::new(control_handle),
20216                                tx_id: header.tx_id,
20217                            },
20218                        })
20219                    }
20220                    _ => Err(fidl::Error::UnknownOrdinal {
20221                        ordinal: header.ordinal,
20222                        protocol_name:
20223                            <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
20224                    }),
20225                }))
20226            },
20227        )
20228    }
20229}
20230
20231#[derive(Debug)]
20232pub enum WritableRequest {
20233    /// Writes data at the seek offset.
20234    /// The seek offset is moved forward by the number of bytes written.
20235    /// If the file is in append mode, the seek offset is first set to the end
20236    /// of the file, followed by the write, in one atomic step.
20237    ///
20238    /// The file size may grow if the seek offset plus `data.length` is beyond
20239    /// the current end of file.
20240    ///
20241    /// + request `data` the byte buffer to write to the file.
20242    /// - response `actual_count` the number of bytes written.
20243    ///
20244    /// ## Invariants
20245    ///
20246    /// * The returned `actual_count` will never be greater than `data.length`.
20247    /// * If the server is unable to write all the data due to e.g. not enough
20248    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20249    ///   could be written, an error is returned.
20250    /// * If `data.length` is zero, the server should perform all the checks
20251    ///   ensuring write access without mutating the file and return a
20252    ///   successful write of zero bytes.  The seek offset is still updated if
20253    ///   in append mode.
20254    ///
20255    /// This method requires the [`Rights.WRITE_BYTES`] right.
20256    Write { data: Vec<u8>, responder: WritableWriteResponder },
20257}
20258
20259impl WritableRequest {
20260    #[allow(irrefutable_let_patterns)]
20261    pub fn into_write(self) -> Option<(Vec<u8>, WritableWriteResponder)> {
20262        if let WritableRequest::Write { data, responder } = self {
20263            Some((data, responder))
20264        } else {
20265            None
20266        }
20267    }
20268
20269    /// Name of the method defined in FIDL
20270    pub fn method_name(&self) -> &'static str {
20271        match *self {
20272            WritableRequest::Write { .. } => "write",
20273        }
20274    }
20275}
20276
20277#[derive(Debug, Clone)]
20278pub struct WritableControlHandle {
20279    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20280}
20281
20282impl fidl::endpoints::ControlHandle for WritableControlHandle {
20283    fn shutdown(&self) {
20284        self.inner.shutdown()
20285    }
20286    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
20287        self.inner.shutdown_with_epitaph(status)
20288    }
20289
20290    fn is_closed(&self) -> bool {
20291        self.inner.channel().is_closed()
20292    }
20293    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
20294        self.inner.channel().on_closed()
20295    }
20296
20297    #[cfg(target_os = "fuchsia")]
20298    fn signal_peer(
20299        &self,
20300        clear_mask: zx::Signals,
20301        set_mask: zx::Signals,
20302    ) -> Result<(), zx_status::Status> {
20303        use fidl::Peered;
20304        self.inner.channel().signal_peer(clear_mask, set_mask)
20305    }
20306}
20307
20308impl WritableControlHandle {}
20309
20310#[must_use = "FIDL methods require a response to be sent"]
20311#[derive(Debug)]
20312pub struct WritableWriteResponder {
20313    control_handle: std::mem::ManuallyDrop<WritableControlHandle>,
20314    tx_id: u32,
20315}
20316
20317/// Set the the channel to be shutdown (see [`WritableControlHandle::shutdown`])
20318/// if the responder is dropped without sending a response, so that the client
20319/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20320impl std::ops::Drop for WritableWriteResponder {
20321    fn drop(&mut self) {
20322        self.control_handle.shutdown();
20323        // Safety: drops once, never accessed again
20324        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20325    }
20326}
20327
20328impl fidl::endpoints::Responder for WritableWriteResponder {
20329    type ControlHandle = WritableControlHandle;
20330
20331    fn control_handle(&self) -> &WritableControlHandle {
20332        &self.control_handle
20333    }
20334
20335    fn drop_without_shutdown(mut self) {
20336        // Safety: drops once, never accessed again due to mem::forget
20337        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20338        // Prevent Drop from running (which would shut down the channel)
20339        std::mem::forget(self);
20340    }
20341}
20342
20343impl WritableWriteResponder {
20344    /// Sends a response to the FIDL transaction.
20345    ///
20346    /// Sets the channel to shutdown if an error occurs.
20347    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
20348        let _result = self.send_raw(result);
20349        if _result.is_err() {
20350            self.control_handle.shutdown();
20351        }
20352        self.drop_without_shutdown();
20353        _result
20354    }
20355
20356    /// Similar to "send" but does not shutdown the channel if an error occurs.
20357    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
20358        let _result = self.send_raw(result);
20359        self.drop_without_shutdown();
20360        _result
20361    }
20362
20363    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
20364        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
20365            result.map(|actual_count| (actual_count,)),
20366            self.tx_id,
20367            0x6a31437832469f82,
20368            fidl::encoding::DynamicFlags::empty(),
20369        )
20370    }
20371}
20372
20373mod internal {
20374    use super::*;
20375
20376    impl fidl::encoding::ResourceTypeMarker for DirectoryCreateSymlinkRequest {
20377        type Borrowed<'a> = &'a mut Self;
20378        fn take_or_borrow<'a>(
20379            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20380        ) -> Self::Borrowed<'a> {
20381            value
20382        }
20383    }
20384
20385    unsafe impl fidl::encoding::TypeMarker for DirectoryCreateSymlinkRequest {
20386        type Owned = Self;
20387
20388        #[inline(always)]
20389        fn inline_align(_context: fidl::encoding::Context) -> usize {
20390            8
20391        }
20392
20393        #[inline(always)]
20394        fn inline_size(_context: fidl::encoding::Context) -> usize {
20395            40
20396        }
20397    }
20398
20399    unsafe impl
20400        fidl::encoding::Encode<
20401            DirectoryCreateSymlinkRequest,
20402            fidl::encoding::DefaultFuchsiaResourceDialect,
20403        > for &mut DirectoryCreateSymlinkRequest
20404    {
20405        #[inline]
20406        unsafe fn encode(
20407            self,
20408            encoder: &mut fidl::encoding::Encoder<
20409                '_,
20410                fidl::encoding::DefaultFuchsiaResourceDialect,
20411            >,
20412            offset: usize,
20413            _depth: fidl::encoding::Depth,
20414        ) -> fidl::Result<()> {
20415            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
20416            // Delegate to tuple encoding.
20417            fidl::encoding::Encode::<
20418                DirectoryCreateSymlinkRequest,
20419                fidl::encoding::DefaultFuchsiaResourceDialect,
20420            >::encode(
20421                (
20422                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
20423                        &self.name,
20424                    ),
20425                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
20426                        &self.target,
20427                    ),
20428                    <fidl::encoding::Optional<
20429                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20430                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20431                        &mut self.connection
20432                    ),
20433                ),
20434                encoder,
20435                offset,
20436                _depth,
20437            )
20438        }
20439    }
20440    unsafe impl<
20441        T0: fidl::encoding::Encode<
20442                fidl::encoding::BoundedString<255>,
20443                fidl::encoding::DefaultFuchsiaResourceDialect,
20444            >,
20445        T1: fidl::encoding::Encode<
20446                fidl::encoding::Vector<u8, 4095>,
20447                fidl::encoding::DefaultFuchsiaResourceDialect,
20448            >,
20449        T2: fidl::encoding::Encode<
20450                fidl::encoding::Optional<
20451                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20452                >,
20453                fidl::encoding::DefaultFuchsiaResourceDialect,
20454            >,
20455    >
20456        fidl::encoding::Encode<
20457            DirectoryCreateSymlinkRequest,
20458            fidl::encoding::DefaultFuchsiaResourceDialect,
20459        > for (T0, T1, T2)
20460    {
20461        #[inline]
20462        unsafe fn encode(
20463            self,
20464            encoder: &mut fidl::encoding::Encoder<
20465                '_,
20466                fidl::encoding::DefaultFuchsiaResourceDialect,
20467            >,
20468            offset: usize,
20469            depth: fidl::encoding::Depth,
20470        ) -> fidl::Result<()> {
20471            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
20472            // Zero out padding regions. There's no need to apply masks
20473            // because the unmasked parts will be overwritten by fields.
20474            unsafe {
20475                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
20476                (ptr as *mut u64).write_unaligned(0);
20477            }
20478            // Write the fields.
20479            self.0.encode(encoder, offset + 0, depth)?;
20480            self.1.encode(encoder, offset + 16, depth)?;
20481            self.2.encode(encoder, offset + 32, depth)?;
20482            Ok(())
20483        }
20484    }
20485
20486    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20487        for DirectoryCreateSymlinkRequest
20488    {
20489        #[inline(always)]
20490        fn new_empty() -> Self {
20491            Self {
20492                name: fidl::new_empty!(
20493                    fidl::encoding::BoundedString<255>,
20494                    fidl::encoding::DefaultFuchsiaResourceDialect
20495                ),
20496                target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect),
20497                connection: fidl::new_empty!(
20498                    fidl::encoding::Optional<
20499                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20500                    >,
20501                    fidl::encoding::DefaultFuchsiaResourceDialect
20502                ),
20503            }
20504        }
20505
20506        #[inline]
20507        unsafe fn decode(
20508            &mut self,
20509            decoder: &mut fidl::encoding::Decoder<
20510                '_,
20511                fidl::encoding::DefaultFuchsiaResourceDialect,
20512            >,
20513            offset: usize,
20514            _depth: fidl::encoding::Depth,
20515        ) -> fidl::Result<()> {
20516            decoder.debug_check_bounds::<Self>(offset);
20517            // Verify that padding bytes are zero.
20518            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
20519            let padval = unsafe { (ptr as *const u64).read_unaligned() };
20520            let mask = 0xffffffff00000000u64;
20521            let maskedval = padval & mask;
20522            if maskedval != 0 {
20523                return Err(fidl::Error::NonZeroPadding {
20524                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
20525                });
20526            }
20527            fidl::decode!(
20528                fidl::encoding::BoundedString<255>,
20529                fidl::encoding::DefaultFuchsiaResourceDialect,
20530                &mut self.name,
20531                decoder,
20532                offset + 0,
20533                _depth
20534            )?;
20535            fidl::decode!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.target, decoder, offset + 16, _depth)?;
20536            fidl::decode!(
20537                fidl::encoding::Optional<
20538                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20539                >,
20540                fidl::encoding::DefaultFuchsiaResourceDialect,
20541                &mut self.connection,
20542                decoder,
20543                offset + 32,
20544                _depth
20545            )?;
20546            Ok(())
20547        }
20548    }
20549
20550    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedOpenRequest {
20551        type Borrowed<'a> = &'a mut Self;
20552        fn take_or_borrow<'a>(
20553            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20554        ) -> Self::Borrowed<'a> {
20555            value
20556        }
20557    }
20558
20559    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedOpenRequest {
20560        type Owned = Self;
20561
20562        #[inline(always)]
20563        fn inline_align(_context: fidl::encoding::Context) -> usize {
20564            8
20565        }
20566
20567        #[inline(always)]
20568        fn inline_size(_context: fidl::encoding::Context) -> usize {
20569            32
20570        }
20571    }
20572
20573    unsafe impl
20574        fidl::encoding::Encode<
20575            DirectoryDeprecatedOpenRequest,
20576            fidl::encoding::DefaultFuchsiaResourceDialect,
20577        > for &mut DirectoryDeprecatedOpenRequest
20578    {
20579        #[inline]
20580        unsafe fn encode(
20581            self,
20582            encoder: &mut fidl::encoding::Encoder<
20583                '_,
20584                fidl::encoding::DefaultFuchsiaResourceDialect,
20585            >,
20586            offset: usize,
20587            _depth: fidl::encoding::Depth,
20588        ) -> fidl::Result<()> {
20589            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
20590            // Delegate to tuple encoding.
20591            fidl::encoding::Encode::<DirectoryDeprecatedOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
20592                (
20593                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
20594                    <ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
20595                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
20596                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
20597                ),
20598                encoder, offset, _depth
20599            )
20600        }
20601    }
20602    unsafe impl<
20603        T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
20604        T1: fidl::encoding::Encode<ModeType, fidl::encoding::DefaultFuchsiaResourceDialect>,
20605        T2: fidl::encoding::Encode<
20606                fidl::encoding::BoundedString<4095>,
20607                fidl::encoding::DefaultFuchsiaResourceDialect,
20608            >,
20609        T3: fidl::encoding::Encode<
20610                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
20611                fidl::encoding::DefaultFuchsiaResourceDialect,
20612            >,
20613    >
20614        fidl::encoding::Encode<
20615            DirectoryDeprecatedOpenRequest,
20616            fidl::encoding::DefaultFuchsiaResourceDialect,
20617        > for (T0, T1, T2, T3)
20618    {
20619        #[inline]
20620        unsafe fn encode(
20621            self,
20622            encoder: &mut fidl::encoding::Encoder<
20623                '_,
20624                fidl::encoding::DefaultFuchsiaResourceDialect,
20625            >,
20626            offset: usize,
20627            depth: fidl::encoding::Depth,
20628        ) -> fidl::Result<()> {
20629            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
20630            // Zero out padding regions. There's no need to apply masks
20631            // because the unmasked parts will be overwritten by fields.
20632            unsafe {
20633                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
20634                (ptr as *mut u64).write_unaligned(0);
20635            }
20636            // Write the fields.
20637            self.0.encode(encoder, offset + 0, depth)?;
20638            self.1.encode(encoder, offset + 4, depth)?;
20639            self.2.encode(encoder, offset + 8, depth)?;
20640            self.3.encode(encoder, offset + 24, depth)?;
20641            Ok(())
20642        }
20643    }
20644
20645    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20646        for DirectoryDeprecatedOpenRequest
20647    {
20648        #[inline(always)]
20649        fn new_empty() -> Self {
20650            Self {
20651                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
20652                mode: fidl::new_empty!(ModeType, fidl::encoding::DefaultFuchsiaResourceDialect),
20653                path: fidl::new_empty!(
20654                    fidl::encoding::BoundedString<4095>,
20655                    fidl::encoding::DefaultFuchsiaResourceDialect
20656                ),
20657                object: fidl::new_empty!(
20658                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
20659                    fidl::encoding::DefaultFuchsiaResourceDialect
20660                ),
20661            }
20662        }
20663
20664        #[inline]
20665        unsafe fn decode(
20666            &mut self,
20667            decoder: &mut fidl::encoding::Decoder<
20668                '_,
20669                fidl::encoding::DefaultFuchsiaResourceDialect,
20670            >,
20671            offset: usize,
20672            _depth: fidl::encoding::Depth,
20673        ) -> fidl::Result<()> {
20674            decoder.debug_check_bounds::<Self>(offset);
20675            // Verify that padding bytes are zero.
20676            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
20677            let padval = unsafe { (ptr as *const u64).read_unaligned() };
20678            let mask = 0xffffffff00000000u64;
20679            let maskedval = padval & mask;
20680            if maskedval != 0 {
20681                return Err(fidl::Error::NonZeroPadding {
20682                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
20683                });
20684            }
20685            fidl::decode!(
20686                OpenFlags,
20687                fidl::encoding::DefaultFuchsiaResourceDialect,
20688                &mut self.flags,
20689                decoder,
20690                offset + 0,
20691                _depth
20692            )?;
20693            fidl::decode!(
20694                ModeType,
20695                fidl::encoding::DefaultFuchsiaResourceDialect,
20696                &mut self.mode,
20697                decoder,
20698                offset + 4,
20699                _depth
20700            )?;
20701            fidl::decode!(
20702                fidl::encoding::BoundedString<4095>,
20703                fidl::encoding::DefaultFuchsiaResourceDialect,
20704                &mut self.path,
20705                decoder,
20706                offset + 8,
20707                _depth
20708            )?;
20709            fidl::decode!(
20710                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
20711                fidl::encoding::DefaultFuchsiaResourceDialect,
20712                &mut self.object,
20713                decoder,
20714                offset + 24,
20715                _depth
20716            )?;
20717            Ok(())
20718        }
20719    }
20720
20721    impl fidl::encoding::ResourceTypeMarker for DirectoryGetTokenResponse {
20722        type Borrowed<'a> = &'a mut Self;
20723        fn take_or_borrow<'a>(
20724            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20725        ) -> Self::Borrowed<'a> {
20726            value
20727        }
20728    }
20729
20730    unsafe impl fidl::encoding::TypeMarker for DirectoryGetTokenResponse {
20731        type Owned = Self;
20732
20733        #[inline(always)]
20734        fn inline_align(_context: fidl::encoding::Context) -> usize {
20735            4
20736        }
20737
20738        #[inline(always)]
20739        fn inline_size(_context: fidl::encoding::Context) -> usize {
20740            8
20741        }
20742    }
20743
20744    unsafe impl
20745        fidl::encoding::Encode<
20746            DirectoryGetTokenResponse,
20747            fidl::encoding::DefaultFuchsiaResourceDialect,
20748        > for &mut DirectoryGetTokenResponse
20749    {
20750        #[inline]
20751        unsafe fn encode(
20752            self,
20753            encoder: &mut fidl::encoding::Encoder<
20754                '_,
20755                fidl::encoding::DefaultFuchsiaResourceDialect,
20756            >,
20757            offset: usize,
20758            _depth: fidl::encoding::Depth,
20759        ) -> fidl::Result<()> {
20760            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
20761            // Delegate to tuple encoding.
20762            fidl::encoding::Encode::<
20763                DirectoryGetTokenResponse,
20764                fidl::encoding::DefaultFuchsiaResourceDialect,
20765            >::encode(
20766                (
20767                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
20768                    <fidl::encoding::Optional<
20769                        fidl::encoding::HandleType<
20770                            fidl::NullableHandle,
20771                            { fidl::ObjectType::NONE.into_raw() },
20772                            2147483648,
20773                        >,
20774                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20775                        &mut self.token
20776                    ),
20777                ),
20778                encoder,
20779                offset,
20780                _depth,
20781            )
20782        }
20783    }
20784    unsafe impl<
20785        T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
20786        T1: fidl::encoding::Encode<
20787                fidl::encoding::Optional<
20788                    fidl::encoding::HandleType<
20789                        fidl::NullableHandle,
20790                        { fidl::ObjectType::NONE.into_raw() },
20791                        2147483648,
20792                    >,
20793                >,
20794                fidl::encoding::DefaultFuchsiaResourceDialect,
20795            >,
20796    >
20797        fidl::encoding::Encode<
20798            DirectoryGetTokenResponse,
20799            fidl::encoding::DefaultFuchsiaResourceDialect,
20800        > for (T0, T1)
20801    {
20802        #[inline]
20803        unsafe fn encode(
20804            self,
20805            encoder: &mut fidl::encoding::Encoder<
20806                '_,
20807                fidl::encoding::DefaultFuchsiaResourceDialect,
20808            >,
20809            offset: usize,
20810            depth: fidl::encoding::Depth,
20811        ) -> fidl::Result<()> {
20812            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
20813            // Zero out padding regions. There's no need to apply masks
20814            // because the unmasked parts will be overwritten by fields.
20815            // Write the fields.
20816            self.0.encode(encoder, offset + 0, depth)?;
20817            self.1.encode(encoder, offset + 4, depth)?;
20818            Ok(())
20819        }
20820    }
20821
20822    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20823        for DirectoryGetTokenResponse
20824    {
20825        #[inline(always)]
20826        fn new_empty() -> Self {
20827            Self {
20828                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
20829                token: fidl::new_empty!(
20830                    fidl::encoding::Optional<
20831                        fidl::encoding::HandleType<
20832                            fidl::NullableHandle,
20833                            { fidl::ObjectType::NONE.into_raw() },
20834                            2147483648,
20835                        >,
20836                    >,
20837                    fidl::encoding::DefaultFuchsiaResourceDialect
20838                ),
20839            }
20840        }
20841
20842        #[inline]
20843        unsafe fn decode(
20844            &mut self,
20845            decoder: &mut fidl::encoding::Decoder<
20846                '_,
20847                fidl::encoding::DefaultFuchsiaResourceDialect,
20848            >,
20849            offset: usize,
20850            _depth: fidl::encoding::Depth,
20851        ) -> fidl::Result<()> {
20852            decoder.debug_check_bounds::<Self>(offset);
20853            // Verify that padding bytes are zero.
20854            fidl::decode!(
20855                i32,
20856                fidl::encoding::DefaultFuchsiaResourceDialect,
20857                &mut self.s,
20858                decoder,
20859                offset + 0,
20860                _depth
20861            )?;
20862            fidl::decode!(
20863                fidl::encoding::Optional<
20864                    fidl::encoding::HandleType<
20865                        fidl::NullableHandle,
20866                        { fidl::ObjectType::NONE.into_raw() },
20867                        2147483648,
20868                    >,
20869                >,
20870                fidl::encoding::DefaultFuchsiaResourceDialect,
20871                &mut self.token,
20872                decoder,
20873                offset + 4,
20874                _depth
20875            )?;
20876            Ok(())
20877        }
20878    }
20879
20880    impl fidl::encoding::ResourceTypeMarker for DirectoryLinkRequest {
20881        type Borrowed<'a> = &'a mut Self;
20882        fn take_or_borrow<'a>(
20883            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20884        ) -> Self::Borrowed<'a> {
20885            value
20886        }
20887    }
20888
20889    unsafe impl fidl::encoding::TypeMarker for DirectoryLinkRequest {
20890        type Owned = Self;
20891
20892        #[inline(always)]
20893        fn inline_align(_context: fidl::encoding::Context) -> usize {
20894            8
20895        }
20896
20897        #[inline(always)]
20898        fn inline_size(_context: fidl::encoding::Context) -> usize {
20899            40
20900        }
20901    }
20902
20903    unsafe impl
20904        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
20905        for &mut DirectoryLinkRequest
20906    {
20907        #[inline]
20908        unsafe fn encode(
20909            self,
20910            encoder: &mut fidl::encoding::Encoder<
20911                '_,
20912                fidl::encoding::DefaultFuchsiaResourceDialect,
20913            >,
20914            offset: usize,
20915            _depth: fidl::encoding::Depth,
20916        ) -> fidl::Result<()> {
20917            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
20918            // Delegate to tuple encoding.
20919            fidl::encoding::Encode::<
20920                DirectoryLinkRequest,
20921                fidl::encoding::DefaultFuchsiaResourceDialect,
20922            >::encode(
20923                (
20924                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
20925                        &self.src,
20926                    ),
20927                    <fidl::encoding::HandleType<
20928                        fidl::NullableHandle,
20929                        { fidl::ObjectType::NONE.into_raw() },
20930                        2147483648,
20931                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20932                        &mut self.dst_parent_token,
20933                    ),
20934                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
20935                        &self.dst,
20936                    ),
20937                ),
20938                encoder,
20939                offset,
20940                _depth,
20941            )
20942        }
20943    }
20944    unsafe impl<
20945        T0: fidl::encoding::Encode<
20946                fidl::encoding::BoundedString<255>,
20947                fidl::encoding::DefaultFuchsiaResourceDialect,
20948            >,
20949        T1: fidl::encoding::Encode<
20950                fidl::encoding::HandleType<
20951                    fidl::NullableHandle,
20952                    { fidl::ObjectType::NONE.into_raw() },
20953                    2147483648,
20954                >,
20955                fidl::encoding::DefaultFuchsiaResourceDialect,
20956            >,
20957        T2: fidl::encoding::Encode<
20958                fidl::encoding::BoundedString<255>,
20959                fidl::encoding::DefaultFuchsiaResourceDialect,
20960            >,
20961    >
20962        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
20963        for (T0, T1, T2)
20964    {
20965        #[inline]
20966        unsafe fn encode(
20967            self,
20968            encoder: &mut fidl::encoding::Encoder<
20969                '_,
20970                fidl::encoding::DefaultFuchsiaResourceDialect,
20971            >,
20972            offset: usize,
20973            depth: fidl::encoding::Depth,
20974        ) -> fidl::Result<()> {
20975            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
20976            // Zero out padding regions. There's no need to apply masks
20977            // because the unmasked parts will be overwritten by fields.
20978            unsafe {
20979                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
20980                (ptr as *mut u64).write_unaligned(0);
20981            }
20982            // Write the fields.
20983            self.0.encode(encoder, offset + 0, depth)?;
20984            self.1.encode(encoder, offset + 16, depth)?;
20985            self.2.encode(encoder, offset + 24, depth)?;
20986            Ok(())
20987        }
20988    }
20989
20990    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20991        for DirectoryLinkRequest
20992    {
20993        #[inline(always)]
20994        fn new_empty() -> Self {
20995            Self {
20996                src: fidl::new_empty!(
20997                    fidl::encoding::BoundedString<255>,
20998                    fidl::encoding::DefaultFuchsiaResourceDialect
20999                ),
21000                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21001                dst: fidl::new_empty!(
21002                    fidl::encoding::BoundedString<255>,
21003                    fidl::encoding::DefaultFuchsiaResourceDialect
21004                ),
21005            }
21006        }
21007
21008        #[inline]
21009        unsafe fn decode(
21010            &mut self,
21011            decoder: &mut fidl::encoding::Decoder<
21012                '_,
21013                fidl::encoding::DefaultFuchsiaResourceDialect,
21014            >,
21015            offset: usize,
21016            _depth: fidl::encoding::Depth,
21017        ) -> fidl::Result<()> {
21018            decoder.debug_check_bounds::<Self>(offset);
21019            // Verify that padding bytes are zero.
21020            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21021            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21022            let mask = 0xffffffff00000000u64;
21023            let maskedval = padval & mask;
21024            if maskedval != 0 {
21025                return Err(fidl::Error::NonZeroPadding {
21026                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21027                });
21028            }
21029            fidl::decode!(
21030                fidl::encoding::BoundedString<255>,
21031                fidl::encoding::DefaultFuchsiaResourceDialect,
21032                &mut self.src,
21033                decoder,
21034                offset + 0,
21035                _depth
21036            )?;
21037            fidl::decode!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dst_parent_token, decoder, offset + 16, _depth)?;
21038            fidl::decode!(
21039                fidl::encoding::BoundedString<255>,
21040                fidl::encoding::DefaultFuchsiaResourceDialect,
21041                &mut self.dst,
21042                decoder,
21043                offset + 24,
21044                _depth
21045            )?;
21046            Ok(())
21047        }
21048    }
21049
21050    impl fidl::encoding::ResourceTypeMarker for DirectoryOpenRequest {
21051        type Borrowed<'a> = &'a mut Self;
21052        fn take_or_borrow<'a>(
21053            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21054        ) -> Self::Borrowed<'a> {
21055            value
21056        }
21057    }
21058
21059    unsafe impl fidl::encoding::TypeMarker for DirectoryOpenRequest {
21060        type Owned = Self;
21061
21062        #[inline(always)]
21063        fn inline_align(_context: fidl::encoding::Context) -> usize {
21064            8
21065        }
21066
21067        #[inline(always)]
21068        fn inline_size(_context: fidl::encoding::Context) -> usize {
21069            48
21070        }
21071    }
21072
21073    unsafe impl
21074        fidl::encoding::Encode<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21075        for &mut DirectoryOpenRequest
21076    {
21077        #[inline]
21078        unsafe fn encode(
21079            self,
21080            encoder: &mut fidl::encoding::Encoder<
21081                '_,
21082                fidl::encoding::DefaultFuchsiaResourceDialect,
21083            >,
21084            offset: usize,
21085            _depth: fidl::encoding::Depth,
21086        ) -> fidl::Result<()> {
21087            encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
21088            // Delegate to tuple encoding.
21089            fidl::encoding::Encode::<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21090                (
21091                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
21092                    <Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
21093                    <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
21094                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
21095                ),
21096                encoder, offset, _depth
21097            )
21098        }
21099    }
21100    unsafe impl<
21101        T0: fidl::encoding::Encode<
21102                fidl::encoding::BoundedString<4095>,
21103                fidl::encoding::DefaultFuchsiaResourceDialect,
21104            >,
21105        T1: fidl::encoding::Encode<Flags, fidl::encoding::DefaultFuchsiaResourceDialect>,
21106        T2: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
21107        T3: fidl::encoding::Encode<
21108                fidl::encoding::HandleType<
21109                    fidl::Channel,
21110                    { fidl::ObjectType::CHANNEL.into_raw() },
21111                    2147483648,
21112                >,
21113                fidl::encoding::DefaultFuchsiaResourceDialect,
21114            >,
21115    >
21116        fidl::encoding::Encode<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21117        for (T0, T1, T2, T3)
21118    {
21119        #[inline]
21120        unsafe fn encode(
21121            self,
21122            encoder: &mut fidl::encoding::Encoder<
21123                '_,
21124                fidl::encoding::DefaultFuchsiaResourceDialect,
21125            >,
21126            offset: usize,
21127            depth: fidl::encoding::Depth,
21128        ) -> fidl::Result<()> {
21129            encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
21130            // Zero out padding regions. There's no need to apply masks
21131            // because the unmasked parts will be overwritten by fields.
21132            unsafe {
21133                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
21134                (ptr as *mut u64).write_unaligned(0);
21135            }
21136            // Write the fields.
21137            self.0.encode(encoder, offset + 0, depth)?;
21138            self.1.encode(encoder, offset + 16, depth)?;
21139            self.2.encode(encoder, offset + 24, depth)?;
21140            self.3.encode(encoder, offset + 40, depth)?;
21141            Ok(())
21142        }
21143    }
21144
21145    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21146        for DirectoryOpenRequest
21147    {
21148        #[inline(always)]
21149        fn new_empty() -> Self {
21150            Self {
21151                path: fidl::new_empty!(
21152                    fidl::encoding::BoundedString<4095>,
21153                    fidl::encoding::DefaultFuchsiaResourceDialect
21154                ),
21155                flags: fidl::new_empty!(Flags, fidl::encoding::DefaultFuchsiaResourceDialect),
21156                options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
21157                object: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21158            }
21159        }
21160
21161        #[inline]
21162        unsafe fn decode(
21163            &mut self,
21164            decoder: &mut fidl::encoding::Decoder<
21165                '_,
21166                fidl::encoding::DefaultFuchsiaResourceDialect,
21167            >,
21168            offset: usize,
21169            _depth: fidl::encoding::Depth,
21170        ) -> fidl::Result<()> {
21171            decoder.debug_check_bounds::<Self>(offset);
21172            // Verify that padding bytes are zero.
21173            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
21174            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21175            let mask = 0xffffffff00000000u64;
21176            let maskedval = padval & mask;
21177            if maskedval != 0 {
21178                return Err(fidl::Error::NonZeroPadding {
21179                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
21180                });
21181            }
21182            fidl::decode!(
21183                fidl::encoding::BoundedString<4095>,
21184                fidl::encoding::DefaultFuchsiaResourceDialect,
21185                &mut self.path,
21186                decoder,
21187                offset + 0,
21188                _depth
21189            )?;
21190            fidl::decode!(
21191                Flags,
21192                fidl::encoding::DefaultFuchsiaResourceDialect,
21193                &mut self.flags,
21194                decoder,
21195                offset + 16,
21196                _depth
21197            )?;
21198            fidl::decode!(
21199                Options,
21200                fidl::encoding::DefaultFuchsiaResourceDialect,
21201                &mut self.options,
21202                decoder,
21203                offset + 24,
21204                _depth
21205            )?;
21206            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.object, decoder, offset + 40, _depth)?;
21207            Ok(())
21208        }
21209    }
21210
21211    impl fidl::encoding::ResourceTypeMarker for DirectoryRenameRequest {
21212        type Borrowed<'a> = &'a mut Self;
21213        fn take_or_borrow<'a>(
21214            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21215        ) -> Self::Borrowed<'a> {
21216            value
21217        }
21218    }
21219
21220    unsafe impl fidl::encoding::TypeMarker for DirectoryRenameRequest {
21221        type Owned = Self;
21222
21223        #[inline(always)]
21224        fn inline_align(_context: fidl::encoding::Context) -> usize {
21225            8
21226        }
21227
21228        #[inline(always)]
21229        fn inline_size(_context: fidl::encoding::Context) -> usize {
21230            40
21231        }
21232    }
21233
21234    unsafe impl
21235        fidl::encoding::Encode<
21236            DirectoryRenameRequest,
21237            fidl::encoding::DefaultFuchsiaResourceDialect,
21238        > for &mut DirectoryRenameRequest
21239    {
21240        #[inline]
21241        unsafe fn encode(
21242            self,
21243            encoder: &mut fidl::encoding::Encoder<
21244                '_,
21245                fidl::encoding::DefaultFuchsiaResourceDialect,
21246            >,
21247            offset: usize,
21248            _depth: fidl::encoding::Depth,
21249        ) -> fidl::Result<()> {
21250            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
21251            // Delegate to tuple encoding.
21252            fidl::encoding::Encode::<
21253                DirectoryRenameRequest,
21254                fidl::encoding::DefaultFuchsiaResourceDialect,
21255            >::encode(
21256                (
21257                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21258                        &self.src,
21259                    ),
21260                    <fidl::encoding::HandleType<
21261                        fidl::Event,
21262                        { fidl::ObjectType::EVENT.into_raw() },
21263                        2147483648,
21264                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21265                        &mut self.dst_parent_token,
21266                    ),
21267                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21268                        &self.dst,
21269                    ),
21270                ),
21271                encoder,
21272                offset,
21273                _depth,
21274            )
21275        }
21276    }
21277    unsafe impl<
21278        T0: fidl::encoding::Encode<
21279                fidl::encoding::BoundedString<255>,
21280                fidl::encoding::DefaultFuchsiaResourceDialect,
21281            >,
21282        T1: fidl::encoding::Encode<
21283                fidl::encoding::HandleType<
21284                    fidl::Event,
21285                    { fidl::ObjectType::EVENT.into_raw() },
21286                    2147483648,
21287                >,
21288                fidl::encoding::DefaultFuchsiaResourceDialect,
21289            >,
21290        T2: fidl::encoding::Encode<
21291                fidl::encoding::BoundedString<255>,
21292                fidl::encoding::DefaultFuchsiaResourceDialect,
21293            >,
21294    >
21295        fidl::encoding::Encode<
21296            DirectoryRenameRequest,
21297            fidl::encoding::DefaultFuchsiaResourceDialect,
21298        > for (T0, T1, T2)
21299    {
21300        #[inline]
21301        unsafe fn encode(
21302            self,
21303            encoder: &mut fidl::encoding::Encoder<
21304                '_,
21305                fidl::encoding::DefaultFuchsiaResourceDialect,
21306            >,
21307            offset: usize,
21308            depth: fidl::encoding::Depth,
21309        ) -> fidl::Result<()> {
21310            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
21311            // Zero out padding regions. There's no need to apply masks
21312            // because the unmasked parts will be overwritten by fields.
21313            unsafe {
21314                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21315                (ptr as *mut u64).write_unaligned(0);
21316            }
21317            // Write the fields.
21318            self.0.encode(encoder, offset + 0, depth)?;
21319            self.1.encode(encoder, offset + 16, depth)?;
21320            self.2.encode(encoder, offset + 24, depth)?;
21321            Ok(())
21322        }
21323    }
21324
21325    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21326        for DirectoryRenameRequest
21327    {
21328        #[inline(always)]
21329        fn new_empty() -> Self {
21330            Self {
21331                src: fidl::new_empty!(
21332                    fidl::encoding::BoundedString<255>,
21333                    fidl::encoding::DefaultFuchsiaResourceDialect
21334                ),
21335                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21336                dst: fidl::new_empty!(
21337                    fidl::encoding::BoundedString<255>,
21338                    fidl::encoding::DefaultFuchsiaResourceDialect
21339                ),
21340            }
21341        }
21342
21343        #[inline]
21344        unsafe fn decode(
21345            &mut self,
21346            decoder: &mut fidl::encoding::Decoder<
21347                '_,
21348                fidl::encoding::DefaultFuchsiaResourceDialect,
21349            >,
21350            offset: usize,
21351            _depth: fidl::encoding::Depth,
21352        ) -> fidl::Result<()> {
21353            decoder.debug_check_bounds::<Self>(offset);
21354            // Verify that padding bytes are zero.
21355            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21356            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21357            let mask = 0xffffffff00000000u64;
21358            let maskedval = padval & mask;
21359            if maskedval != 0 {
21360                return Err(fidl::Error::NonZeroPadding {
21361                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21362                });
21363            }
21364            fidl::decode!(
21365                fidl::encoding::BoundedString<255>,
21366                fidl::encoding::DefaultFuchsiaResourceDialect,
21367                &mut self.src,
21368                decoder,
21369                offset + 0,
21370                _depth
21371            )?;
21372            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dst_parent_token, decoder, offset + 16, _depth)?;
21373            fidl::decode!(
21374                fidl::encoding::BoundedString<255>,
21375                fidl::encoding::DefaultFuchsiaResourceDialect,
21376                &mut self.dst,
21377                decoder,
21378                offset + 24,
21379                _depth
21380            )?;
21381            Ok(())
21382        }
21383    }
21384
21385    impl fidl::encoding::ResourceTypeMarker for DirectoryWatchRequest {
21386        type Borrowed<'a> = &'a mut Self;
21387        fn take_or_borrow<'a>(
21388            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21389        ) -> Self::Borrowed<'a> {
21390            value
21391        }
21392    }
21393
21394    unsafe impl fidl::encoding::TypeMarker for DirectoryWatchRequest {
21395        type Owned = Self;
21396
21397        #[inline(always)]
21398        fn inline_align(_context: fidl::encoding::Context) -> usize {
21399            4
21400        }
21401
21402        #[inline(always)]
21403        fn inline_size(_context: fidl::encoding::Context) -> usize {
21404            12
21405        }
21406    }
21407
21408    unsafe impl
21409        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21410        for &mut DirectoryWatchRequest
21411    {
21412        #[inline]
21413        unsafe fn encode(
21414            self,
21415            encoder: &mut fidl::encoding::Encoder<
21416                '_,
21417                fidl::encoding::DefaultFuchsiaResourceDialect,
21418            >,
21419            offset: usize,
21420            _depth: fidl::encoding::Depth,
21421        ) -> fidl::Result<()> {
21422            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
21423            // Delegate to tuple encoding.
21424            fidl::encoding::Encode::<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21425                (
21426                    <WatchMask as fidl::encoding::ValueTypeMarker>::borrow(&self.mask),
21427                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
21428                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
21429                ),
21430                encoder, offset, _depth
21431            )
21432        }
21433    }
21434    unsafe impl<
21435        T0: fidl::encoding::Encode<WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect>,
21436        T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
21437        T2: fidl::encoding::Encode<
21438                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
21439                fidl::encoding::DefaultFuchsiaResourceDialect,
21440            >,
21441    >
21442        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21443        for (T0, T1, T2)
21444    {
21445        #[inline]
21446        unsafe fn encode(
21447            self,
21448            encoder: &mut fidl::encoding::Encoder<
21449                '_,
21450                fidl::encoding::DefaultFuchsiaResourceDialect,
21451            >,
21452            offset: usize,
21453            depth: fidl::encoding::Depth,
21454        ) -> fidl::Result<()> {
21455            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
21456            // Zero out padding regions. There's no need to apply masks
21457            // because the unmasked parts will be overwritten by fields.
21458            // Write the fields.
21459            self.0.encode(encoder, offset + 0, depth)?;
21460            self.1.encode(encoder, offset + 4, depth)?;
21461            self.2.encode(encoder, offset + 8, depth)?;
21462            Ok(())
21463        }
21464    }
21465
21466    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21467        for DirectoryWatchRequest
21468    {
21469        #[inline(always)]
21470        fn new_empty() -> Self {
21471            Self {
21472                mask: fidl::new_empty!(WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect),
21473                options: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
21474                watcher: fidl::new_empty!(
21475                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
21476                    fidl::encoding::DefaultFuchsiaResourceDialect
21477                ),
21478            }
21479        }
21480
21481        #[inline]
21482        unsafe fn decode(
21483            &mut self,
21484            decoder: &mut fidl::encoding::Decoder<
21485                '_,
21486                fidl::encoding::DefaultFuchsiaResourceDialect,
21487            >,
21488            offset: usize,
21489            _depth: fidl::encoding::Depth,
21490        ) -> fidl::Result<()> {
21491            decoder.debug_check_bounds::<Self>(offset);
21492            // Verify that padding bytes are zero.
21493            fidl::decode!(
21494                WatchMask,
21495                fidl::encoding::DefaultFuchsiaResourceDialect,
21496                &mut self.mask,
21497                decoder,
21498                offset + 0,
21499                _depth
21500            )?;
21501            fidl::decode!(
21502                u32,
21503                fidl::encoding::DefaultFuchsiaResourceDialect,
21504                &mut self.options,
21505                decoder,
21506                offset + 4,
21507                _depth
21508            )?;
21509            fidl::decode!(
21510                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
21511                fidl::encoding::DefaultFuchsiaResourceDialect,
21512                &mut self.watcher,
21513                decoder,
21514                offset + 8,
21515                _depth
21516            )?;
21517            Ok(())
21518        }
21519    }
21520
21521    impl fidl::encoding::ResourceTypeMarker for FileAllocateRequest {
21522        type Borrowed<'a> = &'a mut Self;
21523        fn take_or_borrow<'a>(
21524            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21525        ) -> Self::Borrowed<'a> {
21526            value
21527        }
21528    }
21529
21530    unsafe impl fidl::encoding::TypeMarker for FileAllocateRequest {
21531        type Owned = Self;
21532
21533        #[inline(always)]
21534        fn inline_align(_context: fidl::encoding::Context) -> usize {
21535            8
21536        }
21537
21538        #[inline(always)]
21539        fn inline_size(_context: fidl::encoding::Context) -> usize {
21540            24
21541        }
21542    }
21543
21544    unsafe impl
21545        fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21546        for &mut FileAllocateRequest
21547    {
21548        #[inline]
21549        unsafe fn encode(
21550            self,
21551            encoder: &mut fidl::encoding::Encoder<
21552                '_,
21553                fidl::encoding::DefaultFuchsiaResourceDialect,
21554            >,
21555            offset: usize,
21556            _depth: fidl::encoding::Depth,
21557        ) -> fidl::Result<()> {
21558            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
21559            // Delegate to tuple encoding.
21560            fidl::encoding::Encode::<
21561                FileAllocateRequest,
21562                fidl::encoding::DefaultFuchsiaResourceDialect,
21563            >::encode(
21564                (
21565                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
21566                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
21567                    <AllocateMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
21568                ),
21569                encoder,
21570                offset,
21571                _depth,
21572            )
21573        }
21574    }
21575    unsafe impl<
21576        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
21577        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
21578        T2: fidl::encoding::Encode<AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect>,
21579    > fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21580        for (T0, T1, T2)
21581    {
21582        #[inline]
21583        unsafe fn encode(
21584            self,
21585            encoder: &mut fidl::encoding::Encoder<
21586                '_,
21587                fidl::encoding::DefaultFuchsiaResourceDialect,
21588            >,
21589            offset: usize,
21590            depth: fidl::encoding::Depth,
21591        ) -> fidl::Result<()> {
21592            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
21593            // Zero out padding regions. There's no need to apply masks
21594            // because the unmasked parts will be overwritten by fields.
21595            unsafe {
21596                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21597                (ptr as *mut u64).write_unaligned(0);
21598            }
21599            // Write the fields.
21600            self.0.encode(encoder, offset + 0, depth)?;
21601            self.1.encode(encoder, offset + 8, depth)?;
21602            self.2.encode(encoder, offset + 16, depth)?;
21603            Ok(())
21604        }
21605    }
21606
21607    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21608        for FileAllocateRequest
21609    {
21610        #[inline(always)]
21611        fn new_empty() -> Self {
21612            Self {
21613                offset: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
21614                length: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
21615                mode: fidl::new_empty!(AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect),
21616            }
21617        }
21618
21619        #[inline]
21620        unsafe fn decode(
21621            &mut self,
21622            decoder: &mut fidl::encoding::Decoder<
21623                '_,
21624                fidl::encoding::DefaultFuchsiaResourceDialect,
21625            >,
21626            offset: usize,
21627            _depth: fidl::encoding::Depth,
21628        ) -> fidl::Result<()> {
21629            decoder.debug_check_bounds::<Self>(offset);
21630            // Verify that padding bytes are zero.
21631            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21632            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21633            let mask = 0xffffffff00000000u64;
21634            let maskedval = padval & mask;
21635            if maskedval != 0 {
21636                return Err(fidl::Error::NonZeroPadding {
21637                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21638                });
21639            }
21640            fidl::decode!(
21641                u64,
21642                fidl::encoding::DefaultFuchsiaResourceDialect,
21643                &mut self.offset,
21644                decoder,
21645                offset + 0,
21646                _depth
21647            )?;
21648            fidl::decode!(
21649                u64,
21650                fidl::encoding::DefaultFuchsiaResourceDialect,
21651                &mut self.length,
21652                decoder,
21653                offset + 8,
21654                _depth
21655            )?;
21656            fidl::decode!(
21657                AllocateMode,
21658                fidl::encoding::DefaultFuchsiaResourceDialect,
21659                &mut self.mode,
21660                decoder,
21661                offset + 16,
21662                _depth
21663            )?;
21664            Ok(())
21665        }
21666    }
21667
21668    impl fidl::encoding::ResourceTypeMarker for FileEnableVerityRequest {
21669        type Borrowed<'a> = &'a mut Self;
21670        fn take_or_borrow<'a>(
21671            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21672        ) -> Self::Borrowed<'a> {
21673            value
21674        }
21675    }
21676
21677    unsafe impl fidl::encoding::TypeMarker for FileEnableVerityRequest {
21678        type Owned = Self;
21679
21680        #[inline(always)]
21681        fn inline_align(_context: fidl::encoding::Context) -> usize {
21682            8
21683        }
21684
21685        #[inline(always)]
21686        fn inline_size(_context: fidl::encoding::Context) -> usize {
21687            16
21688        }
21689    }
21690
21691    unsafe impl
21692        fidl::encoding::Encode<
21693            FileEnableVerityRequest,
21694            fidl::encoding::DefaultFuchsiaResourceDialect,
21695        > for &mut FileEnableVerityRequest
21696    {
21697        #[inline]
21698        unsafe fn encode(
21699            self,
21700            encoder: &mut fidl::encoding::Encoder<
21701                '_,
21702                fidl::encoding::DefaultFuchsiaResourceDialect,
21703            >,
21704            offset: usize,
21705            _depth: fidl::encoding::Depth,
21706        ) -> fidl::Result<()> {
21707            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
21708            // Delegate to tuple encoding.
21709            fidl::encoding::Encode::<
21710                FileEnableVerityRequest,
21711                fidl::encoding::DefaultFuchsiaResourceDialect,
21712            >::encode(
21713                (<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
21714                encoder,
21715                offset,
21716                _depth,
21717            )
21718        }
21719    }
21720    unsafe impl<
21721        T0: fidl::encoding::Encode<VerificationOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
21722    >
21723        fidl::encoding::Encode<
21724            FileEnableVerityRequest,
21725            fidl::encoding::DefaultFuchsiaResourceDialect,
21726        > for (T0,)
21727    {
21728        #[inline]
21729        unsafe fn encode(
21730            self,
21731            encoder: &mut fidl::encoding::Encoder<
21732                '_,
21733                fidl::encoding::DefaultFuchsiaResourceDialect,
21734            >,
21735            offset: usize,
21736            depth: fidl::encoding::Depth,
21737        ) -> fidl::Result<()> {
21738            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
21739            // Zero out padding regions. There's no need to apply masks
21740            // because the unmasked parts will be overwritten by fields.
21741            // Write the fields.
21742            self.0.encode(encoder, offset + 0, depth)?;
21743            Ok(())
21744        }
21745    }
21746
21747    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21748        for FileEnableVerityRequest
21749    {
21750        #[inline(always)]
21751        fn new_empty() -> Self {
21752            Self {
21753                options: fidl::new_empty!(
21754                    VerificationOptions,
21755                    fidl::encoding::DefaultFuchsiaResourceDialect
21756                ),
21757            }
21758        }
21759
21760        #[inline]
21761        unsafe fn decode(
21762            &mut self,
21763            decoder: &mut fidl::encoding::Decoder<
21764                '_,
21765                fidl::encoding::DefaultFuchsiaResourceDialect,
21766            >,
21767            offset: usize,
21768            _depth: fidl::encoding::Depth,
21769        ) -> fidl::Result<()> {
21770            decoder.debug_check_bounds::<Self>(offset);
21771            // Verify that padding bytes are zero.
21772            fidl::decode!(
21773                VerificationOptions,
21774                fidl::encoding::DefaultFuchsiaResourceDialect,
21775                &mut self.options,
21776                decoder,
21777                offset + 0,
21778                _depth
21779            )?;
21780            Ok(())
21781        }
21782    }
21783
21784    impl fidl::encoding::ResourceTypeMarker for FileObject {
21785        type Borrowed<'a> = &'a mut Self;
21786        fn take_or_borrow<'a>(
21787            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21788        ) -> Self::Borrowed<'a> {
21789            value
21790        }
21791    }
21792
21793    unsafe impl fidl::encoding::TypeMarker for FileObject {
21794        type Owned = Self;
21795
21796        #[inline(always)]
21797        fn inline_align(_context: fidl::encoding::Context) -> usize {
21798            4
21799        }
21800
21801        #[inline(always)]
21802        fn inline_size(_context: fidl::encoding::Context) -> usize {
21803            8
21804        }
21805    }
21806
21807    unsafe impl fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
21808        for &mut FileObject
21809    {
21810        #[inline]
21811        unsafe fn encode(
21812            self,
21813            encoder: &mut fidl::encoding::Encoder<
21814                '_,
21815                fidl::encoding::DefaultFuchsiaResourceDialect,
21816            >,
21817            offset: usize,
21818            _depth: fidl::encoding::Depth,
21819        ) -> fidl::Result<()> {
21820            encoder.debug_check_bounds::<FileObject>(offset);
21821            // Delegate to tuple encoding.
21822            fidl::encoding::Encode::<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21823                (
21824                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.event),
21825                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stream),
21826                ),
21827                encoder, offset, _depth
21828            )
21829        }
21830    }
21831    unsafe impl<
21832        T0: fidl::encoding::Encode<
21833                fidl::encoding::Optional<
21834                    fidl::encoding::HandleType<
21835                        fidl::Event,
21836                        { fidl::ObjectType::EVENT.into_raw() },
21837                        2147483648,
21838                    >,
21839                >,
21840                fidl::encoding::DefaultFuchsiaResourceDialect,
21841            >,
21842        T1: fidl::encoding::Encode<
21843                fidl::encoding::Optional<
21844                    fidl::encoding::HandleType<
21845                        fidl::Stream,
21846                        { fidl::ObjectType::STREAM.into_raw() },
21847                        2147483648,
21848                    >,
21849                >,
21850                fidl::encoding::DefaultFuchsiaResourceDialect,
21851            >,
21852    > fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
21853        for (T0, T1)
21854    {
21855        #[inline]
21856        unsafe fn encode(
21857            self,
21858            encoder: &mut fidl::encoding::Encoder<
21859                '_,
21860                fidl::encoding::DefaultFuchsiaResourceDialect,
21861            >,
21862            offset: usize,
21863            depth: fidl::encoding::Depth,
21864        ) -> fidl::Result<()> {
21865            encoder.debug_check_bounds::<FileObject>(offset);
21866            // Zero out padding regions. There's no need to apply masks
21867            // because the unmasked parts will be overwritten by fields.
21868            // Write the fields.
21869            self.0.encode(encoder, offset + 0, depth)?;
21870            self.1.encode(encoder, offset + 4, depth)?;
21871            Ok(())
21872        }
21873    }
21874
21875    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileObject {
21876        #[inline(always)]
21877        fn new_empty() -> Self {
21878            Self {
21879                event: fidl::new_empty!(
21880                    fidl::encoding::Optional<
21881                        fidl::encoding::HandleType<
21882                            fidl::Event,
21883                            { fidl::ObjectType::EVENT.into_raw() },
21884                            2147483648,
21885                        >,
21886                    >,
21887                    fidl::encoding::DefaultFuchsiaResourceDialect
21888                ),
21889                stream: fidl::new_empty!(
21890                    fidl::encoding::Optional<
21891                        fidl::encoding::HandleType<
21892                            fidl::Stream,
21893                            { fidl::ObjectType::STREAM.into_raw() },
21894                            2147483648,
21895                        >,
21896                    >,
21897                    fidl::encoding::DefaultFuchsiaResourceDialect
21898                ),
21899            }
21900        }
21901
21902        #[inline]
21903        unsafe fn decode(
21904            &mut self,
21905            decoder: &mut fidl::encoding::Decoder<
21906                '_,
21907                fidl::encoding::DefaultFuchsiaResourceDialect,
21908            >,
21909            offset: usize,
21910            _depth: fidl::encoding::Depth,
21911        ) -> fidl::Result<()> {
21912            decoder.debug_check_bounds::<Self>(offset);
21913            // Verify that padding bytes are zero.
21914            fidl::decode!(
21915                fidl::encoding::Optional<
21916                    fidl::encoding::HandleType<
21917                        fidl::Event,
21918                        { fidl::ObjectType::EVENT.into_raw() },
21919                        2147483648,
21920                    >,
21921                >,
21922                fidl::encoding::DefaultFuchsiaResourceDialect,
21923                &mut self.event,
21924                decoder,
21925                offset + 0,
21926                _depth
21927            )?;
21928            fidl::decode!(
21929                fidl::encoding::Optional<
21930                    fidl::encoding::HandleType<
21931                        fidl::Stream,
21932                        { fidl::ObjectType::STREAM.into_raw() },
21933                        2147483648,
21934                    >,
21935                >,
21936                fidl::encoding::DefaultFuchsiaResourceDialect,
21937                &mut self.stream,
21938                decoder,
21939                offset + 4,
21940                _depth
21941            )?;
21942            Ok(())
21943        }
21944    }
21945
21946    impl fidl::encoding::ResourceTypeMarker for FileGetBackingMemoryResponse {
21947        type Borrowed<'a> = &'a mut Self;
21948        fn take_or_borrow<'a>(
21949            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21950        ) -> Self::Borrowed<'a> {
21951            value
21952        }
21953    }
21954
21955    unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryResponse {
21956        type Owned = Self;
21957
21958        #[inline(always)]
21959        fn inline_align(_context: fidl::encoding::Context) -> usize {
21960            4
21961        }
21962
21963        #[inline(always)]
21964        fn inline_size(_context: fidl::encoding::Context) -> usize {
21965            4
21966        }
21967    }
21968
21969    unsafe impl
21970        fidl::encoding::Encode<
21971            FileGetBackingMemoryResponse,
21972            fidl::encoding::DefaultFuchsiaResourceDialect,
21973        > for &mut FileGetBackingMemoryResponse
21974    {
21975        #[inline]
21976        unsafe fn encode(
21977            self,
21978            encoder: &mut fidl::encoding::Encoder<
21979                '_,
21980                fidl::encoding::DefaultFuchsiaResourceDialect,
21981            >,
21982            offset: usize,
21983            _depth: fidl::encoding::Depth,
21984        ) -> fidl::Result<()> {
21985            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
21986            // Delegate to tuple encoding.
21987            fidl::encoding::Encode::<
21988                FileGetBackingMemoryResponse,
21989                fidl::encoding::DefaultFuchsiaResourceDialect,
21990            >::encode(
21991                (<fidl::encoding::HandleType<
21992                    fidl::Vmo,
21993                    { fidl::ObjectType::VMO.into_raw() },
21994                    2147483648,
21995                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21996                    &mut self.vmo
21997                ),),
21998                encoder,
21999                offset,
22000                _depth,
22001            )
22002        }
22003    }
22004    unsafe impl<
22005        T0: fidl::encoding::Encode<
22006                fidl::encoding::HandleType<
22007                    fidl::Vmo,
22008                    { fidl::ObjectType::VMO.into_raw() },
22009                    2147483648,
22010                >,
22011                fidl::encoding::DefaultFuchsiaResourceDialect,
22012            >,
22013    >
22014        fidl::encoding::Encode<
22015            FileGetBackingMemoryResponse,
22016            fidl::encoding::DefaultFuchsiaResourceDialect,
22017        > for (T0,)
22018    {
22019        #[inline]
22020        unsafe fn encode(
22021            self,
22022            encoder: &mut fidl::encoding::Encoder<
22023                '_,
22024                fidl::encoding::DefaultFuchsiaResourceDialect,
22025            >,
22026            offset: usize,
22027            depth: fidl::encoding::Depth,
22028        ) -> fidl::Result<()> {
22029            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
22030            // Zero out padding regions. There's no need to apply masks
22031            // because the unmasked parts will be overwritten by fields.
22032            // Write the fields.
22033            self.0.encode(encoder, offset + 0, depth)?;
22034            Ok(())
22035        }
22036    }
22037
22038    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22039        for FileGetBackingMemoryResponse
22040    {
22041        #[inline(always)]
22042        fn new_empty() -> Self {
22043            Self {
22044                vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22045            }
22046        }
22047
22048        #[inline]
22049        unsafe fn decode(
22050            &mut self,
22051            decoder: &mut fidl::encoding::Decoder<
22052                '_,
22053                fidl::encoding::DefaultFuchsiaResourceDialect,
22054            >,
22055            offset: usize,
22056            _depth: fidl::encoding::Depth,
22057        ) -> fidl::Result<()> {
22058            decoder.debug_check_bounds::<Self>(offset);
22059            // Verify that padding bytes are zero.
22060            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
22061            Ok(())
22062        }
22063    }
22064
22065    impl fidl::encoding::ResourceTypeMarker for LinkableLinkIntoRequest {
22066        type Borrowed<'a> = &'a mut Self;
22067        fn take_or_borrow<'a>(
22068            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22069        ) -> Self::Borrowed<'a> {
22070            value
22071        }
22072    }
22073
22074    unsafe impl fidl::encoding::TypeMarker for LinkableLinkIntoRequest {
22075        type Owned = Self;
22076
22077        #[inline(always)]
22078        fn inline_align(_context: fidl::encoding::Context) -> usize {
22079            8
22080        }
22081
22082        #[inline(always)]
22083        fn inline_size(_context: fidl::encoding::Context) -> usize {
22084            24
22085        }
22086    }
22087
22088    unsafe impl
22089        fidl::encoding::Encode<
22090            LinkableLinkIntoRequest,
22091            fidl::encoding::DefaultFuchsiaResourceDialect,
22092        > for &mut LinkableLinkIntoRequest
22093    {
22094        #[inline]
22095        unsafe fn encode(
22096            self,
22097            encoder: &mut fidl::encoding::Encoder<
22098                '_,
22099                fidl::encoding::DefaultFuchsiaResourceDialect,
22100            >,
22101            offset: usize,
22102            _depth: fidl::encoding::Depth,
22103        ) -> fidl::Result<()> {
22104            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
22105            // Delegate to tuple encoding.
22106            fidl::encoding::Encode::<
22107                LinkableLinkIntoRequest,
22108                fidl::encoding::DefaultFuchsiaResourceDialect,
22109            >::encode(
22110                (
22111                    <fidl::encoding::HandleType<
22112                        fidl::Event,
22113                        { fidl::ObjectType::EVENT.into_raw() },
22114                        2147483648,
22115                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22116                        &mut self.dst_parent_token,
22117                    ),
22118                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
22119                        &self.dst,
22120                    ),
22121                ),
22122                encoder,
22123                offset,
22124                _depth,
22125            )
22126        }
22127    }
22128    unsafe impl<
22129        T0: fidl::encoding::Encode<
22130                fidl::encoding::HandleType<
22131                    fidl::Event,
22132                    { fidl::ObjectType::EVENT.into_raw() },
22133                    2147483648,
22134                >,
22135                fidl::encoding::DefaultFuchsiaResourceDialect,
22136            >,
22137        T1: fidl::encoding::Encode<
22138                fidl::encoding::BoundedString<255>,
22139                fidl::encoding::DefaultFuchsiaResourceDialect,
22140            >,
22141    >
22142        fidl::encoding::Encode<
22143            LinkableLinkIntoRequest,
22144            fidl::encoding::DefaultFuchsiaResourceDialect,
22145        > for (T0, T1)
22146    {
22147        #[inline]
22148        unsafe fn encode(
22149            self,
22150            encoder: &mut fidl::encoding::Encoder<
22151                '_,
22152                fidl::encoding::DefaultFuchsiaResourceDialect,
22153            >,
22154            offset: usize,
22155            depth: fidl::encoding::Depth,
22156        ) -> fidl::Result<()> {
22157            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
22158            // Zero out padding regions. There's no need to apply masks
22159            // because the unmasked parts will be overwritten by fields.
22160            unsafe {
22161                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
22162                (ptr as *mut u64).write_unaligned(0);
22163            }
22164            // Write the fields.
22165            self.0.encode(encoder, offset + 0, depth)?;
22166            self.1.encode(encoder, offset + 8, depth)?;
22167            Ok(())
22168        }
22169    }
22170
22171    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22172        for LinkableLinkIntoRequest
22173    {
22174        #[inline(always)]
22175        fn new_empty() -> Self {
22176            Self {
22177                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22178                dst: fidl::new_empty!(
22179                    fidl::encoding::BoundedString<255>,
22180                    fidl::encoding::DefaultFuchsiaResourceDialect
22181                ),
22182            }
22183        }
22184
22185        #[inline]
22186        unsafe fn decode(
22187            &mut self,
22188            decoder: &mut fidl::encoding::Decoder<
22189                '_,
22190                fidl::encoding::DefaultFuchsiaResourceDialect,
22191            >,
22192            offset: usize,
22193            _depth: fidl::encoding::Depth,
22194        ) -> fidl::Result<()> {
22195            decoder.debug_check_bounds::<Self>(offset);
22196            // Verify that padding bytes are zero.
22197            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
22198            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22199            let mask = 0xffffffff00000000u64;
22200            let maskedval = padval & mask;
22201            if maskedval != 0 {
22202                return Err(fidl::Error::NonZeroPadding {
22203                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
22204                });
22205            }
22206            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dst_parent_token, decoder, offset + 0, _depth)?;
22207            fidl::decode!(
22208                fidl::encoding::BoundedString<255>,
22209                fidl::encoding::DefaultFuchsiaResourceDialect,
22210                &mut self.dst,
22211                decoder,
22212                offset + 8,
22213                _depth
22214            )?;
22215            Ok(())
22216        }
22217    }
22218
22219    impl fidl::encoding::ResourceTypeMarker for NodeDeprecatedCloneRequest {
22220        type Borrowed<'a> = &'a mut Self;
22221        fn take_or_borrow<'a>(
22222            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22223        ) -> Self::Borrowed<'a> {
22224            value
22225        }
22226    }
22227
22228    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedCloneRequest {
22229        type Owned = Self;
22230
22231        #[inline(always)]
22232        fn inline_align(_context: fidl::encoding::Context) -> usize {
22233            4
22234        }
22235
22236        #[inline(always)]
22237        fn inline_size(_context: fidl::encoding::Context) -> usize {
22238            8
22239        }
22240    }
22241
22242    unsafe impl
22243        fidl::encoding::Encode<
22244            NodeDeprecatedCloneRequest,
22245            fidl::encoding::DefaultFuchsiaResourceDialect,
22246        > for &mut NodeDeprecatedCloneRequest
22247    {
22248        #[inline]
22249        unsafe fn encode(
22250            self,
22251            encoder: &mut fidl::encoding::Encoder<
22252                '_,
22253                fidl::encoding::DefaultFuchsiaResourceDialect,
22254            >,
22255            offset: usize,
22256            _depth: fidl::encoding::Depth,
22257        ) -> fidl::Result<()> {
22258            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
22259            // Delegate to tuple encoding.
22260            fidl::encoding::Encode::<NodeDeprecatedCloneRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22261                (
22262                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
22263                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
22264                ),
22265                encoder, offset, _depth
22266            )
22267        }
22268    }
22269    unsafe impl<
22270        T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
22271        T1: fidl::encoding::Encode<
22272                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22273                fidl::encoding::DefaultFuchsiaResourceDialect,
22274            >,
22275    >
22276        fidl::encoding::Encode<
22277            NodeDeprecatedCloneRequest,
22278            fidl::encoding::DefaultFuchsiaResourceDialect,
22279        > for (T0, T1)
22280    {
22281        #[inline]
22282        unsafe fn encode(
22283            self,
22284            encoder: &mut fidl::encoding::Encoder<
22285                '_,
22286                fidl::encoding::DefaultFuchsiaResourceDialect,
22287            >,
22288            offset: usize,
22289            depth: fidl::encoding::Depth,
22290        ) -> fidl::Result<()> {
22291            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
22292            // Zero out padding regions. There's no need to apply masks
22293            // because the unmasked parts will be overwritten by fields.
22294            // Write the fields.
22295            self.0.encode(encoder, offset + 0, depth)?;
22296            self.1.encode(encoder, offset + 4, depth)?;
22297            Ok(())
22298        }
22299    }
22300
22301    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22302        for NodeDeprecatedCloneRequest
22303    {
22304        #[inline(always)]
22305        fn new_empty() -> Self {
22306            Self {
22307                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
22308                object: fidl::new_empty!(
22309                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22310                    fidl::encoding::DefaultFuchsiaResourceDialect
22311                ),
22312            }
22313        }
22314
22315        #[inline]
22316        unsafe fn decode(
22317            &mut self,
22318            decoder: &mut fidl::encoding::Decoder<
22319                '_,
22320                fidl::encoding::DefaultFuchsiaResourceDialect,
22321            >,
22322            offset: usize,
22323            _depth: fidl::encoding::Depth,
22324        ) -> fidl::Result<()> {
22325            decoder.debug_check_bounds::<Self>(offset);
22326            // Verify that padding bytes are zero.
22327            fidl::decode!(
22328                OpenFlags,
22329                fidl::encoding::DefaultFuchsiaResourceDialect,
22330                &mut self.flags,
22331                decoder,
22332                offset + 0,
22333                _depth
22334            )?;
22335            fidl::decode!(
22336                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22337                fidl::encoding::DefaultFuchsiaResourceDialect,
22338                &mut self.object,
22339                decoder,
22340                offset + 4,
22341                _depth
22342            )?;
22343            Ok(())
22344        }
22345    }
22346
22347    impl fidl::encoding::ResourceTypeMarker for NodeListExtendedAttributesRequest {
22348        type Borrowed<'a> = &'a mut Self;
22349        fn take_or_borrow<'a>(
22350            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22351        ) -> Self::Borrowed<'a> {
22352            value
22353        }
22354    }
22355
22356    unsafe impl fidl::encoding::TypeMarker for NodeListExtendedAttributesRequest {
22357        type Owned = Self;
22358
22359        #[inline(always)]
22360        fn inline_align(_context: fidl::encoding::Context) -> usize {
22361            4
22362        }
22363
22364        #[inline(always)]
22365        fn inline_size(_context: fidl::encoding::Context) -> usize {
22366            4
22367        }
22368    }
22369
22370    unsafe impl
22371        fidl::encoding::Encode<
22372            NodeListExtendedAttributesRequest,
22373            fidl::encoding::DefaultFuchsiaResourceDialect,
22374        > for &mut NodeListExtendedAttributesRequest
22375    {
22376        #[inline]
22377        unsafe fn encode(
22378            self,
22379            encoder: &mut fidl::encoding::Encoder<
22380                '_,
22381                fidl::encoding::DefaultFuchsiaResourceDialect,
22382            >,
22383            offset: usize,
22384            _depth: fidl::encoding::Depth,
22385        ) -> fidl::Result<()> {
22386            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
22387            // Delegate to tuple encoding.
22388            fidl::encoding::Encode::<
22389                NodeListExtendedAttributesRequest,
22390                fidl::encoding::DefaultFuchsiaResourceDialect,
22391            >::encode(
22392                (<fidl::encoding::Endpoint<
22393                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22394                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22395                    &mut self.iterator
22396                ),),
22397                encoder,
22398                offset,
22399                _depth,
22400            )
22401        }
22402    }
22403    unsafe impl<
22404        T0: fidl::encoding::Encode<
22405                fidl::encoding::Endpoint<
22406                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22407                >,
22408                fidl::encoding::DefaultFuchsiaResourceDialect,
22409            >,
22410    >
22411        fidl::encoding::Encode<
22412            NodeListExtendedAttributesRequest,
22413            fidl::encoding::DefaultFuchsiaResourceDialect,
22414        > for (T0,)
22415    {
22416        #[inline]
22417        unsafe fn encode(
22418            self,
22419            encoder: &mut fidl::encoding::Encoder<
22420                '_,
22421                fidl::encoding::DefaultFuchsiaResourceDialect,
22422            >,
22423            offset: usize,
22424            depth: fidl::encoding::Depth,
22425        ) -> fidl::Result<()> {
22426            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
22427            // Zero out padding regions. There's no need to apply masks
22428            // because the unmasked parts will be overwritten by fields.
22429            // Write the fields.
22430            self.0.encode(encoder, offset + 0, depth)?;
22431            Ok(())
22432        }
22433    }
22434
22435    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22436        for NodeListExtendedAttributesRequest
22437    {
22438        #[inline(always)]
22439        fn new_empty() -> Self {
22440            Self {
22441                iterator: fidl::new_empty!(
22442                    fidl::encoding::Endpoint<
22443                        fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22444                    >,
22445                    fidl::encoding::DefaultFuchsiaResourceDialect
22446                ),
22447            }
22448        }
22449
22450        #[inline]
22451        unsafe fn decode(
22452            &mut self,
22453            decoder: &mut fidl::encoding::Decoder<
22454                '_,
22455                fidl::encoding::DefaultFuchsiaResourceDialect,
22456            >,
22457            offset: usize,
22458            _depth: fidl::encoding::Depth,
22459        ) -> fidl::Result<()> {
22460            decoder.debug_check_bounds::<Self>(offset);
22461            // Verify that padding bytes are zero.
22462            fidl::decode!(
22463                fidl::encoding::Endpoint<
22464                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22465                >,
22466                fidl::encoding::DefaultFuchsiaResourceDialect,
22467                &mut self.iterator,
22468                decoder,
22469                offset + 0,
22470                _depth
22471            )?;
22472            Ok(())
22473        }
22474    }
22475
22476    impl fidl::encoding::ResourceTypeMarker for NodeOnOpenRequest {
22477        type Borrowed<'a> = &'a mut Self;
22478        fn take_or_borrow<'a>(
22479            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22480        ) -> Self::Borrowed<'a> {
22481            value
22482        }
22483    }
22484
22485    unsafe impl fidl::encoding::TypeMarker for NodeOnOpenRequest {
22486        type Owned = Self;
22487
22488        #[inline(always)]
22489        fn inline_align(_context: fidl::encoding::Context) -> usize {
22490            8
22491        }
22492
22493        #[inline(always)]
22494        fn inline_size(_context: fidl::encoding::Context) -> usize {
22495            24
22496        }
22497    }
22498
22499    unsafe impl
22500        fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22501        for &mut NodeOnOpenRequest
22502    {
22503        #[inline]
22504        unsafe fn encode(
22505            self,
22506            encoder: &mut fidl::encoding::Encoder<
22507                '_,
22508                fidl::encoding::DefaultFuchsiaResourceDialect,
22509            >,
22510            offset: usize,
22511            _depth: fidl::encoding::Depth,
22512        ) -> fidl::Result<()> {
22513            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
22514            // Delegate to tuple encoding.
22515            fidl::encoding::Encode::<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22516                (
22517                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
22518                    <fidl::encoding::OptionalUnion<NodeInfoDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
22519                ),
22520                encoder, offset, _depth
22521            )
22522        }
22523    }
22524    unsafe impl<
22525        T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
22526        T1: fidl::encoding::Encode<
22527                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
22528                fidl::encoding::DefaultFuchsiaResourceDialect,
22529            >,
22530    > fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22531        for (T0, T1)
22532    {
22533        #[inline]
22534        unsafe fn encode(
22535            self,
22536            encoder: &mut fidl::encoding::Encoder<
22537                '_,
22538                fidl::encoding::DefaultFuchsiaResourceDialect,
22539            >,
22540            offset: usize,
22541            depth: fidl::encoding::Depth,
22542        ) -> fidl::Result<()> {
22543            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
22544            // Zero out padding regions. There's no need to apply masks
22545            // because the unmasked parts will be overwritten by fields.
22546            unsafe {
22547                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
22548                (ptr as *mut u64).write_unaligned(0);
22549            }
22550            // Write the fields.
22551            self.0.encode(encoder, offset + 0, depth)?;
22552            self.1.encode(encoder, offset + 8, depth)?;
22553            Ok(())
22554        }
22555    }
22556
22557    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22558        for NodeOnOpenRequest
22559    {
22560        #[inline(always)]
22561        fn new_empty() -> Self {
22562            Self {
22563                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
22564                info: fidl::new_empty!(
22565                    fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
22566                    fidl::encoding::DefaultFuchsiaResourceDialect
22567                ),
22568            }
22569        }
22570
22571        #[inline]
22572        unsafe fn decode(
22573            &mut self,
22574            decoder: &mut fidl::encoding::Decoder<
22575                '_,
22576                fidl::encoding::DefaultFuchsiaResourceDialect,
22577            >,
22578            offset: usize,
22579            _depth: fidl::encoding::Depth,
22580        ) -> fidl::Result<()> {
22581            decoder.debug_check_bounds::<Self>(offset);
22582            // Verify that padding bytes are zero.
22583            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
22584            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22585            let mask = 0xffffffff00000000u64;
22586            let maskedval = padval & mask;
22587            if maskedval != 0 {
22588                return Err(fidl::Error::NonZeroPadding {
22589                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
22590                });
22591            }
22592            fidl::decode!(
22593                i32,
22594                fidl::encoding::DefaultFuchsiaResourceDialect,
22595                &mut self.s,
22596                decoder,
22597                offset + 0,
22598                _depth
22599            )?;
22600            fidl::decode!(
22601                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
22602                fidl::encoding::DefaultFuchsiaResourceDialect,
22603                &mut self.info,
22604                decoder,
22605                offset + 8,
22606                _depth
22607            )?;
22608            Ok(())
22609        }
22610    }
22611
22612    impl fidl::encoding::ResourceTypeMarker for NodeSetExtendedAttributeRequest {
22613        type Borrowed<'a> = &'a mut Self;
22614        fn take_or_borrow<'a>(
22615            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22616        ) -> Self::Borrowed<'a> {
22617            value
22618        }
22619    }
22620
22621    unsafe impl fidl::encoding::TypeMarker for NodeSetExtendedAttributeRequest {
22622        type Owned = Self;
22623
22624        #[inline(always)]
22625        fn inline_align(_context: fidl::encoding::Context) -> usize {
22626            8
22627        }
22628
22629        #[inline(always)]
22630        fn inline_size(_context: fidl::encoding::Context) -> usize {
22631            40
22632        }
22633    }
22634
22635    unsafe impl
22636        fidl::encoding::Encode<
22637            NodeSetExtendedAttributeRequest,
22638            fidl::encoding::DefaultFuchsiaResourceDialect,
22639        > for &mut NodeSetExtendedAttributeRequest
22640    {
22641        #[inline]
22642        unsafe fn encode(
22643            self,
22644            encoder: &mut fidl::encoding::Encoder<
22645                '_,
22646                fidl::encoding::DefaultFuchsiaResourceDialect,
22647            >,
22648            offset: usize,
22649            _depth: fidl::encoding::Depth,
22650        ) -> fidl::Result<()> {
22651            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
22652            // Delegate to tuple encoding.
22653            fidl::encoding::Encode::<
22654                NodeSetExtendedAttributeRequest,
22655                fidl::encoding::DefaultFuchsiaResourceDialect,
22656            >::encode(
22657                (
22658                    <fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
22659                        &self.name,
22660                    ),
22661                    <ExtendedAttributeValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22662                        &mut self.value,
22663                    ),
22664                    <SetExtendedAttributeMode as fidl::encoding::ValueTypeMarker>::borrow(
22665                        &self.mode,
22666                    ),
22667                ),
22668                encoder,
22669                offset,
22670                _depth,
22671            )
22672        }
22673    }
22674    unsafe impl<
22675        T0: fidl::encoding::Encode<
22676                fidl::encoding::Vector<u8, 255>,
22677                fidl::encoding::DefaultFuchsiaResourceDialect,
22678            >,
22679        T1: fidl::encoding::Encode<
22680                ExtendedAttributeValue,
22681                fidl::encoding::DefaultFuchsiaResourceDialect,
22682            >,
22683        T2: fidl::encoding::Encode<
22684                SetExtendedAttributeMode,
22685                fidl::encoding::DefaultFuchsiaResourceDialect,
22686            >,
22687    >
22688        fidl::encoding::Encode<
22689            NodeSetExtendedAttributeRequest,
22690            fidl::encoding::DefaultFuchsiaResourceDialect,
22691        > for (T0, T1, T2)
22692    {
22693        #[inline]
22694        unsafe fn encode(
22695            self,
22696            encoder: &mut fidl::encoding::Encoder<
22697                '_,
22698                fidl::encoding::DefaultFuchsiaResourceDialect,
22699            >,
22700            offset: usize,
22701            depth: fidl::encoding::Depth,
22702        ) -> fidl::Result<()> {
22703            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
22704            // Zero out padding regions. There's no need to apply masks
22705            // because the unmasked parts will be overwritten by fields.
22706            unsafe {
22707                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
22708                (ptr as *mut u64).write_unaligned(0);
22709            }
22710            // Write the fields.
22711            self.0.encode(encoder, offset + 0, depth)?;
22712            self.1.encode(encoder, offset + 16, depth)?;
22713            self.2.encode(encoder, offset + 32, depth)?;
22714            Ok(())
22715        }
22716    }
22717
22718    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22719        for NodeSetExtendedAttributeRequest
22720    {
22721        #[inline(always)]
22722        fn new_empty() -> Self {
22723            Self {
22724                name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect),
22725                value: fidl::new_empty!(
22726                    ExtendedAttributeValue,
22727                    fidl::encoding::DefaultFuchsiaResourceDialect
22728                ),
22729                mode: fidl::new_empty!(
22730                    SetExtendedAttributeMode,
22731                    fidl::encoding::DefaultFuchsiaResourceDialect
22732                ),
22733            }
22734        }
22735
22736        #[inline]
22737        unsafe fn decode(
22738            &mut self,
22739            decoder: &mut fidl::encoding::Decoder<
22740                '_,
22741                fidl::encoding::DefaultFuchsiaResourceDialect,
22742            >,
22743            offset: usize,
22744            _depth: fidl::encoding::Depth,
22745        ) -> fidl::Result<()> {
22746            decoder.debug_check_bounds::<Self>(offset);
22747            // Verify that padding bytes are zero.
22748            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
22749            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22750            let mask = 0xffffffff00000000u64;
22751            let maskedval = padval & mask;
22752            if maskedval != 0 {
22753                return Err(fidl::Error::NonZeroPadding {
22754                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
22755                });
22756            }
22757            fidl::decode!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.name, decoder, offset + 0, _depth)?;
22758            fidl::decode!(
22759                ExtendedAttributeValue,
22760                fidl::encoding::DefaultFuchsiaResourceDialect,
22761                &mut self.value,
22762                decoder,
22763                offset + 16,
22764                _depth
22765            )?;
22766            fidl::decode!(
22767                SetExtendedAttributeMode,
22768                fidl::encoding::DefaultFuchsiaResourceDialect,
22769                &mut self.mode,
22770                decoder,
22771                offset + 32,
22772                _depth
22773            )?;
22774            Ok(())
22775        }
22776    }
22777
22778    impl ConnectionInfo {
22779        #[inline(always)]
22780        fn max_ordinal_present(&self) -> u64 {
22781            if let Some(_) = self.rights {
22782                return 1;
22783            }
22784            0
22785        }
22786    }
22787
22788    impl fidl::encoding::ResourceTypeMarker for ConnectionInfo {
22789        type Borrowed<'a> = &'a mut Self;
22790        fn take_or_borrow<'a>(
22791            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22792        ) -> Self::Borrowed<'a> {
22793            value
22794        }
22795    }
22796
22797    unsafe impl fidl::encoding::TypeMarker for ConnectionInfo {
22798        type Owned = Self;
22799
22800        #[inline(always)]
22801        fn inline_align(_context: fidl::encoding::Context) -> usize {
22802            8
22803        }
22804
22805        #[inline(always)]
22806        fn inline_size(_context: fidl::encoding::Context) -> usize {
22807            16
22808        }
22809    }
22810
22811    unsafe impl
22812        fidl::encoding::Encode<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
22813        for &mut ConnectionInfo
22814    {
22815        unsafe fn encode(
22816            self,
22817            encoder: &mut fidl::encoding::Encoder<
22818                '_,
22819                fidl::encoding::DefaultFuchsiaResourceDialect,
22820            >,
22821            offset: usize,
22822            mut depth: fidl::encoding::Depth,
22823        ) -> fidl::Result<()> {
22824            encoder.debug_check_bounds::<ConnectionInfo>(offset);
22825            // Vector header
22826            let max_ordinal: u64 = self.max_ordinal_present();
22827            encoder.write_num(max_ordinal, offset);
22828            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
22829            // Calling encoder.out_of_line_offset(0) is not allowed.
22830            if max_ordinal == 0 {
22831                return Ok(());
22832            }
22833            depth.increment()?;
22834            let envelope_size = 8;
22835            let bytes_len = max_ordinal as usize * envelope_size;
22836            #[allow(unused_variables)]
22837            let offset = encoder.out_of_line_offset(bytes_len);
22838            let mut _prev_end_offset: usize = 0;
22839            if 1 > max_ordinal {
22840                return Ok(());
22841            }
22842
22843            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
22844            // are envelope_size bytes.
22845            let cur_offset: usize = (1 - 1) * envelope_size;
22846
22847            // Zero reserved fields.
22848            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22849
22850            // Safety:
22851            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
22852            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
22853            //   envelope_size bytes, there is always sufficient room.
22854            fidl::encoding::encode_in_envelope_optional::<
22855                Operations,
22856                fidl::encoding::DefaultFuchsiaResourceDialect,
22857            >(
22858                self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
22859                encoder,
22860                offset + cur_offset,
22861                depth,
22862            )?;
22863
22864            _prev_end_offset = cur_offset + envelope_size;
22865
22866            Ok(())
22867        }
22868    }
22869
22870    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22871        for ConnectionInfo
22872    {
22873        #[inline(always)]
22874        fn new_empty() -> Self {
22875            Self::default()
22876        }
22877
22878        unsafe fn decode(
22879            &mut self,
22880            decoder: &mut fidl::encoding::Decoder<
22881                '_,
22882                fidl::encoding::DefaultFuchsiaResourceDialect,
22883            >,
22884            offset: usize,
22885            mut depth: fidl::encoding::Depth,
22886        ) -> fidl::Result<()> {
22887            decoder.debug_check_bounds::<Self>(offset);
22888            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22889                None => return Err(fidl::Error::NotNullable),
22890                Some(len) => len,
22891            };
22892            // Calling decoder.out_of_line_offset(0) is not allowed.
22893            if len == 0 {
22894                return Ok(());
22895            };
22896            depth.increment()?;
22897            let envelope_size = 8;
22898            let bytes_len = len * envelope_size;
22899            let offset = decoder.out_of_line_offset(bytes_len)?;
22900            // Decode the envelope for each type.
22901            let mut _next_ordinal_to_read = 0;
22902            let mut next_offset = offset;
22903            let end_offset = offset + bytes_len;
22904            _next_ordinal_to_read += 1;
22905            if next_offset >= end_offset {
22906                return Ok(());
22907            }
22908
22909            // Decode unknown envelopes for gaps in ordinals.
22910            while _next_ordinal_to_read < 1 {
22911                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22912                _next_ordinal_to_read += 1;
22913                next_offset += envelope_size;
22914            }
22915
22916            let next_out_of_line = decoder.next_out_of_line();
22917            let handles_before = decoder.remaining_handles();
22918            if let Some((inlined, num_bytes, num_handles)) =
22919                fidl::encoding::decode_envelope_header(decoder, next_offset)?
22920            {
22921                let member_inline_size =
22922                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22923                if inlined != (member_inline_size <= 4) {
22924                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
22925                }
22926                let inner_offset;
22927                let mut inner_depth = depth.clone();
22928                if inlined {
22929                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22930                    inner_offset = next_offset;
22931                } else {
22932                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22933                    inner_depth.increment()?;
22934                }
22935                let val_ref = self.rights.get_or_insert_with(|| {
22936                    fidl::new_empty!(Operations, fidl::encoding::DefaultFuchsiaResourceDialect)
22937                });
22938                fidl::decode!(
22939                    Operations,
22940                    fidl::encoding::DefaultFuchsiaResourceDialect,
22941                    val_ref,
22942                    decoder,
22943                    inner_offset,
22944                    inner_depth
22945                )?;
22946                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22947                {
22948                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
22949                }
22950                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22951                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22952                }
22953            }
22954
22955            next_offset += envelope_size;
22956
22957            // Decode the remaining unknown envelopes.
22958            while next_offset < end_offset {
22959                _next_ordinal_to_read += 1;
22960                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22961                next_offset += envelope_size;
22962            }
22963
22964            Ok(())
22965        }
22966    }
22967
22968    impl FileInfo {
22969        #[inline(always)]
22970        fn max_ordinal_present(&self) -> u64 {
22971            if let Some(_) = self.attributes {
22972                return 4;
22973            }
22974            if let Some(_) = self.stream {
22975                return 3;
22976            }
22977            if let Some(_) = self.observer {
22978                return 2;
22979            }
22980            if let Some(_) = self.is_append {
22981                return 1;
22982            }
22983            0
22984        }
22985    }
22986
22987    impl fidl::encoding::ResourceTypeMarker for FileInfo {
22988        type Borrowed<'a> = &'a mut Self;
22989        fn take_or_borrow<'a>(
22990            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22991        ) -> Self::Borrowed<'a> {
22992            value
22993        }
22994    }
22995
22996    unsafe impl fidl::encoding::TypeMarker for FileInfo {
22997        type Owned = Self;
22998
22999        #[inline(always)]
23000        fn inline_align(_context: fidl::encoding::Context) -> usize {
23001            8
23002        }
23003
23004        #[inline(always)]
23005        fn inline_size(_context: fidl::encoding::Context) -> usize {
23006            16
23007        }
23008    }
23009
23010    unsafe impl fidl::encoding::Encode<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
23011        for &mut FileInfo
23012    {
23013        unsafe fn encode(
23014            self,
23015            encoder: &mut fidl::encoding::Encoder<
23016                '_,
23017                fidl::encoding::DefaultFuchsiaResourceDialect,
23018            >,
23019            offset: usize,
23020            mut depth: fidl::encoding::Depth,
23021        ) -> fidl::Result<()> {
23022            encoder.debug_check_bounds::<FileInfo>(offset);
23023            // Vector header
23024            let max_ordinal: u64 = self.max_ordinal_present();
23025            encoder.write_num(max_ordinal, offset);
23026            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23027            // Calling encoder.out_of_line_offset(0) is not allowed.
23028            if max_ordinal == 0 {
23029                return Ok(());
23030            }
23031            depth.increment()?;
23032            let envelope_size = 8;
23033            let bytes_len = max_ordinal as usize * envelope_size;
23034            #[allow(unused_variables)]
23035            let offset = encoder.out_of_line_offset(bytes_len);
23036            let mut _prev_end_offset: usize = 0;
23037            if 1 > max_ordinal {
23038                return Ok(());
23039            }
23040
23041            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23042            // are envelope_size bytes.
23043            let cur_offset: usize = (1 - 1) * envelope_size;
23044
23045            // Zero reserved fields.
23046            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23047
23048            // Safety:
23049            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23050            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23051            //   envelope_size bytes, there is always sufficient room.
23052            fidl::encoding::encode_in_envelope_optional::<
23053                bool,
23054                fidl::encoding::DefaultFuchsiaResourceDialect,
23055            >(
23056                self.is_append.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
23057                encoder,
23058                offset + cur_offset,
23059                depth,
23060            )?;
23061
23062            _prev_end_offset = cur_offset + envelope_size;
23063            if 2 > max_ordinal {
23064                return Ok(());
23065            }
23066
23067            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23068            // are envelope_size bytes.
23069            let cur_offset: usize = (2 - 1) * envelope_size;
23070
23071            // Zero reserved fields.
23072            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23073
23074            // Safety:
23075            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23076            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23077            //   envelope_size bytes, there is always sufficient room.
23078            fidl::encoding::encode_in_envelope_optional::<
23079                fidl::encoding::HandleType<
23080                    fidl::Event,
23081                    { fidl::ObjectType::EVENT.into_raw() },
23082                    2147483648,
23083                >,
23084                fidl::encoding::DefaultFuchsiaResourceDialect,
23085            >(
23086                self.observer.as_mut().map(
23087                    <fidl::encoding::HandleType<
23088                        fidl::Event,
23089                        { fidl::ObjectType::EVENT.into_raw() },
23090                        2147483648,
23091                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
23092                ),
23093                encoder,
23094                offset + cur_offset,
23095                depth,
23096            )?;
23097
23098            _prev_end_offset = cur_offset + envelope_size;
23099            if 3 > max_ordinal {
23100                return Ok(());
23101            }
23102
23103            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23104            // are envelope_size bytes.
23105            let cur_offset: usize = (3 - 1) * envelope_size;
23106
23107            // Zero reserved fields.
23108            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23109
23110            // Safety:
23111            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23112            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23113            //   envelope_size bytes, there is always sufficient room.
23114            fidl::encoding::encode_in_envelope_optional::<
23115                fidl::encoding::HandleType<
23116                    fidl::Stream,
23117                    { fidl::ObjectType::STREAM.into_raw() },
23118                    2147483648,
23119                >,
23120                fidl::encoding::DefaultFuchsiaResourceDialect,
23121            >(
23122                self.stream.as_mut().map(
23123                    <fidl::encoding::HandleType<
23124                        fidl::Stream,
23125                        { fidl::ObjectType::STREAM.into_raw() },
23126                        2147483648,
23127                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
23128                ),
23129                encoder,
23130                offset + cur_offset,
23131                depth,
23132            )?;
23133
23134            _prev_end_offset = cur_offset + envelope_size;
23135            if 4 > max_ordinal {
23136                return Ok(());
23137            }
23138
23139            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23140            // are envelope_size bytes.
23141            let cur_offset: usize = (4 - 1) * envelope_size;
23142
23143            // Zero reserved fields.
23144            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23145
23146            // Safety:
23147            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23148            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23149            //   envelope_size bytes, there is always sufficient room.
23150            fidl::encoding::encode_in_envelope_optional::<
23151                NodeAttributes2,
23152                fidl::encoding::DefaultFuchsiaResourceDialect,
23153            >(
23154                self.attributes
23155                    .as_ref()
23156                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
23157                encoder,
23158                offset + cur_offset,
23159                depth,
23160            )?;
23161
23162            _prev_end_offset = cur_offset + envelope_size;
23163
23164            Ok(())
23165        }
23166    }
23167
23168    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileInfo {
23169        #[inline(always)]
23170        fn new_empty() -> Self {
23171            Self::default()
23172        }
23173
23174        unsafe fn decode(
23175            &mut self,
23176            decoder: &mut fidl::encoding::Decoder<
23177                '_,
23178                fidl::encoding::DefaultFuchsiaResourceDialect,
23179            >,
23180            offset: usize,
23181            mut depth: fidl::encoding::Depth,
23182        ) -> fidl::Result<()> {
23183            decoder.debug_check_bounds::<Self>(offset);
23184            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23185                None => return Err(fidl::Error::NotNullable),
23186                Some(len) => len,
23187            };
23188            // Calling decoder.out_of_line_offset(0) is not allowed.
23189            if len == 0 {
23190                return Ok(());
23191            };
23192            depth.increment()?;
23193            let envelope_size = 8;
23194            let bytes_len = len * envelope_size;
23195            let offset = decoder.out_of_line_offset(bytes_len)?;
23196            // Decode the envelope for each type.
23197            let mut _next_ordinal_to_read = 0;
23198            let mut next_offset = offset;
23199            let end_offset = offset + bytes_len;
23200            _next_ordinal_to_read += 1;
23201            if next_offset >= end_offset {
23202                return Ok(());
23203            }
23204
23205            // Decode unknown envelopes for gaps in ordinals.
23206            while _next_ordinal_to_read < 1 {
23207                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23208                _next_ordinal_to_read += 1;
23209                next_offset += envelope_size;
23210            }
23211
23212            let next_out_of_line = decoder.next_out_of_line();
23213            let handles_before = decoder.remaining_handles();
23214            if let Some((inlined, num_bytes, num_handles)) =
23215                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23216            {
23217                let member_inline_size =
23218                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23219                if inlined != (member_inline_size <= 4) {
23220                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23221                }
23222                let inner_offset;
23223                let mut inner_depth = depth.clone();
23224                if inlined {
23225                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23226                    inner_offset = next_offset;
23227                } else {
23228                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23229                    inner_depth.increment()?;
23230                }
23231                let val_ref = self.is_append.get_or_insert_with(|| {
23232                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
23233                });
23234                fidl::decode!(
23235                    bool,
23236                    fidl::encoding::DefaultFuchsiaResourceDialect,
23237                    val_ref,
23238                    decoder,
23239                    inner_offset,
23240                    inner_depth
23241                )?;
23242                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23243                {
23244                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23245                }
23246                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23247                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23248                }
23249            }
23250
23251            next_offset += envelope_size;
23252            _next_ordinal_to_read += 1;
23253            if next_offset >= end_offset {
23254                return Ok(());
23255            }
23256
23257            // Decode unknown envelopes for gaps in ordinals.
23258            while _next_ordinal_to_read < 2 {
23259                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23260                _next_ordinal_to_read += 1;
23261                next_offset += envelope_size;
23262            }
23263
23264            let next_out_of_line = decoder.next_out_of_line();
23265            let handles_before = decoder.remaining_handles();
23266            if let Some((inlined, num_bytes, num_handles)) =
23267                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23268            {
23269                let member_inline_size = <fidl::encoding::HandleType<
23270                    fidl::Event,
23271                    { fidl::ObjectType::EVENT.into_raw() },
23272                    2147483648,
23273                > as fidl::encoding::TypeMarker>::inline_size(
23274                    decoder.context
23275                );
23276                if inlined != (member_inline_size <= 4) {
23277                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23278                }
23279                let inner_offset;
23280                let mut inner_depth = depth.clone();
23281                if inlined {
23282                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23283                    inner_offset = next_offset;
23284                } else {
23285                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23286                    inner_depth.increment()?;
23287                }
23288                let val_ref =
23289                self.observer.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
23290                fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
23291                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23292                {
23293                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23294                }
23295                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23296                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23297                }
23298            }
23299
23300            next_offset += envelope_size;
23301            _next_ordinal_to_read += 1;
23302            if next_offset >= end_offset {
23303                return Ok(());
23304            }
23305
23306            // Decode unknown envelopes for gaps in ordinals.
23307            while _next_ordinal_to_read < 3 {
23308                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23309                _next_ordinal_to_read += 1;
23310                next_offset += envelope_size;
23311            }
23312
23313            let next_out_of_line = decoder.next_out_of_line();
23314            let handles_before = decoder.remaining_handles();
23315            if let Some((inlined, num_bytes, num_handles)) =
23316                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23317            {
23318                let member_inline_size = <fidl::encoding::HandleType<
23319                    fidl::Stream,
23320                    { fidl::ObjectType::STREAM.into_raw() },
23321                    2147483648,
23322                > as fidl::encoding::TypeMarker>::inline_size(
23323                    decoder.context
23324                );
23325                if inlined != (member_inline_size <= 4) {
23326                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23327                }
23328                let inner_offset;
23329                let mut inner_depth = depth.clone();
23330                if inlined {
23331                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23332                    inner_offset = next_offset;
23333                } else {
23334                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23335                    inner_depth.increment()?;
23336                }
23337                let val_ref =
23338                self.stream.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
23339                fidl::decode!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
23340                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23341                {
23342                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23343                }
23344                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23345                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23346                }
23347            }
23348
23349            next_offset += envelope_size;
23350            _next_ordinal_to_read += 1;
23351            if next_offset >= end_offset {
23352                return Ok(());
23353            }
23354
23355            // Decode unknown envelopes for gaps in ordinals.
23356            while _next_ordinal_to_read < 4 {
23357                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23358                _next_ordinal_to_read += 1;
23359                next_offset += envelope_size;
23360            }
23361
23362            let next_out_of_line = decoder.next_out_of_line();
23363            let handles_before = decoder.remaining_handles();
23364            if let Some((inlined, num_bytes, num_handles)) =
23365                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23366            {
23367                let member_inline_size =
23368                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23369                if inlined != (member_inline_size <= 4) {
23370                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23371                }
23372                let inner_offset;
23373                let mut inner_depth = depth.clone();
23374                if inlined {
23375                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23376                    inner_offset = next_offset;
23377                } else {
23378                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23379                    inner_depth.increment()?;
23380                }
23381                let val_ref = self.attributes.get_or_insert_with(|| {
23382                    fidl::new_empty!(NodeAttributes2, fidl::encoding::DefaultFuchsiaResourceDialect)
23383                });
23384                fidl::decode!(
23385                    NodeAttributes2,
23386                    fidl::encoding::DefaultFuchsiaResourceDialect,
23387                    val_ref,
23388                    decoder,
23389                    inner_offset,
23390                    inner_depth
23391                )?;
23392                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23393                {
23394                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23395                }
23396                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23397                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23398                }
23399            }
23400
23401            next_offset += envelope_size;
23402
23403            // Decode the remaining unknown envelopes.
23404            while next_offset < end_offset {
23405                _next_ordinal_to_read += 1;
23406                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23407                next_offset += envelope_size;
23408            }
23409
23410            Ok(())
23411        }
23412    }
23413
23414    impl fidl::encoding::ResourceTypeMarker for ExtendedAttributeValue {
23415        type Borrowed<'a> = &'a mut Self;
23416        fn take_or_borrow<'a>(
23417            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23418        ) -> Self::Borrowed<'a> {
23419            value
23420        }
23421    }
23422
23423    unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeValue {
23424        type Owned = Self;
23425
23426        #[inline(always)]
23427        fn inline_align(_context: fidl::encoding::Context) -> usize {
23428            8
23429        }
23430
23431        #[inline(always)]
23432        fn inline_size(_context: fidl::encoding::Context) -> usize {
23433            16
23434        }
23435    }
23436
23437    unsafe impl
23438        fidl::encoding::Encode<
23439            ExtendedAttributeValue,
23440            fidl::encoding::DefaultFuchsiaResourceDialect,
23441        > for &mut ExtendedAttributeValue
23442    {
23443        #[inline]
23444        unsafe fn encode(
23445            self,
23446            encoder: &mut fidl::encoding::Encoder<
23447                '_,
23448                fidl::encoding::DefaultFuchsiaResourceDialect,
23449            >,
23450            offset: usize,
23451            _depth: fidl::encoding::Depth,
23452        ) -> fidl::Result<()> {
23453            encoder.debug_check_bounds::<ExtendedAttributeValue>(offset);
23454            encoder.write_num::<u64>(self.ordinal(), offset);
23455            match self {
23456                ExtendedAttributeValue::Bytes(ref val) => fidl::encoding::encode_in_envelope::<
23457                    fidl::encoding::Vector<u8, 32768>,
23458                    fidl::encoding::DefaultFuchsiaResourceDialect,
23459                >(
23460                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::ValueTypeMarker>::borrow(
23461                        val,
23462                    ),
23463                    encoder,
23464                    offset + 8,
23465                    _depth,
23466                ),
23467                ExtendedAttributeValue::Buffer(ref mut val) => {
23468                    fidl::encoding::encode_in_envelope::<
23469                        fidl::encoding::HandleType<
23470                            fidl::Vmo,
23471                            { fidl::ObjectType::VMO.into_raw() },
23472                            2147483648,
23473                        >,
23474                        fidl::encoding::DefaultFuchsiaResourceDialect,
23475                    >(
23476                        <fidl::encoding::HandleType<
23477                            fidl::Vmo,
23478                            { fidl::ObjectType::VMO.into_raw() },
23479                            2147483648,
23480                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
23481                            val
23482                        ),
23483                        encoder,
23484                        offset + 8,
23485                        _depth,
23486                    )
23487                }
23488                ExtendedAttributeValue::__SourceBreaking { .. } => {
23489                    Err(fidl::Error::UnknownUnionTag)
23490                }
23491            }
23492        }
23493    }
23494
23495    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23496        for ExtendedAttributeValue
23497    {
23498        #[inline(always)]
23499        fn new_empty() -> Self {
23500            Self::__SourceBreaking { unknown_ordinal: 0 }
23501        }
23502
23503        #[inline]
23504        unsafe fn decode(
23505            &mut self,
23506            decoder: &mut fidl::encoding::Decoder<
23507                '_,
23508                fidl::encoding::DefaultFuchsiaResourceDialect,
23509            >,
23510            offset: usize,
23511            mut depth: fidl::encoding::Depth,
23512        ) -> fidl::Result<()> {
23513            decoder.debug_check_bounds::<Self>(offset);
23514            #[allow(unused_variables)]
23515            let next_out_of_line = decoder.next_out_of_line();
23516            let handles_before = decoder.remaining_handles();
23517            let (ordinal, inlined, num_bytes, num_handles) =
23518                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23519
23520            let member_inline_size = match ordinal {
23521                1 => {
23522                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::TypeMarker>::inline_size(
23523                        decoder.context,
23524                    )
23525                }
23526                2 => <fidl::encoding::HandleType<
23527                    fidl::Vmo,
23528                    { fidl::ObjectType::VMO.into_raw() },
23529                    2147483648,
23530                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23531                0 => return Err(fidl::Error::UnknownUnionTag),
23532                _ => num_bytes as usize,
23533            };
23534
23535            if inlined != (member_inline_size <= 4) {
23536                return Err(fidl::Error::InvalidInlineBitInEnvelope);
23537            }
23538            let _inner_offset;
23539            if inlined {
23540                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23541                _inner_offset = offset + 8;
23542            } else {
23543                depth.increment()?;
23544                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23545            }
23546            match ordinal {
23547                1 => {
23548                    #[allow(irrefutable_let_patterns)]
23549                    if let ExtendedAttributeValue::Bytes(_) = self {
23550                        // Do nothing, read the value into the object
23551                    } else {
23552                        // Initialize `self` to the right variant
23553                        *self = ExtendedAttributeValue::Bytes(
23554                            fidl::new_empty!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect),
23555                        );
23556                    }
23557                    #[allow(irrefutable_let_patterns)]
23558                    if let ExtendedAttributeValue::Bytes(ref mut val) = self {
23559                        fidl::decode!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
23560                    } else {
23561                        unreachable!()
23562                    }
23563                }
23564                2 => {
23565                    #[allow(irrefutable_let_patterns)]
23566                    if let ExtendedAttributeValue::Buffer(_) = self {
23567                        // Do nothing, read the value into the object
23568                    } else {
23569                        // Initialize `self` to the right variant
23570                        *self = ExtendedAttributeValue::Buffer(
23571                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
23572                        );
23573                    }
23574                    #[allow(irrefutable_let_patterns)]
23575                    if let ExtendedAttributeValue::Buffer(ref mut val) = self {
23576                        fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
23577                    } else {
23578                        unreachable!()
23579                    }
23580                }
23581                #[allow(deprecated)]
23582                ordinal => {
23583                    for _ in 0..num_handles {
23584                        decoder.drop_next_handle()?;
23585                    }
23586                    *self = ExtendedAttributeValue::__SourceBreaking { unknown_ordinal: ordinal };
23587                }
23588            }
23589            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23590                return Err(fidl::Error::InvalidNumBytesInEnvelope);
23591            }
23592            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23593                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23594            }
23595            Ok(())
23596        }
23597    }
23598
23599    impl fidl::encoding::ResourceTypeMarker for NodeInfoDeprecated {
23600        type Borrowed<'a> = &'a mut Self;
23601        fn take_or_borrow<'a>(
23602            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23603        ) -> Self::Borrowed<'a> {
23604            value
23605        }
23606    }
23607
23608    unsafe impl fidl::encoding::TypeMarker for NodeInfoDeprecated {
23609        type Owned = Self;
23610
23611        #[inline(always)]
23612        fn inline_align(_context: fidl::encoding::Context) -> usize {
23613            8
23614        }
23615
23616        #[inline(always)]
23617        fn inline_size(_context: fidl::encoding::Context) -> usize {
23618            16
23619        }
23620    }
23621
23622    unsafe impl
23623        fidl::encoding::Encode<NodeInfoDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>
23624        for &mut NodeInfoDeprecated
23625    {
23626        #[inline]
23627        unsafe fn encode(
23628            self,
23629            encoder: &mut fidl::encoding::Encoder<
23630                '_,
23631                fidl::encoding::DefaultFuchsiaResourceDialect,
23632            >,
23633            offset: usize,
23634            _depth: fidl::encoding::Depth,
23635        ) -> fidl::Result<()> {
23636            encoder.debug_check_bounds::<NodeInfoDeprecated>(offset);
23637            encoder.write_num::<u64>(self.ordinal(), offset);
23638            match self {
23639                NodeInfoDeprecated::Service(ref val) => fidl::encoding::encode_in_envelope::<
23640                    Service,
23641                    fidl::encoding::DefaultFuchsiaResourceDialect,
23642                >(
23643                    <Service as fidl::encoding::ValueTypeMarker>::borrow(val),
23644                    encoder,
23645                    offset + 8,
23646                    _depth,
23647                ),
23648                NodeInfoDeprecated::File(ref mut val) => fidl::encoding::encode_in_envelope::<
23649                    FileObject,
23650                    fidl::encoding::DefaultFuchsiaResourceDialect,
23651                >(
23652                    <FileObject as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
23653                    encoder,
23654                    offset + 8,
23655                    _depth,
23656                ),
23657                NodeInfoDeprecated::Directory(ref val) => fidl::encoding::encode_in_envelope::<
23658                    DirectoryObject,
23659                    fidl::encoding::DefaultFuchsiaResourceDialect,
23660                >(
23661                    <DirectoryObject as fidl::encoding::ValueTypeMarker>::borrow(val),
23662                    encoder,
23663                    offset + 8,
23664                    _depth,
23665                ),
23666                NodeInfoDeprecated::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
23667                    SymlinkObject,
23668                    fidl::encoding::DefaultFuchsiaResourceDialect,
23669                >(
23670                    <SymlinkObject as fidl::encoding::ValueTypeMarker>::borrow(val),
23671                    encoder,
23672                    offset + 8,
23673                    _depth,
23674                ),
23675            }
23676        }
23677    }
23678
23679    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23680        for NodeInfoDeprecated
23681    {
23682        #[inline(always)]
23683        fn new_empty() -> Self {
23684            Self::Service(fidl::new_empty!(Service, fidl::encoding::DefaultFuchsiaResourceDialect))
23685        }
23686
23687        #[inline]
23688        unsafe fn decode(
23689            &mut self,
23690            decoder: &mut fidl::encoding::Decoder<
23691                '_,
23692                fidl::encoding::DefaultFuchsiaResourceDialect,
23693            >,
23694            offset: usize,
23695            mut depth: fidl::encoding::Depth,
23696        ) -> fidl::Result<()> {
23697            decoder.debug_check_bounds::<Self>(offset);
23698            #[allow(unused_variables)]
23699            let next_out_of_line = decoder.next_out_of_line();
23700            let handles_before = decoder.remaining_handles();
23701            let (ordinal, inlined, num_bytes, num_handles) =
23702                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23703
23704            let member_inline_size = match ordinal {
23705                1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23706                2 => <FileObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23707                3 => <DirectoryObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23708                4 => <SymlinkObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23709                _ => return Err(fidl::Error::UnknownUnionTag),
23710            };
23711
23712            if inlined != (member_inline_size <= 4) {
23713                return Err(fidl::Error::InvalidInlineBitInEnvelope);
23714            }
23715            let _inner_offset;
23716            if inlined {
23717                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23718                _inner_offset = offset + 8;
23719            } else {
23720                depth.increment()?;
23721                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23722            }
23723            match ordinal {
23724                1 => {
23725                    #[allow(irrefutable_let_patterns)]
23726                    if let NodeInfoDeprecated::Service(_) = self {
23727                        // Do nothing, read the value into the object
23728                    } else {
23729                        // Initialize `self` to the right variant
23730                        *self = NodeInfoDeprecated::Service(fidl::new_empty!(
23731                            Service,
23732                            fidl::encoding::DefaultFuchsiaResourceDialect
23733                        ));
23734                    }
23735                    #[allow(irrefutable_let_patterns)]
23736                    if let NodeInfoDeprecated::Service(ref mut val) = self {
23737                        fidl::decode!(
23738                            Service,
23739                            fidl::encoding::DefaultFuchsiaResourceDialect,
23740                            val,
23741                            decoder,
23742                            _inner_offset,
23743                            depth
23744                        )?;
23745                    } else {
23746                        unreachable!()
23747                    }
23748                }
23749                2 => {
23750                    #[allow(irrefutable_let_patterns)]
23751                    if let NodeInfoDeprecated::File(_) = self {
23752                        // Do nothing, read the value into the object
23753                    } else {
23754                        // Initialize `self` to the right variant
23755                        *self = NodeInfoDeprecated::File(fidl::new_empty!(
23756                            FileObject,
23757                            fidl::encoding::DefaultFuchsiaResourceDialect
23758                        ));
23759                    }
23760                    #[allow(irrefutable_let_patterns)]
23761                    if let NodeInfoDeprecated::File(ref mut val) = self {
23762                        fidl::decode!(
23763                            FileObject,
23764                            fidl::encoding::DefaultFuchsiaResourceDialect,
23765                            val,
23766                            decoder,
23767                            _inner_offset,
23768                            depth
23769                        )?;
23770                    } else {
23771                        unreachable!()
23772                    }
23773                }
23774                3 => {
23775                    #[allow(irrefutable_let_patterns)]
23776                    if let NodeInfoDeprecated::Directory(_) = self {
23777                        // Do nothing, read the value into the object
23778                    } else {
23779                        // Initialize `self` to the right variant
23780                        *self = NodeInfoDeprecated::Directory(fidl::new_empty!(
23781                            DirectoryObject,
23782                            fidl::encoding::DefaultFuchsiaResourceDialect
23783                        ));
23784                    }
23785                    #[allow(irrefutable_let_patterns)]
23786                    if let NodeInfoDeprecated::Directory(ref mut val) = self {
23787                        fidl::decode!(
23788                            DirectoryObject,
23789                            fidl::encoding::DefaultFuchsiaResourceDialect,
23790                            val,
23791                            decoder,
23792                            _inner_offset,
23793                            depth
23794                        )?;
23795                    } else {
23796                        unreachable!()
23797                    }
23798                }
23799                4 => {
23800                    #[allow(irrefutable_let_patterns)]
23801                    if let NodeInfoDeprecated::Symlink(_) = self {
23802                        // Do nothing, read the value into the object
23803                    } else {
23804                        // Initialize `self` to the right variant
23805                        *self = NodeInfoDeprecated::Symlink(fidl::new_empty!(
23806                            SymlinkObject,
23807                            fidl::encoding::DefaultFuchsiaResourceDialect
23808                        ));
23809                    }
23810                    #[allow(irrefutable_let_patterns)]
23811                    if let NodeInfoDeprecated::Symlink(ref mut val) = self {
23812                        fidl::decode!(
23813                            SymlinkObject,
23814                            fidl::encoding::DefaultFuchsiaResourceDialect,
23815                            val,
23816                            decoder,
23817                            _inner_offset,
23818                            depth
23819                        )?;
23820                    } else {
23821                        unreachable!()
23822                    }
23823                }
23824                ordinal => panic!("unexpected ordinal {:?}", ordinal),
23825            }
23826            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23827                return Err(fidl::Error::InvalidNumBytesInEnvelope);
23828            }
23829            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23830                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23831            }
23832            Ok(())
23833        }
23834    }
23835
23836    impl fidl::encoding::ResourceTypeMarker for Representation {
23837        type Borrowed<'a> = &'a mut Self;
23838        fn take_or_borrow<'a>(
23839            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23840        ) -> Self::Borrowed<'a> {
23841            value
23842        }
23843    }
23844
23845    unsafe impl fidl::encoding::TypeMarker for Representation {
23846        type Owned = Self;
23847
23848        #[inline(always)]
23849        fn inline_align(_context: fidl::encoding::Context) -> usize {
23850            8
23851        }
23852
23853        #[inline(always)]
23854        fn inline_size(_context: fidl::encoding::Context) -> usize {
23855            16
23856        }
23857    }
23858
23859    unsafe impl
23860        fidl::encoding::Encode<Representation, fidl::encoding::DefaultFuchsiaResourceDialect>
23861        for &mut Representation
23862    {
23863        #[inline]
23864        unsafe fn encode(
23865            self,
23866            encoder: &mut fidl::encoding::Encoder<
23867                '_,
23868                fidl::encoding::DefaultFuchsiaResourceDialect,
23869            >,
23870            offset: usize,
23871            _depth: fidl::encoding::Depth,
23872        ) -> fidl::Result<()> {
23873            encoder.debug_check_bounds::<Representation>(offset);
23874            encoder.write_num::<u64>(self.ordinal(), offset);
23875            match self {
23876                Representation::Node(ref val) => fidl::encoding::encode_in_envelope::<
23877                    NodeInfo,
23878                    fidl::encoding::DefaultFuchsiaResourceDialect,
23879                >(
23880                    <NodeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
23881                    encoder,
23882                    offset + 8,
23883                    _depth,
23884                ),
23885                Representation::Directory(ref val) => fidl::encoding::encode_in_envelope::<
23886                    DirectoryInfo,
23887                    fidl::encoding::DefaultFuchsiaResourceDialect,
23888                >(
23889                    <DirectoryInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
23890                    encoder,
23891                    offset + 8,
23892                    _depth,
23893                ),
23894                Representation::File(ref mut val) => fidl::encoding::encode_in_envelope::<
23895                    FileInfo,
23896                    fidl::encoding::DefaultFuchsiaResourceDialect,
23897                >(
23898                    <FileInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
23899                    encoder,
23900                    offset + 8,
23901                    _depth,
23902                ),
23903                Representation::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
23904                    SymlinkInfo,
23905                    fidl::encoding::DefaultFuchsiaResourceDialect,
23906                >(
23907                    <SymlinkInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
23908                    encoder,
23909                    offset + 8,
23910                    _depth,
23911                ),
23912                Representation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
23913            }
23914        }
23915    }
23916
23917    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23918        for Representation
23919    {
23920        #[inline(always)]
23921        fn new_empty() -> Self {
23922            Self::__SourceBreaking { unknown_ordinal: 0 }
23923        }
23924
23925        #[inline]
23926        unsafe fn decode(
23927            &mut self,
23928            decoder: &mut fidl::encoding::Decoder<
23929                '_,
23930                fidl::encoding::DefaultFuchsiaResourceDialect,
23931            >,
23932            offset: usize,
23933            mut depth: fidl::encoding::Depth,
23934        ) -> fidl::Result<()> {
23935            decoder.debug_check_bounds::<Self>(offset);
23936            #[allow(unused_variables)]
23937            let next_out_of_line = decoder.next_out_of_line();
23938            let handles_before = decoder.remaining_handles();
23939            let (ordinal, inlined, num_bytes, num_handles) =
23940                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23941
23942            let member_inline_size = match ordinal {
23943                1 => <NodeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23944                2 => <DirectoryInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23945                3 => <FileInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23946                4 => <SymlinkInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23947                0 => return Err(fidl::Error::UnknownUnionTag),
23948                _ => num_bytes as usize,
23949            };
23950
23951            if inlined != (member_inline_size <= 4) {
23952                return Err(fidl::Error::InvalidInlineBitInEnvelope);
23953            }
23954            let _inner_offset;
23955            if inlined {
23956                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23957                _inner_offset = offset + 8;
23958            } else {
23959                depth.increment()?;
23960                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23961            }
23962            match ordinal {
23963                1 => {
23964                    #[allow(irrefutable_let_patterns)]
23965                    if let Representation::Node(_) = self {
23966                        // Do nothing, read the value into the object
23967                    } else {
23968                        // Initialize `self` to the right variant
23969                        *self = Representation::Node(fidl::new_empty!(
23970                            NodeInfo,
23971                            fidl::encoding::DefaultFuchsiaResourceDialect
23972                        ));
23973                    }
23974                    #[allow(irrefutable_let_patterns)]
23975                    if let Representation::Node(ref mut val) = self {
23976                        fidl::decode!(
23977                            NodeInfo,
23978                            fidl::encoding::DefaultFuchsiaResourceDialect,
23979                            val,
23980                            decoder,
23981                            _inner_offset,
23982                            depth
23983                        )?;
23984                    } else {
23985                        unreachable!()
23986                    }
23987                }
23988                2 => {
23989                    #[allow(irrefutable_let_patterns)]
23990                    if let Representation::Directory(_) = self {
23991                        // Do nothing, read the value into the object
23992                    } else {
23993                        // Initialize `self` to the right variant
23994                        *self = Representation::Directory(fidl::new_empty!(
23995                            DirectoryInfo,
23996                            fidl::encoding::DefaultFuchsiaResourceDialect
23997                        ));
23998                    }
23999                    #[allow(irrefutable_let_patterns)]
24000                    if let Representation::Directory(ref mut val) = self {
24001                        fidl::decode!(
24002                            DirectoryInfo,
24003                            fidl::encoding::DefaultFuchsiaResourceDialect,
24004                            val,
24005                            decoder,
24006                            _inner_offset,
24007                            depth
24008                        )?;
24009                    } else {
24010                        unreachable!()
24011                    }
24012                }
24013                3 => {
24014                    #[allow(irrefutable_let_patterns)]
24015                    if let Representation::File(_) = self {
24016                        // Do nothing, read the value into the object
24017                    } else {
24018                        // Initialize `self` to the right variant
24019                        *self = Representation::File(fidl::new_empty!(
24020                            FileInfo,
24021                            fidl::encoding::DefaultFuchsiaResourceDialect
24022                        ));
24023                    }
24024                    #[allow(irrefutable_let_patterns)]
24025                    if let Representation::File(ref mut val) = self {
24026                        fidl::decode!(
24027                            FileInfo,
24028                            fidl::encoding::DefaultFuchsiaResourceDialect,
24029                            val,
24030                            decoder,
24031                            _inner_offset,
24032                            depth
24033                        )?;
24034                    } else {
24035                        unreachable!()
24036                    }
24037                }
24038                4 => {
24039                    #[allow(irrefutable_let_patterns)]
24040                    if let Representation::Symlink(_) = self {
24041                        // Do nothing, read the value into the object
24042                    } else {
24043                        // Initialize `self` to the right variant
24044                        *self = Representation::Symlink(fidl::new_empty!(
24045                            SymlinkInfo,
24046                            fidl::encoding::DefaultFuchsiaResourceDialect
24047                        ));
24048                    }
24049                    #[allow(irrefutable_let_patterns)]
24050                    if let Representation::Symlink(ref mut val) = self {
24051                        fidl::decode!(
24052                            SymlinkInfo,
24053                            fidl::encoding::DefaultFuchsiaResourceDialect,
24054                            val,
24055                            decoder,
24056                            _inner_offset,
24057                            depth
24058                        )?;
24059                    } else {
24060                        unreachable!()
24061                    }
24062                }
24063                #[allow(deprecated)]
24064                ordinal => {
24065                    for _ in 0..num_handles {
24066                        decoder.drop_next_handle()?;
24067                    }
24068                    *self = Representation::__SourceBreaking { unknown_ordinal: ordinal };
24069                }
24070            }
24071            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24072                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24073            }
24074            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24075                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24076            }
24077            Ok(())
24078        }
24079    }
24080}