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
832    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
833        self.inner.shutdown_with_epitaph(status)
834    }
835
836    fn is_closed(&self) -> bool {
837        self.inner.channel().is_closed()
838    }
839    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
840        self.inner.channel().on_closed()
841    }
842
843    #[cfg(target_os = "fuchsia")]
844    fn signal_peer(
845        &self,
846        clear_mask: zx::Signals,
847        set_mask: zx::Signals,
848    ) -> Result<(), zx_status::Status> {
849        use fidl::Peered;
850        self.inner.channel().signal_peer(clear_mask, set_mask)
851    }
852}
853
854impl AdvisoryLockingControlHandle {}
855
856#[must_use = "FIDL methods require a response to be sent"]
857#[derive(Debug)]
858pub struct AdvisoryLockingAdvisoryLockResponder {
859    control_handle: std::mem::ManuallyDrop<AdvisoryLockingControlHandle>,
860    tx_id: u32,
861}
862
863/// Set the the channel to be shutdown (see [`AdvisoryLockingControlHandle::shutdown`])
864/// if the responder is dropped without sending a response, so that the client
865/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
866impl std::ops::Drop for AdvisoryLockingAdvisoryLockResponder {
867    fn drop(&mut self) {
868        self.control_handle.shutdown();
869        // Safety: drops once, never accessed again
870        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
871    }
872}
873
874impl fidl::endpoints::Responder for AdvisoryLockingAdvisoryLockResponder {
875    type ControlHandle = AdvisoryLockingControlHandle;
876
877    fn control_handle(&self) -> &AdvisoryLockingControlHandle {
878        &self.control_handle
879    }
880
881    fn drop_without_shutdown(mut self) {
882        // Safety: drops once, never accessed again due to mem::forget
883        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
884        // Prevent Drop from running (which would shut down the channel)
885        std::mem::forget(self);
886    }
887}
888
889impl AdvisoryLockingAdvisoryLockResponder {
890    /// Sends a response to the FIDL transaction.
891    ///
892    /// Sets the channel to shutdown if an error occurs.
893    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
894        let _result = self.send_raw(result);
895        if _result.is_err() {
896            self.control_handle.shutdown();
897        }
898        self.drop_without_shutdown();
899        _result
900    }
901
902    /// Similar to "send" but does not shutdown the channel if an error occurs.
903    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
904        let _result = self.send_raw(result);
905        self.drop_without_shutdown();
906        _result
907    }
908
909    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
910        self.control_handle
911            .inner
912            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
913                result,
914                self.tx_id,
915                0x6ee9c0ad53ec87aa,
916                fidl::encoding::DynamicFlags::empty(),
917            )
918    }
919}
920
921#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
922pub struct DirectoryMarker;
923
924impl fidl::endpoints::ProtocolMarker for DirectoryMarker {
925    type Proxy = DirectoryProxy;
926    type RequestStream = DirectoryRequestStream;
927    #[cfg(target_os = "fuchsia")]
928    type SynchronousProxy = DirectorySynchronousProxy;
929
930    const DEBUG_NAME: &'static str = "fuchsia.io.Directory";
931}
932impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryMarker {}
933pub type DirectoryUnlinkResult = Result<(), i32>;
934pub type DirectoryRenameResult = Result<(), i32>;
935pub type DirectoryCreateSymlinkResult = Result<(), i32>;
936
937pub trait DirectoryProxyInterface: Send + Sync {
938    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
939        + Send;
940    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
941    fn r#clone(
942        &self,
943        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
944    ) -> Result<(), fidl::Error>;
945    type CloseResponseFut: std::future::Future<
946            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
947        > + Send;
948    fn r#close(&self) -> Self::CloseResponseFut;
949    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
950    fn r#query(&self) -> Self::QueryResponseFut;
951    fn r#deprecated_clone(
952        &self,
953        flags: OpenFlags,
954        object: fidl::endpoints::ServerEnd<NodeMarker>,
955    ) -> Result<(), fidl::Error>;
956    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
957        + Send;
958    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
959    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
960    fn r#deprecated_set_attr(
961        &self,
962        flags: NodeAttributeFlags,
963        attributes: &NodeAttributes,
964    ) -> Self::DeprecatedSetAttrResponseFut;
965    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
966        + Send;
967    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
968    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
969        + Send;
970    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
971    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
972        + Send;
973    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
974    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
975        + Send;
976    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
977    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
978        + Send;
979    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
980    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
981        + Send;
982    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
983    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
984        + Send;
985    fn r#update_attributes(
986        &self,
987        payload: &MutableNodeAttributes,
988    ) -> Self::UpdateAttributesResponseFut;
989    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
990    fn r#sync(&self) -> Self::SyncResponseFut;
991    fn r#list_extended_attributes(
992        &self,
993        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
994    ) -> Result<(), fidl::Error>;
995    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
996        + Send;
997    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
998    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
999        + Send;
1000    fn r#set_extended_attribute(
1001        &self,
1002        name: &[u8],
1003        value: ExtendedAttributeValue,
1004        mode: SetExtendedAttributeMode,
1005    ) -> Self::SetExtendedAttributeResponseFut;
1006    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
1007        + Send;
1008    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
1009    fn r#deprecated_open(
1010        &self,
1011        flags: OpenFlags,
1012        mode: ModeType,
1013        path: &str,
1014        object: fidl::endpoints::ServerEnd<NodeMarker>,
1015    ) -> Result<(), fidl::Error>;
1016    fn r#open(
1017        &self,
1018        path: &str,
1019        flags: Flags,
1020        options: &Options,
1021        object: fidl::Channel,
1022    ) -> Result<(), fidl::Error>;
1023    type ReadDirentsResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>), fidl::Error>>
1024        + Send;
1025    fn r#read_dirents(&self, max_bytes: u64) -> Self::ReadDirentsResponseFut;
1026    type RewindResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1027    fn r#rewind(&self) -> Self::RewindResponseFut;
1028    type GetTokenResponseFut: std::future::Future<Output = Result<(i32, Option<fidl::NullableHandle>), fidl::Error>>
1029        + Send;
1030    fn r#get_token(&self) -> Self::GetTokenResponseFut;
1031    type LinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1032    fn r#link(
1033        &self,
1034        src: &str,
1035        dst_parent_token: fidl::NullableHandle,
1036        dst: &str,
1037    ) -> Self::LinkResponseFut;
1038    type UnlinkResponseFut: std::future::Future<Output = Result<DirectoryUnlinkResult, fidl::Error>>
1039        + Send;
1040    fn r#unlink(&self, name: &str, options: &UnlinkOptions) -> Self::UnlinkResponseFut;
1041    type RenameResponseFut: std::future::Future<Output = Result<DirectoryRenameResult, fidl::Error>>
1042        + Send;
1043    fn r#rename(
1044        &self,
1045        src: &str,
1046        dst_parent_token: fidl::Event,
1047        dst: &str,
1048    ) -> Self::RenameResponseFut;
1049    type CreateSymlinkResponseFut: std::future::Future<Output = Result<DirectoryCreateSymlinkResult, fidl::Error>>
1050        + Send;
1051    fn r#create_symlink(
1052        &self,
1053        name: &str,
1054        target: &[u8],
1055        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1056    ) -> Self::CreateSymlinkResponseFut;
1057    type WatchResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1058    fn r#watch(
1059        &self,
1060        mask: WatchMask,
1061        options: u32,
1062        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1063    ) -> Self::WatchResponseFut;
1064}
1065#[derive(Debug)]
1066#[cfg(target_os = "fuchsia")]
1067pub struct DirectorySynchronousProxy {
1068    client: fidl::client::sync::Client,
1069}
1070
1071#[cfg(target_os = "fuchsia")]
1072impl fidl::endpoints::SynchronousProxy for DirectorySynchronousProxy {
1073    type Proxy = DirectoryProxy;
1074    type Protocol = DirectoryMarker;
1075
1076    fn from_channel(inner: fidl::Channel) -> Self {
1077        Self::new(inner)
1078    }
1079
1080    fn into_channel(self) -> fidl::Channel {
1081        self.client.into_channel()
1082    }
1083
1084    fn as_channel(&self) -> &fidl::Channel {
1085        self.client.as_channel()
1086    }
1087}
1088
1089#[cfg(target_os = "fuchsia")]
1090impl DirectorySynchronousProxy {
1091    pub fn new(channel: fidl::Channel) -> Self {
1092        let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1093        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1094    }
1095
1096    pub fn into_channel(self) -> fidl::Channel {
1097        self.client.into_channel()
1098    }
1099
1100    /// Waits until an event arrives and returns it. It is safe for other
1101    /// threads to make concurrent requests while waiting for an event.
1102    pub fn wait_for_event(
1103        &self,
1104        deadline: zx::MonotonicInstant,
1105    ) -> Result<DirectoryEvent, fidl::Error> {
1106        DirectoryEvent::decode(self.client.wait_for_event(deadline)?)
1107    }
1108
1109    /// Acquires an advisory lock on the underlying file.
1110    ///
1111    /// The lock lasts until either this connection is closed or
1112    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1113    /// explicitly.
1114    ///
1115    /// Advisory locks are purely advisory. They do not prevent actual read or
1116    /// write operations from occurring on the file, either through this
1117    /// connection or through other connections.
1118    ///
1119    /// This method requires the following rights:
1120    ///
1121    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1122    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1123    ///   [`AdvisoryLockType.WRITE`].
1124    ///
1125    /// # Errors
1126    ///
1127    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1128    ///   example, another connection might hold a conflicting lock type.
1129    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1130    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1131    ///   to acquire the given type of lock.
1132    pub fn r#advisory_lock(
1133        &self,
1134        mut request: &AdvisoryLockRequest,
1135        ___deadline: zx::MonotonicInstant,
1136    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
1137        let _response = self.client.send_query::<
1138            AdvisoryLockingAdvisoryLockRequest,
1139            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1140        >(
1141            (request,),
1142            0x6ee9c0ad53ec87aa,
1143            fidl::encoding::DynamicFlags::empty(),
1144            ___deadline,
1145        )?;
1146        Ok(_response.map(|x| x))
1147    }
1148
1149    pub fn r#clone(
1150        &self,
1151        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1152    ) -> Result<(), fidl::Error> {
1153        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
1154            (request,),
1155            0x20d8a7aba2168a79,
1156            fidl::encoding::DynamicFlags::empty(),
1157        )
1158    }
1159
1160    /// Terminates the connection.
1161    ///
1162    /// After calling `Close`, the client must not send any other requests.
1163    ///
1164    /// Servers, after sending the status response, should close the connection
1165    /// regardless of status and without sending an epitaph.
1166    ///
1167    /// Closing the client end of the channel should be semantically equivalent
1168    /// to calling `Close` without knowing when the close has completed or its
1169    /// status.
1170    pub fn r#close(
1171        &self,
1172        ___deadline: zx::MonotonicInstant,
1173    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
1174        let _response = self.client.send_query::<
1175            fidl::encoding::EmptyPayload,
1176            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1177        >(
1178            (),
1179            0x5ac5d459ad7f657e,
1180            fidl::encoding::DynamicFlags::empty(),
1181            ___deadline,
1182        )?;
1183        Ok(_response.map(|x| x))
1184    }
1185
1186    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
1187        let _response = self.client.send_query::<
1188            fidl::encoding::EmptyPayload,
1189            fidl_fuchsia_unknown::QueryableQueryResponse,
1190        >(
1191            (),
1192            0x2658edee9decfc06,
1193            fidl::encoding::DynamicFlags::empty(),
1194            ___deadline,
1195        )?;
1196        Ok(_response.protocol)
1197    }
1198
1199    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1200    pub fn r#deprecated_clone(
1201        &self,
1202        mut flags: OpenFlags,
1203        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1204    ) -> Result<(), fidl::Error> {
1205        self.client.send::<NodeDeprecatedCloneRequest>(
1206            (flags, object),
1207            0x5a61678f293ce16f,
1208            fidl::encoding::DynamicFlags::FLEXIBLE,
1209        )
1210    }
1211
1212    /// DEPRECATED - Use `Node.GetAttributes` instead.
1213    pub fn r#deprecated_get_attr(
1214        &self,
1215        ___deadline: zx::MonotonicInstant,
1216    ) -> Result<(i32, NodeAttributes), fidl::Error> {
1217        let _response =
1218            self.client.send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse>(
1219                (),
1220                0x78985e216314dafd,
1221                fidl::encoding::DynamicFlags::empty(),
1222                ___deadline,
1223            )?;
1224        Ok((_response.s, _response.attributes))
1225    }
1226
1227    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1228    pub fn r#deprecated_set_attr(
1229        &self,
1230        mut flags: NodeAttributeFlags,
1231        mut attributes: &NodeAttributes,
1232        ___deadline: zx::MonotonicInstant,
1233    ) -> Result<i32, fidl::Error> {
1234        let _response =
1235            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
1236                (flags, attributes),
1237                0x4186c0f40d938f46,
1238                fidl::encoding::DynamicFlags::empty(),
1239                ___deadline,
1240            )?;
1241        Ok(_response.s)
1242    }
1243
1244    /// [DEPRECATED - Use new GetFlags method instead.]
1245    pub fn r#deprecated_get_flags(
1246        &self,
1247        ___deadline: zx::MonotonicInstant,
1248    ) -> Result<(i32, OpenFlags), fidl::Error> {
1249        let _response = self
1250            .client
1251            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
1252                (),
1253                0x5b88fffb8eda3aa1,
1254                fidl::encoding::DynamicFlags::empty(),
1255                ___deadline,
1256            )?;
1257        Ok((_response.s, _response.flags))
1258    }
1259
1260    /// [DEPRECATED - Use new SetFlags method instead.]
1261    pub fn r#deprecated_set_flags(
1262        &self,
1263        mut flags: OpenFlags,
1264        ___deadline: zx::MonotonicInstant,
1265    ) -> Result<i32, fidl::Error> {
1266        let _response = self
1267            .client
1268            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
1269                (flags,),
1270                0x5295b76c71fde733,
1271                fidl::encoding::DynamicFlags::empty(),
1272                ___deadline,
1273            )?;
1274        Ok(_response.s)
1275    }
1276
1277    /// Queries the flags that apply to this node after it has been opened/created. This method does
1278    /// not require any rights.
1279    ///
1280    /// Note that the final set of flags that apply to the connection may differ from those
1281    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1282    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1283    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1284    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1285    pub fn r#get_flags(
1286        &self,
1287        ___deadline: zx::MonotonicInstant,
1288    ) -> Result<NodeGetFlagsResult, fidl::Error> {
1289        let _response = self.client.send_query::<
1290            fidl::encoding::EmptyPayload,
1291            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
1292        >(
1293            (),
1294            0x176eb318f64ec23,
1295            fidl::encoding::DynamicFlags::FLEXIBLE,
1296            ___deadline,
1297        )?
1298        .into_result::<DirectoryMarker>("get_flags")?;
1299        Ok(_response.map(|x| x.flags))
1300    }
1301
1302    /// Sets the flags that apply to this node after it has been opened. This method does not
1303    /// require any rights.
1304    ///
1305    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1306    /// clear append mode.
1307    ///
1308    /// Errors:
1309    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1310    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1311    pub fn r#set_flags(
1312        &self,
1313        mut flags: Flags,
1314        ___deadline: zx::MonotonicInstant,
1315    ) -> Result<NodeSetFlagsResult, fidl::Error> {
1316        let _response = self.client.send_query::<
1317            NodeSetFlagsRequest,
1318            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1319        >(
1320            (flags,),
1321            0x55a8028685791ea8,
1322            fidl::encoding::DynamicFlags::FLEXIBLE,
1323            ___deadline,
1324        )?
1325        .into_result::<DirectoryMarker>("set_flags")?;
1326        Ok(_response.map(|x| x))
1327    }
1328
1329    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
1330    /// volume has different settings or the storage is accounted seperately from the rest of the
1331    /// filesystem that may be reported instead of filesystem-wide details.
1332    pub fn r#query_filesystem(
1333        &self,
1334        ___deadline: zx::MonotonicInstant,
1335    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
1336        let _response =
1337            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
1338                (),
1339                0x6f344a1c6b0a0610,
1340                fidl::encoding::DynamicFlags::empty(),
1341                ___deadline,
1342            )?;
1343        Ok((_response.s, _response.info))
1344    }
1345
1346    /// Acquires information about the node.
1347    ///
1348    /// The attributes of a node should be stable, independent of the
1349    /// specific protocol used to access it.
1350    ///
1351    /// If a particular attribute is not applicable or not supported,
1352    /// filesystems should leave the corresponding field absent.
1353    ///
1354    /// + `query` a bit-mask specifying which attributes to fetch. The server
1355    ///   should not return more than necessary.
1356    /// - `attributes` the returned attributes.
1357    ///
1358    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1359    pub fn r#get_attributes(
1360        &self,
1361        mut query: NodeAttributesQuery,
1362        ___deadline: zx::MonotonicInstant,
1363    ) -> Result<NodeGetAttributesResult, fidl::Error> {
1364        let _response = self.client.send_query::<
1365            NodeGetAttributesRequest,
1366            fidl::encoding::ResultType<NodeAttributes2, i32>,
1367        >(
1368            (query,),
1369            0x3d4396a638ea053b,
1370            fidl::encoding::DynamicFlags::empty(),
1371            ___deadline,
1372        )?;
1373        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
1374    }
1375
1376    /// Updates information about the node.
1377    ///
1378    /// + `attributes` the presence of a table field in `attributes` indicates
1379    /// the intent to update the corresponding attribute.
1380    ///
1381    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
1382    ///
1383    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1384    pub fn r#update_attributes(
1385        &self,
1386        mut payload: &MutableNodeAttributes,
1387        ___deadline: zx::MonotonicInstant,
1388    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
1389        let _response = self.client.send_query::<
1390            MutableNodeAttributes,
1391            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1392        >(
1393            payload,
1394            0x3308c1da5a89bf08,
1395            fidl::encoding::DynamicFlags::empty(),
1396            ___deadline,
1397        )?;
1398        Ok(_response.map(|x| x))
1399    }
1400
1401    /// Synchronizes updates to the node to the underlying media, if it exists.
1402    ///
1403    /// This method will return when the filesystem server has flushed the
1404    /// relevant updates to the underlying media, but does not guarantee the
1405    /// underlying media has persisted the information, nor that any information
1406    /// is committed to hardware. Clients may use `Sync` to ensure ordering
1407    /// between operations.
1408    ///
1409    /// This method does not require any rights.
1410    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
1411        let _response = self.client.send_query::<
1412            fidl::encoding::EmptyPayload,
1413            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1414        >(
1415            (),
1416            0x2c5c27ca0ab5dc49,
1417            fidl::encoding::DynamicFlags::empty(),
1418            ___deadline,
1419        )?;
1420        Ok(_response.map(|x| x))
1421    }
1422
1423    /// Creates an iterator over all the extended attribute names associated
1424    /// with this node. If an error occurs it is returned as an epitaph on the
1425    /// iterator request channel, and then the channel is closed.
1426    ///
1427    /// GetExtendedAttributes can be used with any of these names to retrieve
1428    /// the associated value.
1429    ///
1430    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1431    pub fn r#list_extended_attributes(
1432        &self,
1433        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
1434    ) -> Result<(), fidl::Error> {
1435        self.client.send::<NodeListExtendedAttributesRequest>(
1436            (iterator,),
1437            0x4b61033de007fcd0,
1438            fidl::encoding::DynamicFlags::empty(),
1439        )
1440    }
1441
1442    /// Get the value associated with the given attribute `name` for this node.
1443    ///
1444    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
1445    /// particular structure is imposed on them.
1446    ///
1447    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1448    pub fn r#get_extended_attribute(
1449        &self,
1450        mut name: &[u8],
1451        ___deadline: zx::MonotonicInstant,
1452    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
1453        let _response = self.client.send_query::<
1454            NodeGetExtendedAttributeRequest,
1455            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
1456        >(
1457            (name,),
1458            0x45ffa3ccfdeb76db,
1459            fidl::encoding::DynamicFlags::empty(),
1460            ___deadline,
1461        )?;
1462        Ok(_response.map(|x| x))
1463    }
1464
1465    /// Set the value for the given attribute `name` to `value` for this node.
1466    ///
1467    /// The attribute name may exist, in which case the attribute is updated.
1468    /// If the attribute doesn't exist, it is created. The name should have no
1469    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
1470    ///
1471    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1472    pub fn r#set_extended_attribute(
1473        &self,
1474        mut name: &[u8],
1475        mut value: ExtendedAttributeValue,
1476        mut mode: SetExtendedAttributeMode,
1477        ___deadline: zx::MonotonicInstant,
1478    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
1479        let _response = self.client.send_query::<
1480            NodeSetExtendedAttributeRequest,
1481            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1482        >(
1483            (name, &mut value, mode,),
1484            0x4a951362f681f23c,
1485            fidl::encoding::DynamicFlags::empty(),
1486            ___deadline,
1487        )?;
1488        Ok(_response.map(|x| x))
1489    }
1490
1491    /// Remove the specified extended attribute.
1492    ///
1493    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
1494    ///
1495    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1496    pub fn r#remove_extended_attribute(
1497        &self,
1498        mut name: &[u8],
1499        ___deadline: zx::MonotonicInstant,
1500    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
1501        let _response = self.client.send_query::<
1502            NodeRemoveExtendedAttributeRequest,
1503            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1504        >(
1505            (name,),
1506            0x7a0b9f3a9bf9032d,
1507            fidl::encoding::DynamicFlags::empty(),
1508            ___deadline,
1509        )?;
1510        Ok(_response.map(|x| x))
1511    }
1512
1513    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
1514    pub fn r#deprecated_open(
1515        &self,
1516        mut flags: OpenFlags,
1517        mut mode: ModeType,
1518        mut path: &str,
1519        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1520    ) -> Result<(), fidl::Error> {
1521        self.client.send::<DirectoryDeprecatedOpenRequest>(
1522            (flags, mode, path, object),
1523            0x2c5044561d685ec0,
1524            fidl::encoding::DynamicFlags::FLEXIBLE,
1525        )
1526    }
1527
1528    /// Open (or create) a node relative to this directory. Any errors are communicated via an
1529    /// epitaph sent on the `object` channel.
1530    ///
1531    /// Errors:
1532    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
1533    /// * See [`Flags`] for other errors which may be communicated based on `flags`
1534    pub fn r#open(
1535        &self,
1536        mut path: &str,
1537        mut flags: Flags,
1538        mut options: &Options,
1539        mut object: fidl::Channel,
1540    ) -> Result<(), fidl::Error> {
1541        self.client.send::<DirectoryOpenRequest>(
1542            (path, flags, options, object),
1543            0x568ddcb9a9cbb6d9,
1544            fidl::encoding::DynamicFlags::empty(),
1545        )
1546    }
1547
1548    /// Reads a collection of variably sized dirents into a buffer.
1549    /// The number of dirents in a directory may be very large: akin to
1550    /// calling read multiple times on a file, directories have a seek
1551    /// offset which is updated on subsequent calls to ReadDirents.
1552    /// Each call to ReadDirents will only return whole dirent structures,
1553    /// they will not get split across ReadDirent calls. When the seek
1554    /// offset reaches the end, `dirents` will be empty.
1555    ///
1556    /// These dirents are of the form:
1557    /// ```
1558    /// struct dirent {
1559    ///   // Describes the inode of the entry.
1560    ///   uint64 ino;
1561    ///   // Describes the length of the dirent name in bytes.
1562    ///   uint8 size;
1563    ///   // Describes the type of the entry. Aligned with the
1564    ///   // POSIX d_type values. Use `DirentType` constants.
1565    ///   uint8 type;
1566    ///   // Unterminated name of entry.
1567    ///   char name[0];
1568    /// }
1569    /// ```
1570    ///
1571    /// This method does not require any rights, since one could always probe for
1572    /// directory contents by triggering name conflicts during file creation.
1573    pub fn r#read_dirents(
1574        &self,
1575        mut max_bytes: u64,
1576        ___deadline: zx::MonotonicInstant,
1577    ) -> Result<(i32, Vec<u8>), fidl::Error> {
1578        let _response =
1579            self.client.send_query::<DirectoryReadDirentsRequest, DirectoryReadDirentsResponse>(
1580                (max_bytes,),
1581                0x3582806bf27faa0a,
1582                fidl::encoding::DynamicFlags::empty(),
1583                ___deadline,
1584            )?;
1585        Ok((_response.s, _response.dirents))
1586    }
1587
1588    /// Resets the directory seek offset.
1589    ///
1590    /// This method does not require any rights, similar to ReadDirents.
1591    pub fn r#rewind(&self, ___deadline: zx::MonotonicInstant) -> Result<i32, fidl::Error> {
1592        let _response =
1593            self.client.send_query::<fidl::encoding::EmptyPayload, DirectoryRewindResponse>(
1594                (),
1595                0x16b1202af0f34c71,
1596                fidl::encoding::DynamicFlags::empty(),
1597                ___deadline,
1598            )?;
1599        Ok(_response.s)
1600    }
1601
1602    /// Acquires a token to a Directory which can be used to identify access to it at a later point
1603    /// in time. The token will remain valid for as long as the connection requesting the token
1604    /// remains open.
1605    ///
1606    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1607    /// `ZX_ERR_BAD_HANDLE`.
1608    pub fn r#get_token(
1609        &self,
1610        ___deadline: zx::MonotonicInstant,
1611    ) -> Result<(i32, Option<fidl::NullableHandle>), fidl::Error> {
1612        let _response =
1613            self.client.send_query::<fidl::encoding::EmptyPayload, DirectoryGetTokenResponse>(
1614                (),
1615                0x26ae9d18763c8655,
1616                fidl::encoding::DynamicFlags::empty(),
1617                ___deadline,
1618            )?;
1619        Ok((_response.s, _response.token))
1620    }
1621
1622    /// Creates a link to an object named src by the name dst, within a directory represented by
1623    /// token.
1624    ///
1625    /// `src` must be a resolved object name. Including "/" in the string will
1626    /// return `ZX_ERR_INVALID_ARGS`.
1627    ///
1628    /// `dst` must be a resolved object name. Including "/" in the string will
1629    /// return `ZX_ERR_INVALID_ARGS`.
1630    ///
1631    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
1632    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
1633    ///
1634    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
1635    /// there are two actors operating concurrently, and one actor performs a rename that affects
1636    /// the source within this directory, and the other does a link, each will appear to occur
1637    /// atomically in an unspecified order.
1638    pub fn r#link(
1639        &self,
1640        mut src: &str,
1641        mut dst_parent_token: fidl::NullableHandle,
1642        mut dst: &str,
1643        ___deadline: zx::MonotonicInstant,
1644    ) -> Result<i32, fidl::Error> {
1645        let _response = self.client.send_query::<DirectoryLinkRequest, DirectoryLinkResponse>(
1646            (src, dst_parent_token, dst),
1647            0x740604c0c7c930e7,
1648            fidl::encoding::DynamicFlags::empty(),
1649            ___deadline,
1650        )?;
1651        Ok(_response.s)
1652    }
1653
1654    /// Removes a child node from the this directory's list of entries.
1655    ///
1656    /// Note: this does not guarantee that the underlying object is destroyed.
1657    /// Although the link will be removed from the containing directory,
1658    /// objects with multiple references (such as files which are still open)
1659    /// will not actually be destroyed until all references are closed.
1660    ///
1661    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
1662    ///   [`Rights.WRITE_BYTES`].
1663    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
1664    ///   support writing.
1665    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
1666    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
1667    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
1668    ///   containing a remote channel.
1669    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
1670    ///     something other than a directory was found.
1671    ///
1672    /// Other errors may be returned for filesystem-specific reasons.
1673    ///
1674    /// This method requires the following rights:
1675    ///
1676    /// * [`Rights.ENUMERATE`]
1677    /// * [`Rights.MODIFY_DIRECTORY`]
1678    pub fn r#unlink(
1679        &self,
1680        mut name: &str,
1681        mut options: &UnlinkOptions,
1682        ___deadline: zx::MonotonicInstant,
1683    ) -> Result<DirectoryUnlinkResult, fidl::Error> {
1684        let _response = self.client.send_query::<
1685            DirectoryUnlinkRequest,
1686            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1687        >(
1688            (name, options,),
1689            0x750a0326a78d7bed,
1690            fidl::encoding::DynamicFlags::empty(),
1691            ___deadline,
1692        )?;
1693        Ok(_response.map(|x| x))
1694    }
1695
1696    /// Renames a node named `src` to the name `dst`, in a directory represented
1697    /// by `dst_parent_token`.
1698    ///
1699    /// `src` and `dst` must be valid node names.
1700    /// See [`Name`] for what constitutes a valid name.
1701    ///
1702    /// This method requires the following rights on both the current connection, and the connection
1703    /// identified by `dst_parent_token`:
1704    ///
1705    /// * [`Rights.ENUMERATE`]
1706    /// * [`Rights.MODIFY_DIRECTORY`]
1707    ///
1708    /// The following requirements are necessary to avoid rights escalations.
1709    ///
1710    /// If the source and destination directory differ, the source directory must also have the
1711    /// maximal set of abilities supported for files, which would typically be
1712    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
1713    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
1714    /// right.
1715    ///
1716    /// If `src` refers to a directory, and differs from the destination directory, then the source
1717    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
1718    ///
1719    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
1720    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
1721    pub fn r#rename(
1722        &self,
1723        mut src: &str,
1724        mut dst_parent_token: fidl::Event,
1725        mut dst: &str,
1726        ___deadline: zx::MonotonicInstant,
1727    ) -> Result<DirectoryRenameResult, fidl::Error> {
1728        let _response = self.client.send_query::<
1729            DirectoryRenameRequest,
1730            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1731        >(
1732            (src, dst_parent_token, dst,),
1733            0x7060e7723b9928de,
1734            fidl::encoding::DynamicFlags::empty(),
1735            ___deadline,
1736        )?;
1737        Ok(_response.map(|x| x))
1738    }
1739
1740    /// Creates a symbolic link.
1741    ///
1742    /// `name` is the name to be given to the created symbolic link.
1743    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
1744    /// will perform no validation of `target` except for a server chosen maximum length.
1745    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
1746    /// on the successfully created node.
1747    ///
1748    /// * [`Rights.MODIFY_DIRECTORY`]
1749    ///
1750    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
1751    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
1752    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
1753    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
1754    pub fn r#create_symlink(
1755        &self,
1756        mut name: &str,
1757        mut target: &[u8],
1758        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1759        ___deadline: zx::MonotonicInstant,
1760    ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
1761        let _response = self.client.send_query::<
1762            DirectoryCreateSymlinkRequest,
1763            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1764        >(
1765            (name, target, connection,),
1766            0x21ce0f19ec043889,
1767            fidl::encoding::DynamicFlags::empty(),
1768            ___deadline,
1769        )?;
1770        Ok(_response.map(|x| x))
1771    }
1772
1773    /// Watches a directory, receiving events of added messages on the
1774    /// watcher request channel.
1775    ///
1776    /// Options must be zero; it is reserved.
1777    ///
1778    /// This method does not require any rights, similar to ReadDirents.
1779    pub fn r#watch(
1780        &self,
1781        mut mask: WatchMask,
1782        mut options: u32,
1783        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1784        ___deadline: zx::MonotonicInstant,
1785    ) -> Result<i32, fidl::Error> {
1786        let _response = self.client.send_query::<DirectoryWatchRequest, DirectoryWatchResponse>(
1787            (mask, options, watcher),
1788            0x5717193a59d66d91,
1789            fidl::encoding::DynamicFlags::empty(),
1790            ___deadline,
1791        )?;
1792        Ok(_response.s)
1793    }
1794}
1795
1796#[cfg(target_os = "fuchsia")]
1797impl From<DirectorySynchronousProxy> for zx::NullableHandle {
1798    fn from(value: DirectorySynchronousProxy) -> Self {
1799        value.into_channel().into()
1800    }
1801}
1802
1803#[cfg(target_os = "fuchsia")]
1804impl From<fidl::Channel> for DirectorySynchronousProxy {
1805    fn from(value: fidl::Channel) -> Self {
1806        Self::new(value)
1807    }
1808}
1809
1810#[cfg(target_os = "fuchsia")]
1811impl fidl::endpoints::FromClient for DirectorySynchronousProxy {
1812    type Protocol = DirectoryMarker;
1813
1814    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryMarker>) -> Self {
1815        Self::new(value.into_channel())
1816    }
1817}
1818
1819#[derive(Debug, Clone)]
1820pub struct DirectoryProxy {
1821    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1822}
1823
1824impl fidl::endpoints::Proxy for DirectoryProxy {
1825    type Protocol = DirectoryMarker;
1826
1827    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1828        Self::new(inner)
1829    }
1830
1831    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1832        self.client.into_channel().map_err(|client| Self { client })
1833    }
1834
1835    fn as_channel(&self) -> &::fidl::AsyncChannel {
1836        self.client.as_channel()
1837    }
1838}
1839
1840impl DirectoryProxy {
1841    /// Create a new Proxy for fuchsia.io/Directory.
1842    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1843        let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1844        Self { client: fidl::client::Client::new(channel, protocol_name) }
1845    }
1846
1847    /// Get a Stream of events from the remote end of the protocol.
1848    ///
1849    /// # Panics
1850    ///
1851    /// Panics if the event stream was already taken.
1852    pub fn take_event_stream(&self) -> DirectoryEventStream {
1853        DirectoryEventStream { event_receiver: self.client.take_event_receiver() }
1854    }
1855
1856    /// Acquires an advisory lock on the underlying file.
1857    ///
1858    /// The lock lasts until either this connection is closed or
1859    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1860    /// explicitly.
1861    ///
1862    /// Advisory locks are purely advisory. They do not prevent actual read or
1863    /// write operations from occurring on the file, either through this
1864    /// connection or through other connections.
1865    ///
1866    /// This method requires the following rights:
1867    ///
1868    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1869    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1870    ///   [`AdvisoryLockType.WRITE`].
1871    ///
1872    /// # Errors
1873    ///
1874    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1875    ///   example, another connection might hold a conflicting lock type.
1876    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1877    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1878    ///   to acquire the given type of lock.
1879    pub fn r#advisory_lock(
1880        &self,
1881        mut request: &AdvisoryLockRequest,
1882    ) -> fidl::client::QueryResponseFut<
1883        AdvisoryLockingAdvisoryLockResult,
1884        fidl::encoding::DefaultFuchsiaResourceDialect,
1885    > {
1886        DirectoryProxyInterface::r#advisory_lock(self, request)
1887    }
1888
1889    pub fn r#clone(
1890        &self,
1891        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1892    ) -> Result<(), fidl::Error> {
1893        DirectoryProxyInterface::r#clone(self, request)
1894    }
1895
1896    /// Terminates the connection.
1897    ///
1898    /// After calling `Close`, the client must not send any other requests.
1899    ///
1900    /// Servers, after sending the status response, should close the connection
1901    /// regardless of status and without sending an epitaph.
1902    ///
1903    /// Closing the client end of the channel should be semantically equivalent
1904    /// to calling `Close` without knowing when the close has completed or its
1905    /// status.
1906    pub fn r#close(
1907        &self,
1908    ) -> fidl::client::QueryResponseFut<
1909        fidl_fuchsia_unknown::CloseableCloseResult,
1910        fidl::encoding::DefaultFuchsiaResourceDialect,
1911    > {
1912        DirectoryProxyInterface::r#close(self)
1913    }
1914
1915    pub fn r#query(
1916        &self,
1917    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
1918    {
1919        DirectoryProxyInterface::r#query(self)
1920    }
1921
1922    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1923    pub fn r#deprecated_clone(
1924        &self,
1925        mut flags: OpenFlags,
1926        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1927    ) -> Result<(), fidl::Error> {
1928        DirectoryProxyInterface::r#deprecated_clone(self, flags, object)
1929    }
1930
1931    /// DEPRECATED - Use `Node.GetAttributes` instead.
1932    pub fn r#deprecated_get_attr(
1933        &self,
1934    ) -> fidl::client::QueryResponseFut<
1935        (i32, NodeAttributes),
1936        fidl::encoding::DefaultFuchsiaResourceDialect,
1937    > {
1938        DirectoryProxyInterface::r#deprecated_get_attr(self)
1939    }
1940
1941    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1942    pub fn r#deprecated_set_attr(
1943        &self,
1944        mut flags: NodeAttributeFlags,
1945        mut attributes: &NodeAttributes,
1946    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
1947        DirectoryProxyInterface::r#deprecated_set_attr(self, flags, attributes)
1948    }
1949
1950    /// [DEPRECATED - Use new GetFlags method instead.]
1951    pub fn r#deprecated_get_flags(
1952        &self,
1953    ) -> fidl::client::QueryResponseFut<
1954        (i32, OpenFlags),
1955        fidl::encoding::DefaultFuchsiaResourceDialect,
1956    > {
1957        DirectoryProxyInterface::r#deprecated_get_flags(self)
1958    }
1959
1960    /// [DEPRECATED - Use new SetFlags method instead.]
1961    pub fn r#deprecated_set_flags(
1962        &self,
1963        mut flags: OpenFlags,
1964    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
1965        DirectoryProxyInterface::r#deprecated_set_flags(self, flags)
1966    }
1967
1968    /// Queries the flags that apply to this node after it has been opened/created. This method does
1969    /// not require any rights.
1970    ///
1971    /// Note that the final set of flags that apply to the connection may differ from those
1972    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1973    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1974    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1975    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1976    pub fn r#get_flags(
1977        &self,
1978    ) -> fidl::client::QueryResponseFut<
1979        NodeGetFlagsResult,
1980        fidl::encoding::DefaultFuchsiaResourceDialect,
1981    > {
1982        DirectoryProxyInterface::r#get_flags(self)
1983    }
1984
1985    /// Sets the flags that apply to this node after it has been opened. This method does not
1986    /// require any rights.
1987    ///
1988    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1989    /// clear append mode.
1990    ///
1991    /// Errors:
1992    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1993    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1994    pub fn r#set_flags(
1995        &self,
1996        mut flags: Flags,
1997    ) -> fidl::client::QueryResponseFut<
1998        NodeSetFlagsResult,
1999        fidl::encoding::DefaultFuchsiaResourceDialect,
2000    > {
2001        DirectoryProxyInterface::r#set_flags(self, flags)
2002    }
2003
2004    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
2005    /// volume has different settings or the storage is accounted seperately from the rest of the
2006    /// filesystem that may be reported instead of filesystem-wide details.
2007    pub fn r#query_filesystem(
2008        &self,
2009    ) -> fidl::client::QueryResponseFut<
2010        (i32, Option<Box<FilesystemInfo>>),
2011        fidl::encoding::DefaultFuchsiaResourceDialect,
2012    > {
2013        DirectoryProxyInterface::r#query_filesystem(self)
2014    }
2015
2016    /// Acquires information about the node.
2017    ///
2018    /// The attributes of a node should be stable, independent of the
2019    /// specific protocol used to access it.
2020    ///
2021    /// If a particular attribute is not applicable or not supported,
2022    /// filesystems should leave the corresponding field absent.
2023    ///
2024    /// + `query` a bit-mask specifying which attributes to fetch. The server
2025    ///   should not return more than necessary.
2026    /// - `attributes` the returned attributes.
2027    ///
2028    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2029    pub fn r#get_attributes(
2030        &self,
2031        mut query: NodeAttributesQuery,
2032    ) -> fidl::client::QueryResponseFut<
2033        NodeGetAttributesResult,
2034        fidl::encoding::DefaultFuchsiaResourceDialect,
2035    > {
2036        DirectoryProxyInterface::r#get_attributes(self, query)
2037    }
2038
2039    /// Updates information about the node.
2040    ///
2041    /// + `attributes` the presence of a table field in `attributes` indicates
2042    /// the intent to update the corresponding attribute.
2043    ///
2044    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
2045    ///
2046    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2047    pub fn r#update_attributes(
2048        &self,
2049        mut payload: &MutableNodeAttributes,
2050    ) -> fidl::client::QueryResponseFut<
2051        NodeUpdateAttributesResult,
2052        fidl::encoding::DefaultFuchsiaResourceDialect,
2053    > {
2054        DirectoryProxyInterface::r#update_attributes(self, payload)
2055    }
2056
2057    /// Synchronizes updates to the node to the underlying media, if it exists.
2058    ///
2059    /// This method will return when the filesystem server has flushed the
2060    /// relevant updates to the underlying media, but does not guarantee the
2061    /// underlying media has persisted the information, nor that any information
2062    /// is committed to hardware. Clients may use `Sync` to ensure ordering
2063    /// between operations.
2064    ///
2065    /// This method does not require any rights.
2066    pub fn r#sync(
2067        &self,
2068    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
2069    {
2070        DirectoryProxyInterface::r#sync(self)
2071    }
2072
2073    /// Creates an iterator over all the extended attribute names associated
2074    /// with this node. If an error occurs it is returned as an epitaph on the
2075    /// iterator request channel, and then the channel is closed.
2076    ///
2077    /// GetExtendedAttributes can be used with any of these names to retrieve
2078    /// the associated value.
2079    ///
2080    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2081    pub fn r#list_extended_attributes(
2082        &self,
2083        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2084    ) -> Result<(), fidl::Error> {
2085        DirectoryProxyInterface::r#list_extended_attributes(self, iterator)
2086    }
2087
2088    /// Get the value associated with the given attribute `name` for this node.
2089    ///
2090    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
2091    /// particular structure is imposed on them.
2092    ///
2093    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2094    pub fn r#get_extended_attribute(
2095        &self,
2096        mut name: &[u8],
2097    ) -> fidl::client::QueryResponseFut<
2098        NodeGetExtendedAttributeResult,
2099        fidl::encoding::DefaultFuchsiaResourceDialect,
2100    > {
2101        DirectoryProxyInterface::r#get_extended_attribute(self, name)
2102    }
2103
2104    /// Set the value for the given attribute `name` to `value` for this node.
2105    ///
2106    /// The attribute name may exist, in which case the attribute is updated.
2107    /// If the attribute doesn't exist, it is created. The name should have no
2108    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
2109    ///
2110    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2111    pub fn r#set_extended_attribute(
2112        &self,
2113        mut name: &[u8],
2114        mut value: ExtendedAttributeValue,
2115        mut mode: SetExtendedAttributeMode,
2116    ) -> fidl::client::QueryResponseFut<
2117        NodeSetExtendedAttributeResult,
2118        fidl::encoding::DefaultFuchsiaResourceDialect,
2119    > {
2120        DirectoryProxyInterface::r#set_extended_attribute(self, name, value, mode)
2121    }
2122
2123    /// Remove the specified extended attribute.
2124    ///
2125    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
2126    ///
2127    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2128    pub fn r#remove_extended_attribute(
2129        &self,
2130        mut name: &[u8],
2131    ) -> fidl::client::QueryResponseFut<
2132        NodeRemoveExtendedAttributeResult,
2133        fidl::encoding::DefaultFuchsiaResourceDialect,
2134    > {
2135        DirectoryProxyInterface::r#remove_extended_attribute(self, name)
2136    }
2137
2138    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
2139    pub fn r#deprecated_open(
2140        &self,
2141        mut flags: OpenFlags,
2142        mut mode: ModeType,
2143        mut path: &str,
2144        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2145    ) -> Result<(), fidl::Error> {
2146        DirectoryProxyInterface::r#deprecated_open(self, flags, mode, path, object)
2147    }
2148
2149    /// Open (or create) a node relative to this directory. Any errors are communicated via an
2150    /// epitaph sent on the `object` channel.
2151    ///
2152    /// Errors:
2153    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
2154    /// * See [`Flags`] for other errors which may be communicated based on `flags`
2155    pub fn r#open(
2156        &self,
2157        mut path: &str,
2158        mut flags: Flags,
2159        mut options: &Options,
2160        mut object: fidl::Channel,
2161    ) -> Result<(), fidl::Error> {
2162        DirectoryProxyInterface::r#open(self, path, flags, options, object)
2163    }
2164
2165    /// Reads a collection of variably sized dirents into a buffer.
2166    /// The number of dirents in a directory may be very large: akin to
2167    /// calling read multiple times on a file, directories have a seek
2168    /// offset which is updated on subsequent calls to ReadDirents.
2169    /// Each call to ReadDirents will only return whole dirent structures,
2170    /// they will not get split across ReadDirent calls. When the seek
2171    /// offset reaches the end, `dirents` will be empty.
2172    ///
2173    /// These dirents are of the form:
2174    /// ```
2175    /// struct dirent {
2176    ///   // Describes the inode of the entry.
2177    ///   uint64 ino;
2178    ///   // Describes the length of the dirent name in bytes.
2179    ///   uint8 size;
2180    ///   // Describes the type of the entry. Aligned with the
2181    ///   // POSIX d_type values. Use `DirentType` constants.
2182    ///   uint8 type;
2183    ///   // Unterminated name of entry.
2184    ///   char name[0];
2185    /// }
2186    /// ```
2187    ///
2188    /// This method does not require any rights, since one could always probe for
2189    /// directory contents by triggering name conflicts during file creation.
2190    pub fn r#read_dirents(
2191        &self,
2192        mut max_bytes: u64,
2193    ) -> fidl::client::QueryResponseFut<(i32, Vec<u8>), fidl::encoding::DefaultFuchsiaResourceDialect>
2194    {
2195        DirectoryProxyInterface::r#read_dirents(self, max_bytes)
2196    }
2197
2198    /// Resets the directory seek offset.
2199    ///
2200    /// This method does not require any rights, similar to ReadDirents.
2201    pub fn r#rewind(
2202        &self,
2203    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2204        DirectoryProxyInterface::r#rewind(self)
2205    }
2206
2207    /// Acquires a token to a Directory which can be used to identify access to it at a later point
2208    /// in time. The token will remain valid for as long as the connection requesting the token
2209    /// remains open.
2210    ///
2211    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
2212    /// `ZX_ERR_BAD_HANDLE`.
2213    pub fn r#get_token(
2214        &self,
2215    ) -> fidl::client::QueryResponseFut<
2216        (i32, Option<fidl::NullableHandle>),
2217        fidl::encoding::DefaultFuchsiaResourceDialect,
2218    > {
2219        DirectoryProxyInterface::r#get_token(self)
2220    }
2221
2222    /// Creates a link to an object named src by the name dst, within a directory represented by
2223    /// token.
2224    ///
2225    /// `src` must be a resolved object name. Including "/" in the string will
2226    /// return `ZX_ERR_INVALID_ARGS`.
2227    ///
2228    /// `dst` must be a resolved object name. Including "/" in the string will
2229    /// return `ZX_ERR_INVALID_ARGS`.
2230    ///
2231    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
2232    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
2233    ///
2234    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
2235    /// there are two actors operating concurrently, and one actor performs a rename that affects
2236    /// the source within this directory, and the other does a link, each will appear to occur
2237    /// atomically in an unspecified order.
2238    pub fn r#link(
2239        &self,
2240        mut src: &str,
2241        mut dst_parent_token: fidl::NullableHandle,
2242        mut dst: &str,
2243    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2244        DirectoryProxyInterface::r#link(self, src, dst_parent_token, dst)
2245    }
2246
2247    /// Removes a child node from the this directory's list of entries.
2248    ///
2249    /// Note: this does not guarantee that the underlying object is destroyed.
2250    /// Although the link will be removed from the containing directory,
2251    /// objects with multiple references (such as files which are still open)
2252    /// will not actually be destroyed until all references are closed.
2253    ///
2254    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
2255    ///   [`Rights.WRITE_BYTES`].
2256    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
2257    ///   support writing.
2258    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
2259    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
2260    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
2261    ///   containing a remote channel.
2262    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
2263    ///     something other than a directory was found.
2264    ///
2265    /// Other errors may be returned for filesystem-specific reasons.
2266    ///
2267    /// This method requires the following rights:
2268    ///
2269    /// * [`Rights.ENUMERATE`]
2270    /// * [`Rights.MODIFY_DIRECTORY`]
2271    pub fn r#unlink(
2272        &self,
2273        mut name: &str,
2274        mut options: &UnlinkOptions,
2275    ) -> fidl::client::QueryResponseFut<
2276        DirectoryUnlinkResult,
2277        fidl::encoding::DefaultFuchsiaResourceDialect,
2278    > {
2279        DirectoryProxyInterface::r#unlink(self, name, options)
2280    }
2281
2282    /// Renames a node named `src` to the name `dst`, in a directory represented
2283    /// by `dst_parent_token`.
2284    ///
2285    /// `src` and `dst` must be valid node names.
2286    /// See [`Name`] for what constitutes a valid name.
2287    ///
2288    /// This method requires the following rights on both the current connection, and the connection
2289    /// identified by `dst_parent_token`:
2290    ///
2291    /// * [`Rights.ENUMERATE`]
2292    /// * [`Rights.MODIFY_DIRECTORY`]
2293    ///
2294    /// The following requirements are necessary to avoid rights escalations.
2295    ///
2296    /// If the source and destination directory differ, the source directory must also have the
2297    /// maximal set of abilities supported for files, which would typically be
2298    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
2299    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
2300    /// right.
2301    ///
2302    /// If `src` refers to a directory, and differs from the destination directory, then the source
2303    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
2304    ///
2305    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
2306    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
2307    pub fn r#rename(
2308        &self,
2309        mut src: &str,
2310        mut dst_parent_token: fidl::Event,
2311        mut dst: &str,
2312    ) -> fidl::client::QueryResponseFut<
2313        DirectoryRenameResult,
2314        fidl::encoding::DefaultFuchsiaResourceDialect,
2315    > {
2316        DirectoryProxyInterface::r#rename(self, src, dst_parent_token, dst)
2317    }
2318
2319    /// Creates a symbolic link.
2320    ///
2321    /// `name` is the name to be given to the created symbolic link.
2322    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
2323    /// will perform no validation of `target` except for a server chosen maximum length.
2324    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
2325    /// on the successfully created node.
2326    ///
2327    /// * [`Rights.MODIFY_DIRECTORY`]
2328    ///
2329    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
2330    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
2331    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
2332    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
2333    pub fn r#create_symlink(
2334        &self,
2335        mut name: &str,
2336        mut target: &[u8],
2337        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
2338    ) -> fidl::client::QueryResponseFut<
2339        DirectoryCreateSymlinkResult,
2340        fidl::encoding::DefaultFuchsiaResourceDialect,
2341    > {
2342        DirectoryProxyInterface::r#create_symlink(self, name, target, connection)
2343    }
2344
2345    /// Watches a directory, receiving events of added messages on the
2346    /// watcher request channel.
2347    ///
2348    /// Options must be zero; it is reserved.
2349    ///
2350    /// This method does not require any rights, similar to ReadDirents.
2351    pub fn r#watch(
2352        &self,
2353        mut mask: WatchMask,
2354        mut options: u32,
2355        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
2356    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2357        DirectoryProxyInterface::r#watch(self, mask, options, watcher)
2358    }
2359}
2360
2361impl DirectoryProxyInterface for DirectoryProxy {
2362    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
2363        AdvisoryLockingAdvisoryLockResult,
2364        fidl::encoding::DefaultFuchsiaResourceDialect,
2365    >;
2366    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
2367        fn _decode(
2368            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2369        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
2370            let _response = fidl::client::decode_transaction_body::<
2371                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2372                fidl::encoding::DefaultFuchsiaResourceDialect,
2373                0x6ee9c0ad53ec87aa,
2374            >(_buf?)?;
2375            Ok(_response.map(|x| x))
2376        }
2377        self.client.send_query_and_decode::<
2378            AdvisoryLockingAdvisoryLockRequest,
2379            AdvisoryLockingAdvisoryLockResult,
2380        >(
2381            (request,),
2382            0x6ee9c0ad53ec87aa,
2383            fidl::encoding::DynamicFlags::empty(),
2384            _decode,
2385        )
2386    }
2387
2388    fn r#clone(
2389        &self,
2390        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
2391    ) -> Result<(), fidl::Error> {
2392        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
2393            (request,),
2394            0x20d8a7aba2168a79,
2395            fidl::encoding::DynamicFlags::empty(),
2396        )
2397    }
2398
2399    type CloseResponseFut = fidl::client::QueryResponseFut<
2400        fidl_fuchsia_unknown::CloseableCloseResult,
2401        fidl::encoding::DefaultFuchsiaResourceDialect,
2402    >;
2403    fn r#close(&self) -> Self::CloseResponseFut {
2404        fn _decode(
2405            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2406        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
2407            let _response = fidl::client::decode_transaction_body::<
2408                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2409                fidl::encoding::DefaultFuchsiaResourceDialect,
2410                0x5ac5d459ad7f657e,
2411            >(_buf?)?;
2412            Ok(_response.map(|x| x))
2413        }
2414        self.client.send_query_and_decode::<
2415            fidl::encoding::EmptyPayload,
2416            fidl_fuchsia_unknown::CloseableCloseResult,
2417        >(
2418            (),
2419            0x5ac5d459ad7f657e,
2420            fidl::encoding::DynamicFlags::empty(),
2421            _decode,
2422        )
2423    }
2424
2425    type QueryResponseFut =
2426        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2427    fn r#query(&self) -> Self::QueryResponseFut {
2428        fn _decode(
2429            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2430        ) -> Result<Vec<u8>, fidl::Error> {
2431            let _response = fidl::client::decode_transaction_body::<
2432                fidl_fuchsia_unknown::QueryableQueryResponse,
2433                fidl::encoding::DefaultFuchsiaResourceDialect,
2434                0x2658edee9decfc06,
2435            >(_buf?)?;
2436            Ok(_response.protocol)
2437        }
2438        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
2439            (),
2440            0x2658edee9decfc06,
2441            fidl::encoding::DynamicFlags::empty(),
2442            _decode,
2443        )
2444    }
2445
2446    fn r#deprecated_clone(
2447        &self,
2448        mut flags: OpenFlags,
2449        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2450    ) -> Result<(), fidl::Error> {
2451        self.client.send::<NodeDeprecatedCloneRequest>(
2452            (flags, object),
2453            0x5a61678f293ce16f,
2454            fidl::encoding::DynamicFlags::FLEXIBLE,
2455        )
2456    }
2457
2458    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
2459        (i32, NodeAttributes),
2460        fidl::encoding::DefaultFuchsiaResourceDialect,
2461    >;
2462    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
2463        fn _decode(
2464            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2465        ) -> Result<(i32, NodeAttributes), fidl::Error> {
2466            let _response = fidl::client::decode_transaction_body::<
2467                NodeDeprecatedGetAttrResponse,
2468                fidl::encoding::DefaultFuchsiaResourceDialect,
2469                0x78985e216314dafd,
2470            >(_buf?)?;
2471            Ok((_response.s, _response.attributes))
2472        }
2473        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
2474            (),
2475            0x78985e216314dafd,
2476            fidl::encoding::DynamicFlags::empty(),
2477            _decode,
2478        )
2479    }
2480
2481    type DeprecatedSetAttrResponseFut =
2482        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2483    fn r#deprecated_set_attr(
2484        &self,
2485        mut flags: NodeAttributeFlags,
2486        mut attributes: &NodeAttributes,
2487    ) -> Self::DeprecatedSetAttrResponseFut {
2488        fn _decode(
2489            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2490        ) -> Result<i32, fidl::Error> {
2491            let _response = fidl::client::decode_transaction_body::<
2492                NodeDeprecatedSetAttrResponse,
2493                fidl::encoding::DefaultFuchsiaResourceDialect,
2494                0x4186c0f40d938f46,
2495            >(_buf?)?;
2496            Ok(_response.s)
2497        }
2498        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
2499            (flags, attributes),
2500            0x4186c0f40d938f46,
2501            fidl::encoding::DynamicFlags::empty(),
2502            _decode,
2503        )
2504    }
2505
2506    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
2507        (i32, OpenFlags),
2508        fidl::encoding::DefaultFuchsiaResourceDialect,
2509    >;
2510    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
2511        fn _decode(
2512            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2513        ) -> Result<(i32, OpenFlags), fidl::Error> {
2514            let _response = fidl::client::decode_transaction_body::<
2515                NodeDeprecatedGetFlagsResponse,
2516                fidl::encoding::DefaultFuchsiaResourceDialect,
2517                0x5b88fffb8eda3aa1,
2518            >(_buf?)?;
2519            Ok((_response.s, _response.flags))
2520        }
2521        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
2522            (),
2523            0x5b88fffb8eda3aa1,
2524            fidl::encoding::DynamicFlags::empty(),
2525            _decode,
2526        )
2527    }
2528
2529    type DeprecatedSetFlagsResponseFut =
2530        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2531    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
2532        fn _decode(
2533            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2534        ) -> Result<i32, fidl::Error> {
2535            let _response = fidl::client::decode_transaction_body::<
2536                NodeDeprecatedSetFlagsResponse,
2537                fidl::encoding::DefaultFuchsiaResourceDialect,
2538                0x5295b76c71fde733,
2539            >(_buf?)?;
2540            Ok(_response.s)
2541        }
2542        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
2543            (flags,),
2544            0x5295b76c71fde733,
2545            fidl::encoding::DynamicFlags::empty(),
2546            _decode,
2547        )
2548    }
2549
2550    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
2551        NodeGetFlagsResult,
2552        fidl::encoding::DefaultFuchsiaResourceDialect,
2553    >;
2554    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
2555        fn _decode(
2556            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2557        ) -> Result<NodeGetFlagsResult, fidl::Error> {
2558            let _response = fidl::client::decode_transaction_body::<
2559                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
2560                fidl::encoding::DefaultFuchsiaResourceDialect,
2561                0x176eb318f64ec23,
2562            >(_buf?)?
2563            .into_result::<DirectoryMarker>("get_flags")?;
2564            Ok(_response.map(|x| x.flags))
2565        }
2566        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
2567            (),
2568            0x176eb318f64ec23,
2569            fidl::encoding::DynamicFlags::FLEXIBLE,
2570            _decode,
2571        )
2572    }
2573
2574    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
2575        NodeSetFlagsResult,
2576        fidl::encoding::DefaultFuchsiaResourceDialect,
2577    >;
2578    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
2579        fn _decode(
2580            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2581        ) -> Result<NodeSetFlagsResult, fidl::Error> {
2582            let _response = fidl::client::decode_transaction_body::<
2583                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2584                fidl::encoding::DefaultFuchsiaResourceDialect,
2585                0x55a8028685791ea8,
2586            >(_buf?)?
2587            .into_result::<DirectoryMarker>("set_flags")?;
2588            Ok(_response.map(|x| x))
2589        }
2590        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
2591            (flags,),
2592            0x55a8028685791ea8,
2593            fidl::encoding::DynamicFlags::FLEXIBLE,
2594            _decode,
2595        )
2596    }
2597
2598    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
2599        (i32, Option<Box<FilesystemInfo>>),
2600        fidl::encoding::DefaultFuchsiaResourceDialect,
2601    >;
2602    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
2603        fn _decode(
2604            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2605        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
2606            let _response = fidl::client::decode_transaction_body::<
2607                NodeQueryFilesystemResponse,
2608                fidl::encoding::DefaultFuchsiaResourceDialect,
2609                0x6f344a1c6b0a0610,
2610            >(_buf?)?;
2611            Ok((_response.s, _response.info))
2612        }
2613        self.client.send_query_and_decode::<
2614            fidl::encoding::EmptyPayload,
2615            (i32, Option<Box<FilesystemInfo>>),
2616        >(
2617            (),
2618            0x6f344a1c6b0a0610,
2619            fidl::encoding::DynamicFlags::empty(),
2620            _decode,
2621        )
2622    }
2623
2624    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
2625        NodeGetAttributesResult,
2626        fidl::encoding::DefaultFuchsiaResourceDialect,
2627    >;
2628    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
2629        fn _decode(
2630            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2631        ) -> Result<NodeGetAttributesResult, fidl::Error> {
2632            let _response = fidl::client::decode_transaction_body::<
2633                fidl::encoding::ResultType<NodeAttributes2, i32>,
2634                fidl::encoding::DefaultFuchsiaResourceDialect,
2635                0x3d4396a638ea053b,
2636            >(_buf?)?;
2637            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
2638        }
2639        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
2640            (query,),
2641            0x3d4396a638ea053b,
2642            fidl::encoding::DynamicFlags::empty(),
2643            _decode,
2644        )
2645    }
2646
2647    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
2648        NodeUpdateAttributesResult,
2649        fidl::encoding::DefaultFuchsiaResourceDialect,
2650    >;
2651    fn r#update_attributes(
2652        &self,
2653        mut payload: &MutableNodeAttributes,
2654    ) -> Self::UpdateAttributesResponseFut {
2655        fn _decode(
2656            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2657        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
2658            let _response = fidl::client::decode_transaction_body::<
2659                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2660                fidl::encoding::DefaultFuchsiaResourceDialect,
2661                0x3308c1da5a89bf08,
2662            >(_buf?)?;
2663            Ok(_response.map(|x| x))
2664        }
2665        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
2666            payload,
2667            0x3308c1da5a89bf08,
2668            fidl::encoding::DynamicFlags::empty(),
2669            _decode,
2670        )
2671    }
2672
2673    type SyncResponseFut = fidl::client::QueryResponseFut<
2674        NodeSyncResult,
2675        fidl::encoding::DefaultFuchsiaResourceDialect,
2676    >;
2677    fn r#sync(&self) -> Self::SyncResponseFut {
2678        fn _decode(
2679            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2680        ) -> Result<NodeSyncResult, fidl::Error> {
2681            let _response = fidl::client::decode_transaction_body::<
2682                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2683                fidl::encoding::DefaultFuchsiaResourceDialect,
2684                0x2c5c27ca0ab5dc49,
2685            >(_buf?)?;
2686            Ok(_response.map(|x| x))
2687        }
2688        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
2689            (),
2690            0x2c5c27ca0ab5dc49,
2691            fidl::encoding::DynamicFlags::empty(),
2692            _decode,
2693        )
2694    }
2695
2696    fn r#list_extended_attributes(
2697        &self,
2698        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2699    ) -> Result<(), fidl::Error> {
2700        self.client.send::<NodeListExtendedAttributesRequest>(
2701            (iterator,),
2702            0x4b61033de007fcd0,
2703            fidl::encoding::DynamicFlags::empty(),
2704        )
2705    }
2706
2707    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2708        NodeGetExtendedAttributeResult,
2709        fidl::encoding::DefaultFuchsiaResourceDialect,
2710    >;
2711    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
2712        fn _decode(
2713            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2714        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
2715            let _response = fidl::client::decode_transaction_body::<
2716                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
2717                fidl::encoding::DefaultFuchsiaResourceDialect,
2718                0x45ffa3ccfdeb76db,
2719            >(_buf?)?;
2720            Ok(_response.map(|x| x))
2721        }
2722        self.client.send_query_and_decode::<
2723            NodeGetExtendedAttributeRequest,
2724            NodeGetExtendedAttributeResult,
2725        >(
2726            (name,),
2727            0x45ffa3ccfdeb76db,
2728            fidl::encoding::DynamicFlags::empty(),
2729            _decode,
2730        )
2731    }
2732
2733    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2734        NodeSetExtendedAttributeResult,
2735        fidl::encoding::DefaultFuchsiaResourceDialect,
2736    >;
2737    fn r#set_extended_attribute(
2738        &self,
2739        mut name: &[u8],
2740        mut value: ExtendedAttributeValue,
2741        mut mode: SetExtendedAttributeMode,
2742    ) -> Self::SetExtendedAttributeResponseFut {
2743        fn _decode(
2744            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2745        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
2746            let _response = fidl::client::decode_transaction_body::<
2747                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2748                fidl::encoding::DefaultFuchsiaResourceDialect,
2749                0x4a951362f681f23c,
2750            >(_buf?)?;
2751            Ok(_response.map(|x| x))
2752        }
2753        self.client.send_query_and_decode::<
2754            NodeSetExtendedAttributeRequest,
2755            NodeSetExtendedAttributeResult,
2756        >(
2757            (name, &mut value, mode,),
2758            0x4a951362f681f23c,
2759            fidl::encoding::DynamicFlags::empty(),
2760            _decode,
2761        )
2762    }
2763
2764    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2765        NodeRemoveExtendedAttributeResult,
2766        fidl::encoding::DefaultFuchsiaResourceDialect,
2767    >;
2768    fn r#remove_extended_attribute(
2769        &self,
2770        mut name: &[u8],
2771    ) -> Self::RemoveExtendedAttributeResponseFut {
2772        fn _decode(
2773            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2774        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
2775            let _response = fidl::client::decode_transaction_body::<
2776                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2777                fidl::encoding::DefaultFuchsiaResourceDialect,
2778                0x7a0b9f3a9bf9032d,
2779            >(_buf?)?;
2780            Ok(_response.map(|x| x))
2781        }
2782        self.client.send_query_and_decode::<
2783            NodeRemoveExtendedAttributeRequest,
2784            NodeRemoveExtendedAttributeResult,
2785        >(
2786            (name,),
2787            0x7a0b9f3a9bf9032d,
2788            fidl::encoding::DynamicFlags::empty(),
2789            _decode,
2790        )
2791    }
2792
2793    fn r#deprecated_open(
2794        &self,
2795        mut flags: OpenFlags,
2796        mut mode: ModeType,
2797        mut path: &str,
2798        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2799    ) -> Result<(), fidl::Error> {
2800        self.client.send::<DirectoryDeprecatedOpenRequest>(
2801            (flags, mode, path, object),
2802            0x2c5044561d685ec0,
2803            fidl::encoding::DynamicFlags::FLEXIBLE,
2804        )
2805    }
2806
2807    fn r#open(
2808        &self,
2809        mut path: &str,
2810        mut flags: Flags,
2811        mut options: &Options,
2812        mut object: fidl::Channel,
2813    ) -> Result<(), fidl::Error> {
2814        self.client.send::<DirectoryOpenRequest>(
2815            (path, flags, options, object),
2816            0x568ddcb9a9cbb6d9,
2817            fidl::encoding::DynamicFlags::empty(),
2818        )
2819    }
2820
2821    type ReadDirentsResponseFut = fidl::client::QueryResponseFut<
2822        (i32, Vec<u8>),
2823        fidl::encoding::DefaultFuchsiaResourceDialect,
2824    >;
2825    fn r#read_dirents(&self, mut max_bytes: u64) -> Self::ReadDirentsResponseFut {
2826        fn _decode(
2827            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2828        ) -> Result<(i32, Vec<u8>), fidl::Error> {
2829            let _response = fidl::client::decode_transaction_body::<
2830                DirectoryReadDirentsResponse,
2831                fidl::encoding::DefaultFuchsiaResourceDialect,
2832                0x3582806bf27faa0a,
2833            >(_buf?)?;
2834            Ok((_response.s, _response.dirents))
2835        }
2836        self.client.send_query_and_decode::<DirectoryReadDirentsRequest, (i32, Vec<u8>)>(
2837            (max_bytes,),
2838            0x3582806bf27faa0a,
2839            fidl::encoding::DynamicFlags::empty(),
2840            _decode,
2841        )
2842    }
2843
2844    type RewindResponseFut =
2845        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2846    fn r#rewind(&self) -> Self::RewindResponseFut {
2847        fn _decode(
2848            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2849        ) -> Result<i32, fidl::Error> {
2850            let _response = fidl::client::decode_transaction_body::<
2851                DirectoryRewindResponse,
2852                fidl::encoding::DefaultFuchsiaResourceDialect,
2853                0x16b1202af0f34c71,
2854            >(_buf?)?;
2855            Ok(_response.s)
2856        }
2857        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
2858            (),
2859            0x16b1202af0f34c71,
2860            fidl::encoding::DynamicFlags::empty(),
2861            _decode,
2862        )
2863    }
2864
2865    type GetTokenResponseFut = fidl::client::QueryResponseFut<
2866        (i32, Option<fidl::NullableHandle>),
2867        fidl::encoding::DefaultFuchsiaResourceDialect,
2868    >;
2869    fn r#get_token(&self) -> Self::GetTokenResponseFut {
2870        fn _decode(
2871            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2872        ) -> Result<(i32, Option<fidl::NullableHandle>), fidl::Error> {
2873            let _response = fidl::client::decode_transaction_body::<
2874                DirectoryGetTokenResponse,
2875                fidl::encoding::DefaultFuchsiaResourceDialect,
2876                0x26ae9d18763c8655,
2877            >(_buf?)?;
2878            Ok((_response.s, _response.token))
2879        }
2880        self.client.send_query_and_decode::<
2881            fidl::encoding::EmptyPayload,
2882            (i32, Option<fidl::NullableHandle>),
2883        >(
2884            (),
2885            0x26ae9d18763c8655,
2886            fidl::encoding::DynamicFlags::empty(),
2887            _decode,
2888        )
2889    }
2890
2891    type LinkResponseFut =
2892        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2893    fn r#link(
2894        &self,
2895        mut src: &str,
2896        mut dst_parent_token: fidl::NullableHandle,
2897        mut dst: &str,
2898    ) -> Self::LinkResponseFut {
2899        fn _decode(
2900            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2901        ) -> Result<i32, fidl::Error> {
2902            let _response = fidl::client::decode_transaction_body::<
2903                DirectoryLinkResponse,
2904                fidl::encoding::DefaultFuchsiaResourceDialect,
2905                0x740604c0c7c930e7,
2906            >(_buf?)?;
2907            Ok(_response.s)
2908        }
2909        self.client.send_query_and_decode::<DirectoryLinkRequest, i32>(
2910            (src, dst_parent_token, dst),
2911            0x740604c0c7c930e7,
2912            fidl::encoding::DynamicFlags::empty(),
2913            _decode,
2914        )
2915    }
2916
2917    type UnlinkResponseFut = fidl::client::QueryResponseFut<
2918        DirectoryUnlinkResult,
2919        fidl::encoding::DefaultFuchsiaResourceDialect,
2920    >;
2921    fn r#unlink(&self, mut name: &str, mut options: &UnlinkOptions) -> Self::UnlinkResponseFut {
2922        fn _decode(
2923            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2924        ) -> Result<DirectoryUnlinkResult, fidl::Error> {
2925            let _response = fidl::client::decode_transaction_body::<
2926                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2927                fidl::encoding::DefaultFuchsiaResourceDialect,
2928                0x750a0326a78d7bed,
2929            >(_buf?)?;
2930            Ok(_response.map(|x| x))
2931        }
2932        self.client.send_query_and_decode::<DirectoryUnlinkRequest, DirectoryUnlinkResult>(
2933            (name, options),
2934            0x750a0326a78d7bed,
2935            fidl::encoding::DynamicFlags::empty(),
2936            _decode,
2937        )
2938    }
2939
2940    type RenameResponseFut = fidl::client::QueryResponseFut<
2941        DirectoryRenameResult,
2942        fidl::encoding::DefaultFuchsiaResourceDialect,
2943    >;
2944    fn r#rename(
2945        &self,
2946        mut src: &str,
2947        mut dst_parent_token: fidl::Event,
2948        mut dst: &str,
2949    ) -> Self::RenameResponseFut {
2950        fn _decode(
2951            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2952        ) -> Result<DirectoryRenameResult, fidl::Error> {
2953            let _response = fidl::client::decode_transaction_body::<
2954                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2955                fidl::encoding::DefaultFuchsiaResourceDialect,
2956                0x7060e7723b9928de,
2957            >(_buf?)?;
2958            Ok(_response.map(|x| x))
2959        }
2960        self.client.send_query_and_decode::<DirectoryRenameRequest, DirectoryRenameResult>(
2961            (src, dst_parent_token, dst),
2962            0x7060e7723b9928de,
2963            fidl::encoding::DynamicFlags::empty(),
2964            _decode,
2965        )
2966    }
2967
2968    type CreateSymlinkResponseFut = fidl::client::QueryResponseFut<
2969        DirectoryCreateSymlinkResult,
2970        fidl::encoding::DefaultFuchsiaResourceDialect,
2971    >;
2972    fn r#create_symlink(
2973        &self,
2974        mut name: &str,
2975        mut target: &[u8],
2976        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
2977    ) -> Self::CreateSymlinkResponseFut {
2978        fn _decode(
2979            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2980        ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
2981            let _response = fidl::client::decode_transaction_body::<
2982                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2983                fidl::encoding::DefaultFuchsiaResourceDialect,
2984                0x21ce0f19ec043889,
2985            >(_buf?)?;
2986            Ok(_response.map(|x| x))
2987        }
2988        self.client
2989            .send_query_and_decode::<DirectoryCreateSymlinkRequest, DirectoryCreateSymlinkResult>(
2990                (name, target, connection),
2991                0x21ce0f19ec043889,
2992                fidl::encoding::DynamicFlags::empty(),
2993                _decode,
2994            )
2995    }
2996
2997    type WatchResponseFut =
2998        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2999    fn r#watch(
3000        &self,
3001        mut mask: WatchMask,
3002        mut options: u32,
3003        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
3004    ) -> Self::WatchResponseFut {
3005        fn _decode(
3006            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3007        ) -> Result<i32, fidl::Error> {
3008            let _response = fidl::client::decode_transaction_body::<
3009                DirectoryWatchResponse,
3010                fidl::encoding::DefaultFuchsiaResourceDialect,
3011                0x5717193a59d66d91,
3012            >(_buf?)?;
3013            Ok(_response.s)
3014        }
3015        self.client.send_query_and_decode::<DirectoryWatchRequest, i32>(
3016            (mask, options, watcher),
3017            0x5717193a59d66d91,
3018            fidl::encoding::DynamicFlags::empty(),
3019            _decode,
3020        )
3021    }
3022}
3023
3024pub struct DirectoryEventStream {
3025    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3026}
3027
3028impl std::marker::Unpin for DirectoryEventStream {}
3029
3030impl futures::stream::FusedStream for DirectoryEventStream {
3031    fn is_terminated(&self) -> bool {
3032        self.event_receiver.is_terminated()
3033    }
3034}
3035
3036impl futures::Stream for DirectoryEventStream {
3037    type Item = Result<DirectoryEvent, fidl::Error>;
3038
3039    fn poll_next(
3040        mut self: std::pin::Pin<&mut Self>,
3041        cx: &mut std::task::Context<'_>,
3042    ) -> std::task::Poll<Option<Self::Item>> {
3043        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3044            &mut self.event_receiver,
3045            cx
3046        )?) {
3047            Some(buf) => std::task::Poll::Ready(Some(DirectoryEvent::decode(buf))),
3048            None => std::task::Poll::Ready(None),
3049        }
3050    }
3051}
3052
3053#[derive(Debug)]
3054pub enum DirectoryEvent {
3055    OnOpen_ {
3056        s: i32,
3057        info: Option<Box<NodeInfoDeprecated>>,
3058    },
3059    OnRepresentation {
3060        payload: Representation,
3061    },
3062    #[non_exhaustive]
3063    _UnknownEvent {
3064        /// Ordinal of the event that was sent.
3065        ordinal: u64,
3066    },
3067}
3068
3069impl DirectoryEvent {
3070    #[allow(irrefutable_let_patterns)]
3071    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
3072        if let DirectoryEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
3073    }
3074    #[allow(irrefutable_let_patterns)]
3075    pub fn into_on_representation(self) -> Option<Representation> {
3076        if let DirectoryEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
3077    }
3078
3079    /// Decodes a message buffer as a [`DirectoryEvent`].
3080    fn decode(
3081        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3082    ) -> Result<DirectoryEvent, fidl::Error> {
3083        let (bytes, _handles) = buf.split_mut();
3084        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3085        debug_assert_eq!(tx_header.tx_id, 0);
3086        match tx_header.ordinal {
3087            0x7fc7bbb1dbfd1972 => {
3088                let mut out = fidl::new_empty!(
3089                    NodeOnOpenRequest,
3090                    fidl::encoding::DefaultFuchsiaResourceDialect
3091                );
3092                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3093                Ok((DirectoryEvent::OnOpen_ { s: out.s, info: out.info }))
3094            }
3095            0x5cb40567d80a510c => {
3096                let mut out =
3097                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
3098                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
3099                Ok((DirectoryEvent::OnRepresentation { payload: out }))
3100            }
3101            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3102                Ok(DirectoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3103            }
3104            _ => Err(fidl::Error::UnknownOrdinal {
3105                ordinal: tx_header.ordinal,
3106                protocol_name: <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3107            }),
3108        }
3109    }
3110}
3111
3112/// A Stream of incoming requests for fuchsia.io/Directory.
3113pub struct DirectoryRequestStream {
3114    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3115    is_terminated: bool,
3116}
3117
3118impl std::marker::Unpin for DirectoryRequestStream {}
3119
3120impl futures::stream::FusedStream for DirectoryRequestStream {
3121    fn is_terminated(&self) -> bool {
3122        self.is_terminated
3123    }
3124}
3125
3126impl fidl::endpoints::RequestStream for DirectoryRequestStream {
3127    type Protocol = DirectoryMarker;
3128    type ControlHandle = DirectoryControlHandle;
3129
3130    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3131        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3132    }
3133
3134    fn control_handle(&self) -> Self::ControlHandle {
3135        DirectoryControlHandle { inner: self.inner.clone() }
3136    }
3137
3138    fn into_inner(
3139        self,
3140    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3141    {
3142        (self.inner, self.is_terminated)
3143    }
3144
3145    fn from_inner(
3146        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3147        is_terminated: bool,
3148    ) -> Self {
3149        Self { inner, is_terminated }
3150    }
3151}
3152
3153impl futures::Stream for DirectoryRequestStream {
3154    type Item = Result<DirectoryRequest, fidl::Error>;
3155
3156    fn poll_next(
3157        mut self: std::pin::Pin<&mut Self>,
3158        cx: &mut std::task::Context<'_>,
3159    ) -> std::task::Poll<Option<Self::Item>> {
3160        let this = &mut *self;
3161        if this.inner.check_shutdown(cx) {
3162            this.is_terminated = true;
3163            return std::task::Poll::Ready(None);
3164        }
3165        if this.is_terminated {
3166            panic!("polled DirectoryRequestStream after completion");
3167        }
3168        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3169            |bytes, handles| {
3170                match this.inner.channel().read_etc(cx, bytes, handles) {
3171                    std::task::Poll::Ready(Ok(())) => {}
3172                    std::task::Poll::Pending => return std::task::Poll::Pending,
3173                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3174                        this.is_terminated = true;
3175                        return std::task::Poll::Ready(None);
3176                    }
3177                    std::task::Poll::Ready(Err(e)) => {
3178                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3179                            e.into(),
3180                        ))));
3181                    }
3182                }
3183
3184                // A message has been received from the channel
3185                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3186
3187                std::task::Poll::Ready(Some(match header.ordinal {
3188                    0x6ee9c0ad53ec87aa => {
3189                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3190                        let mut req = fidl::new_empty!(
3191                            AdvisoryLockingAdvisoryLockRequest,
3192                            fidl::encoding::DefaultFuchsiaResourceDialect
3193                        );
3194                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
3195                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3196                        Ok(DirectoryRequest::AdvisoryLock {
3197                            request: req.request,
3198
3199                            responder: DirectoryAdvisoryLockResponder {
3200                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3201                                tx_id: header.tx_id,
3202                            },
3203                        })
3204                    }
3205                    0x20d8a7aba2168a79 => {
3206                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3207                        let mut req = fidl::new_empty!(
3208                            fidl_fuchsia_unknown::CloneableCloneRequest,
3209                            fidl::encoding::DefaultFuchsiaResourceDialect
3210                        );
3211                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3212                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3213                        Ok(DirectoryRequest::Clone { request: req.request, control_handle })
3214                    }
3215                    0x5ac5d459ad7f657e => {
3216                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3217                        let mut req = fidl::new_empty!(
3218                            fidl::encoding::EmptyPayload,
3219                            fidl::encoding::DefaultFuchsiaResourceDialect
3220                        );
3221                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3222                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3223                        Ok(DirectoryRequest::Close {
3224                            responder: DirectoryCloseResponder {
3225                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3226                                tx_id: header.tx_id,
3227                            },
3228                        })
3229                    }
3230                    0x2658edee9decfc06 => {
3231                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3232                        let mut req = fidl::new_empty!(
3233                            fidl::encoding::EmptyPayload,
3234                            fidl::encoding::DefaultFuchsiaResourceDialect
3235                        );
3236                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3237                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3238                        Ok(DirectoryRequest::Query {
3239                            responder: DirectoryQueryResponder {
3240                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3241                                tx_id: header.tx_id,
3242                            },
3243                        })
3244                    }
3245                    0x5a61678f293ce16f => {
3246                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3247                        let mut req = fidl::new_empty!(
3248                            NodeDeprecatedCloneRequest,
3249                            fidl::encoding::DefaultFuchsiaResourceDialect
3250                        );
3251                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3252                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3253                        Ok(DirectoryRequest::DeprecatedClone {
3254                            flags: req.flags,
3255                            object: req.object,
3256
3257                            control_handle,
3258                        })
3259                    }
3260                    0x78985e216314dafd => {
3261                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3262                        let mut req = fidl::new_empty!(
3263                            fidl::encoding::EmptyPayload,
3264                            fidl::encoding::DefaultFuchsiaResourceDialect
3265                        );
3266                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3267                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3268                        Ok(DirectoryRequest::DeprecatedGetAttr {
3269                            responder: DirectoryDeprecatedGetAttrResponder {
3270                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3271                                tx_id: header.tx_id,
3272                            },
3273                        })
3274                    }
3275                    0x4186c0f40d938f46 => {
3276                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3277                        let mut req = fidl::new_empty!(
3278                            NodeDeprecatedSetAttrRequest,
3279                            fidl::encoding::DefaultFuchsiaResourceDialect
3280                        );
3281                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
3282                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3283                        Ok(DirectoryRequest::DeprecatedSetAttr {
3284                            flags: req.flags,
3285                            attributes: req.attributes,
3286
3287                            responder: DirectoryDeprecatedSetAttrResponder {
3288                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3289                                tx_id: header.tx_id,
3290                            },
3291                        })
3292                    }
3293                    0x5b88fffb8eda3aa1 => {
3294                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3295                        let mut req = fidl::new_empty!(
3296                            fidl::encoding::EmptyPayload,
3297                            fidl::encoding::DefaultFuchsiaResourceDialect
3298                        );
3299                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3300                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3301                        Ok(DirectoryRequest::DeprecatedGetFlags {
3302                            responder: DirectoryDeprecatedGetFlagsResponder {
3303                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3304                                tx_id: header.tx_id,
3305                            },
3306                        })
3307                    }
3308                    0x5295b76c71fde733 => {
3309                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3310                        let mut req = fidl::new_empty!(
3311                            NodeDeprecatedSetFlagsRequest,
3312                            fidl::encoding::DefaultFuchsiaResourceDialect
3313                        );
3314                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3315                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3316                        Ok(DirectoryRequest::DeprecatedSetFlags {
3317                            flags: req.flags,
3318
3319                            responder: DirectoryDeprecatedSetFlagsResponder {
3320                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3321                                tx_id: header.tx_id,
3322                            },
3323                        })
3324                    }
3325                    0x176eb318f64ec23 => {
3326                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3327                        let mut req = fidl::new_empty!(
3328                            fidl::encoding::EmptyPayload,
3329                            fidl::encoding::DefaultFuchsiaResourceDialect
3330                        );
3331                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3332                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3333                        Ok(DirectoryRequest::GetFlags {
3334                            responder: DirectoryGetFlagsResponder {
3335                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3336                                tx_id: header.tx_id,
3337                            },
3338                        })
3339                    }
3340                    0x55a8028685791ea8 => {
3341                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3342                        let mut req = fidl::new_empty!(
3343                            NodeSetFlagsRequest,
3344                            fidl::encoding::DefaultFuchsiaResourceDialect
3345                        );
3346                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3347                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3348                        Ok(DirectoryRequest::SetFlags {
3349                            flags: req.flags,
3350
3351                            responder: DirectorySetFlagsResponder {
3352                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3353                                tx_id: header.tx_id,
3354                            },
3355                        })
3356                    }
3357                    0x6f344a1c6b0a0610 => {
3358                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3359                        let mut req = fidl::new_empty!(
3360                            fidl::encoding::EmptyPayload,
3361                            fidl::encoding::DefaultFuchsiaResourceDialect
3362                        );
3363                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3364                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3365                        Ok(DirectoryRequest::QueryFilesystem {
3366                            responder: DirectoryQueryFilesystemResponder {
3367                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3368                                tx_id: header.tx_id,
3369                            },
3370                        })
3371                    }
3372                    0x3d4396a638ea053b => {
3373                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3374                        let mut req = fidl::new_empty!(
3375                            NodeGetAttributesRequest,
3376                            fidl::encoding::DefaultFuchsiaResourceDialect
3377                        );
3378                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3379                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3380                        Ok(DirectoryRequest::GetAttributes {
3381                            query: req.query,
3382
3383                            responder: DirectoryGetAttributesResponder {
3384                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3385                                tx_id: header.tx_id,
3386                            },
3387                        })
3388                    }
3389                    0x3308c1da5a89bf08 => {
3390                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3391                        let mut req = fidl::new_empty!(
3392                            MutableNodeAttributes,
3393                            fidl::encoding::DefaultFuchsiaResourceDialect
3394                        );
3395                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
3396                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3397                        Ok(DirectoryRequest::UpdateAttributes {
3398                            payload: req,
3399                            responder: DirectoryUpdateAttributesResponder {
3400                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3401                                tx_id: header.tx_id,
3402                            },
3403                        })
3404                    }
3405                    0x2c5c27ca0ab5dc49 => {
3406                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3407                        let mut req = fidl::new_empty!(
3408                            fidl::encoding::EmptyPayload,
3409                            fidl::encoding::DefaultFuchsiaResourceDialect
3410                        );
3411                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3412                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3413                        Ok(DirectoryRequest::Sync {
3414                            responder: DirectorySyncResponder {
3415                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3416                                tx_id: header.tx_id,
3417                            },
3418                        })
3419                    }
3420                    0x4b61033de007fcd0 => {
3421                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3422                        let mut req = fidl::new_empty!(
3423                            NodeListExtendedAttributesRequest,
3424                            fidl::encoding::DefaultFuchsiaResourceDialect
3425                        );
3426                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3427                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3428                        Ok(DirectoryRequest::ListExtendedAttributes {
3429                            iterator: req.iterator,
3430
3431                            control_handle,
3432                        })
3433                    }
3434                    0x45ffa3ccfdeb76db => {
3435                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3436                        let mut req = fidl::new_empty!(
3437                            NodeGetExtendedAttributeRequest,
3438                            fidl::encoding::DefaultFuchsiaResourceDialect
3439                        );
3440                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3441                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3442                        Ok(DirectoryRequest::GetExtendedAttribute {
3443                            name: req.name,
3444
3445                            responder: DirectoryGetExtendedAttributeResponder {
3446                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3447                                tx_id: header.tx_id,
3448                            },
3449                        })
3450                    }
3451                    0x4a951362f681f23c => {
3452                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3453                        let mut req = fidl::new_empty!(
3454                            NodeSetExtendedAttributeRequest,
3455                            fidl::encoding::DefaultFuchsiaResourceDialect
3456                        );
3457                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3458                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3459                        Ok(DirectoryRequest::SetExtendedAttribute {
3460                            name: req.name,
3461                            value: req.value,
3462                            mode: req.mode,
3463
3464                            responder: DirectorySetExtendedAttributeResponder {
3465                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3466                                tx_id: header.tx_id,
3467                            },
3468                        })
3469                    }
3470                    0x7a0b9f3a9bf9032d => {
3471                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3472                        let mut req = fidl::new_empty!(
3473                            NodeRemoveExtendedAttributeRequest,
3474                            fidl::encoding::DefaultFuchsiaResourceDialect
3475                        );
3476                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3477                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3478                        Ok(DirectoryRequest::RemoveExtendedAttribute {
3479                            name: req.name,
3480
3481                            responder: DirectoryRemoveExtendedAttributeResponder {
3482                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3483                                tx_id: header.tx_id,
3484                            },
3485                        })
3486                    }
3487                    0x2c5044561d685ec0 => {
3488                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3489                        let mut req = fidl::new_empty!(
3490                            DirectoryDeprecatedOpenRequest,
3491                            fidl::encoding::DefaultFuchsiaResourceDialect
3492                        );
3493                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryDeprecatedOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3494                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3495                        Ok(DirectoryRequest::DeprecatedOpen {
3496                            flags: req.flags,
3497                            mode: req.mode,
3498                            path: req.path,
3499                            object: req.object,
3500
3501                            control_handle,
3502                        })
3503                    }
3504                    0x568ddcb9a9cbb6d9 => {
3505                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3506                        let mut req = fidl::new_empty!(
3507                            DirectoryOpenRequest,
3508                            fidl::encoding::DefaultFuchsiaResourceDialect
3509                        );
3510                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3511                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3512                        Ok(DirectoryRequest::Open {
3513                            path: req.path,
3514                            flags: req.flags,
3515                            options: req.options,
3516                            object: req.object,
3517
3518                            control_handle,
3519                        })
3520                    }
3521                    0x3582806bf27faa0a => {
3522                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3523                        let mut req = fidl::new_empty!(
3524                            DirectoryReadDirentsRequest,
3525                            fidl::encoding::DefaultFuchsiaResourceDialect
3526                        );
3527                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryReadDirentsRequest>(&header, _body_bytes, handles, &mut req)?;
3528                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3529                        Ok(DirectoryRequest::ReadDirents {
3530                            max_bytes: req.max_bytes,
3531
3532                            responder: DirectoryReadDirentsResponder {
3533                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3534                                tx_id: header.tx_id,
3535                            },
3536                        })
3537                    }
3538                    0x16b1202af0f34c71 => {
3539                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3540                        let mut req = fidl::new_empty!(
3541                            fidl::encoding::EmptyPayload,
3542                            fidl::encoding::DefaultFuchsiaResourceDialect
3543                        );
3544                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3545                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3546                        Ok(DirectoryRequest::Rewind {
3547                            responder: DirectoryRewindResponder {
3548                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3549                                tx_id: header.tx_id,
3550                            },
3551                        })
3552                    }
3553                    0x26ae9d18763c8655 => {
3554                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3555                        let mut req = fidl::new_empty!(
3556                            fidl::encoding::EmptyPayload,
3557                            fidl::encoding::DefaultFuchsiaResourceDialect
3558                        );
3559                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3560                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3561                        Ok(DirectoryRequest::GetToken {
3562                            responder: DirectoryGetTokenResponder {
3563                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3564                                tx_id: header.tx_id,
3565                            },
3566                        })
3567                    }
3568                    0x740604c0c7c930e7 => {
3569                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3570                        let mut req = fidl::new_empty!(
3571                            DirectoryLinkRequest,
3572                            fidl::encoding::DefaultFuchsiaResourceDialect
3573                        );
3574                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryLinkRequest>(&header, _body_bytes, handles, &mut req)?;
3575                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3576                        Ok(DirectoryRequest::Link {
3577                            src: req.src,
3578                            dst_parent_token: req.dst_parent_token,
3579                            dst: req.dst,
3580
3581                            responder: DirectoryLinkResponder {
3582                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3583                                tx_id: header.tx_id,
3584                            },
3585                        })
3586                    }
3587                    0x750a0326a78d7bed => {
3588                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3589                        let mut req = fidl::new_empty!(
3590                            DirectoryUnlinkRequest,
3591                            fidl::encoding::DefaultFuchsiaResourceDialect
3592                        );
3593                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryUnlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3594                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3595                        Ok(DirectoryRequest::Unlink {
3596                            name: req.name,
3597                            options: req.options,
3598
3599                            responder: DirectoryUnlinkResponder {
3600                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3601                                tx_id: header.tx_id,
3602                            },
3603                        })
3604                    }
3605                    0x7060e7723b9928de => {
3606                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3607                        let mut req = fidl::new_empty!(
3608                            DirectoryRenameRequest,
3609                            fidl::encoding::DefaultFuchsiaResourceDialect
3610                        );
3611                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryRenameRequest>(&header, _body_bytes, handles, &mut req)?;
3612                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3613                        Ok(DirectoryRequest::Rename {
3614                            src: req.src,
3615                            dst_parent_token: req.dst_parent_token,
3616                            dst: req.dst,
3617
3618                            responder: DirectoryRenameResponder {
3619                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3620                                tx_id: header.tx_id,
3621                            },
3622                        })
3623                    }
3624                    0x21ce0f19ec043889 => {
3625                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3626                        let mut req = fidl::new_empty!(
3627                            DirectoryCreateSymlinkRequest,
3628                            fidl::encoding::DefaultFuchsiaResourceDialect
3629                        );
3630                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryCreateSymlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3631                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3632                        Ok(DirectoryRequest::CreateSymlink {
3633                            name: req.name,
3634                            target: req.target,
3635                            connection: req.connection,
3636
3637                            responder: DirectoryCreateSymlinkResponder {
3638                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3639                                tx_id: header.tx_id,
3640                            },
3641                        })
3642                    }
3643                    0x5717193a59d66d91 => {
3644                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3645                        let mut req = fidl::new_empty!(
3646                            DirectoryWatchRequest,
3647                            fidl::encoding::DefaultFuchsiaResourceDialect
3648                        );
3649                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryWatchRequest>(&header, _body_bytes, handles, &mut req)?;
3650                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3651                        Ok(DirectoryRequest::Watch {
3652                            mask: req.mask,
3653                            options: req.options,
3654                            watcher: req.watcher,
3655
3656                            responder: DirectoryWatchResponder {
3657                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3658                                tx_id: header.tx_id,
3659                            },
3660                        })
3661                    }
3662                    _ if header.tx_id == 0
3663                        && header
3664                            .dynamic_flags()
3665                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3666                    {
3667                        Ok(DirectoryRequest::_UnknownMethod {
3668                            ordinal: header.ordinal,
3669                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3670                            method_type: fidl::MethodType::OneWay,
3671                        })
3672                    }
3673                    _ if header
3674                        .dynamic_flags()
3675                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3676                    {
3677                        this.inner.send_framework_err(
3678                            fidl::encoding::FrameworkErr::UnknownMethod,
3679                            header.tx_id,
3680                            header.ordinal,
3681                            header.dynamic_flags(),
3682                            (bytes, handles),
3683                        )?;
3684                        Ok(DirectoryRequest::_UnknownMethod {
3685                            ordinal: header.ordinal,
3686                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3687                            method_type: fidl::MethodType::TwoWay,
3688                        })
3689                    }
3690                    _ => Err(fidl::Error::UnknownOrdinal {
3691                        ordinal: header.ordinal,
3692                        protocol_name:
3693                            <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3694                    }),
3695                }))
3696            },
3697        )
3698    }
3699}
3700
3701/// Directory defines a node which is capable of containing other Objects.
3702#[derive(Debug)]
3703pub enum DirectoryRequest {
3704    /// Acquires an advisory lock on the underlying file.
3705    ///
3706    /// The lock lasts until either this connection is closed or
3707    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
3708    /// explicitly.
3709    ///
3710    /// Advisory locks are purely advisory. They do not prevent actual read or
3711    /// write operations from occurring on the file, either through this
3712    /// connection or through other connections.
3713    ///
3714    /// This method requires the following rights:
3715    ///
3716    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
3717    /// * [`Rights.WRITE_BYTES`] if `request.type` is
3718    ///   [`AdvisoryLockType.WRITE`].
3719    ///
3720    /// # Errors
3721    ///
3722    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
3723    ///   example, another connection might hold a conflicting lock type.
3724    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
3725    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
3726    ///   to acquire the given type of lock.
3727    AdvisoryLock {
3728        request: AdvisoryLockRequest,
3729        responder: DirectoryAdvisoryLockResponder,
3730    },
3731    Clone {
3732        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
3733        control_handle: DirectoryControlHandle,
3734    },
3735    /// Terminates the connection.
3736    ///
3737    /// After calling `Close`, the client must not send any other requests.
3738    ///
3739    /// Servers, after sending the status response, should close the connection
3740    /// regardless of status and without sending an epitaph.
3741    ///
3742    /// Closing the client end of the channel should be semantically equivalent
3743    /// to calling `Close` without knowing when the close has completed or its
3744    /// status.
3745    Close {
3746        responder: DirectoryCloseResponder,
3747    },
3748    Query {
3749        responder: DirectoryQueryResponder,
3750    },
3751    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
3752    DeprecatedClone {
3753        flags: OpenFlags,
3754        object: fidl::endpoints::ServerEnd<NodeMarker>,
3755        control_handle: DirectoryControlHandle,
3756    },
3757    /// DEPRECATED - Use `Node.GetAttributes` instead.
3758    DeprecatedGetAttr {
3759        responder: DirectoryDeprecatedGetAttrResponder,
3760    },
3761    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
3762    DeprecatedSetAttr {
3763        flags: NodeAttributeFlags,
3764        attributes: NodeAttributes,
3765        responder: DirectoryDeprecatedSetAttrResponder,
3766    },
3767    /// [DEPRECATED - Use new GetFlags method instead.]
3768    DeprecatedGetFlags {
3769        responder: DirectoryDeprecatedGetFlagsResponder,
3770    },
3771    /// [DEPRECATED - Use new SetFlags method instead.]
3772    DeprecatedSetFlags {
3773        flags: OpenFlags,
3774        responder: DirectoryDeprecatedSetFlagsResponder,
3775    },
3776    /// Queries the flags that apply to this node after it has been opened/created. This method does
3777    /// not require any rights.
3778    ///
3779    /// Note that the final set of flags that apply to the connection may differ from those
3780    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
3781    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
3782    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
3783    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
3784    GetFlags {
3785        responder: DirectoryGetFlagsResponder,
3786    },
3787    /// Sets the flags that apply to this node after it has been opened. This method does not
3788    /// require any rights.
3789    ///
3790    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
3791    /// clear append mode.
3792    ///
3793    /// Errors:
3794    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
3795    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
3796    SetFlags {
3797        flags: Flags,
3798        responder: DirectorySetFlagsResponder,
3799    },
3800    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
3801    /// volume has different settings or the storage is accounted seperately from the rest of the
3802    /// filesystem that may be reported instead of filesystem-wide details.
3803    QueryFilesystem {
3804        responder: DirectoryQueryFilesystemResponder,
3805    },
3806    /// Acquires information about the node.
3807    ///
3808    /// The attributes of a node should be stable, independent of the
3809    /// specific protocol used to access it.
3810    ///
3811    /// If a particular attribute is not applicable or not supported,
3812    /// filesystems should leave the corresponding field absent.
3813    ///
3814    /// + `query` a bit-mask specifying which attributes to fetch. The server
3815    ///   should not return more than necessary.
3816    /// - `attributes` the returned attributes.
3817    ///
3818    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3819    GetAttributes {
3820        query: NodeAttributesQuery,
3821        responder: DirectoryGetAttributesResponder,
3822    },
3823    /// Updates information about the node.
3824    ///
3825    /// + `attributes` the presence of a table field in `attributes` indicates
3826    /// the intent to update the corresponding attribute.
3827    ///
3828    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
3829    ///
3830    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3831    UpdateAttributes {
3832        payload: MutableNodeAttributes,
3833        responder: DirectoryUpdateAttributesResponder,
3834    },
3835    /// Synchronizes updates to the node to the underlying media, if it exists.
3836    ///
3837    /// This method will return when the filesystem server has flushed the
3838    /// relevant updates to the underlying media, but does not guarantee the
3839    /// underlying media has persisted the information, nor that any information
3840    /// is committed to hardware. Clients may use `Sync` to ensure ordering
3841    /// between operations.
3842    ///
3843    /// This method does not require any rights.
3844    Sync {
3845        responder: DirectorySyncResponder,
3846    },
3847    /// Creates an iterator over all the extended attribute names associated
3848    /// with this node. If an error occurs it is returned as an epitaph on the
3849    /// iterator request channel, and then the channel is closed.
3850    ///
3851    /// GetExtendedAttributes can be used with any of these names to retrieve
3852    /// the associated value.
3853    ///
3854    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3855    ListExtendedAttributes {
3856        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
3857        control_handle: DirectoryControlHandle,
3858    },
3859    /// Get the value associated with the given attribute `name` for this node.
3860    ///
3861    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
3862    /// particular structure is imposed on them.
3863    ///
3864    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3865    GetExtendedAttribute {
3866        name: Vec<u8>,
3867        responder: DirectoryGetExtendedAttributeResponder,
3868    },
3869    /// Set the value for the given attribute `name` to `value` for this node.
3870    ///
3871    /// The attribute name may exist, in which case the attribute is updated.
3872    /// If the attribute doesn't exist, it is created. The name should have no
3873    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
3874    ///
3875    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3876    SetExtendedAttribute {
3877        name: Vec<u8>,
3878        value: ExtendedAttributeValue,
3879        mode: SetExtendedAttributeMode,
3880        responder: DirectorySetExtendedAttributeResponder,
3881    },
3882    /// Remove the specified extended attribute.
3883    ///
3884    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
3885    ///
3886    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3887    RemoveExtendedAttribute {
3888        name: Vec<u8>,
3889        responder: DirectoryRemoveExtendedAttributeResponder,
3890    },
3891    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
3892    DeprecatedOpen {
3893        flags: OpenFlags,
3894        mode: ModeType,
3895        path: String,
3896        object: fidl::endpoints::ServerEnd<NodeMarker>,
3897        control_handle: DirectoryControlHandle,
3898    },
3899    /// Open (or create) a node relative to this directory. Any errors are communicated via an
3900    /// epitaph sent on the `object` channel.
3901    ///
3902    /// Errors:
3903    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
3904    /// * See [`Flags`] for other errors which may be communicated based on `flags`
3905    Open {
3906        path: String,
3907        flags: Flags,
3908        options: Options,
3909        object: fidl::Channel,
3910        control_handle: DirectoryControlHandle,
3911    },
3912    /// Reads a collection of variably sized dirents into a buffer.
3913    /// The number of dirents in a directory may be very large: akin to
3914    /// calling read multiple times on a file, directories have a seek
3915    /// offset which is updated on subsequent calls to ReadDirents.
3916    /// Each call to ReadDirents will only return whole dirent structures,
3917    /// they will not get split across ReadDirent calls. When the seek
3918    /// offset reaches the end, `dirents` will be empty.
3919    ///
3920    /// These dirents are of the form:
3921    /// ```
3922    /// struct dirent {
3923    ///   // Describes the inode of the entry.
3924    ///   uint64 ino;
3925    ///   // Describes the length of the dirent name in bytes.
3926    ///   uint8 size;
3927    ///   // Describes the type of the entry. Aligned with the
3928    ///   // POSIX d_type values. Use `DirentType` constants.
3929    ///   uint8 type;
3930    ///   // Unterminated name of entry.
3931    ///   char name[0];
3932    /// }
3933    /// ```
3934    ///
3935    /// This method does not require any rights, since one could always probe for
3936    /// directory contents by triggering name conflicts during file creation.
3937    ReadDirents {
3938        max_bytes: u64,
3939        responder: DirectoryReadDirentsResponder,
3940    },
3941    /// Resets the directory seek offset.
3942    ///
3943    /// This method does not require any rights, similar to ReadDirents.
3944    Rewind {
3945        responder: DirectoryRewindResponder,
3946    },
3947    /// Acquires a token to a Directory which can be used to identify access to it at a later point
3948    /// in time. The token will remain valid for as long as the connection requesting the token
3949    /// remains open.
3950    ///
3951    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
3952    /// `ZX_ERR_BAD_HANDLE`.
3953    GetToken {
3954        responder: DirectoryGetTokenResponder,
3955    },
3956    /// Creates a link to an object named src by the name dst, within a directory represented by
3957    /// token.
3958    ///
3959    /// `src` must be a resolved object name. Including "/" in the string will
3960    /// return `ZX_ERR_INVALID_ARGS`.
3961    ///
3962    /// `dst` must be a resolved object name. Including "/" in the string will
3963    /// return `ZX_ERR_INVALID_ARGS`.
3964    ///
3965    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
3966    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
3967    ///
3968    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
3969    /// there are two actors operating concurrently, and one actor performs a rename that affects
3970    /// the source within this directory, and the other does a link, each will appear to occur
3971    /// atomically in an unspecified order.
3972    Link {
3973        src: String,
3974        dst_parent_token: fidl::NullableHandle,
3975        dst: String,
3976        responder: DirectoryLinkResponder,
3977    },
3978    /// Removes a child node from the this directory's list of entries.
3979    ///
3980    /// Note: this does not guarantee that the underlying object is destroyed.
3981    /// Although the link will be removed from the containing directory,
3982    /// objects with multiple references (such as files which are still open)
3983    /// will not actually be destroyed until all references are closed.
3984    ///
3985    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
3986    ///   [`Rights.WRITE_BYTES`].
3987    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
3988    ///   support writing.
3989    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
3990    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
3991    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
3992    ///   containing a remote channel.
3993    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
3994    ///     something other than a directory was found.
3995    ///
3996    /// Other errors may be returned for filesystem-specific reasons.
3997    ///
3998    /// This method requires the following rights:
3999    ///
4000    /// * [`Rights.ENUMERATE`]
4001    /// * [`Rights.MODIFY_DIRECTORY`]
4002    Unlink {
4003        name: String,
4004        options: UnlinkOptions,
4005        responder: DirectoryUnlinkResponder,
4006    },
4007    /// Renames a node named `src` to the name `dst`, in a directory represented
4008    /// by `dst_parent_token`.
4009    ///
4010    /// `src` and `dst` must be valid node names.
4011    /// See [`Name`] for what constitutes a valid name.
4012    ///
4013    /// This method requires the following rights on both the current connection, and the connection
4014    /// identified by `dst_parent_token`:
4015    ///
4016    /// * [`Rights.ENUMERATE`]
4017    /// * [`Rights.MODIFY_DIRECTORY`]
4018    ///
4019    /// The following requirements are necessary to avoid rights escalations.
4020    ///
4021    /// If the source and destination directory differ, the source directory must also have the
4022    /// maximal set of abilities supported for files, which would typically be
4023    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
4024    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
4025    /// right.
4026    ///
4027    /// If `src` refers to a directory, and differs from the destination directory, then the source
4028    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
4029    ///
4030    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
4031    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
4032    Rename {
4033        src: String,
4034        dst_parent_token: fidl::Event,
4035        dst: String,
4036        responder: DirectoryRenameResponder,
4037    },
4038    /// Creates a symbolic link.
4039    ///
4040    /// `name` is the name to be given to the created symbolic link.
4041    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
4042    /// will perform no validation of `target` except for a server chosen maximum length.
4043    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
4044    /// on the successfully created node.
4045    ///
4046    /// * [`Rights.MODIFY_DIRECTORY`]
4047    ///
4048    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
4049    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
4050    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
4051    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
4052    CreateSymlink {
4053        name: String,
4054        target: Vec<u8>,
4055        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4056        responder: DirectoryCreateSymlinkResponder,
4057    },
4058    /// Watches a directory, receiving events of added messages on the
4059    /// watcher request channel.
4060    ///
4061    /// Options must be zero; it is reserved.
4062    ///
4063    /// This method does not require any rights, similar to ReadDirents.
4064    Watch {
4065        mask: WatchMask,
4066        options: u32,
4067        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4068        responder: DirectoryWatchResponder,
4069    },
4070    /// An interaction was received which does not match any known method.
4071    #[non_exhaustive]
4072    _UnknownMethod {
4073        /// Ordinal of the method that was called.
4074        ordinal: u64,
4075        control_handle: DirectoryControlHandle,
4076        method_type: fidl::MethodType,
4077    },
4078}
4079
4080impl DirectoryRequest {
4081    #[allow(irrefutable_let_patterns)]
4082    pub fn into_advisory_lock(
4083        self,
4084    ) -> Option<(AdvisoryLockRequest, DirectoryAdvisoryLockResponder)> {
4085        if let DirectoryRequest::AdvisoryLock { request, responder } = self {
4086            Some((request, responder))
4087        } else {
4088            None
4089        }
4090    }
4091
4092    #[allow(irrefutable_let_patterns)]
4093    pub fn into_clone(
4094        self,
4095    ) -> Option<(
4096        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
4097        DirectoryControlHandle,
4098    )> {
4099        if let DirectoryRequest::Clone { request, control_handle } = self {
4100            Some((request, control_handle))
4101        } else {
4102            None
4103        }
4104    }
4105
4106    #[allow(irrefutable_let_patterns)]
4107    pub fn into_close(self) -> Option<(DirectoryCloseResponder)> {
4108        if let DirectoryRequest::Close { responder } = self { Some((responder)) } else { None }
4109    }
4110
4111    #[allow(irrefutable_let_patterns)]
4112    pub fn into_query(self) -> Option<(DirectoryQueryResponder)> {
4113        if let DirectoryRequest::Query { responder } = self { Some((responder)) } else { None }
4114    }
4115
4116    #[allow(irrefutable_let_patterns)]
4117    pub fn into_deprecated_clone(
4118        self,
4119    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, DirectoryControlHandle)> {
4120        if let DirectoryRequest::DeprecatedClone { flags, object, control_handle } = self {
4121            Some((flags, object, control_handle))
4122        } else {
4123            None
4124        }
4125    }
4126
4127    #[allow(irrefutable_let_patterns)]
4128    pub fn into_deprecated_get_attr(self) -> Option<(DirectoryDeprecatedGetAttrResponder)> {
4129        if let DirectoryRequest::DeprecatedGetAttr { responder } = self {
4130            Some((responder))
4131        } else {
4132            None
4133        }
4134    }
4135
4136    #[allow(irrefutable_let_patterns)]
4137    pub fn into_deprecated_set_attr(
4138        self,
4139    ) -> Option<(NodeAttributeFlags, NodeAttributes, DirectoryDeprecatedSetAttrResponder)> {
4140        if let DirectoryRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
4141            Some((flags, attributes, responder))
4142        } else {
4143            None
4144        }
4145    }
4146
4147    #[allow(irrefutable_let_patterns)]
4148    pub fn into_deprecated_get_flags(self) -> Option<(DirectoryDeprecatedGetFlagsResponder)> {
4149        if let DirectoryRequest::DeprecatedGetFlags { responder } = self {
4150            Some((responder))
4151        } else {
4152            None
4153        }
4154    }
4155
4156    #[allow(irrefutable_let_patterns)]
4157    pub fn into_deprecated_set_flags(
4158        self,
4159    ) -> Option<(OpenFlags, DirectoryDeprecatedSetFlagsResponder)> {
4160        if let DirectoryRequest::DeprecatedSetFlags { flags, responder } = self {
4161            Some((flags, responder))
4162        } else {
4163            None
4164        }
4165    }
4166
4167    #[allow(irrefutable_let_patterns)]
4168    pub fn into_get_flags(self) -> Option<(DirectoryGetFlagsResponder)> {
4169        if let DirectoryRequest::GetFlags { responder } = self { Some((responder)) } else { None }
4170    }
4171
4172    #[allow(irrefutable_let_patterns)]
4173    pub fn into_set_flags(self) -> Option<(Flags, DirectorySetFlagsResponder)> {
4174        if let DirectoryRequest::SetFlags { flags, responder } = self {
4175            Some((flags, responder))
4176        } else {
4177            None
4178        }
4179    }
4180
4181    #[allow(irrefutable_let_patterns)]
4182    pub fn into_query_filesystem(self) -> Option<(DirectoryQueryFilesystemResponder)> {
4183        if let DirectoryRequest::QueryFilesystem { responder } = self {
4184            Some((responder))
4185        } else {
4186            None
4187        }
4188    }
4189
4190    #[allow(irrefutable_let_patterns)]
4191    pub fn into_get_attributes(
4192        self,
4193    ) -> Option<(NodeAttributesQuery, DirectoryGetAttributesResponder)> {
4194        if let DirectoryRequest::GetAttributes { query, responder } = self {
4195            Some((query, responder))
4196        } else {
4197            None
4198        }
4199    }
4200
4201    #[allow(irrefutable_let_patterns)]
4202    pub fn into_update_attributes(
4203        self,
4204    ) -> Option<(MutableNodeAttributes, DirectoryUpdateAttributesResponder)> {
4205        if let DirectoryRequest::UpdateAttributes { payload, responder } = self {
4206            Some((payload, responder))
4207        } else {
4208            None
4209        }
4210    }
4211
4212    #[allow(irrefutable_let_patterns)]
4213    pub fn into_sync(self) -> Option<(DirectorySyncResponder)> {
4214        if let DirectoryRequest::Sync { responder } = self { Some((responder)) } else { None }
4215    }
4216
4217    #[allow(irrefutable_let_patterns)]
4218    pub fn into_list_extended_attributes(
4219        self,
4220    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, DirectoryControlHandle)>
4221    {
4222        if let DirectoryRequest::ListExtendedAttributes { iterator, control_handle } = self {
4223            Some((iterator, control_handle))
4224        } else {
4225            None
4226        }
4227    }
4228
4229    #[allow(irrefutable_let_patterns)]
4230    pub fn into_get_extended_attribute(
4231        self,
4232    ) -> Option<(Vec<u8>, DirectoryGetExtendedAttributeResponder)> {
4233        if let DirectoryRequest::GetExtendedAttribute { name, responder } = self {
4234            Some((name, responder))
4235        } else {
4236            None
4237        }
4238    }
4239
4240    #[allow(irrefutable_let_patterns)]
4241    pub fn into_set_extended_attribute(
4242        self,
4243    ) -> Option<(
4244        Vec<u8>,
4245        ExtendedAttributeValue,
4246        SetExtendedAttributeMode,
4247        DirectorySetExtendedAttributeResponder,
4248    )> {
4249        if let DirectoryRequest::SetExtendedAttribute { name, value, mode, responder } = self {
4250            Some((name, value, mode, responder))
4251        } else {
4252            None
4253        }
4254    }
4255
4256    #[allow(irrefutable_let_patterns)]
4257    pub fn into_remove_extended_attribute(
4258        self,
4259    ) -> Option<(Vec<u8>, DirectoryRemoveExtendedAttributeResponder)> {
4260        if let DirectoryRequest::RemoveExtendedAttribute { name, responder } = self {
4261            Some((name, responder))
4262        } else {
4263            None
4264        }
4265    }
4266
4267    #[allow(irrefutable_let_patterns)]
4268    pub fn into_deprecated_open(
4269        self,
4270    ) -> Option<(
4271        OpenFlags,
4272        ModeType,
4273        String,
4274        fidl::endpoints::ServerEnd<NodeMarker>,
4275        DirectoryControlHandle,
4276    )> {
4277        if let DirectoryRequest::DeprecatedOpen { flags, mode, path, object, control_handle } = self
4278        {
4279            Some((flags, mode, path, object, control_handle))
4280        } else {
4281            None
4282        }
4283    }
4284
4285    #[allow(irrefutable_let_patterns)]
4286    pub fn into_open(
4287        self,
4288    ) -> Option<(String, Flags, Options, fidl::Channel, DirectoryControlHandle)> {
4289        if let DirectoryRequest::Open { path, flags, options, object, control_handle } = self {
4290            Some((path, flags, options, object, control_handle))
4291        } else {
4292            None
4293        }
4294    }
4295
4296    #[allow(irrefutable_let_patterns)]
4297    pub fn into_read_dirents(self) -> Option<(u64, DirectoryReadDirentsResponder)> {
4298        if let DirectoryRequest::ReadDirents { max_bytes, responder } = self {
4299            Some((max_bytes, responder))
4300        } else {
4301            None
4302        }
4303    }
4304
4305    #[allow(irrefutable_let_patterns)]
4306    pub fn into_rewind(self) -> Option<(DirectoryRewindResponder)> {
4307        if let DirectoryRequest::Rewind { responder } = self { Some((responder)) } else { None }
4308    }
4309
4310    #[allow(irrefutable_let_patterns)]
4311    pub fn into_get_token(self) -> Option<(DirectoryGetTokenResponder)> {
4312        if let DirectoryRequest::GetToken { responder } = self { Some((responder)) } else { None }
4313    }
4314
4315    #[allow(irrefutable_let_patterns)]
4316    pub fn into_link(
4317        self,
4318    ) -> Option<(String, fidl::NullableHandle, String, DirectoryLinkResponder)> {
4319        if let DirectoryRequest::Link { src, dst_parent_token, dst, responder } = self {
4320            Some((src, dst_parent_token, dst, responder))
4321        } else {
4322            None
4323        }
4324    }
4325
4326    #[allow(irrefutable_let_patterns)]
4327    pub fn into_unlink(self) -> Option<(String, UnlinkOptions, DirectoryUnlinkResponder)> {
4328        if let DirectoryRequest::Unlink { name, options, responder } = self {
4329            Some((name, options, responder))
4330        } else {
4331            None
4332        }
4333    }
4334
4335    #[allow(irrefutable_let_patterns)]
4336    pub fn into_rename(self) -> Option<(String, fidl::Event, String, DirectoryRenameResponder)> {
4337        if let DirectoryRequest::Rename { src, dst_parent_token, dst, responder } = self {
4338            Some((src, dst_parent_token, dst, responder))
4339        } else {
4340            None
4341        }
4342    }
4343
4344    #[allow(irrefutable_let_patterns)]
4345    pub fn into_create_symlink(
4346        self,
4347    ) -> Option<(
4348        String,
4349        Vec<u8>,
4350        Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4351        DirectoryCreateSymlinkResponder,
4352    )> {
4353        if let DirectoryRequest::CreateSymlink { name, target, connection, responder } = self {
4354            Some((name, target, connection, responder))
4355        } else {
4356            None
4357        }
4358    }
4359
4360    #[allow(irrefutable_let_patterns)]
4361    pub fn into_watch(
4362        self,
4363    ) -> Option<(
4364        WatchMask,
4365        u32,
4366        fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4367        DirectoryWatchResponder,
4368    )> {
4369        if let DirectoryRequest::Watch { mask, options, watcher, responder } = self {
4370            Some((mask, options, watcher, responder))
4371        } else {
4372            None
4373        }
4374    }
4375
4376    /// Name of the method defined in FIDL
4377    pub fn method_name(&self) -> &'static str {
4378        match *self {
4379            DirectoryRequest::AdvisoryLock { .. } => "advisory_lock",
4380            DirectoryRequest::Clone { .. } => "clone",
4381            DirectoryRequest::Close { .. } => "close",
4382            DirectoryRequest::Query { .. } => "query",
4383            DirectoryRequest::DeprecatedClone { .. } => "deprecated_clone",
4384            DirectoryRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
4385            DirectoryRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
4386            DirectoryRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
4387            DirectoryRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
4388            DirectoryRequest::GetFlags { .. } => "get_flags",
4389            DirectoryRequest::SetFlags { .. } => "set_flags",
4390            DirectoryRequest::QueryFilesystem { .. } => "query_filesystem",
4391            DirectoryRequest::GetAttributes { .. } => "get_attributes",
4392            DirectoryRequest::UpdateAttributes { .. } => "update_attributes",
4393            DirectoryRequest::Sync { .. } => "sync",
4394            DirectoryRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
4395            DirectoryRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
4396            DirectoryRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
4397            DirectoryRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
4398            DirectoryRequest::DeprecatedOpen { .. } => "deprecated_open",
4399            DirectoryRequest::Open { .. } => "open",
4400            DirectoryRequest::ReadDirents { .. } => "read_dirents",
4401            DirectoryRequest::Rewind { .. } => "rewind",
4402            DirectoryRequest::GetToken { .. } => "get_token",
4403            DirectoryRequest::Link { .. } => "link",
4404            DirectoryRequest::Unlink { .. } => "unlink",
4405            DirectoryRequest::Rename { .. } => "rename",
4406            DirectoryRequest::CreateSymlink { .. } => "create_symlink",
4407            DirectoryRequest::Watch { .. } => "watch",
4408            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4409                "unknown one-way method"
4410            }
4411            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4412                "unknown two-way method"
4413            }
4414        }
4415    }
4416}
4417
4418#[derive(Debug, Clone)]
4419pub struct DirectoryControlHandle {
4420    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4421}
4422
4423impl fidl::endpoints::ControlHandle for DirectoryControlHandle {
4424    fn shutdown(&self) {
4425        self.inner.shutdown()
4426    }
4427
4428    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4429        self.inner.shutdown_with_epitaph(status)
4430    }
4431
4432    fn is_closed(&self) -> bool {
4433        self.inner.channel().is_closed()
4434    }
4435    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4436        self.inner.channel().on_closed()
4437    }
4438
4439    #[cfg(target_os = "fuchsia")]
4440    fn signal_peer(
4441        &self,
4442        clear_mask: zx::Signals,
4443        set_mask: zx::Signals,
4444    ) -> Result<(), zx_status::Status> {
4445        use fidl::Peered;
4446        self.inner.channel().signal_peer(clear_mask, set_mask)
4447    }
4448}
4449
4450impl DirectoryControlHandle {
4451    pub fn send_on_open_(
4452        &self,
4453        mut s: i32,
4454        mut info: Option<NodeInfoDeprecated>,
4455    ) -> Result<(), fidl::Error> {
4456        self.inner.send::<NodeOnOpenRequest>(
4457            (s, info.as_mut()),
4458            0,
4459            0x7fc7bbb1dbfd1972,
4460            fidl::encoding::DynamicFlags::FLEXIBLE,
4461        )
4462    }
4463
4464    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
4465        self.inner.send::<Representation>(
4466            &mut payload,
4467            0,
4468            0x5cb40567d80a510c,
4469            fidl::encoding::DynamicFlags::empty(),
4470        )
4471    }
4472}
4473
4474#[must_use = "FIDL methods require a response to be sent"]
4475#[derive(Debug)]
4476pub struct DirectoryAdvisoryLockResponder {
4477    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4478    tx_id: u32,
4479}
4480
4481/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4482/// if the responder is dropped without sending a response, so that the client
4483/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4484impl std::ops::Drop for DirectoryAdvisoryLockResponder {
4485    fn drop(&mut self) {
4486        self.control_handle.shutdown();
4487        // Safety: drops once, never accessed again
4488        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4489    }
4490}
4491
4492impl fidl::endpoints::Responder for DirectoryAdvisoryLockResponder {
4493    type ControlHandle = DirectoryControlHandle;
4494
4495    fn control_handle(&self) -> &DirectoryControlHandle {
4496        &self.control_handle
4497    }
4498
4499    fn drop_without_shutdown(mut self) {
4500        // Safety: drops once, never accessed again due to mem::forget
4501        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4502        // Prevent Drop from running (which would shut down the channel)
4503        std::mem::forget(self);
4504    }
4505}
4506
4507impl DirectoryAdvisoryLockResponder {
4508    /// Sends a response to the FIDL transaction.
4509    ///
4510    /// Sets the channel to shutdown if an error occurs.
4511    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4512        let _result = self.send_raw(result);
4513        if _result.is_err() {
4514            self.control_handle.shutdown();
4515        }
4516        self.drop_without_shutdown();
4517        _result
4518    }
4519
4520    /// Similar to "send" but does not shutdown the channel if an error occurs.
4521    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4522        let _result = self.send_raw(result);
4523        self.drop_without_shutdown();
4524        _result
4525    }
4526
4527    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4528        self.control_handle
4529            .inner
4530            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4531                result,
4532                self.tx_id,
4533                0x6ee9c0ad53ec87aa,
4534                fidl::encoding::DynamicFlags::empty(),
4535            )
4536    }
4537}
4538
4539#[must_use = "FIDL methods require a response to be sent"]
4540#[derive(Debug)]
4541pub struct DirectoryCloseResponder {
4542    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4543    tx_id: u32,
4544}
4545
4546/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4547/// if the responder is dropped without sending a response, so that the client
4548/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4549impl std::ops::Drop for DirectoryCloseResponder {
4550    fn drop(&mut self) {
4551        self.control_handle.shutdown();
4552        // Safety: drops once, never accessed again
4553        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4554    }
4555}
4556
4557impl fidl::endpoints::Responder for DirectoryCloseResponder {
4558    type ControlHandle = DirectoryControlHandle;
4559
4560    fn control_handle(&self) -> &DirectoryControlHandle {
4561        &self.control_handle
4562    }
4563
4564    fn drop_without_shutdown(mut self) {
4565        // Safety: drops once, never accessed again due to mem::forget
4566        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4567        // Prevent Drop from running (which would shut down the channel)
4568        std::mem::forget(self);
4569    }
4570}
4571
4572impl DirectoryCloseResponder {
4573    /// Sends a response to the FIDL transaction.
4574    ///
4575    /// Sets the channel to shutdown if an error occurs.
4576    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4577        let _result = self.send_raw(result);
4578        if _result.is_err() {
4579            self.control_handle.shutdown();
4580        }
4581        self.drop_without_shutdown();
4582        _result
4583    }
4584
4585    /// Similar to "send" but does not shutdown the channel if an error occurs.
4586    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4587        let _result = self.send_raw(result);
4588        self.drop_without_shutdown();
4589        _result
4590    }
4591
4592    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4593        self.control_handle
4594            .inner
4595            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4596                result,
4597                self.tx_id,
4598                0x5ac5d459ad7f657e,
4599                fidl::encoding::DynamicFlags::empty(),
4600            )
4601    }
4602}
4603
4604#[must_use = "FIDL methods require a response to be sent"]
4605#[derive(Debug)]
4606pub struct DirectoryQueryResponder {
4607    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4608    tx_id: u32,
4609}
4610
4611/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4612/// if the responder is dropped without sending a response, so that the client
4613/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4614impl std::ops::Drop for DirectoryQueryResponder {
4615    fn drop(&mut self) {
4616        self.control_handle.shutdown();
4617        // Safety: drops once, never accessed again
4618        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4619    }
4620}
4621
4622impl fidl::endpoints::Responder for DirectoryQueryResponder {
4623    type ControlHandle = DirectoryControlHandle;
4624
4625    fn control_handle(&self) -> &DirectoryControlHandle {
4626        &self.control_handle
4627    }
4628
4629    fn drop_without_shutdown(mut self) {
4630        // Safety: drops once, never accessed again due to mem::forget
4631        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4632        // Prevent Drop from running (which would shut down the channel)
4633        std::mem::forget(self);
4634    }
4635}
4636
4637impl DirectoryQueryResponder {
4638    /// Sends a response to the FIDL transaction.
4639    ///
4640    /// Sets the channel to shutdown if an error occurs.
4641    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4642        let _result = self.send_raw(protocol);
4643        if _result.is_err() {
4644            self.control_handle.shutdown();
4645        }
4646        self.drop_without_shutdown();
4647        _result
4648    }
4649
4650    /// Similar to "send" but does not shutdown the channel if an error occurs.
4651    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4652        let _result = self.send_raw(protocol);
4653        self.drop_without_shutdown();
4654        _result
4655    }
4656
4657    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4658        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
4659            (protocol,),
4660            self.tx_id,
4661            0x2658edee9decfc06,
4662            fidl::encoding::DynamicFlags::empty(),
4663        )
4664    }
4665}
4666
4667#[must_use = "FIDL methods require a response to be sent"]
4668#[derive(Debug)]
4669pub struct DirectoryDeprecatedGetAttrResponder {
4670    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4671    tx_id: u32,
4672}
4673
4674/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4675/// if the responder is dropped without sending a response, so that the client
4676/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4677impl std::ops::Drop for DirectoryDeprecatedGetAttrResponder {
4678    fn drop(&mut self) {
4679        self.control_handle.shutdown();
4680        // Safety: drops once, never accessed again
4681        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4682    }
4683}
4684
4685impl fidl::endpoints::Responder for DirectoryDeprecatedGetAttrResponder {
4686    type ControlHandle = DirectoryControlHandle;
4687
4688    fn control_handle(&self) -> &DirectoryControlHandle {
4689        &self.control_handle
4690    }
4691
4692    fn drop_without_shutdown(mut self) {
4693        // Safety: drops once, never accessed again due to mem::forget
4694        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4695        // Prevent Drop from running (which would shut down the channel)
4696        std::mem::forget(self);
4697    }
4698}
4699
4700impl DirectoryDeprecatedGetAttrResponder {
4701    /// Sends a response to the FIDL transaction.
4702    ///
4703    /// Sets the channel to shutdown if an error occurs.
4704    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4705        let _result = self.send_raw(s, attributes);
4706        if _result.is_err() {
4707            self.control_handle.shutdown();
4708        }
4709        self.drop_without_shutdown();
4710        _result
4711    }
4712
4713    /// Similar to "send" but does not shutdown the channel if an error occurs.
4714    pub fn send_no_shutdown_on_err(
4715        self,
4716        mut s: i32,
4717        mut attributes: &NodeAttributes,
4718    ) -> Result<(), fidl::Error> {
4719        let _result = self.send_raw(s, attributes);
4720        self.drop_without_shutdown();
4721        _result
4722    }
4723
4724    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4725        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
4726            (s, attributes),
4727            self.tx_id,
4728            0x78985e216314dafd,
4729            fidl::encoding::DynamicFlags::empty(),
4730        )
4731    }
4732}
4733
4734#[must_use = "FIDL methods require a response to be sent"]
4735#[derive(Debug)]
4736pub struct DirectoryDeprecatedSetAttrResponder {
4737    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4738    tx_id: u32,
4739}
4740
4741/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4742/// if the responder is dropped without sending a response, so that the client
4743/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4744impl std::ops::Drop for DirectoryDeprecatedSetAttrResponder {
4745    fn drop(&mut self) {
4746        self.control_handle.shutdown();
4747        // Safety: drops once, never accessed again
4748        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4749    }
4750}
4751
4752impl fidl::endpoints::Responder for DirectoryDeprecatedSetAttrResponder {
4753    type ControlHandle = DirectoryControlHandle;
4754
4755    fn control_handle(&self) -> &DirectoryControlHandle {
4756        &self.control_handle
4757    }
4758
4759    fn drop_without_shutdown(mut self) {
4760        // Safety: drops once, never accessed again due to mem::forget
4761        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4762        // Prevent Drop from running (which would shut down the channel)
4763        std::mem::forget(self);
4764    }
4765}
4766
4767impl DirectoryDeprecatedSetAttrResponder {
4768    /// Sends a response to the FIDL transaction.
4769    ///
4770    /// Sets the channel to shutdown if an error occurs.
4771    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4772        let _result = self.send_raw(s);
4773        if _result.is_err() {
4774            self.control_handle.shutdown();
4775        }
4776        self.drop_without_shutdown();
4777        _result
4778    }
4779
4780    /// Similar to "send" but does not shutdown the channel if an error occurs.
4781    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4782        let _result = self.send_raw(s);
4783        self.drop_without_shutdown();
4784        _result
4785    }
4786
4787    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4788        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
4789            (s,),
4790            self.tx_id,
4791            0x4186c0f40d938f46,
4792            fidl::encoding::DynamicFlags::empty(),
4793        )
4794    }
4795}
4796
4797#[must_use = "FIDL methods require a response to be sent"]
4798#[derive(Debug)]
4799pub struct DirectoryDeprecatedGetFlagsResponder {
4800    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4801    tx_id: u32,
4802}
4803
4804/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4805/// if the responder is dropped without sending a response, so that the client
4806/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4807impl std::ops::Drop for DirectoryDeprecatedGetFlagsResponder {
4808    fn drop(&mut self) {
4809        self.control_handle.shutdown();
4810        // Safety: drops once, never accessed again
4811        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4812    }
4813}
4814
4815impl fidl::endpoints::Responder for DirectoryDeprecatedGetFlagsResponder {
4816    type ControlHandle = DirectoryControlHandle;
4817
4818    fn control_handle(&self) -> &DirectoryControlHandle {
4819        &self.control_handle
4820    }
4821
4822    fn drop_without_shutdown(mut self) {
4823        // Safety: drops once, never accessed again due to mem::forget
4824        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4825        // Prevent Drop from running (which would shut down the channel)
4826        std::mem::forget(self);
4827    }
4828}
4829
4830impl DirectoryDeprecatedGetFlagsResponder {
4831    /// Sends a response to the FIDL transaction.
4832    ///
4833    /// Sets the channel to shutdown if an error occurs.
4834    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4835        let _result = self.send_raw(s, flags);
4836        if _result.is_err() {
4837            self.control_handle.shutdown();
4838        }
4839        self.drop_without_shutdown();
4840        _result
4841    }
4842
4843    /// Similar to "send" but does not shutdown the channel if an error occurs.
4844    pub fn send_no_shutdown_on_err(
4845        self,
4846        mut s: i32,
4847        mut flags: OpenFlags,
4848    ) -> Result<(), fidl::Error> {
4849        let _result = self.send_raw(s, flags);
4850        self.drop_without_shutdown();
4851        _result
4852    }
4853
4854    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4855        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
4856            (s, flags),
4857            self.tx_id,
4858            0x5b88fffb8eda3aa1,
4859            fidl::encoding::DynamicFlags::empty(),
4860        )
4861    }
4862}
4863
4864#[must_use = "FIDL methods require a response to be sent"]
4865#[derive(Debug)]
4866pub struct DirectoryDeprecatedSetFlagsResponder {
4867    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4868    tx_id: u32,
4869}
4870
4871/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4872/// if the responder is dropped without sending a response, so that the client
4873/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4874impl std::ops::Drop for DirectoryDeprecatedSetFlagsResponder {
4875    fn drop(&mut self) {
4876        self.control_handle.shutdown();
4877        // Safety: drops once, never accessed again
4878        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4879    }
4880}
4881
4882impl fidl::endpoints::Responder for DirectoryDeprecatedSetFlagsResponder {
4883    type ControlHandle = DirectoryControlHandle;
4884
4885    fn control_handle(&self) -> &DirectoryControlHandle {
4886        &self.control_handle
4887    }
4888
4889    fn drop_without_shutdown(mut self) {
4890        // Safety: drops once, never accessed again due to mem::forget
4891        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4892        // Prevent Drop from running (which would shut down the channel)
4893        std::mem::forget(self);
4894    }
4895}
4896
4897impl DirectoryDeprecatedSetFlagsResponder {
4898    /// Sends a response to the FIDL transaction.
4899    ///
4900    /// Sets the channel to shutdown if an error occurs.
4901    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4902        let _result = self.send_raw(s);
4903        if _result.is_err() {
4904            self.control_handle.shutdown();
4905        }
4906        self.drop_without_shutdown();
4907        _result
4908    }
4909
4910    /// Similar to "send" but does not shutdown the channel if an error occurs.
4911    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4912        let _result = self.send_raw(s);
4913        self.drop_without_shutdown();
4914        _result
4915    }
4916
4917    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4918        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
4919            (s,),
4920            self.tx_id,
4921            0x5295b76c71fde733,
4922            fidl::encoding::DynamicFlags::empty(),
4923        )
4924    }
4925}
4926
4927#[must_use = "FIDL methods require a response to be sent"]
4928#[derive(Debug)]
4929pub struct DirectoryGetFlagsResponder {
4930    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4931    tx_id: u32,
4932}
4933
4934/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4935/// if the responder is dropped without sending a response, so that the client
4936/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4937impl std::ops::Drop for DirectoryGetFlagsResponder {
4938    fn drop(&mut self) {
4939        self.control_handle.shutdown();
4940        // Safety: drops once, never accessed again
4941        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4942    }
4943}
4944
4945impl fidl::endpoints::Responder for DirectoryGetFlagsResponder {
4946    type ControlHandle = DirectoryControlHandle;
4947
4948    fn control_handle(&self) -> &DirectoryControlHandle {
4949        &self.control_handle
4950    }
4951
4952    fn drop_without_shutdown(mut self) {
4953        // Safety: drops once, never accessed again due to mem::forget
4954        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4955        // Prevent Drop from running (which would shut down the channel)
4956        std::mem::forget(self);
4957    }
4958}
4959
4960impl DirectoryGetFlagsResponder {
4961    /// Sends a response to the FIDL transaction.
4962    ///
4963    /// Sets the channel to shutdown if an error occurs.
4964    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4965        let _result = self.send_raw(result);
4966        if _result.is_err() {
4967            self.control_handle.shutdown();
4968        }
4969        self.drop_without_shutdown();
4970        _result
4971    }
4972
4973    /// Similar to "send" but does not shutdown the channel if an error occurs.
4974    pub fn send_no_shutdown_on_err(
4975        self,
4976        mut result: Result<Flags, i32>,
4977    ) -> Result<(), fidl::Error> {
4978        let _result = self.send_raw(result);
4979        self.drop_without_shutdown();
4980        _result
4981    }
4982
4983    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4984        self.control_handle
4985            .inner
4986            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
4987                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
4988                self.tx_id,
4989                0x176eb318f64ec23,
4990                fidl::encoding::DynamicFlags::FLEXIBLE,
4991            )
4992    }
4993}
4994
4995#[must_use = "FIDL methods require a response to be sent"]
4996#[derive(Debug)]
4997pub struct DirectorySetFlagsResponder {
4998    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4999    tx_id: u32,
5000}
5001
5002/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5003/// if the responder is dropped without sending a response, so that the client
5004/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5005impl std::ops::Drop for DirectorySetFlagsResponder {
5006    fn drop(&mut self) {
5007        self.control_handle.shutdown();
5008        // Safety: drops once, never accessed again
5009        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5010    }
5011}
5012
5013impl fidl::endpoints::Responder for DirectorySetFlagsResponder {
5014    type ControlHandle = DirectoryControlHandle;
5015
5016    fn control_handle(&self) -> &DirectoryControlHandle {
5017        &self.control_handle
5018    }
5019
5020    fn drop_without_shutdown(mut self) {
5021        // Safety: drops once, never accessed again due to mem::forget
5022        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5023        // Prevent Drop from running (which would shut down the channel)
5024        std::mem::forget(self);
5025    }
5026}
5027
5028impl DirectorySetFlagsResponder {
5029    /// Sends a response to the FIDL transaction.
5030    ///
5031    /// Sets the channel to shutdown if an error occurs.
5032    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5033        let _result = self.send_raw(result);
5034        if _result.is_err() {
5035            self.control_handle.shutdown();
5036        }
5037        self.drop_without_shutdown();
5038        _result
5039    }
5040
5041    /// Similar to "send" but does not shutdown the channel if an error occurs.
5042    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5043        let _result = self.send_raw(result);
5044        self.drop_without_shutdown();
5045        _result
5046    }
5047
5048    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5049        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5050            fidl::encoding::EmptyStruct,
5051            i32,
5052        >>(
5053            fidl::encoding::FlexibleResult::new(result),
5054            self.tx_id,
5055            0x55a8028685791ea8,
5056            fidl::encoding::DynamicFlags::FLEXIBLE,
5057        )
5058    }
5059}
5060
5061#[must_use = "FIDL methods require a response to be sent"]
5062#[derive(Debug)]
5063pub struct DirectoryQueryFilesystemResponder {
5064    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5065    tx_id: u32,
5066}
5067
5068/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5069/// if the responder is dropped without sending a response, so that the client
5070/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5071impl std::ops::Drop for DirectoryQueryFilesystemResponder {
5072    fn drop(&mut self) {
5073        self.control_handle.shutdown();
5074        // Safety: drops once, never accessed again
5075        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5076    }
5077}
5078
5079impl fidl::endpoints::Responder for DirectoryQueryFilesystemResponder {
5080    type ControlHandle = DirectoryControlHandle;
5081
5082    fn control_handle(&self) -> &DirectoryControlHandle {
5083        &self.control_handle
5084    }
5085
5086    fn drop_without_shutdown(mut self) {
5087        // Safety: drops once, never accessed again due to mem::forget
5088        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5089        // Prevent Drop from running (which would shut down the channel)
5090        std::mem::forget(self);
5091    }
5092}
5093
5094impl DirectoryQueryFilesystemResponder {
5095    /// Sends a response to the FIDL transaction.
5096    ///
5097    /// Sets the channel to shutdown if an error occurs.
5098    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5099        let _result = self.send_raw(s, info);
5100        if _result.is_err() {
5101            self.control_handle.shutdown();
5102        }
5103        self.drop_without_shutdown();
5104        _result
5105    }
5106
5107    /// Similar to "send" but does not shutdown the channel if an error occurs.
5108    pub fn send_no_shutdown_on_err(
5109        self,
5110        mut s: i32,
5111        mut info: Option<&FilesystemInfo>,
5112    ) -> Result<(), fidl::Error> {
5113        let _result = self.send_raw(s, info);
5114        self.drop_without_shutdown();
5115        _result
5116    }
5117
5118    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5119        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
5120            (s, info),
5121            self.tx_id,
5122            0x6f344a1c6b0a0610,
5123            fidl::encoding::DynamicFlags::empty(),
5124        )
5125    }
5126}
5127
5128#[must_use = "FIDL methods require a response to be sent"]
5129#[derive(Debug)]
5130pub struct DirectoryGetAttributesResponder {
5131    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5132    tx_id: u32,
5133}
5134
5135/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5136/// if the responder is dropped without sending a response, so that the client
5137/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5138impl std::ops::Drop for DirectoryGetAttributesResponder {
5139    fn drop(&mut self) {
5140        self.control_handle.shutdown();
5141        // Safety: drops once, never accessed again
5142        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5143    }
5144}
5145
5146impl fidl::endpoints::Responder for DirectoryGetAttributesResponder {
5147    type ControlHandle = DirectoryControlHandle;
5148
5149    fn control_handle(&self) -> &DirectoryControlHandle {
5150        &self.control_handle
5151    }
5152
5153    fn drop_without_shutdown(mut self) {
5154        // Safety: drops once, never accessed again due to mem::forget
5155        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5156        // Prevent Drop from running (which would shut down the channel)
5157        std::mem::forget(self);
5158    }
5159}
5160
5161impl DirectoryGetAttributesResponder {
5162    /// Sends a response to the FIDL transaction.
5163    ///
5164    /// Sets the channel to shutdown if an error occurs.
5165    pub fn send(
5166        self,
5167        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5168    ) -> Result<(), fidl::Error> {
5169        let _result = self.send_raw(result);
5170        if _result.is_err() {
5171            self.control_handle.shutdown();
5172        }
5173        self.drop_without_shutdown();
5174        _result
5175    }
5176
5177    /// Similar to "send" but does not shutdown the channel if an error occurs.
5178    pub fn send_no_shutdown_on_err(
5179        self,
5180        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5181    ) -> Result<(), fidl::Error> {
5182        let _result = self.send_raw(result);
5183        self.drop_without_shutdown();
5184        _result
5185    }
5186
5187    fn send_raw(
5188        &self,
5189        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5190    ) -> Result<(), fidl::Error> {
5191        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
5192            result,
5193            self.tx_id,
5194            0x3d4396a638ea053b,
5195            fidl::encoding::DynamicFlags::empty(),
5196        )
5197    }
5198}
5199
5200#[must_use = "FIDL methods require a response to be sent"]
5201#[derive(Debug)]
5202pub struct DirectoryUpdateAttributesResponder {
5203    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5204    tx_id: u32,
5205}
5206
5207/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5208/// if the responder is dropped without sending a response, so that the client
5209/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5210impl std::ops::Drop for DirectoryUpdateAttributesResponder {
5211    fn drop(&mut self) {
5212        self.control_handle.shutdown();
5213        // Safety: drops once, never accessed again
5214        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5215    }
5216}
5217
5218impl fidl::endpoints::Responder for DirectoryUpdateAttributesResponder {
5219    type ControlHandle = DirectoryControlHandle;
5220
5221    fn control_handle(&self) -> &DirectoryControlHandle {
5222        &self.control_handle
5223    }
5224
5225    fn drop_without_shutdown(mut self) {
5226        // Safety: drops once, never accessed again due to mem::forget
5227        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5228        // Prevent Drop from running (which would shut down the channel)
5229        std::mem::forget(self);
5230    }
5231}
5232
5233impl DirectoryUpdateAttributesResponder {
5234    /// Sends a response to the FIDL transaction.
5235    ///
5236    /// Sets the channel to shutdown if an error occurs.
5237    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5238        let _result = self.send_raw(result);
5239        if _result.is_err() {
5240            self.control_handle.shutdown();
5241        }
5242        self.drop_without_shutdown();
5243        _result
5244    }
5245
5246    /// Similar to "send" but does not shutdown the channel if an error occurs.
5247    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5248        let _result = self.send_raw(result);
5249        self.drop_without_shutdown();
5250        _result
5251    }
5252
5253    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5254        self.control_handle
5255            .inner
5256            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5257                result,
5258                self.tx_id,
5259                0x3308c1da5a89bf08,
5260                fidl::encoding::DynamicFlags::empty(),
5261            )
5262    }
5263}
5264
5265#[must_use = "FIDL methods require a response to be sent"]
5266#[derive(Debug)]
5267pub struct DirectorySyncResponder {
5268    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5269    tx_id: u32,
5270}
5271
5272/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5273/// if the responder is dropped without sending a response, so that the client
5274/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5275impl std::ops::Drop for DirectorySyncResponder {
5276    fn drop(&mut self) {
5277        self.control_handle.shutdown();
5278        // Safety: drops once, never accessed again
5279        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5280    }
5281}
5282
5283impl fidl::endpoints::Responder for DirectorySyncResponder {
5284    type ControlHandle = DirectoryControlHandle;
5285
5286    fn control_handle(&self) -> &DirectoryControlHandle {
5287        &self.control_handle
5288    }
5289
5290    fn drop_without_shutdown(mut self) {
5291        // Safety: drops once, never accessed again due to mem::forget
5292        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5293        // Prevent Drop from running (which would shut down the channel)
5294        std::mem::forget(self);
5295    }
5296}
5297
5298impl DirectorySyncResponder {
5299    /// Sends a response to the FIDL transaction.
5300    ///
5301    /// Sets the channel to shutdown if an error occurs.
5302    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5303        let _result = self.send_raw(result);
5304        if _result.is_err() {
5305            self.control_handle.shutdown();
5306        }
5307        self.drop_without_shutdown();
5308        _result
5309    }
5310
5311    /// Similar to "send" but does not shutdown the channel if an error occurs.
5312    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5313        let _result = self.send_raw(result);
5314        self.drop_without_shutdown();
5315        _result
5316    }
5317
5318    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5319        self.control_handle
5320            .inner
5321            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5322                result,
5323                self.tx_id,
5324                0x2c5c27ca0ab5dc49,
5325                fidl::encoding::DynamicFlags::empty(),
5326            )
5327    }
5328}
5329
5330#[must_use = "FIDL methods require a response to be sent"]
5331#[derive(Debug)]
5332pub struct DirectoryGetExtendedAttributeResponder {
5333    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5334    tx_id: u32,
5335}
5336
5337/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5338/// if the responder is dropped without sending a response, so that the client
5339/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5340impl std::ops::Drop for DirectoryGetExtendedAttributeResponder {
5341    fn drop(&mut self) {
5342        self.control_handle.shutdown();
5343        // Safety: drops once, never accessed again
5344        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5345    }
5346}
5347
5348impl fidl::endpoints::Responder for DirectoryGetExtendedAttributeResponder {
5349    type ControlHandle = DirectoryControlHandle;
5350
5351    fn control_handle(&self) -> &DirectoryControlHandle {
5352        &self.control_handle
5353    }
5354
5355    fn drop_without_shutdown(mut self) {
5356        // Safety: drops once, never accessed again due to mem::forget
5357        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5358        // Prevent Drop from running (which would shut down the channel)
5359        std::mem::forget(self);
5360    }
5361}
5362
5363impl DirectoryGetExtendedAttributeResponder {
5364    /// Sends a response to the FIDL transaction.
5365    ///
5366    /// Sets the channel to shutdown if an error occurs.
5367    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5368        let _result = self.send_raw(result);
5369        if _result.is_err() {
5370            self.control_handle.shutdown();
5371        }
5372        self.drop_without_shutdown();
5373        _result
5374    }
5375
5376    /// Similar to "send" but does not shutdown the channel if an error occurs.
5377    pub fn send_no_shutdown_on_err(
5378        self,
5379        mut result: Result<ExtendedAttributeValue, i32>,
5380    ) -> Result<(), fidl::Error> {
5381        let _result = self.send_raw(result);
5382        self.drop_without_shutdown();
5383        _result
5384    }
5385
5386    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5387        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
5388            result.as_mut().map_err(|e| *e),
5389            self.tx_id,
5390            0x45ffa3ccfdeb76db,
5391            fidl::encoding::DynamicFlags::empty(),
5392        )
5393    }
5394}
5395
5396#[must_use = "FIDL methods require a response to be sent"]
5397#[derive(Debug)]
5398pub struct DirectorySetExtendedAttributeResponder {
5399    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5400    tx_id: u32,
5401}
5402
5403/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5404/// if the responder is dropped without sending a response, so that the client
5405/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5406impl std::ops::Drop for DirectorySetExtendedAttributeResponder {
5407    fn drop(&mut self) {
5408        self.control_handle.shutdown();
5409        // Safety: drops once, never accessed again
5410        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5411    }
5412}
5413
5414impl fidl::endpoints::Responder for DirectorySetExtendedAttributeResponder {
5415    type ControlHandle = DirectoryControlHandle;
5416
5417    fn control_handle(&self) -> &DirectoryControlHandle {
5418        &self.control_handle
5419    }
5420
5421    fn drop_without_shutdown(mut self) {
5422        // Safety: drops once, never accessed again due to mem::forget
5423        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5424        // Prevent Drop from running (which would shut down the channel)
5425        std::mem::forget(self);
5426    }
5427}
5428
5429impl DirectorySetExtendedAttributeResponder {
5430    /// Sends a response to the FIDL transaction.
5431    ///
5432    /// Sets the channel to shutdown if an error occurs.
5433    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5434        let _result = self.send_raw(result);
5435        if _result.is_err() {
5436            self.control_handle.shutdown();
5437        }
5438        self.drop_without_shutdown();
5439        _result
5440    }
5441
5442    /// Similar to "send" but does not shutdown the channel if an error occurs.
5443    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5444        let _result = self.send_raw(result);
5445        self.drop_without_shutdown();
5446        _result
5447    }
5448
5449    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5450        self.control_handle
5451            .inner
5452            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5453                result,
5454                self.tx_id,
5455                0x4a951362f681f23c,
5456                fidl::encoding::DynamicFlags::empty(),
5457            )
5458    }
5459}
5460
5461#[must_use = "FIDL methods require a response to be sent"]
5462#[derive(Debug)]
5463pub struct DirectoryRemoveExtendedAttributeResponder {
5464    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5465    tx_id: u32,
5466}
5467
5468/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5469/// if the responder is dropped without sending a response, so that the client
5470/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5471impl std::ops::Drop for DirectoryRemoveExtendedAttributeResponder {
5472    fn drop(&mut self) {
5473        self.control_handle.shutdown();
5474        // Safety: drops once, never accessed again
5475        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5476    }
5477}
5478
5479impl fidl::endpoints::Responder for DirectoryRemoveExtendedAttributeResponder {
5480    type ControlHandle = DirectoryControlHandle;
5481
5482    fn control_handle(&self) -> &DirectoryControlHandle {
5483        &self.control_handle
5484    }
5485
5486    fn drop_without_shutdown(mut self) {
5487        // Safety: drops once, never accessed again due to mem::forget
5488        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5489        // Prevent Drop from running (which would shut down the channel)
5490        std::mem::forget(self);
5491    }
5492}
5493
5494impl DirectoryRemoveExtendedAttributeResponder {
5495    /// Sends a response to the FIDL transaction.
5496    ///
5497    /// Sets the channel to shutdown if an error occurs.
5498    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5499        let _result = self.send_raw(result);
5500        if _result.is_err() {
5501            self.control_handle.shutdown();
5502        }
5503        self.drop_without_shutdown();
5504        _result
5505    }
5506
5507    /// Similar to "send" but does not shutdown the channel if an error occurs.
5508    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5509        let _result = self.send_raw(result);
5510        self.drop_without_shutdown();
5511        _result
5512    }
5513
5514    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5515        self.control_handle
5516            .inner
5517            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5518                result,
5519                self.tx_id,
5520                0x7a0b9f3a9bf9032d,
5521                fidl::encoding::DynamicFlags::empty(),
5522            )
5523    }
5524}
5525
5526#[must_use = "FIDL methods require a response to be sent"]
5527#[derive(Debug)]
5528pub struct DirectoryReadDirentsResponder {
5529    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5530    tx_id: u32,
5531}
5532
5533/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5534/// if the responder is dropped without sending a response, so that the client
5535/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5536impl std::ops::Drop for DirectoryReadDirentsResponder {
5537    fn drop(&mut self) {
5538        self.control_handle.shutdown();
5539        // Safety: drops once, never accessed again
5540        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5541    }
5542}
5543
5544impl fidl::endpoints::Responder for DirectoryReadDirentsResponder {
5545    type ControlHandle = DirectoryControlHandle;
5546
5547    fn control_handle(&self) -> &DirectoryControlHandle {
5548        &self.control_handle
5549    }
5550
5551    fn drop_without_shutdown(mut self) {
5552        // Safety: drops once, never accessed again due to mem::forget
5553        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5554        // Prevent Drop from running (which would shut down the channel)
5555        std::mem::forget(self);
5556    }
5557}
5558
5559impl DirectoryReadDirentsResponder {
5560    /// Sends a response to the FIDL transaction.
5561    ///
5562    /// Sets the channel to shutdown if an error occurs.
5563    pub fn send(self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5564        let _result = self.send_raw(s, dirents);
5565        if _result.is_err() {
5566            self.control_handle.shutdown();
5567        }
5568        self.drop_without_shutdown();
5569        _result
5570    }
5571
5572    /// Similar to "send" but does not shutdown the channel if an error occurs.
5573    pub fn send_no_shutdown_on_err(
5574        self,
5575        mut s: i32,
5576        mut dirents: &[u8],
5577    ) -> Result<(), fidl::Error> {
5578        let _result = self.send_raw(s, dirents);
5579        self.drop_without_shutdown();
5580        _result
5581    }
5582
5583    fn send_raw(&self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5584        self.control_handle.inner.send::<DirectoryReadDirentsResponse>(
5585            (s, dirents),
5586            self.tx_id,
5587            0x3582806bf27faa0a,
5588            fidl::encoding::DynamicFlags::empty(),
5589        )
5590    }
5591}
5592
5593#[must_use = "FIDL methods require a response to be sent"]
5594#[derive(Debug)]
5595pub struct DirectoryRewindResponder {
5596    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5597    tx_id: u32,
5598}
5599
5600/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5601/// if the responder is dropped without sending a response, so that the client
5602/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5603impl std::ops::Drop for DirectoryRewindResponder {
5604    fn drop(&mut self) {
5605        self.control_handle.shutdown();
5606        // Safety: drops once, never accessed again
5607        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5608    }
5609}
5610
5611impl fidl::endpoints::Responder for DirectoryRewindResponder {
5612    type ControlHandle = DirectoryControlHandle;
5613
5614    fn control_handle(&self) -> &DirectoryControlHandle {
5615        &self.control_handle
5616    }
5617
5618    fn drop_without_shutdown(mut self) {
5619        // Safety: drops once, never accessed again due to mem::forget
5620        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5621        // Prevent Drop from running (which would shut down the channel)
5622        std::mem::forget(self);
5623    }
5624}
5625
5626impl DirectoryRewindResponder {
5627    /// Sends a response to the FIDL transaction.
5628    ///
5629    /// Sets the channel to shutdown if an error occurs.
5630    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5631        let _result = self.send_raw(s);
5632        if _result.is_err() {
5633            self.control_handle.shutdown();
5634        }
5635        self.drop_without_shutdown();
5636        _result
5637    }
5638
5639    /// Similar to "send" but does not shutdown the channel if an error occurs.
5640    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5641        let _result = self.send_raw(s);
5642        self.drop_without_shutdown();
5643        _result
5644    }
5645
5646    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5647        self.control_handle.inner.send::<DirectoryRewindResponse>(
5648            (s,),
5649            self.tx_id,
5650            0x16b1202af0f34c71,
5651            fidl::encoding::DynamicFlags::empty(),
5652        )
5653    }
5654}
5655
5656#[must_use = "FIDL methods require a response to be sent"]
5657#[derive(Debug)]
5658pub struct DirectoryGetTokenResponder {
5659    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5660    tx_id: u32,
5661}
5662
5663/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5664/// if the responder is dropped without sending a response, so that the client
5665/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5666impl std::ops::Drop for DirectoryGetTokenResponder {
5667    fn drop(&mut self) {
5668        self.control_handle.shutdown();
5669        // Safety: drops once, never accessed again
5670        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5671    }
5672}
5673
5674impl fidl::endpoints::Responder for DirectoryGetTokenResponder {
5675    type ControlHandle = DirectoryControlHandle;
5676
5677    fn control_handle(&self) -> &DirectoryControlHandle {
5678        &self.control_handle
5679    }
5680
5681    fn drop_without_shutdown(mut self) {
5682        // Safety: drops once, never accessed again due to mem::forget
5683        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5684        // Prevent Drop from running (which would shut down the channel)
5685        std::mem::forget(self);
5686    }
5687}
5688
5689impl DirectoryGetTokenResponder {
5690    /// Sends a response to the FIDL transaction.
5691    ///
5692    /// Sets the channel to shutdown if an error occurs.
5693    pub fn send(
5694        self,
5695        mut s: i32,
5696        mut token: Option<fidl::NullableHandle>,
5697    ) -> Result<(), fidl::Error> {
5698        let _result = self.send_raw(s, token);
5699        if _result.is_err() {
5700            self.control_handle.shutdown();
5701        }
5702        self.drop_without_shutdown();
5703        _result
5704    }
5705
5706    /// Similar to "send" but does not shutdown the channel if an error occurs.
5707    pub fn send_no_shutdown_on_err(
5708        self,
5709        mut s: i32,
5710        mut token: Option<fidl::NullableHandle>,
5711    ) -> Result<(), fidl::Error> {
5712        let _result = self.send_raw(s, token);
5713        self.drop_without_shutdown();
5714        _result
5715    }
5716
5717    fn send_raw(
5718        &self,
5719        mut s: i32,
5720        mut token: Option<fidl::NullableHandle>,
5721    ) -> Result<(), fidl::Error> {
5722        self.control_handle.inner.send::<DirectoryGetTokenResponse>(
5723            (s, token),
5724            self.tx_id,
5725            0x26ae9d18763c8655,
5726            fidl::encoding::DynamicFlags::empty(),
5727        )
5728    }
5729}
5730
5731#[must_use = "FIDL methods require a response to be sent"]
5732#[derive(Debug)]
5733pub struct DirectoryLinkResponder {
5734    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5735    tx_id: u32,
5736}
5737
5738/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5739/// if the responder is dropped without sending a response, so that the client
5740/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5741impl std::ops::Drop for DirectoryLinkResponder {
5742    fn drop(&mut self) {
5743        self.control_handle.shutdown();
5744        // Safety: drops once, never accessed again
5745        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5746    }
5747}
5748
5749impl fidl::endpoints::Responder for DirectoryLinkResponder {
5750    type ControlHandle = DirectoryControlHandle;
5751
5752    fn control_handle(&self) -> &DirectoryControlHandle {
5753        &self.control_handle
5754    }
5755
5756    fn drop_without_shutdown(mut self) {
5757        // Safety: drops once, never accessed again due to mem::forget
5758        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5759        // Prevent Drop from running (which would shut down the channel)
5760        std::mem::forget(self);
5761    }
5762}
5763
5764impl DirectoryLinkResponder {
5765    /// Sends a response to the FIDL transaction.
5766    ///
5767    /// Sets the channel to shutdown if an error occurs.
5768    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5769        let _result = self.send_raw(s);
5770        if _result.is_err() {
5771            self.control_handle.shutdown();
5772        }
5773        self.drop_without_shutdown();
5774        _result
5775    }
5776
5777    /// Similar to "send" but does not shutdown the channel if an error occurs.
5778    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5779        let _result = self.send_raw(s);
5780        self.drop_without_shutdown();
5781        _result
5782    }
5783
5784    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5785        self.control_handle.inner.send::<DirectoryLinkResponse>(
5786            (s,),
5787            self.tx_id,
5788            0x740604c0c7c930e7,
5789            fidl::encoding::DynamicFlags::empty(),
5790        )
5791    }
5792}
5793
5794#[must_use = "FIDL methods require a response to be sent"]
5795#[derive(Debug)]
5796pub struct DirectoryUnlinkResponder {
5797    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5798    tx_id: u32,
5799}
5800
5801/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5802/// if the responder is dropped without sending a response, so that the client
5803/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5804impl std::ops::Drop for DirectoryUnlinkResponder {
5805    fn drop(&mut self) {
5806        self.control_handle.shutdown();
5807        // Safety: drops once, never accessed again
5808        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5809    }
5810}
5811
5812impl fidl::endpoints::Responder for DirectoryUnlinkResponder {
5813    type ControlHandle = DirectoryControlHandle;
5814
5815    fn control_handle(&self) -> &DirectoryControlHandle {
5816        &self.control_handle
5817    }
5818
5819    fn drop_without_shutdown(mut self) {
5820        // Safety: drops once, never accessed again due to mem::forget
5821        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5822        // Prevent Drop from running (which would shut down the channel)
5823        std::mem::forget(self);
5824    }
5825}
5826
5827impl DirectoryUnlinkResponder {
5828    /// Sends a response to the FIDL transaction.
5829    ///
5830    /// Sets the channel to shutdown if an error occurs.
5831    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5832        let _result = self.send_raw(result);
5833        if _result.is_err() {
5834            self.control_handle.shutdown();
5835        }
5836        self.drop_without_shutdown();
5837        _result
5838    }
5839
5840    /// Similar to "send" but does not shutdown the channel if an error occurs.
5841    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5842        let _result = self.send_raw(result);
5843        self.drop_without_shutdown();
5844        _result
5845    }
5846
5847    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5848        self.control_handle
5849            .inner
5850            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5851                result,
5852                self.tx_id,
5853                0x750a0326a78d7bed,
5854                fidl::encoding::DynamicFlags::empty(),
5855            )
5856    }
5857}
5858
5859#[must_use = "FIDL methods require a response to be sent"]
5860#[derive(Debug)]
5861pub struct DirectoryRenameResponder {
5862    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5863    tx_id: u32,
5864}
5865
5866/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5867/// if the responder is dropped without sending a response, so that the client
5868/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5869impl std::ops::Drop for DirectoryRenameResponder {
5870    fn drop(&mut self) {
5871        self.control_handle.shutdown();
5872        // Safety: drops once, never accessed again
5873        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5874    }
5875}
5876
5877impl fidl::endpoints::Responder for DirectoryRenameResponder {
5878    type ControlHandle = DirectoryControlHandle;
5879
5880    fn control_handle(&self) -> &DirectoryControlHandle {
5881        &self.control_handle
5882    }
5883
5884    fn drop_without_shutdown(mut self) {
5885        // Safety: drops once, never accessed again due to mem::forget
5886        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5887        // Prevent Drop from running (which would shut down the channel)
5888        std::mem::forget(self);
5889    }
5890}
5891
5892impl DirectoryRenameResponder {
5893    /// Sends a response to the FIDL transaction.
5894    ///
5895    /// Sets the channel to shutdown if an error occurs.
5896    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5897        let _result = self.send_raw(result);
5898        if _result.is_err() {
5899            self.control_handle.shutdown();
5900        }
5901        self.drop_without_shutdown();
5902        _result
5903    }
5904
5905    /// Similar to "send" but does not shutdown the channel if an error occurs.
5906    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5907        let _result = self.send_raw(result);
5908        self.drop_without_shutdown();
5909        _result
5910    }
5911
5912    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5913        self.control_handle
5914            .inner
5915            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5916                result,
5917                self.tx_id,
5918                0x7060e7723b9928de,
5919                fidl::encoding::DynamicFlags::empty(),
5920            )
5921    }
5922}
5923
5924#[must_use = "FIDL methods require a response to be sent"]
5925#[derive(Debug)]
5926pub struct DirectoryCreateSymlinkResponder {
5927    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5928    tx_id: u32,
5929}
5930
5931/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5932/// if the responder is dropped without sending a response, so that the client
5933/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5934impl std::ops::Drop for DirectoryCreateSymlinkResponder {
5935    fn drop(&mut self) {
5936        self.control_handle.shutdown();
5937        // Safety: drops once, never accessed again
5938        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5939    }
5940}
5941
5942impl fidl::endpoints::Responder for DirectoryCreateSymlinkResponder {
5943    type ControlHandle = DirectoryControlHandle;
5944
5945    fn control_handle(&self) -> &DirectoryControlHandle {
5946        &self.control_handle
5947    }
5948
5949    fn drop_without_shutdown(mut self) {
5950        // Safety: drops once, never accessed again due to mem::forget
5951        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5952        // Prevent Drop from running (which would shut down the channel)
5953        std::mem::forget(self);
5954    }
5955}
5956
5957impl DirectoryCreateSymlinkResponder {
5958    /// Sends a response to the FIDL transaction.
5959    ///
5960    /// Sets the channel to shutdown if an error occurs.
5961    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5962        let _result = self.send_raw(result);
5963        if _result.is_err() {
5964            self.control_handle.shutdown();
5965        }
5966        self.drop_without_shutdown();
5967        _result
5968    }
5969
5970    /// Similar to "send" but does not shutdown the channel if an error occurs.
5971    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5972        let _result = self.send_raw(result);
5973        self.drop_without_shutdown();
5974        _result
5975    }
5976
5977    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5978        self.control_handle
5979            .inner
5980            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5981                result,
5982                self.tx_id,
5983                0x21ce0f19ec043889,
5984                fidl::encoding::DynamicFlags::empty(),
5985            )
5986    }
5987}
5988
5989#[must_use = "FIDL methods require a response to be sent"]
5990#[derive(Debug)]
5991pub struct DirectoryWatchResponder {
5992    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5993    tx_id: u32,
5994}
5995
5996/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5997/// if the responder is dropped without sending a response, so that the client
5998/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5999impl std::ops::Drop for DirectoryWatchResponder {
6000    fn drop(&mut self) {
6001        self.control_handle.shutdown();
6002        // Safety: drops once, never accessed again
6003        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6004    }
6005}
6006
6007impl fidl::endpoints::Responder for DirectoryWatchResponder {
6008    type ControlHandle = DirectoryControlHandle;
6009
6010    fn control_handle(&self) -> &DirectoryControlHandle {
6011        &self.control_handle
6012    }
6013
6014    fn drop_without_shutdown(mut self) {
6015        // Safety: drops once, never accessed again due to mem::forget
6016        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6017        // Prevent Drop from running (which would shut down the channel)
6018        std::mem::forget(self);
6019    }
6020}
6021
6022impl DirectoryWatchResponder {
6023    /// Sends a response to the FIDL transaction.
6024    ///
6025    /// Sets the channel to shutdown if an error occurs.
6026    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
6027        let _result = self.send_raw(s);
6028        if _result.is_err() {
6029            self.control_handle.shutdown();
6030        }
6031        self.drop_without_shutdown();
6032        _result
6033    }
6034
6035    /// Similar to "send" but does not shutdown the channel if an error occurs.
6036    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
6037        let _result = self.send_raw(s);
6038        self.drop_without_shutdown();
6039        _result
6040    }
6041
6042    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
6043        self.control_handle.inner.send::<DirectoryWatchResponse>(
6044            (s,),
6045            self.tx_id,
6046            0x5717193a59d66d91,
6047            fidl::encoding::DynamicFlags::empty(),
6048        )
6049    }
6050}
6051
6052#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6053pub struct DirectoryWatcherMarker;
6054
6055impl fidl::endpoints::ProtocolMarker for DirectoryWatcherMarker {
6056    type Proxy = DirectoryWatcherProxy;
6057    type RequestStream = DirectoryWatcherRequestStream;
6058    #[cfg(target_os = "fuchsia")]
6059    type SynchronousProxy = DirectoryWatcherSynchronousProxy;
6060
6061    const DEBUG_NAME: &'static str = "(anonymous) DirectoryWatcher";
6062}
6063
6064pub trait DirectoryWatcherProxyInterface: Send + Sync {}
6065#[derive(Debug)]
6066#[cfg(target_os = "fuchsia")]
6067pub struct DirectoryWatcherSynchronousProxy {
6068    client: fidl::client::sync::Client,
6069}
6070
6071#[cfg(target_os = "fuchsia")]
6072impl fidl::endpoints::SynchronousProxy for DirectoryWatcherSynchronousProxy {
6073    type Proxy = DirectoryWatcherProxy;
6074    type Protocol = DirectoryWatcherMarker;
6075
6076    fn from_channel(inner: fidl::Channel) -> Self {
6077        Self::new(inner)
6078    }
6079
6080    fn into_channel(self) -> fidl::Channel {
6081        self.client.into_channel()
6082    }
6083
6084    fn as_channel(&self) -> &fidl::Channel {
6085        self.client.as_channel()
6086    }
6087}
6088
6089#[cfg(target_os = "fuchsia")]
6090impl DirectoryWatcherSynchronousProxy {
6091    pub fn new(channel: fidl::Channel) -> Self {
6092        let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6093        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6094    }
6095
6096    pub fn into_channel(self) -> fidl::Channel {
6097        self.client.into_channel()
6098    }
6099
6100    /// Waits until an event arrives and returns it. It is safe for other
6101    /// threads to make concurrent requests while waiting for an event.
6102    pub fn wait_for_event(
6103        &self,
6104        deadline: zx::MonotonicInstant,
6105    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6106        DirectoryWatcherEvent::decode(self.client.wait_for_event(deadline)?)
6107    }
6108}
6109
6110#[cfg(target_os = "fuchsia")]
6111impl From<DirectoryWatcherSynchronousProxy> for zx::NullableHandle {
6112    fn from(value: DirectoryWatcherSynchronousProxy) -> Self {
6113        value.into_channel().into()
6114    }
6115}
6116
6117#[cfg(target_os = "fuchsia")]
6118impl From<fidl::Channel> for DirectoryWatcherSynchronousProxy {
6119    fn from(value: fidl::Channel) -> Self {
6120        Self::new(value)
6121    }
6122}
6123
6124#[cfg(target_os = "fuchsia")]
6125impl fidl::endpoints::FromClient for DirectoryWatcherSynchronousProxy {
6126    type Protocol = DirectoryWatcherMarker;
6127
6128    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryWatcherMarker>) -> Self {
6129        Self::new(value.into_channel())
6130    }
6131}
6132
6133#[derive(Debug, Clone)]
6134pub struct DirectoryWatcherProxy {
6135    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6136}
6137
6138impl fidl::endpoints::Proxy for DirectoryWatcherProxy {
6139    type Protocol = DirectoryWatcherMarker;
6140
6141    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6142        Self::new(inner)
6143    }
6144
6145    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6146        self.client.into_channel().map_err(|client| Self { client })
6147    }
6148
6149    fn as_channel(&self) -> &::fidl::AsyncChannel {
6150        self.client.as_channel()
6151    }
6152}
6153
6154impl DirectoryWatcherProxy {
6155    /// Create a new Proxy for fuchsia.io/DirectoryWatcher.
6156    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6157        let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6158        Self { client: fidl::client::Client::new(channel, protocol_name) }
6159    }
6160
6161    /// Get a Stream of events from the remote end of the protocol.
6162    ///
6163    /// # Panics
6164    ///
6165    /// Panics if the event stream was already taken.
6166    pub fn take_event_stream(&self) -> DirectoryWatcherEventStream {
6167        DirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
6168    }
6169}
6170
6171impl DirectoryWatcherProxyInterface for DirectoryWatcherProxy {}
6172
6173pub struct DirectoryWatcherEventStream {
6174    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6175}
6176
6177impl std::marker::Unpin for DirectoryWatcherEventStream {}
6178
6179impl futures::stream::FusedStream for DirectoryWatcherEventStream {
6180    fn is_terminated(&self) -> bool {
6181        self.event_receiver.is_terminated()
6182    }
6183}
6184
6185impl futures::Stream for DirectoryWatcherEventStream {
6186    type Item = Result<DirectoryWatcherEvent, fidl::Error>;
6187
6188    fn poll_next(
6189        mut self: std::pin::Pin<&mut Self>,
6190        cx: &mut std::task::Context<'_>,
6191    ) -> std::task::Poll<Option<Self::Item>> {
6192        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6193            &mut self.event_receiver,
6194            cx
6195        )?) {
6196            Some(buf) => std::task::Poll::Ready(Some(DirectoryWatcherEvent::decode(buf))),
6197            None => std::task::Poll::Ready(None),
6198        }
6199    }
6200}
6201
6202#[derive(Debug)]
6203pub enum DirectoryWatcherEvent {}
6204
6205impl DirectoryWatcherEvent {
6206    /// Decodes a message buffer as a [`DirectoryWatcherEvent`].
6207    fn decode(
6208        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6209    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6210        let (bytes, _handles) = buf.split_mut();
6211        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6212        debug_assert_eq!(tx_header.tx_id, 0);
6213        match tx_header.ordinal {
6214            _ => Err(fidl::Error::UnknownOrdinal {
6215                ordinal: tx_header.ordinal,
6216                protocol_name:
6217                    <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6218            }),
6219        }
6220    }
6221}
6222
6223/// A Stream of incoming requests for fuchsia.io/DirectoryWatcher.
6224pub struct DirectoryWatcherRequestStream {
6225    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6226    is_terminated: bool,
6227}
6228
6229impl std::marker::Unpin for DirectoryWatcherRequestStream {}
6230
6231impl futures::stream::FusedStream for DirectoryWatcherRequestStream {
6232    fn is_terminated(&self) -> bool {
6233        self.is_terminated
6234    }
6235}
6236
6237impl fidl::endpoints::RequestStream for DirectoryWatcherRequestStream {
6238    type Protocol = DirectoryWatcherMarker;
6239    type ControlHandle = DirectoryWatcherControlHandle;
6240
6241    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6242        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6243    }
6244
6245    fn control_handle(&self) -> Self::ControlHandle {
6246        DirectoryWatcherControlHandle { inner: self.inner.clone() }
6247    }
6248
6249    fn into_inner(
6250        self,
6251    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6252    {
6253        (self.inner, self.is_terminated)
6254    }
6255
6256    fn from_inner(
6257        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6258        is_terminated: bool,
6259    ) -> Self {
6260        Self { inner, is_terminated }
6261    }
6262}
6263
6264impl futures::Stream for DirectoryWatcherRequestStream {
6265    type Item = Result<DirectoryWatcherRequest, fidl::Error>;
6266
6267    fn poll_next(
6268        mut self: std::pin::Pin<&mut Self>,
6269        cx: &mut std::task::Context<'_>,
6270    ) -> std::task::Poll<Option<Self::Item>> {
6271        let this = &mut *self;
6272        if this.inner.check_shutdown(cx) {
6273            this.is_terminated = true;
6274            return std::task::Poll::Ready(None);
6275        }
6276        if this.is_terminated {
6277            panic!("polled DirectoryWatcherRequestStream after completion");
6278        }
6279        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6280            |bytes, handles| {
6281                match this.inner.channel().read_etc(cx, bytes, handles) {
6282                    std::task::Poll::Ready(Ok(())) => {}
6283                    std::task::Poll::Pending => return std::task::Poll::Pending,
6284                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6285                        this.is_terminated = true;
6286                        return std::task::Poll::Ready(None);
6287                    }
6288                    std::task::Poll::Ready(Err(e)) => {
6289                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6290                            e.into(),
6291                        ))));
6292                    }
6293                }
6294
6295                // A message has been received from the channel
6296                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6297
6298                std::task::Poll::Ready(Some(match header.ordinal {
6299                    _ => Err(fidl::Error::UnknownOrdinal {
6300                        ordinal: header.ordinal,
6301                        protocol_name:
6302                            <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6303                    }),
6304                }))
6305            },
6306        )
6307    }
6308}
6309
6310/// DirectoryWatcher transmits messages from a filesystem server
6311/// about events happening in the filesystem. Clients can register
6312/// new watchers using the `Directory.Watch` method, where they can
6313/// filter which events they want to receive notifications for.
6314///
6315/// The DirectoryWatcher will send messages of the form:
6316/// ```
6317/// struct {
6318///   uint8 event;
6319///   uint8 len;
6320///   char name[];
6321/// };
6322/// ```
6323/// Where names are NOT null-terminated. The name is the relative
6324/// path to the entry the event is refering to. It will be empty if
6325/// the event isn't referencing a particular entry (e.g. for the
6326/// `IDLE` event).
6327#[derive(Debug)]
6328pub enum DirectoryWatcherRequest {}
6329
6330impl DirectoryWatcherRequest {
6331    /// Name of the method defined in FIDL
6332    pub fn method_name(&self) -> &'static str {
6333        match *self {}
6334    }
6335}
6336
6337#[derive(Debug, Clone)]
6338pub struct DirectoryWatcherControlHandle {
6339    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6340}
6341
6342impl fidl::endpoints::ControlHandle for DirectoryWatcherControlHandle {
6343    fn shutdown(&self) {
6344        self.inner.shutdown()
6345    }
6346
6347    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6348        self.inner.shutdown_with_epitaph(status)
6349    }
6350
6351    fn is_closed(&self) -> bool {
6352        self.inner.channel().is_closed()
6353    }
6354    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6355        self.inner.channel().on_closed()
6356    }
6357
6358    #[cfg(target_os = "fuchsia")]
6359    fn signal_peer(
6360        &self,
6361        clear_mask: zx::Signals,
6362        set_mask: zx::Signals,
6363    ) -> Result<(), zx_status::Status> {
6364        use fidl::Peered;
6365        self.inner.channel().signal_peer(clear_mask, set_mask)
6366    }
6367}
6368
6369impl DirectoryWatcherControlHandle {}
6370
6371#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6372pub struct ExtendedAttributeIteratorMarker;
6373
6374impl fidl::endpoints::ProtocolMarker for ExtendedAttributeIteratorMarker {
6375    type Proxy = ExtendedAttributeIteratorProxy;
6376    type RequestStream = ExtendedAttributeIteratorRequestStream;
6377    #[cfg(target_os = "fuchsia")]
6378    type SynchronousProxy = ExtendedAttributeIteratorSynchronousProxy;
6379
6380    const DEBUG_NAME: &'static str = "(anonymous) ExtendedAttributeIterator";
6381}
6382pub type ExtendedAttributeIteratorGetNextResult = Result<(Vec<Vec<u8>>, bool), i32>;
6383
6384pub trait ExtendedAttributeIteratorProxyInterface: Send + Sync {
6385    type GetNextResponseFut: std::future::Future<Output = Result<ExtendedAttributeIteratorGetNextResult, fidl::Error>>
6386        + Send;
6387    fn r#get_next(&self) -> Self::GetNextResponseFut;
6388}
6389#[derive(Debug)]
6390#[cfg(target_os = "fuchsia")]
6391pub struct ExtendedAttributeIteratorSynchronousProxy {
6392    client: fidl::client::sync::Client,
6393}
6394
6395#[cfg(target_os = "fuchsia")]
6396impl fidl::endpoints::SynchronousProxy for ExtendedAttributeIteratorSynchronousProxy {
6397    type Proxy = ExtendedAttributeIteratorProxy;
6398    type Protocol = ExtendedAttributeIteratorMarker;
6399
6400    fn from_channel(inner: fidl::Channel) -> Self {
6401        Self::new(inner)
6402    }
6403
6404    fn into_channel(self) -> fidl::Channel {
6405        self.client.into_channel()
6406    }
6407
6408    fn as_channel(&self) -> &fidl::Channel {
6409        self.client.as_channel()
6410    }
6411}
6412
6413#[cfg(target_os = "fuchsia")]
6414impl ExtendedAttributeIteratorSynchronousProxy {
6415    pub fn new(channel: fidl::Channel) -> Self {
6416        let protocol_name =
6417            <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6418        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6419    }
6420
6421    pub fn into_channel(self) -> fidl::Channel {
6422        self.client.into_channel()
6423    }
6424
6425    /// Waits until an event arrives and returns it. It is safe for other
6426    /// threads to make concurrent requests while waiting for an event.
6427    pub fn wait_for_event(
6428        &self,
6429        deadline: zx::MonotonicInstant,
6430    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6431        ExtendedAttributeIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6432    }
6433
6434    /// Get the next chunk of extended attribute names. If this is the last
6435    /// chunk, last will be true, and the channel will be closed after the
6436    /// call.
6437    pub fn r#get_next(
6438        &self,
6439        ___deadline: zx::MonotonicInstant,
6440    ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6441        let _response = self.client.send_query::<
6442            fidl::encoding::EmptyPayload,
6443            fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6444        >(
6445            (),
6446            0x3ba664a1c2e45a7,
6447            fidl::encoding::DynamicFlags::empty(),
6448            ___deadline,
6449        )?;
6450        Ok(_response.map(|x| (x.attributes, x.last)))
6451    }
6452}
6453
6454#[cfg(target_os = "fuchsia")]
6455impl From<ExtendedAttributeIteratorSynchronousProxy> for zx::NullableHandle {
6456    fn from(value: ExtendedAttributeIteratorSynchronousProxy) -> Self {
6457        value.into_channel().into()
6458    }
6459}
6460
6461#[cfg(target_os = "fuchsia")]
6462impl From<fidl::Channel> for ExtendedAttributeIteratorSynchronousProxy {
6463    fn from(value: fidl::Channel) -> Self {
6464        Self::new(value)
6465    }
6466}
6467
6468#[cfg(target_os = "fuchsia")]
6469impl fidl::endpoints::FromClient for ExtendedAttributeIteratorSynchronousProxy {
6470    type Protocol = ExtendedAttributeIteratorMarker;
6471
6472    fn from_client(value: fidl::endpoints::ClientEnd<ExtendedAttributeIteratorMarker>) -> Self {
6473        Self::new(value.into_channel())
6474    }
6475}
6476
6477#[derive(Debug, Clone)]
6478pub struct ExtendedAttributeIteratorProxy {
6479    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6480}
6481
6482impl fidl::endpoints::Proxy for ExtendedAttributeIteratorProxy {
6483    type Protocol = ExtendedAttributeIteratorMarker;
6484
6485    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6486        Self::new(inner)
6487    }
6488
6489    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6490        self.client.into_channel().map_err(|client| Self { client })
6491    }
6492
6493    fn as_channel(&self) -> &::fidl::AsyncChannel {
6494        self.client.as_channel()
6495    }
6496}
6497
6498impl ExtendedAttributeIteratorProxy {
6499    /// Create a new Proxy for fuchsia.io/ExtendedAttributeIterator.
6500    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6501        let protocol_name =
6502            <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6503        Self { client: fidl::client::Client::new(channel, protocol_name) }
6504    }
6505
6506    /// Get a Stream of events from the remote end of the protocol.
6507    ///
6508    /// # Panics
6509    ///
6510    /// Panics if the event stream was already taken.
6511    pub fn take_event_stream(&self) -> ExtendedAttributeIteratorEventStream {
6512        ExtendedAttributeIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6513    }
6514
6515    /// Get the next chunk of extended attribute names. If this is the last
6516    /// chunk, last will be true, and the channel will be closed after the
6517    /// call.
6518    pub fn r#get_next(
6519        &self,
6520    ) -> fidl::client::QueryResponseFut<
6521        ExtendedAttributeIteratorGetNextResult,
6522        fidl::encoding::DefaultFuchsiaResourceDialect,
6523    > {
6524        ExtendedAttributeIteratorProxyInterface::r#get_next(self)
6525    }
6526}
6527
6528impl ExtendedAttributeIteratorProxyInterface for ExtendedAttributeIteratorProxy {
6529    type GetNextResponseFut = fidl::client::QueryResponseFut<
6530        ExtendedAttributeIteratorGetNextResult,
6531        fidl::encoding::DefaultFuchsiaResourceDialect,
6532    >;
6533    fn r#get_next(&self) -> Self::GetNextResponseFut {
6534        fn _decode(
6535            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6536        ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6537            let _response = fidl::client::decode_transaction_body::<
6538                fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6539                fidl::encoding::DefaultFuchsiaResourceDialect,
6540                0x3ba664a1c2e45a7,
6541            >(_buf?)?;
6542            Ok(_response.map(|x| (x.attributes, x.last)))
6543        }
6544        self.client.send_query_and_decode::<
6545            fidl::encoding::EmptyPayload,
6546            ExtendedAttributeIteratorGetNextResult,
6547        >(
6548            (),
6549            0x3ba664a1c2e45a7,
6550            fidl::encoding::DynamicFlags::empty(),
6551            _decode,
6552        )
6553    }
6554}
6555
6556pub struct ExtendedAttributeIteratorEventStream {
6557    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6558}
6559
6560impl std::marker::Unpin for ExtendedAttributeIteratorEventStream {}
6561
6562impl futures::stream::FusedStream for ExtendedAttributeIteratorEventStream {
6563    fn is_terminated(&self) -> bool {
6564        self.event_receiver.is_terminated()
6565    }
6566}
6567
6568impl futures::Stream for ExtendedAttributeIteratorEventStream {
6569    type Item = Result<ExtendedAttributeIteratorEvent, fidl::Error>;
6570
6571    fn poll_next(
6572        mut self: std::pin::Pin<&mut Self>,
6573        cx: &mut std::task::Context<'_>,
6574    ) -> std::task::Poll<Option<Self::Item>> {
6575        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6576            &mut self.event_receiver,
6577            cx
6578        )?) {
6579            Some(buf) => std::task::Poll::Ready(Some(ExtendedAttributeIteratorEvent::decode(buf))),
6580            None => std::task::Poll::Ready(None),
6581        }
6582    }
6583}
6584
6585#[derive(Debug)]
6586pub enum ExtendedAttributeIteratorEvent {}
6587
6588impl ExtendedAttributeIteratorEvent {
6589    /// Decodes a message buffer as a [`ExtendedAttributeIteratorEvent`].
6590    fn decode(
6591        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6592    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6593        let (bytes, _handles) = buf.split_mut();
6594        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6595        debug_assert_eq!(tx_header.tx_id, 0);
6596        match tx_header.ordinal {
6597            _ => Err(fidl::Error::UnknownOrdinal {
6598                ordinal: tx_header.ordinal,
6599                protocol_name:
6600                    <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6601            }),
6602        }
6603    }
6604}
6605
6606/// A Stream of incoming requests for fuchsia.io/ExtendedAttributeIterator.
6607pub struct ExtendedAttributeIteratorRequestStream {
6608    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6609    is_terminated: bool,
6610}
6611
6612impl std::marker::Unpin for ExtendedAttributeIteratorRequestStream {}
6613
6614impl futures::stream::FusedStream for ExtendedAttributeIteratorRequestStream {
6615    fn is_terminated(&self) -> bool {
6616        self.is_terminated
6617    }
6618}
6619
6620impl fidl::endpoints::RequestStream for ExtendedAttributeIteratorRequestStream {
6621    type Protocol = ExtendedAttributeIteratorMarker;
6622    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6623
6624    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6625        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6626    }
6627
6628    fn control_handle(&self) -> Self::ControlHandle {
6629        ExtendedAttributeIteratorControlHandle { inner: self.inner.clone() }
6630    }
6631
6632    fn into_inner(
6633        self,
6634    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6635    {
6636        (self.inner, self.is_terminated)
6637    }
6638
6639    fn from_inner(
6640        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6641        is_terminated: bool,
6642    ) -> Self {
6643        Self { inner, is_terminated }
6644    }
6645}
6646
6647impl futures::Stream for ExtendedAttributeIteratorRequestStream {
6648    type Item = Result<ExtendedAttributeIteratorRequest, fidl::Error>;
6649
6650    fn poll_next(
6651        mut self: std::pin::Pin<&mut Self>,
6652        cx: &mut std::task::Context<'_>,
6653    ) -> std::task::Poll<Option<Self::Item>> {
6654        let this = &mut *self;
6655        if this.inner.check_shutdown(cx) {
6656            this.is_terminated = true;
6657            return std::task::Poll::Ready(None);
6658        }
6659        if this.is_terminated {
6660            panic!("polled ExtendedAttributeIteratorRequestStream after completion");
6661        }
6662        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6663            |bytes, handles| {
6664                match this.inner.channel().read_etc(cx, bytes, handles) {
6665                    std::task::Poll::Ready(Ok(())) => {}
6666                    std::task::Poll::Pending => return std::task::Poll::Pending,
6667                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6668                        this.is_terminated = true;
6669                        return std::task::Poll::Ready(None);
6670                    }
6671                    std::task::Poll::Ready(Err(e)) => {
6672                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6673                            e.into(),
6674                        ))));
6675                    }
6676                }
6677
6678                // A message has been received from the channel
6679                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6680
6681                std::task::Poll::Ready(Some(match header.ordinal {
6682                0x3ba664a1c2e45a7 => {
6683                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6684                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6685                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6686                    let control_handle = ExtendedAttributeIteratorControlHandle {
6687                        inner: this.inner.clone(),
6688                    };
6689                    Ok(ExtendedAttributeIteratorRequest::GetNext {
6690                        responder: ExtendedAttributeIteratorGetNextResponder {
6691                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6692                            tx_id: header.tx_id,
6693                        },
6694                    })
6695                }
6696                _ => Err(fidl::Error::UnknownOrdinal {
6697                    ordinal: header.ordinal,
6698                    protocol_name: <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6699                }),
6700            }))
6701            },
6702        )
6703    }
6704}
6705
6706#[derive(Debug)]
6707pub enum ExtendedAttributeIteratorRequest {
6708    /// Get the next chunk of extended attribute names. If this is the last
6709    /// chunk, last will be true, and the channel will be closed after the
6710    /// call.
6711    GetNext { responder: ExtendedAttributeIteratorGetNextResponder },
6712}
6713
6714impl ExtendedAttributeIteratorRequest {
6715    #[allow(irrefutable_let_patterns)]
6716    pub fn into_get_next(self) -> Option<(ExtendedAttributeIteratorGetNextResponder)> {
6717        if let ExtendedAttributeIteratorRequest::GetNext { responder } = self {
6718            Some((responder))
6719        } else {
6720            None
6721        }
6722    }
6723
6724    /// Name of the method defined in FIDL
6725    pub fn method_name(&self) -> &'static str {
6726        match *self {
6727            ExtendedAttributeIteratorRequest::GetNext { .. } => "get_next",
6728        }
6729    }
6730}
6731
6732#[derive(Debug, Clone)]
6733pub struct ExtendedAttributeIteratorControlHandle {
6734    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6735}
6736
6737impl fidl::endpoints::ControlHandle for ExtendedAttributeIteratorControlHandle {
6738    fn shutdown(&self) {
6739        self.inner.shutdown()
6740    }
6741
6742    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6743        self.inner.shutdown_with_epitaph(status)
6744    }
6745
6746    fn is_closed(&self) -> bool {
6747        self.inner.channel().is_closed()
6748    }
6749    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6750        self.inner.channel().on_closed()
6751    }
6752
6753    #[cfg(target_os = "fuchsia")]
6754    fn signal_peer(
6755        &self,
6756        clear_mask: zx::Signals,
6757        set_mask: zx::Signals,
6758    ) -> Result<(), zx_status::Status> {
6759        use fidl::Peered;
6760        self.inner.channel().signal_peer(clear_mask, set_mask)
6761    }
6762}
6763
6764impl ExtendedAttributeIteratorControlHandle {}
6765
6766#[must_use = "FIDL methods require a response to be sent"]
6767#[derive(Debug)]
6768pub struct ExtendedAttributeIteratorGetNextResponder {
6769    control_handle: std::mem::ManuallyDrop<ExtendedAttributeIteratorControlHandle>,
6770    tx_id: u32,
6771}
6772
6773/// Set the the channel to be shutdown (see [`ExtendedAttributeIteratorControlHandle::shutdown`])
6774/// if the responder is dropped without sending a response, so that the client
6775/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6776impl std::ops::Drop for ExtendedAttributeIteratorGetNextResponder {
6777    fn drop(&mut self) {
6778        self.control_handle.shutdown();
6779        // Safety: drops once, never accessed again
6780        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6781    }
6782}
6783
6784impl fidl::endpoints::Responder for ExtendedAttributeIteratorGetNextResponder {
6785    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6786
6787    fn control_handle(&self) -> &ExtendedAttributeIteratorControlHandle {
6788        &self.control_handle
6789    }
6790
6791    fn drop_without_shutdown(mut self) {
6792        // Safety: drops once, never accessed again due to mem::forget
6793        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6794        // Prevent Drop from running (which would shut down the channel)
6795        std::mem::forget(self);
6796    }
6797}
6798
6799impl ExtendedAttributeIteratorGetNextResponder {
6800    /// Sends a response to the FIDL transaction.
6801    ///
6802    /// Sets the channel to shutdown if an error occurs.
6803    pub fn send(self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6804        let _result = self.send_raw(result);
6805        if _result.is_err() {
6806            self.control_handle.shutdown();
6807        }
6808        self.drop_without_shutdown();
6809        _result
6810    }
6811
6812    /// Similar to "send" but does not shutdown the channel if an error occurs.
6813    pub fn send_no_shutdown_on_err(
6814        self,
6815        mut result: Result<(&[Vec<u8>], bool), i32>,
6816    ) -> Result<(), fidl::Error> {
6817        let _result = self.send_raw(result);
6818        self.drop_without_shutdown();
6819        _result
6820    }
6821
6822    fn send_raw(&self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6823        self.control_handle.inner.send::<fidl::encoding::ResultType<
6824            ExtendedAttributeIteratorGetNextResponse,
6825            i32,
6826        >>(
6827            result,
6828            self.tx_id,
6829            0x3ba664a1c2e45a7,
6830            fidl::encoding::DynamicFlags::empty(),
6831        )
6832    }
6833}
6834
6835#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6836pub struct FileMarker;
6837
6838impl fidl::endpoints::ProtocolMarker for FileMarker {
6839    type Proxy = FileProxy;
6840    type RequestStream = FileRequestStream;
6841    #[cfg(target_os = "fuchsia")]
6842    type SynchronousProxy = FileSynchronousProxy;
6843
6844    const DEBUG_NAME: &'static str = "fuchsia.io.File";
6845}
6846impl fidl::endpoints::DiscoverableProtocolMarker for FileMarker {}
6847pub type FileSeekResult = Result<u64, i32>;
6848pub type FileReadAtResult = Result<Vec<u8>, i32>;
6849pub type FileWriteAtResult = Result<u64, i32>;
6850pub type FileResizeResult = Result<(), i32>;
6851pub type FileGetBackingMemoryResult = Result<fidl::Vmo, i32>;
6852pub type FileAllocateResult = Result<(), i32>;
6853pub type FileEnableVerityResult = Result<(), i32>;
6854
6855pub trait FileProxyInterface: Send + Sync {
6856    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
6857        + Send;
6858    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
6859    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
6860        + Send;
6861    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
6862    fn r#clone(
6863        &self,
6864        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
6865    ) -> Result<(), fidl::Error>;
6866    type CloseResponseFut: std::future::Future<
6867            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
6868        > + Send;
6869    fn r#close(&self) -> Self::CloseResponseFut;
6870    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
6871    fn r#query(&self) -> Self::QueryResponseFut;
6872    fn r#deprecated_clone(
6873        &self,
6874        flags: OpenFlags,
6875        object: fidl::endpoints::ServerEnd<NodeMarker>,
6876    ) -> Result<(), fidl::Error>;
6877    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
6878        + Send;
6879    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
6880    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
6881    fn r#deprecated_set_attr(
6882        &self,
6883        flags: NodeAttributeFlags,
6884        attributes: &NodeAttributes,
6885    ) -> Self::DeprecatedSetAttrResponseFut;
6886    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
6887        + Send;
6888    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
6889    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
6890        + Send;
6891    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
6892    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
6893        + Send;
6894    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
6895    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
6896        + Send;
6897    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
6898    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
6899        + Send;
6900    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
6901    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
6902        + Send;
6903    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
6904    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
6905        + Send;
6906    fn r#update_attributes(
6907        &self,
6908        payload: &MutableNodeAttributes,
6909    ) -> Self::UpdateAttributesResponseFut;
6910    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
6911    fn r#sync(&self) -> Self::SyncResponseFut;
6912    fn r#list_extended_attributes(
6913        &self,
6914        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
6915    ) -> Result<(), fidl::Error>;
6916    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
6917        + Send;
6918    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
6919    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
6920        + Send;
6921    fn r#set_extended_attribute(
6922        &self,
6923        name: &[u8],
6924        value: ExtendedAttributeValue,
6925        mode: SetExtendedAttributeMode,
6926    ) -> Self::SetExtendedAttributeResponseFut;
6927    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
6928        + Send;
6929    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
6930    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
6931        + Send;
6932    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
6933    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
6934        + Send;
6935    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
6936    type DescribeResponseFut: std::future::Future<Output = Result<FileInfo, fidl::Error>> + Send;
6937    fn r#describe(&self) -> Self::DescribeResponseFut;
6938    type SeekResponseFut: std::future::Future<Output = Result<FileSeekResult, fidl::Error>> + Send;
6939    fn r#seek(&self, origin: SeekOrigin, offset: i64) -> Self::SeekResponseFut;
6940    type ReadAtResponseFut: std::future::Future<Output = Result<FileReadAtResult, fidl::Error>>
6941        + Send;
6942    fn r#read_at(&self, count: u64, offset: u64) -> Self::ReadAtResponseFut;
6943    type WriteAtResponseFut: std::future::Future<Output = Result<FileWriteAtResult, fidl::Error>>
6944        + Send;
6945    fn r#write_at(&self, data: &[u8], offset: u64) -> Self::WriteAtResponseFut;
6946    type ResizeResponseFut: std::future::Future<Output = Result<FileResizeResult, fidl::Error>>
6947        + Send;
6948    fn r#resize(&self, length: u64) -> Self::ResizeResponseFut;
6949    type GetBackingMemoryResponseFut: std::future::Future<Output = Result<FileGetBackingMemoryResult, fidl::Error>>
6950        + Send;
6951    fn r#get_backing_memory(&self, flags: VmoFlags) -> Self::GetBackingMemoryResponseFut;
6952    type AllocateResponseFut: std::future::Future<Output = Result<FileAllocateResult, fidl::Error>>
6953        + Send;
6954    fn r#allocate(&self, offset: u64, length: u64, mode: AllocateMode)
6955    -> Self::AllocateResponseFut;
6956    type EnableVerityResponseFut: std::future::Future<Output = Result<FileEnableVerityResult, fidl::Error>>
6957        + Send;
6958    fn r#enable_verity(&self, options: &VerificationOptions) -> Self::EnableVerityResponseFut;
6959}
6960#[derive(Debug)]
6961#[cfg(target_os = "fuchsia")]
6962pub struct FileSynchronousProxy {
6963    client: fidl::client::sync::Client,
6964}
6965
6966#[cfg(target_os = "fuchsia")]
6967impl fidl::endpoints::SynchronousProxy for FileSynchronousProxy {
6968    type Proxy = FileProxy;
6969    type Protocol = FileMarker;
6970
6971    fn from_channel(inner: fidl::Channel) -> Self {
6972        Self::new(inner)
6973    }
6974
6975    fn into_channel(self) -> fidl::Channel {
6976        self.client.into_channel()
6977    }
6978
6979    fn as_channel(&self) -> &fidl::Channel {
6980        self.client.as_channel()
6981    }
6982}
6983
6984#[cfg(target_os = "fuchsia")]
6985impl FileSynchronousProxy {
6986    pub fn new(channel: fidl::Channel) -> Self {
6987        let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6988        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6989    }
6990
6991    pub fn into_channel(self) -> fidl::Channel {
6992        self.client.into_channel()
6993    }
6994
6995    /// Waits until an event arrives and returns it. It is safe for other
6996    /// threads to make concurrent requests while waiting for an event.
6997    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<FileEvent, fidl::Error> {
6998        FileEvent::decode(self.client.wait_for_event(deadline)?)
6999    }
7000
7001    /// Acquires an advisory lock on the underlying file.
7002    ///
7003    /// The lock lasts until either this connection is closed or
7004    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7005    /// explicitly.
7006    ///
7007    /// Advisory locks are purely advisory. They do not prevent actual read or
7008    /// write operations from occurring on the file, either through this
7009    /// connection or through other connections.
7010    ///
7011    /// This method requires the following rights:
7012    ///
7013    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7014    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7015    ///   [`AdvisoryLockType.WRITE`].
7016    ///
7017    /// # Errors
7018    ///
7019    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7020    ///   example, another connection might hold a conflicting lock type.
7021    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7022    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7023    ///   to acquire the given type of lock.
7024    pub fn r#advisory_lock(
7025        &self,
7026        mut request: &AdvisoryLockRequest,
7027        ___deadline: zx::MonotonicInstant,
7028    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
7029        let _response = self.client.send_query::<
7030            AdvisoryLockingAdvisoryLockRequest,
7031            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7032        >(
7033            (request,),
7034            0x6ee9c0ad53ec87aa,
7035            fidl::encoding::DynamicFlags::empty(),
7036            ___deadline,
7037        )?;
7038        Ok(_response.map(|x| x))
7039    }
7040
7041    /// Creates a link to this this object with name `dst` in the directory represented by
7042    /// `dst_parent_token`.
7043    ///
7044    /// `dst` must be a resolved object name. Including "/" in the string will return
7045    /// `ZX_ERR_INVALID_ARGS`.
7046    ///
7047    /// This method requires the maximal set of rights supported by the filesystem for this object.
7048    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7049    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7050    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7051    /// `ZX_ERR_ACCESS_DENIED`.
7052    ///
7053    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7054    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7055    ///
7056    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7057    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7058    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7059    ///
7060    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7061    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7062    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7063    pub fn r#link_into(
7064        &self,
7065        mut dst_parent_token: fidl::Event,
7066        mut dst: &str,
7067        ___deadline: zx::MonotonicInstant,
7068    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
7069        let _response = self.client.send_query::<
7070            LinkableLinkIntoRequest,
7071            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7072        >(
7073            (dst_parent_token, dst,),
7074            0x54f3949246a03e74,
7075            fidl::encoding::DynamicFlags::empty(),
7076            ___deadline,
7077        )?;
7078        Ok(_response.map(|x| x))
7079    }
7080
7081    pub fn r#clone(
7082        &self,
7083        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7084    ) -> Result<(), fidl::Error> {
7085        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
7086            (request,),
7087            0x20d8a7aba2168a79,
7088            fidl::encoding::DynamicFlags::empty(),
7089        )
7090    }
7091
7092    /// Terminates the connection.
7093    ///
7094    /// After calling `Close`, the client must not send any other requests.
7095    ///
7096    /// Servers, after sending the status response, should close the connection
7097    /// regardless of status and without sending an epitaph.
7098    ///
7099    /// Closing the client end of the channel should be semantically equivalent
7100    /// to calling `Close` without knowing when the close has completed or its
7101    /// status.
7102    pub fn r#close(
7103        &self,
7104        ___deadline: zx::MonotonicInstant,
7105    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
7106        let _response = self.client.send_query::<
7107            fidl::encoding::EmptyPayload,
7108            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7109        >(
7110            (),
7111            0x5ac5d459ad7f657e,
7112            fidl::encoding::DynamicFlags::empty(),
7113            ___deadline,
7114        )?;
7115        Ok(_response.map(|x| x))
7116    }
7117
7118    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
7119        let _response = self.client.send_query::<
7120            fidl::encoding::EmptyPayload,
7121            fidl_fuchsia_unknown::QueryableQueryResponse,
7122        >(
7123            (),
7124            0x2658edee9decfc06,
7125            fidl::encoding::DynamicFlags::empty(),
7126            ___deadline,
7127        )?;
7128        Ok(_response.protocol)
7129    }
7130
7131    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7132    pub fn r#deprecated_clone(
7133        &self,
7134        mut flags: OpenFlags,
7135        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
7136    ) -> Result<(), fidl::Error> {
7137        self.client.send::<NodeDeprecatedCloneRequest>(
7138            (flags, object),
7139            0x5a61678f293ce16f,
7140            fidl::encoding::DynamicFlags::FLEXIBLE,
7141        )
7142    }
7143
7144    /// DEPRECATED - Use `Node.GetAttributes` instead.
7145    pub fn r#deprecated_get_attr(
7146        &self,
7147        ___deadline: zx::MonotonicInstant,
7148    ) -> Result<(i32, NodeAttributes), fidl::Error> {
7149        let _response =
7150            self.client.send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse>(
7151                (),
7152                0x78985e216314dafd,
7153                fidl::encoding::DynamicFlags::empty(),
7154                ___deadline,
7155            )?;
7156        Ok((_response.s, _response.attributes))
7157    }
7158
7159    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7160    pub fn r#deprecated_set_attr(
7161        &self,
7162        mut flags: NodeAttributeFlags,
7163        mut attributes: &NodeAttributes,
7164        ___deadline: zx::MonotonicInstant,
7165    ) -> Result<i32, fidl::Error> {
7166        let _response =
7167            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
7168                (flags, attributes),
7169                0x4186c0f40d938f46,
7170                fidl::encoding::DynamicFlags::empty(),
7171                ___deadline,
7172            )?;
7173        Ok(_response.s)
7174    }
7175
7176    /// [DEPRECATED - Use new GetFlags method instead.]
7177    pub fn r#deprecated_get_flags(
7178        &self,
7179        ___deadline: zx::MonotonicInstant,
7180    ) -> Result<(i32, OpenFlags), fidl::Error> {
7181        let _response = self
7182            .client
7183            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
7184                (),
7185                0x5b88fffb8eda3aa1,
7186                fidl::encoding::DynamicFlags::empty(),
7187                ___deadline,
7188            )?;
7189        Ok((_response.s, _response.flags))
7190    }
7191
7192    /// [DEPRECATED - Use new SetFlags method instead.]
7193    pub fn r#deprecated_set_flags(
7194        &self,
7195        mut flags: OpenFlags,
7196        ___deadline: zx::MonotonicInstant,
7197    ) -> Result<i32, fidl::Error> {
7198        let _response = self
7199            .client
7200            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
7201                (flags,),
7202                0x5295b76c71fde733,
7203                fidl::encoding::DynamicFlags::empty(),
7204                ___deadline,
7205            )?;
7206        Ok(_response.s)
7207    }
7208
7209    /// Queries the flags that apply to this node after it has been opened/created. This method does
7210    /// not require any rights.
7211    ///
7212    /// Note that the final set of flags that apply to the connection may differ from those
7213    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
7214    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
7215    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
7216    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
7217    pub fn r#get_flags(
7218        &self,
7219        ___deadline: zx::MonotonicInstant,
7220    ) -> Result<NodeGetFlagsResult, fidl::Error> {
7221        let _response = self.client.send_query::<
7222            fidl::encoding::EmptyPayload,
7223            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
7224        >(
7225            (),
7226            0x176eb318f64ec23,
7227            fidl::encoding::DynamicFlags::FLEXIBLE,
7228            ___deadline,
7229        )?
7230        .into_result::<FileMarker>("get_flags")?;
7231        Ok(_response.map(|x| x.flags))
7232    }
7233
7234    /// Sets the flags that apply to this node after it has been opened. This method does not
7235    /// require any rights.
7236    ///
7237    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
7238    /// clear append mode.
7239    ///
7240    /// Errors:
7241    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
7242    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
7243    pub fn r#set_flags(
7244        &self,
7245        mut flags: Flags,
7246        ___deadline: zx::MonotonicInstant,
7247    ) -> Result<NodeSetFlagsResult, fidl::Error> {
7248        let _response = self.client.send_query::<
7249            NodeSetFlagsRequest,
7250            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7251        >(
7252            (flags,),
7253            0x55a8028685791ea8,
7254            fidl::encoding::DynamicFlags::FLEXIBLE,
7255            ___deadline,
7256        )?
7257        .into_result::<FileMarker>("set_flags")?;
7258        Ok(_response.map(|x| x))
7259    }
7260
7261    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
7262    /// volume has different settings or the storage is accounted seperately from the rest of the
7263    /// filesystem that may be reported instead of filesystem-wide details.
7264    pub fn r#query_filesystem(
7265        &self,
7266        ___deadline: zx::MonotonicInstant,
7267    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
7268        let _response =
7269            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
7270                (),
7271                0x6f344a1c6b0a0610,
7272                fidl::encoding::DynamicFlags::empty(),
7273                ___deadline,
7274            )?;
7275        Ok((_response.s, _response.info))
7276    }
7277
7278    /// Acquires information about the node.
7279    ///
7280    /// The attributes of a node should be stable, independent of the
7281    /// specific protocol used to access it.
7282    ///
7283    /// If a particular attribute is not applicable or not supported,
7284    /// filesystems should leave the corresponding field absent.
7285    ///
7286    /// + `query` a bit-mask specifying which attributes to fetch. The server
7287    ///   should not return more than necessary.
7288    /// - `attributes` the returned attributes.
7289    ///
7290    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7291    pub fn r#get_attributes(
7292        &self,
7293        mut query: NodeAttributesQuery,
7294        ___deadline: zx::MonotonicInstant,
7295    ) -> Result<NodeGetAttributesResult, fidl::Error> {
7296        let _response = self.client.send_query::<
7297            NodeGetAttributesRequest,
7298            fidl::encoding::ResultType<NodeAttributes2, i32>,
7299        >(
7300            (query,),
7301            0x3d4396a638ea053b,
7302            fidl::encoding::DynamicFlags::empty(),
7303            ___deadline,
7304        )?;
7305        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
7306    }
7307
7308    /// Updates information about the node.
7309    ///
7310    /// + `attributes` the presence of a table field in `attributes` indicates
7311    /// the intent to update the corresponding attribute.
7312    ///
7313    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
7314    ///
7315    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7316    pub fn r#update_attributes(
7317        &self,
7318        mut payload: &MutableNodeAttributes,
7319        ___deadline: zx::MonotonicInstant,
7320    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
7321        let _response = self.client.send_query::<
7322            MutableNodeAttributes,
7323            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7324        >(
7325            payload,
7326            0x3308c1da5a89bf08,
7327            fidl::encoding::DynamicFlags::empty(),
7328            ___deadline,
7329        )?;
7330        Ok(_response.map(|x| x))
7331    }
7332
7333    /// Synchronizes updates to the node to the underlying media, if it exists.
7334    ///
7335    /// This method will return when the filesystem server has flushed the
7336    /// relevant updates to the underlying media, but does not guarantee the
7337    /// underlying media has persisted the information, nor that any information
7338    /// is committed to hardware. Clients may use `Sync` to ensure ordering
7339    /// between operations.
7340    ///
7341    /// This method does not require any rights.
7342    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
7343        let _response = self.client.send_query::<
7344            fidl::encoding::EmptyPayload,
7345            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7346        >(
7347            (),
7348            0x2c5c27ca0ab5dc49,
7349            fidl::encoding::DynamicFlags::empty(),
7350            ___deadline,
7351        )?;
7352        Ok(_response.map(|x| x))
7353    }
7354
7355    /// Creates an iterator over all the extended attribute names associated
7356    /// with this node. If an error occurs it is returned as an epitaph on the
7357    /// iterator request channel, and then the channel is closed.
7358    ///
7359    /// GetExtendedAttributes can be used with any of these names to retrieve
7360    /// the associated value.
7361    ///
7362    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7363    pub fn r#list_extended_attributes(
7364        &self,
7365        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
7366    ) -> Result<(), fidl::Error> {
7367        self.client.send::<NodeListExtendedAttributesRequest>(
7368            (iterator,),
7369            0x4b61033de007fcd0,
7370            fidl::encoding::DynamicFlags::empty(),
7371        )
7372    }
7373
7374    /// Get the value associated with the given attribute `name` for this node.
7375    ///
7376    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
7377    /// particular structure is imposed on them.
7378    ///
7379    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7380    pub fn r#get_extended_attribute(
7381        &self,
7382        mut name: &[u8],
7383        ___deadline: zx::MonotonicInstant,
7384    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
7385        let _response = self.client.send_query::<
7386            NodeGetExtendedAttributeRequest,
7387            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
7388        >(
7389            (name,),
7390            0x45ffa3ccfdeb76db,
7391            fidl::encoding::DynamicFlags::empty(),
7392            ___deadline,
7393        )?;
7394        Ok(_response.map(|x| x))
7395    }
7396
7397    /// Set the value for the given attribute `name` to `value` for this node.
7398    ///
7399    /// The attribute name may exist, in which case the attribute is updated.
7400    /// If the attribute doesn't exist, it is created. The name should have no
7401    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
7402    ///
7403    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7404    pub fn r#set_extended_attribute(
7405        &self,
7406        mut name: &[u8],
7407        mut value: ExtendedAttributeValue,
7408        mut mode: SetExtendedAttributeMode,
7409        ___deadline: zx::MonotonicInstant,
7410    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
7411        let _response = self.client.send_query::<
7412            NodeSetExtendedAttributeRequest,
7413            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7414        >(
7415            (name, &mut value, mode,),
7416            0x4a951362f681f23c,
7417            fidl::encoding::DynamicFlags::empty(),
7418            ___deadline,
7419        )?;
7420        Ok(_response.map(|x| x))
7421    }
7422
7423    /// Remove the specified extended attribute.
7424    ///
7425    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
7426    ///
7427    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7428    pub fn r#remove_extended_attribute(
7429        &self,
7430        mut name: &[u8],
7431        ___deadline: zx::MonotonicInstant,
7432    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
7433        let _response = self.client.send_query::<
7434            NodeRemoveExtendedAttributeRequest,
7435            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7436        >(
7437            (name,),
7438            0x7a0b9f3a9bf9032d,
7439            fidl::encoding::DynamicFlags::empty(),
7440            ___deadline,
7441        )?;
7442        Ok(_response.map(|x| x))
7443    }
7444
7445    /// Reads up to 'count' bytes at the seek offset.
7446    /// The seek offset is moved forward by the number of bytes read.
7447    ///
7448    /// ## Invariants
7449    ///
7450    /// * The returned `data.length` will never be greater than `count`.
7451    /// * If `data.length` is less than `count`, it means that the seek offset
7452    ///   has reached the end of file as part of this operation.
7453    /// * If `data.length` is zero while `count` is not, it means that the
7454    ///   seek offset is already at or beyond the end of file, and no data could
7455    ///   be read.
7456    /// * If `count` is zero, the server should perform all the checks ensuring
7457    ///   read access without actually read anything, and return an empty
7458    ///   `data` vector.
7459    ///
7460    /// This method requires the [`Rights.READ_BYTES`] right.
7461    ///
7462    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7463    pub fn r#read(
7464        &self,
7465        mut count: u64,
7466        ___deadline: zx::MonotonicInstant,
7467    ) -> Result<ReadableReadResult, fidl::Error> {
7468        let _response = self.client.send_query::<
7469            ReadableReadRequest,
7470            fidl::encoding::ResultType<ReadableReadResponse, i32>,
7471        >(
7472            (count,),
7473            0x57e419a298c8ede,
7474            fidl::encoding::DynamicFlags::empty(),
7475            ___deadline,
7476        )?;
7477        Ok(_response.map(|x| x.data))
7478    }
7479
7480    /// Writes data at the seek offset.
7481    /// The seek offset is moved forward by the number of bytes written.
7482    /// If the file is in append mode, the seek offset is first set to the end
7483    /// of the file, followed by the write, in one atomic step.
7484    ///
7485    /// The file size may grow if the seek offset plus `data.length` is beyond
7486    /// the current end of file.
7487    ///
7488    /// + request `data` the byte buffer to write to the file.
7489    /// - response `actual_count` the number of bytes written.
7490    ///
7491    /// ## Invariants
7492    ///
7493    /// * The returned `actual_count` will never be greater than `data.length`.
7494    /// * If the server is unable to write all the data due to e.g. not enough
7495    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7496    ///   could be written, an error is returned.
7497    /// * If `data.length` is zero, the server should perform all the checks
7498    ///   ensuring write access without mutating the file and return a
7499    ///   successful write of zero bytes.  The seek offset is still updated if
7500    ///   in append mode.
7501    ///
7502    /// This method requires the [`Rights.WRITE_BYTES`] right.
7503    pub fn r#write(
7504        &self,
7505        mut data: &[u8],
7506        ___deadline: zx::MonotonicInstant,
7507    ) -> Result<WritableWriteResult, fidl::Error> {
7508        let _response = self.client.send_query::<
7509            WritableWriteRequest,
7510            fidl::encoding::ResultType<WritableWriteResponse, i32>,
7511        >(
7512            (data,),
7513            0x6a31437832469f82,
7514            fidl::encoding::DynamicFlags::empty(),
7515            ___deadline,
7516        )?;
7517        Ok(_response.map(|x| x.actual_count))
7518    }
7519
7520    pub fn r#describe(&self, ___deadline: zx::MonotonicInstant) -> Result<FileInfo, fidl::Error> {
7521        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, FileInfo>(
7522            (),
7523            0x68b5ac00c62906bc,
7524            fidl::encoding::DynamicFlags::empty(),
7525            ___deadline,
7526        )?;
7527        Ok(_response)
7528    }
7529
7530    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
7531    /// will occur. The seek offset is specific to each file connection.
7532    ///
7533    /// + request `origin` the reference point where `offset` will be based on.
7534    /// + request `offset` the number of bytes to seek.
7535    /// - response `offset_from_start` the adjusted seek offset, from the start
7536    ///   of the file.
7537    ///
7538    /// This method does not require any rights.
7539    pub fn r#seek(
7540        &self,
7541        mut origin: SeekOrigin,
7542        mut offset: i64,
7543        ___deadline: zx::MonotonicInstant,
7544    ) -> Result<FileSeekResult, fidl::Error> {
7545        let _response = self
7546            .client
7547            .send_query::<FileSeekRequest, fidl::encoding::ResultType<FileSeekResponse, i32>>(
7548                (origin, offset),
7549                0x78079168162c5207,
7550                fidl::encoding::DynamicFlags::empty(),
7551                ___deadline,
7552            )?;
7553        Ok(_response.map(|x| x.offset_from_start))
7554    }
7555
7556    /// Reads up to 'count' bytes at the provided offset.
7557    /// Does not affect the seek offset.
7558    ///
7559    /// ## Invariants
7560    ///
7561    /// * The returned `data.length` will never be greater than `count`.
7562    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
7563    ///   the end of file as part of this operation.
7564    /// * If `data.length` is zero while `count` is not, it means that `offset`
7565    ///   is at or past the end of file, and no data can be read.
7566    /// * If `count` is zero, the server should perform all the checks ensuring
7567    ///   read access without actually reading anything, and return an empty
7568    ///   `data` vector.
7569    ///
7570    /// This method requires the [`Rights.READ_BYTES`] right.
7571    ///
7572    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7573    pub fn r#read_at(
7574        &self,
7575        mut count: u64,
7576        mut offset: u64,
7577        ___deadline: zx::MonotonicInstant,
7578    ) -> Result<FileReadAtResult, fidl::Error> {
7579        let _response = self
7580            .client
7581            .send_query::<FileReadAtRequest, fidl::encoding::ResultType<FileReadAtResponse, i32>>(
7582                (count, offset),
7583                0x1607a293a60d723e,
7584                fidl::encoding::DynamicFlags::empty(),
7585                ___deadline,
7586            )?;
7587        Ok(_response.map(|x| x.data))
7588    }
7589
7590    /// Writes data at the provided offset.
7591    /// Does not affect the seek offset.
7592    ///
7593    /// The file size may grow if `offset` plus `data.length` is past the
7594    /// current end of file.
7595    ///
7596    /// + request `data` the byte buffer to write to the file.
7597    /// + request `offset` the offset from start of the file to begin writing.
7598    /// - response `actual_count` the number of bytes written.
7599    ///
7600    /// ## Invariants
7601    ///
7602    /// * The returned `actual_count` will never be greater than `data.length`.
7603    /// * If the server is unable to write all the data due to e.g. not enough
7604    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7605    ///   could be written, an error is returned.
7606    /// * If `data.length` is zero, the server should perform all the checks
7607    ///   ensuring write access without mutating the file, and will return a
7608    ///   successful write of zero bytes.
7609    ///
7610    /// This method requires the [`Rights.WRITE_BYTES`] right.
7611    pub fn r#write_at(
7612        &self,
7613        mut data: &[u8],
7614        mut offset: u64,
7615        ___deadline: zx::MonotonicInstant,
7616    ) -> Result<FileWriteAtResult, fidl::Error> {
7617        let _response = self
7618            .client
7619            .send_query::<FileWriteAtRequest, fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
7620                (data, offset),
7621                0x793eefc0045e792b,
7622                fidl::encoding::DynamicFlags::empty(),
7623                ___deadline,
7624            )?;
7625        Ok(_response.map(|x| x.actual_count))
7626    }
7627
7628    /// Shrinks or grows the file size to 'length' bytes.
7629    ///
7630    /// If file size is reduced by this operation, the extra trailing data'
7631    /// is discarded.
7632    /// If file size is increased by this operation, the extended area appears
7633    /// as if it was zeroed.
7634    ///
7635    /// This method requires the [`Rights.WRITE_BYTES`] right.
7636    pub fn r#resize(
7637        &self,
7638        mut length: u64,
7639        ___deadline: zx::MonotonicInstant,
7640    ) -> Result<FileResizeResult, fidl::Error> {
7641        let _response = self.client.send_query::<
7642            FileResizeRequest,
7643            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7644        >(
7645            (length,),
7646            0x2b80825f0535743a,
7647            fidl::encoding::DynamicFlags::empty(),
7648            ___deadline,
7649        )?;
7650        Ok(_response.map(|x| x))
7651    }
7652
7653    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
7654    /// with the requested access rights.
7655    ///
7656    /// Implementations are not required to implement files backed by VMOs so
7657    /// this request may fail. Additionally, implementations may only support
7658    /// a certain subset of the flags. Clients should be prepared with fallback
7659    /// behavior if this request fails.
7660    ///
7661    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
7662    /// implementation is free to choose the semantics of the returned VMO.
7663    ///
7664    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
7665    /// - response `vmo` the requested [`zx.Handle:VMO`].
7666    /// * error a [`zx.Status`] value indicating the failure.
7667    ///
7668    /// This method requires the following rights:
7669    ///
7670    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
7671    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
7672    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
7673    pub fn r#get_backing_memory(
7674        &self,
7675        mut flags: VmoFlags,
7676        ___deadline: zx::MonotonicInstant,
7677    ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
7678        let _response = self.client.send_query::<
7679            FileGetBackingMemoryRequest,
7680            fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
7681        >(
7682            (flags,),
7683            0xa6a9e654cbf62b,
7684            fidl::encoding::DynamicFlags::empty(),
7685            ___deadline,
7686        )?;
7687        Ok(_response.map(|x| x.vmo))
7688    }
7689
7690    /// Pre-allocate on-disk space for this file.
7691    pub fn r#allocate(
7692        &self,
7693        mut offset: u64,
7694        mut length: u64,
7695        mut mode: AllocateMode,
7696        ___deadline: zx::MonotonicInstant,
7697    ) -> Result<FileAllocateResult, fidl::Error> {
7698        let _response = self.client.send_query::<
7699            FileAllocateRequest,
7700            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7701        >(
7702            (offset, length, mode,),
7703            0x77fa0c330b57fd2e,
7704            fidl::encoding::DynamicFlags::FLEXIBLE,
7705            ___deadline,
7706        )?
7707        .into_result::<FileMarker>("allocate")?;
7708        Ok(_response.map(|x| x))
7709    }
7710
7711    /// Enables verification for the file (permanently) which involves computing a merkle tree for
7712    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
7713    /// captured. Future reads will be verified against the computed merkle tree and writes will be
7714    /// rejected. This method can take some time to complete as it depends on the size of the file.
7715    /// This method can be aborted by closing the connection that this method was issued on.
7716    ///
7717    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7718    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
7719    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
7720    /// Also returns any error that might arise from reading the file, or from flushing the file,
7721    /// such as `ZX_ERR_IO`.
7722    pub fn r#enable_verity(
7723        &self,
7724        mut options: &VerificationOptions,
7725        ___deadline: zx::MonotonicInstant,
7726    ) -> Result<FileEnableVerityResult, fidl::Error> {
7727        let _response = self.client.send_query::<
7728            FileEnableVerityRequest,
7729            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7730        >(
7731            (options,),
7732            0x2c421ec3faaeb8bb,
7733            fidl::encoding::DynamicFlags::FLEXIBLE,
7734            ___deadline,
7735        )?
7736        .into_result::<FileMarker>("enable_verity")?;
7737        Ok(_response.map(|x| x))
7738    }
7739}
7740
7741#[cfg(target_os = "fuchsia")]
7742impl From<FileSynchronousProxy> for zx::NullableHandle {
7743    fn from(value: FileSynchronousProxy) -> Self {
7744        value.into_channel().into()
7745    }
7746}
7747
7748#[cfg(target_os = "fuchsia")]
7749impl From<fidl::Channel> for FileSynchronousProxy {
7750    fn from(value: fidl::Channel) -> Self {
7751        Self::new(value)
7752    }
7753}
7754
7755#[cfg(target_os = "fuchsia")]
7756impl fidl::endpoints::FromClient for FileSynchronousProxy {
7757    type Protocol = FileMarker;
7758
7759    fn from_client(value: fidl::endpoints::ClientEnd<FileMarker>) -> Self {
7760        Self::new(value.into_channel())
7761    }
7762}
7763
7764#[derive(Debug, Clone)]
7765pub struct FileProxy {
7766    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7767}
7768
7769impl fidl::endpoints::Proxy for FileProxy {
7770    type Protocol = FileMarker;
7771
7772    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7773        Self::new(inner)
7774    }
7775
7776    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7777        self.client.into_channel().map_err(|client| Self { client })
7778    }
7779
7780    fn as_channel(&self) -> &::fidl::AsyncChannel {
7781        self.client.as_channel()
7782    }
7783}
7784
7785impl FileProxy {
7786    /// Create a new Proxy for fuchsia.io/File.
7787    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7788        let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7789        Self { client: fidl::client::Client::new(channel, protocol_name) }
7790    }
7791
7792    /// Get a Stream of events from the remote end of the protocol.
7793    ///
7794    /// # Panics
7795    ///
7796    /// Panics if the event stream was already taken.
7797    pub fn take_event_stream(&self) -> FileEventStream {
7798        FileEventStream { event_receiver: self.client.take_event_receiver() }
7799    }
7800
7801    /// Acquires an advisory lock on the underlying file.
7802    ///
7803    /// The lock lasts until either this connection is closed or
7804    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7805    /// explicitly.
7806    ///
7807    /// Advisory locks are purely advisory. They do not prevent actual read or
7808    /// write operations from occurring on the file, either through this
7809    /// connection or through other connections.
7810    ///
7811    /// This method requires the following rights:
7812    ///
7813    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7814    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7815    ///   [`AdvisoryLockType.WRITE`].
7816    ///
7817    /// # Errors
7818    ///
7819    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7820    ///   example, another connection might hold a conflicting lock type.
7821    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7822    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7823    ///   to acquire the given type of lock.
7824    pub fn r#advisory_lock(
7825        &self,
7826        mut request: &AdvisoryLockRequest,
7827    ) -> fidl::client::QueryResponseFut<
7828        AdvisoryLockingAdvisoryLockResult,
7829        fidl::encoding::DefaultFuchsiaResourceDialect,
7830    > {
7831        FileProxyInterface::r#advisory_lock(self, request)
7832    }
7833
7834    /// Creates a link to this this object with name `dst` in the directory represented by
7835    /// `dst_parent_token`.
7836    ///
7837    /// `dst` must be a resolved object name. Including "/" in the string will return
7838    /// `ZX_ERR_INVALID_ARGS`.
7839    ///
7840    /// This method requires the maximal set of rights supported by the filesystem for this object.
7841    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7842    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7843    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7844    /// `ZX_ERR_ACCESS_DENIED`.
7845    ///
7846    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7847    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7848    ///
7849    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7850    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7851    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7852    ///
7853    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7854    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7855    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7856    pub fn r#link_into(
7857        &self,
7858        mut dst_parent_token: fidl::Event,
7859        mut dst: &str,
7860    ) -> fidl::client::QueryResponseFut<
7861        LinkableLinkIntoResult,
7862        fidl::encoding::DefaultFuchsiaResourceDialect,
7863    > {
7864        FileProxyInterface::r#link_into(self, dst_parent_token, dst)
7865    }
7866
7867    pub fn r#clone(
7868        &self,
7869        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7870    ) -> Result<(), fidl::Error> {
7871        FileProxyInterface::r#clone(self, request)
7872    }
7873
7874    /// Terminates the connection.
7875    ///
7876    /// After calling `Close`, the client must not send any other requests.
7877    ///
7878    /// Servers, after sending the status response, should close the connection
7879    /// regardless of status and without sending an epitaph.
7880    ///
7881    /// Closing the client end of the channel should be semantically equivalent
7882    /// to calling `Close` without knowing when the close has completed or its
7883    /// status.
7884    pub fn r#close(
7885        &self,
7886    ) -> fidl::client::QueryResponseFut<
7887        fidl_fuchsia_unknown::CloseableCloseResult,
7888        fidl::encoding::DefaultFuchsiaResourceDialect,
7889    > {
7890        FileProxyInterface::r#close(self)
7891    }
7892
7893    pub fn r#query(
7894        &self,
7895    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
7896    {
7897        FileProxyInterface::r#query(self)
7898    }
7899
7900    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7901    pub fn r#deprecated_clone(
7902        &self,
7903        mut flags: OpenFlags,
7904        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
7905    ) -> Result<(), fidl::Error> {
7906        FileProxyInterface::r#deprecated_clone(self, flags, object)
7907    }
7908
7909    /// DEPRECATED - Use `Node.GetAttributes` instead.
7910    pub fn r#deprecated_get_attr(
7911        &self,
7912    ) -> fidl::client::QueryResponseFut<
7913        (i32, NodeAttributes),
7914        fidl::encoding::DefaultFuchsiaResourceDialect,
7915    > {
7916        FileProxyInterface::r#deprecated_get_attr(self)
7917    }
7918
7919    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7920    pub fn r#deprecated_set_attr(
7921        &self,
7922        mut flags: NodeAttributeFlags,
7923        mut attributes: &NodeAttributes,
7924    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
7925        FileProxyInterface::r#deprecated_set_attr(self, flags, attributes)
7926    }
7927
7928    /// [DEPRECATED - Use new GetFlags method instead.]
7929    pub fn r#deprecated_get_flags(
7930        &self,
7931    ) -> fidl::client::QueryResponseFut<
7932        (i32, OpenFlags),
7933        fidl::encoding::DefaultFuchsiaResourceDialect,
7934    > {
7935        FileProxyInterface::r#deprecated_get_flags(self)
7936    }
7937
7938    /// [DEPRECATED - Use new SetFlags method instead.]
7939    pub fn r#deprecated_set_flags(
7940        &self,
7941        mut flags: OpenFlags,
7942    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
7943        FileProxyInterface::r#deprecated_set_flags(self, flags)
7944    }
7945
7946    /// Queries the flags that apply to this node after it has been opened/created. This method does
7947    /// not require any rights.
7948    ///
7949    /// Note that the final set of flags that apply to the connection may differ from those
7950    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
7951    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
7952    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
7953    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
7954    pub fn r#get_flags(
7955        &self,
7956    ) -> fidl::client::QueryResponseFut<
7957        NodeGetFlagsResult,
7958        fidl::encoding::DefaultFuchsiaResourceDialect,
7959    > {
7960        FileProxyInterface::r#get_flags(self)
7961    }
7962
7963    /// Sets the flags that apply to this node after it has been opened. This method does not
7964    /// require any rights.
7965    ///
7966    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
7967    /// clear append mode.
7968    ///
7969    /// Errors:
7970    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
7971    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
7972    pub fn r#set_flags(
7973        &self,
7974        mut flags: Flags,
7975    ) -> fidl::client::QueryResponseFut<
7976        NodeSetFlagsResult,
7977        fidl::encoding::DefaultFuchsiaResourceDialect,
7978    > {
7979        FileProxyInterface::r#set_flags(self, flags)
7980    }
7981
7982    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
7983    /// volume has different settings or the storage is accounted seperately from the rest of the
7984    /// filesystem that may be reported instead of filesystem-wide details.
7985    pub fn r#query_filesystem(
7986        &self,
7987    ) -> fidl::client::QueryResponseFut<
7988        (i32, Option<Box<FilesystemInfo>>),
7989        fidl::encoding::DefaultFuchsiaResourceDialect,
7990    > {
7991        FileProxyInterface::r#query_filesystem(self)
7992    }
7993
7994    /// Acquires information about the node.
7995    ///
7996    /// The attributes of a node should be stable, independent of the
7997    /// specific protocol used to access it.
7998    ///
7999    /// If a particular attribute is not applicable or not supported,
8000    /// filesystems should leave the corresponding field absent.
8001    ///
8002    /// + `query` a bit-mask specifying which attributes to fetch. The server
8003    ///   should not return more than necessary.
8004    /// - `attributes` the returned attributes.
8005    ///
8006    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8007    pub fn r#get_attributes(
8008        &self,
8009        mut query: NodeAttributesQuery,
8010    ) -> fidl::client::QueryResponseFut<
8011        NodeGetAttributesResult,
8012        fidl::encoding::DefaultFuchsiaResourceDialect,
8013    > {
8014        FileProxyInterface::r#get_attributes(self, query)
8015    }
8016
8017    /// Updates information about the node.
8018    ///
8019    /// + `attributes` the presence of a table field in `attributes` indicates
8020    /// the intent to update the corresponding attribute.
8021    ///
8022    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
8023    ///
8024    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8025    pub fn r#update_attributes(
8026        &self,
8027        mut payload: &MutableNodeAttributes,
8028    ) -> fidl::client::QueryResponseFut<
8029        NodeUpdateAttributesResult,
8030        fidl::encoding::DefaultFuchsiaResourceDialect,
8031    > {
8032        FileProxyInterface::r#update_attributes(self, payload)
8033    }
8034
8035    /// Synchronizes updates to the node to the underlying media, if it exists.
8036    ///
8037    /// This method will return when the filesystem server has flushed the
8038    /// relevant updates to the underlying media, but does not guarantee the
8039    /// underlying media has persisted the information, nor that any information
8040    /// is committed to hardware. Clients may use `Sync` to ensure ordering
8041    /// between operations.
8042    ///
8043    /// This method does not require any rights.
8044    pub fn r#sync(
8045        &self,
8046    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8047    {
8048        FileProxyInterface::r#sync(self)
8049    }
8050
8051    /// Creates an iterator over all the extended attribute names associated
8052    /// with this node. If an error occurs it is returned as an epitaph on the
8053    /// iterator request channel, and then the channel is closed.
8054    ///
8055    /// GetExtendedAttributes can be used with any of these names to retrieve
8056    /// the associated value.
8057    ///
8058    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8059    pub fn r#list_extended_attributes(
8060        &self,
8061        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8062    ) -> Result<(), fidl::Error> {
8063        FileProxyInterface::r#list_extended_attributes(self, iterator)
8064    }
8065
8066    /// Get the value associated with the given attribute `name` for this node.
8067    ///
8068    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
8069    /// particular structure is imposed on them.
8070    ///
8071    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8072    pub fn r#get_extended_attribute(
8073        &self,
8074        mut name: &[u8],
8075    ) -> fidl::client::QueryResponseFut<
8076        NodeGetExtendedAttributeResult,
8077        fidl::encoding::DefaultFuchsiaResourceDialect,
8078    > {
8079        FileProxyInterface::r#get_extended_attribute(self, name)
8080    }
8081
8082    /// Set the value for the given attribute `name` to `value` for this node.
8083    ///
8084    /// The attribute name may exist, in which case the attribute is updated.
8085    /// If the attribute doesn't exist, it is created. The name should have no
8086    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
8087    ///
8088    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8089    pub fn r#set_extended_attribute(
8090        &self,
8091        mut name: &[u8],
8092        mut value: ExtendedAttributeValue,
8093        mut mode: SetExtendedAttributeMode,
8094    ) -> fidl::client::QueryResponseFut<
8095        NodeSetExtendedAttributeResult,
8096        fidl::encoding::DefaultFuchsiaResourceDialect,
8097    > {
8098        FileProxyInterface::r#set_extended_attribute(self, name, value, mode)
8099    }
8100
8101    /// Remove the specified extended attribute.
8102    ///
8103    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
8104    ///
8105    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8106    pub fn r#remove_extended_attribute(
8107        &self,
8108        mut name: &[u8],
8109    ) -> fidl::client::QueryResponseFut<
8110        NodeRemoveExtendedAttributeResult,
8111        fidl::encoding::DefaultFuchsiaResourceDialect,
8112    > {
8113        FileProxyInterface::r#remove_extended_attribute(self, name)
8114    }
8115
8116    /// Reads up to 'count' bytes at the seek offset.
8117    /// The seek offset is moved forward by the number of bytes read.
8118    ///
8119    /// ## Invariants
8120    ///
8121    /// * The returned `data.length` will never be greater than `count`.
8122    /// * If `data.length` is less than `count`, it means that the seek offset
8123    ///   has reached the end of file as part of this operation.
8124    /// * If `data.length` is zero while `count` is not, it means that the
8125    ///   seek offset is already at or beyond the end of file, and no data could
8126    ///   be read.
8127    /// * If `count` is zero, the server should perform all the checks ensuring
8128    ///   read access without actually read anything, and return an empty
8129    ///   `data` vector.
8130    ///
8131    /// This method requires the [`Rights.READ_BYTES`] right.
8132    ///
8133    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8134    pub fn r#read(
8135        &self,
8136        mut count: u64,
8137    ) -> fidl::client::QueryResponseFut<
8138        ReadableReadResult,
8139        fidl::encoding::DefaultFuchsiaResourceDialect,
8140    > {
8141        FileProxyInterface::r#read(self, count)
8142    }
8143
8144    /// Writes data at the seek offset.
8145    /// The seek offset is moved forward by the number of bytes written.
8146    /// If the file is in append mode, the seek offset is first set to the end
8147    /// of the file, followed by the write, in one atomic step.
8148    ///
8149    /// The file size may grow if the seek offset plus `data.length` is beyond
8150    /// the current end of file.
8151    ///
8152    /// + request `data` the byte buffer to write to the file.
8153    /// - response `actual_count` the number of bytes written.
8154    ///
8155    /// ## Invariants
8156    ///
8157    /// * The returned `actual_count` will never be greater than `data.length`.
8158    /// * If the server is unable to write all the data due to e.g. not enough
8159    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8160    ///   could be written, an error is returned.
8161    /// * If `data.length` is zero, the server should perform all the checks
8162    ///   ensuring write access without mutating the file and return a
8163    ///   successful write of zero bytes.  The seek offset is still updated if
8164    ///   in append mode.
8165    ///
8166    /// This method requires the [`Rights.WRITE_BYTES`] right.
8167    pub fn r#write(
8168        &self,
8169        mut data: &[u8],
8170    ) -> fidl::client::QueryResponseFut<
8171        WritableWriteResult,
8172        fidl::encoding::DefaultFuchsiaResourceDialect,
8173    > {
8174        FileProxyInterface::r#write(self, data)
8175    }
8176
8177    pub fn r#describe(
8178        &self,
8179    ) -> fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
8180    {
8181        FileProxyInterface::r#describe(self)
8182    }
8183
8184    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
8185    /// will occur. The seek offset is specific to each file connection.
8186    ///
8187    /// + request `origin` the reference point where `offset` will be based on.
8188    /// + request `offset` the number of bytes to seek.
8189    /// - response `offset_from_start` the adjusted seek offset, from the start
8190    ///   of the file.
8191    ///
8192    /// This method does not require any rights.
8193    pub fn r#seek(
8194        &self,
8195        mut origin: SeekOrigin,
8196        mut offset: i64,
8197    ) -> fidl::client::QueryResponseFut<FileSeekResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8198    {
8199        FileProxyInterface::r#seek(self, origin, offset)
8200    }
8201
8202    /// Reads up to 'count' bytes at the provided offset.
8203    /// Does not affect the seek offset.
8204    ///
8205    /// ## Invariants
8206    ///
8207    /// * The returned `data.length` will never be greater than `count`.
8208    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
8209    ///   the end of file as part of this operation.
8210    /// * If `data.length` is zero while `count` is not, it means that `offset`
8211    ///   is at or past the end of file, and no data can be read.
8212    /// * If `count` is zero, the server should perform all the checks ensuring
8213    ///   read access without actually reading anything, and return an empty
8214    ///   `data` vector.
8215    ///
8216    /// This method requires the [`Rights.READ_BYTES`] right.
8217    ///
8218    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8219    pub fn r#read_at(
8220        &self,
8221        mut count: u64,
8222        mut offset: u64,
8223    ) -> fidl::client::QueryResponseFut<
8224        FileReadAtResult,
8225        fidl::encoding::DefaultFuchsiaResourceDialect,
8226    > {
8227        FileProxyInterface::r#read_at(self, count, offset)
8228    }
8229
8230    /// Writes data at the provided offset.
8231    /// Does not affect the seek offset.
8232    ///
8233    /// The file size may grow if `offset` plus `data.length` is past the
8234    /// current end of file.
8235    ///
8236    /// + request `data` the byte buffer to write to the file.
8237    /// + request `offset` the offset from start of the file to begin writing.
8238    /// - response `actual_count` the number of bytes written.
8239    ///
8240    /// ## Invariants
8241    ///
8242    /// * The returned `actual_count` will never be greater than `data.length`.
8243    /// * If the server is unable to write all the data due to e.g. not enough
8244    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8245    ///   could be written, an error is returned.
8246    /// * If `data.length` is zero, the server should perform all the checks
8247    ///   ensuring write access without mutating the file, and will return a
8248    ///   successful write of zero bytes.
8249    ///
8250    /// This method requires the [`Rights.WRITE_BYTES`] right.
8251    pub fn r#write_at(
8252        &self,
8253        mut data: &[u8],
8254        mut offset: u64,
8255    ) -> fidl::client::QueryResponseFut<
8256        FileWriteAtResult,
8257        fidl::encoding::DefaultFuchsiaResourceDialect,
8258    > {
8259        FileProxyInterface::r#write_at(self, data, offset)
8260    }
8261
8262    /// Shrinks or grows the file size to 'length' bytes.
8263    ///
8264    /// If file size is reduced by this operation, the extra trailing data'
8265    /// is discarded.
8266    /// If file size is increased by this operation, the extended area appears
8267    /// as if it was zeroed.
8268    ///
8269    /// This method requires the [`Rights.WRITE_BYTES`] right.
8270    pub fn r#resize(
8271        &self,
8272        mut length: u64,
8273    ) -> fidl::client::QueryResponseFut<
8274        FileResizeResult,
8275        fidl::encoding::DefaultFuchsiaResourceDialect,
8276    > {
8277        FileProxyInterface::r#resize(self, length)
8278    }
8279
8280    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
8281    /// with the requested access rights.
8282    ///
8283    /// Implementations are not required to implement files backed by VMOs so
8284    /// this request may fail. Additionally, implementations may only support
8285    /// a certain subset of the flags. Clients should be prepared with fallback
8286    /// behavior if this request fails.
8287    ///
8288    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
8289    /// implementation is free to choose the semantics of the returned VMO.
8290    ///
8291    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
8292    /// - response `vmo` the requested [`zx.Handle:VMO`].
8293    /// * error a [`zx.Status`] value indicating the failure.
8294    ///
8295    /// This method requires the following rights:
8296    ///
8297    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
8298    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
8299    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
8300    pub fn r#get_backing_memory(
8301        &self,
8302        mut flags: VmoFlags,
8303    ) -> fidl::client::QueryResponseFut<
8304        FileGetBackingMemoryResult,
8305        fidl::encoding::DefaultFuchsiaResourceDialect,
8306    > {
8307        FileProxyInterface::r#get_backing_memory(self, flags)
8308    }
8309
8310    /// Pre-allocate on-disk space for this file.
8311    pub fn r#allocate(
8312        &self,
8313        mut offset: u64,
8314        mut length: u64,
8315        mut mode: AllocateMode,
8316    ) -> fidl::client::QueryResponseFut<
8317        FileAllocateResult,
8318        fidl::encoding::DefaultFuchsiaResourceDialect,
8319    > {
8320        FileProxyInterface::r#allocate(self, offset, length, mode)
8321    }
8322
8323    /// Enables verification for the file (permanently) which involves computing a merkle tree for
8324    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
8325    /// captured. Future reads will be verified against the computed merkle tree and writes will be
8326    /// rejected. This method can take some time to complete as it depends on the size of the file.
8327    /// This method can be aborted by closing the connection that this method was issued on.
8328    ///
8329    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8330    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
8331    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
8332    /// Also returns any error that might arise from reading the file, or from flushing the file,
8333    /// such as `ZX_ERR_IO`.
8334    pub fn r#enable_verity(
8335        &self,
8336        mut options: &VerificationOptions,
8337    ) -> fidl::client::QueryResponseFut<
8338        FileEnableVerityResult,
8339        fidl::encoding::DefaultFuchsiaResourceDialect,
8340    > {
8341        FileProxyInterface::r#enable_verity(self, options)
8342    }
8343}
8344
8345impl FileProxyInterface for FileProxy {
8346    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
8347        AdvisoryLockingAdvisoryLockResult,
8348        fidl::encoding::DefaultFuchsiaResourceDialect,
8349    >;
8350    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
8351        fn _decode(
8352            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8353        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
8354            let _response = fidl::client::decode_transaction_body::<
8355                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8356                fidl::encoding::DefaultFuchsiaResourceDialect,
8357                0x6ee9c0ad53ec87aa,
8358            >(_buf?)?;
8359            Ok(_response.map(|x| x))
8360        }
8361        self.client.send_query_and_decode::<
8362            AdvisoryLockingAdvisoryLockRequest,
8363            AdvisoryLockingAdvisoryLockResult,
8364        >(
8365            (request,),
8366            0x6ee9c0ad53ec87aa,
8367            fidl::encoding::DynamicFlags::empty(),
8368            _decode,
8369        )
8370    }
8371
8372    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
8373        LinkableLinkIntoResult,
8374        fidl::encoding::DefaultFuchsiaResourceDialect,
8375    >;
8376    fn r#link_into(
8377        &self,
8378        mut dst_parent_token: fidl::Event,
8379        mut dst: &str,
8380    ) -> Self::LinkIntoResponseFut {
8381        fn _decode(
8382            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8383        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
8384            let _response = fidl::client::decode_transaction_body::<
8385                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8386                fidl::encoding::DefaultFuchsiaResourceDialect,
8387                0x54f3949246a03e74,
8388            >(_buf?)?;
8389            Ok(_response.map(|x| x))
8390        }
8391        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
8392            (dst_parent_token, dst),
8393            0x54f3949246a03e74,
8394            fidl::encoding::DynamicFlags::empty(),
8395            _decode,
8396        )
8397    }
8398
8399    fn r#clone(
8400        &self,
8401        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8402    ) -> Result<(), fidl::Error> {
8403        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
8404            (request,),
8405            0x20d8a7aba2168a79,
8406            fidl::encoding::DynamicFlags::empty(),
8407        )
8408    }
8409
8410    type CloseResponseFut = fidl::client::QueryResponseFut<
8411        fidl_fuchsia_unknown::CloseableCloseResult,
8412        fidl::encoding::DefaultFuchsiaResourceDialect,
8413    >;
8414    fn r#close(&self) -> Self::CloseResponseFut {
8415        fn _decode(
8416            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8417        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
8418            let _response = fidl::client::decode_transaction_body::<
8419                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8420                fidl::encoding::DefaultFuchsiaResourceDialect,
8421                0x5ac5d459ad7f657e,
8422            >(_buf?)?;
8423            Ok(_response.map(|x| x))
8424        }
8425        self.client.send_query_and_decode::<
8426            fidl::encoding::EmptyPayload,
8427            fidl_fuchsia_unknown::CloseableCloseResult,
8428        >(
8429            (),
8430            0x5ac5d459ad7f657e,
8431            fidl::encoding::DynamicFlags::empty(),
8432            _decode,
8433        )
8434    }
8435
8436    type QueryResponseFut =
8437        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
8438    fn r#query(&self) -> Self::QueryResponseFut {
8439        fn _decode(
8440            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8441        ) -> Result<Vec<u8>, fidl::Error> {
8442            let _response = fidl::client::decode_transaction_body::<
8443                fidl_fuchsia_unknown::QueryableQueryResponse,
8444                fidl::encoding::DefaultFuchsiaResourceDialect,
8445                0x2658edee9decfc06,
8446            >(_buf?)?;
8447            Ok(_response.protocol)
8448        }
8449        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
8450            (),
8451            0x2658edee9decfc06,
8452            fidl::encoding::DynamicFlags::empty(),
8453            _decode,
8454        )
8455    }
8456
8457    fn r#deprecated_clone(
8458        &self,
8459        mut flags: OpenFlags,
8460        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
8461    ) -> Result<(), fidl::Error> {
8462        self.client.send::<NodeDeprecatedCloneRequest>(
8463            (flags, object),
8464            0x5a61678f293ce16f,
8465            fidl::encoding::DynamicFlags::FLEXIBLE,
8466        )
8467    }
8468
8469    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
8470        (i32, NodeAttributes),
8471        fidl::encoding::DefaultFuchsiaResourceDialect,
8472    >;
8473    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
8474        fn _decode(
8475            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8476        ) -> Result<(i32, NodeAttributes), fidl::Error> {
8477            let _response = fidl::client::decode_transaction_body::<
8478                NodeDeprecatedGetAttrResponse,
8479                fidl::encoding::DefaultFuchsiaResourceDialect,
8480                0x78985e216314dafd,
8481            >(_buf?)?;
8482            Ok((_response.s, _response.attributes))
8483        }
8484        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
8485            (),
8486            0x78985e216314dafd,
8487            fidl::encoding::DynamicFlags::empty(),
8488            _decode,
8489        )
8490    }
8491
8492    type DeprecatedSetAttrResponseFut =
8493        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8494    fn r#deprecated_set_attr(
8495        &self,
8496        mut flags: NodeAttributeFlags,
8497        mut attributes: &NodeAttributes,
8498    ) -> Self::DeprecatedSetAttrResponseFut {
8499        fn _decode(
8500            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8501        ) -> Result<i32, fidl::Error> {
8502            let _response = fidl::client::decode_transaction_body::<
8503                NodeDeprecatedSetAttrResponse,
8504                fidl::encoding::DefaultFuchsiaResourceDialect,
8505                0x4186c0f40d938f46,
8506            >(_buf?)?;
8507            Ok(_response.s)
8508        }
8509        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
8510            (flags, attributes),
8511            0x4186c0f40d938f46,
8512            fidl::encoding::DynamicFlags::empty(),
8513            _decode,
8514        )
8515    }
8516
8517    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
8518        (i32, OpenFlags),
8519        fidl::encoding::DefaultFuchsiaResourceDialect,
8520    >;
8521    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
8522        fn _decode(
8523            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8524        ) -> Result<(i32, OpenFlags), fidl::Error> {
8525            let _response = fidl::client::decode_transaction_body::<
8526                NodeDeprecatedGetFlagsResponse,
8527                fidl::encoding::DefaultFuchsiaResourceDialect,
8528                0x5b88fffb8eda3aa1,
8529            >(_buf?)?;
8530            Ok((_response.s, _response.flags))
8531        }
8532        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
8533            (),
8534            0x5b88fffb8eda3aa1,
8535            fidl::encoding::DynamicFlags::empty(),
8536            _decode,
8537        )
8538    }
8539
8540    type DeprecatedSetFlagsResponseFut =
8541        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8542    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
8543        fn _decode(
8544            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8545        ) -> Result<i32, fidl::Error> {
8546            let _response = fidl::client::decode_transaction_body::<
8547                NodeDeprecatedSetFlagsResponse,
8548                fidl::encoding::DefaultFuchsiaResourceDialect,
8549                0x5295b76c71fde733,
8550            >(_buf?)?;
8551            Ok(_response.s)
8552        }
8553        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
8554            (flags,),
8555            0x5295b76c71fde733,
8556            fidl::encoding::DynamicFlags::empty(),
8557            _decode,
8558        )
8559    }
8560
8561    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
8562        NodeGetFlagsResult,
8563        fidl::encoding::DefaultFuchsiaResourceDialect,
8564    >;
8565    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
8566        fn _decode(
8567            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8568        ) -> Result<NodeGetFlagsResult, fidl::Error> {
8569            let _response = fidl::client::decode_transaction_body::<
8570                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
8571                fidl::encoding::DefaultFuchsiaResourceDialect,
8572                0x176eb318f64ec23,
8573            >(_buf?)?
8574            .into_result::<FileMarker>("get_flags")?;
8575            Ok(_response.map(|x| x.flags))
8576        }
8577        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
8578            (),
8579            0x176eb318f64ec23,
8580            fidl::encoding::DynamicFlags::FLEXIBLE,
8581            _decode,
8582        )
8583    }
8584
8585    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
8586        NodeSetFlagsResult,
8587        fidl::encoding::DefaultFuchsiaResourceDialect,
8588    >;
8589    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
8590        fn _decode(
8591            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8592        ) -> Result<NodeSetFlagsResult, fidl::Error> {
8593            let _response = fidl::client::decode_transaction_body::<
8594                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
8595                fidl::encoding::DefaultFuchsiaResourceDialect,
8596                0x55a8028685791ea8,
8597            >(_buf?)?
8598            .into_result::<FileMarker>("set_flags")?;
8599            Ok(_response.map(|x| x))
8600        }
8601        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
8602            (flags,),
8603            0x55a8028685791ea8,
8604            fidl::encoding::DynamicFlags::FLEXIBLE,
8605            _decode,
8606        )
8607    }
8608
8609    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
8610        (i32, Option<Box<FilesystemInfo>>),
8611        fidl::encoding::DefaultFuchsiaResourceDialect,
8612    >;
8613    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
8614        fn _decode(
8615            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8616        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
8617            let _response = fidl::client::decode_transaction_body::<
8618                NodeQueryFilesystemResponse,
8619                fidl::encoding::DefaultFuchsiaResourceDialect,
8620                0x6f344a1c6b0a0610,
8621            >(_buf?)?;
8622            Ok((_response.s, _response.info))
8623        }
8624        self.client.send_query_and_decode::<
8625            fidl::encoding::EmptyPayload,
8626            (i32, Option<Box<FilesystemInfo>>),
8627        >(
8628            (),
8629            0x6f344a1c6b0a0610,
8630            fidl::encoding::DynamicFlags::empty(),
8631            _decode,
8632        )
8633    }
8634
8635    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
8636        NodeGetAttributesResult,
8637        fidl::encoding::DefaultFuchsiaResourceDialect,
8638    >;
8639    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
8640        fn _decode(
8641            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8642        ) -> Result<NodeGetAttributesResult, fidl::Error> {
8643            let _response = fidl::client::decode_transaction_body::<
8644                fidl::encoding::ResultType<NodeAttributes2, i32>,
8645                fidl::encoding::DefaultFuchsiaResourceDialect,
8646                0x3d4396a638ea053b,
8647            >(_buf?)?;
8648            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
8649        }
8650        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
8651            (query,),
8652            0x3d4396a638ea053b,
8653            fidl::encoding::DynamicFlags::empty(),
8654            _decode,
8655        )
8656    }
8657
8658    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
8659        NodeUpdateAttributesResult,
8660        fidl::encoding::DefaultFuchsiaResourceDialect,
8661    >;
8662    fn r#update_attributes(
8663        &self,
8664        mut payload: &MutableNodeAttributes,
8665    ) -> Self::UpdateAttributesResponseFut {
8666        fn _decode(
8667            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8668        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
8669            let _response = fidl::client::decode_transaction_body::<
8670                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8671                fidl::encoding::DefaultFuchsiaResourceDialect,
8672                0x3308c1da5a89bf08,
8673            >(_buf?)?;
8674            Ok(_response.map(|x| x))
8675        }
8676        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
8677            payload,
8678            0x3308c1da5a89bf08,
8679            fidl::encoding::DynamicFlags::empty(),
8680            _decode,
8681        )
8682    }
8683
8684    type SyncResponseFut = fidl::client::QueryResponseFut<
8685        NodeSyncResult,
8686        fidl::encoding::DefaultFuchsiaResourceDialect,
8687    >;
8688    fn r#sync(&self) -> Self::SyncResponseFut {
8689        fn _decode(
8690            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8691        ) -> Result<NodeSyncResult, fidl::Error> {
8692            let _response = fidl::client::decode_transaction_body::<
8693                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8694                fidl::encoding::DefaultFuchsiaResourceDialect,
8695                0x2c5c27ca0ab5dc49,
8696            >(_buf?)?;
8697            Ok(_response.map(|x| x))
8698        }
8699        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
8700            (),
8701            0x2c5c27ca0ab5dc49,
8702            fidl::encoding::DynamicFlags::empty(),
8703            _decode,
8704        )
8705    }
8706
8707    fn r#list_extended_attributes(
8708        &self,
8709        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8710    ) -> Result<(), fidl::Error> {
8711        self.client.send::<NodeListExtendedAttributesRequest>(
8712            (iterator,),
8713            0x4b61033de007fcd0,
8714            fidl::encoding::DynamicFlags::empty(),
8715        )
8716    }
8717
8718    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8719        NodeGetExtendedAttributeResult,
8720        fidl::encoding::DefaultFuchsiaResourceDialect,
8721    >;
8722    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
8723        fn _decode(
8724            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8725        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
8726            let _response = fidl::client::decode_transaction_body::<
8727                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
8728                fidl::encoding::DefaultFuchsiaResourceDialect,
8729                0x45ffa3ccfdeb76db,
8730            >(_buf?)?;
8731            Ok(_response.map(|x| x))
8732        }
8733        self.client.send_query_and_decode::<
8734            NodeGetExtendedAttributeRequest,
8735            NodeGetExtendedAttributeResult,
8736        >(
8737            (name,),
8738            0x45ffa3ccfdeb76db,
8739            fidl::encoding::DynamicFlags::empty(),
8740            _decode,
8741        )
8742    }
8743
8744    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8745        NodeSetExtendedAttributeResult,
8746        fidl::encoding::DefaultFuchsiaResourceDialect,
8747    >;
8748    fn r#set_extended_attribute(
8749        &self,
8750        mut name: &[u8],
8751        mut value: ExtendedAttributeValue,
8752        mut mode: SetExtendedAttributeMode,
8753    ) -> Self::SetExtendedAttributeResponseFut {
8754        fn _decode(
8755            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8756        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
8757            let _response = fidl::client::decode_transaction_body::<
8758                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8759                fidl::encoding::DefaultFuchsiaResourceDialect,
8760                0x4a951362f681f23c,
8761            >(_buf?)?;
8762            Ok(_response.map(|x| x))
8763        }
8764        self.client.send_query_and_decode::<
8765            NodeSetExtendedAttributeRequest,
8766            NodeSetExtendedAttributeResult,
8767        >(
8768            (name, &mut value, mode,),
8769            0x4a951362f681f23c,
8770            fidl::encoding::DynamicFlags::empty(),
8771            _decode,
8772        )
8773    }
8774
8775    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8776        NodeRemoveExtendedAttributeResult,
8777        fidl::encoding::DefaultFuchsiaResourceDialect,
8778    >;
8779    fn r#remove_extended_attribute(
8780        &self,
8781        mut name: &[u8],
8782    ) -> Self::RemoveExtendedAttributeResponseFut {
8783        fn _decode(
8784            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8785        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
8786            let _response = fidl::client::decode_transaction_body::<
8787                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8788                fidl::encoding::DefaultFuchsiaResourceDialect,
8789                0x7a0b9f3a9bf9032d,
8790            >(_buf?)?;
8791            Ok(_response.map(|x| x))
8792        }
8793        self.client.send_query_and_decode::<
8794            NodeRemoveExtendedAttributeRequest,
8795            NodeRemoveExtendedAttributeResult,
8796        >(
8797            (name,),
8798            0x7a0b9f3a9bf9032d,
8799            fidl::encoding::DynamicFlags::empty(),
8800            _decode,
8801        )
8802    }
8803
8804    type ReadResponseFut = fidl::client::QueryResponseFut<
8805        ReadableReadResult,
8806        fidl::encoding::DefaultFuchsiaResourceDialect,
8807    >;
8808    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
8809        fn _decode(
8810            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8811        ) -> Result<ReadableReadResult, fidl::Error> {
8812            let _response = fidl::client::decode_transaction_body::<
8813                fidl::encoding::ResultType<ReadableReadResponse, i32>,
8814                fidl::encoding::DefaultFuchsiaResourceDialect,
8815                0x57e419a298c8ede,
8816            >(_buf?)?;
8817            Ok(_response.map(|x| x.data))
8818        }
8819        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
8820            (count,),
8821            0x57e419a298c8ede,
8822            fidl::encoding::DynamicFlags::empty(),
8823            _decode,
8824        )
8825    }
8826
8827    type WriteResponseFut = fidl::client::QueryResponseFut<
8828        WritableWriteResult,
8829        fidl::encoding::DefaultFuchsiaResourceDialect,
8830    >;
8831    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
8832        fn _decode(
8833            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8834        ) -> Result<WritableWriteResult, fidl::Error> {
8835            let _response = fidl::client::decode_transaction_body::<
8836                fidl::encoding::ResultType<WritableWriteResponse, i32>,
8837                fidl::encoding::DefaultFuchsiaResourceDialect,
8838                0x6a31437832469f82,
8839            >(_buf?)?;
8840            Ok(_response.map(|x| x.actual_count))
8841        }
8842        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
8843            (data,),
8844            0x6a31437832469f82,
8845            fidl::encoding::DynamicFlags::empty(),
8846            _decode,
8847        )
8848    }
8849
8850    type DescribeResponseFut =
8851        fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
8852    fn r#describe(&self) -> Self::DescribeResponseFut {
8853        fn _decode(
8854            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8855        ) -> Result<FileInfo, fidl::Error> {
8856            let _response = fidl::client::decode_transaction_body::<
8857                FileInfo,
8858                fidl::encoding::DefaultFuchsiaResourceDialect,
8859                0x68b5ac00c62906bc,
8860            >(_buf?)?;
8861            Ok(_response)
8862        }
8863        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FileInfo>(
8864            (),
8865            0x68b5ac00c62906bc,
8866            fidl::encoding::DynamicFlags::empty(),
8867            _decode,
8868        )
8869    }
8870
8871    type SeekResponseFut = fidl::client::QueryResponseFut<
8872        FileSeekResult,
8873        fidl::encoding::DefaultFuchsiaResourceDialect,
8874    >;
8875    fn r#seek(&self, mut origin: SeekOrigin, mut offset: i64) -> Self::SeekResponseFut {
8876        fn _decode(
8877            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8878        ) -> Result<FileSeekResult, fidl::Error> {
8879            let _response = fidl::client::decode_transaction_body::<
8880                fidl::encoding::ResultType<FileSeekResponse, i32>,
8881                fidl::encoding::DefaultFuchsiaResourceDialect,
8882                0x78079168162c5207,
8883            >(_buf?)?;
8884            Ok(_response.map(|x| x.offset_from_start))
8885        }
8886        self.client.send_query_and_decode::<FileSeekRequest, FileSeekResult>(
8887            (origin, offset),
8888            0x78079168162c5207,
8889            fidl::encoding::DynamicFlags::empty(),
8890            _decode,
8891        )
8892    }
8893
8894    type ReadAtResponseFut = fidl::client::QueryResponseFut<
8895        FileReadAtResult,
8896        fidl::encoding::DefaultFuchsiaResourceDialect,
8897    >;
8898    fn r#read_at(&self, mut count: u64, mut offset: u64) -> Self::ReadAtResponseFut {
8899        fn _decode(
8900            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8901        ) -> Result<FileReadAtResult, fidl::Error> {
8902            let _response = fidl::client::decode_transaction_body::<
8903                fidl::encoding::ResultType<FileReadAtResponse, i32>,
8904                fidl::encoding::DefaultFuchsiaResourceDialect,
8905                0x1607a293a60d723e,
8906            >(_buf?)?;
8907            Ok(_response.map(|x| x.data))
8908        }
8909        self.client.send_query_and_decode::<FileReadAtRequest, FileReadAtResult>(
8910            (count, offset),
8911            0x1607a293a60d723e,
8912            fidl::encoding::DynamicFlags::empty(),
8913            _decode,
8914        )
8915    }
8916
8917    type WriteAtResponseFut = fidl::client::QueryResponseFut<
8918        FileWriteAtResult,
8919        fidl::encoding::DefaultFuchsiaResourceDialect,
8920    >;
8921    fn r#write_at(&self, mut data: &[u8], mut offset: u64) -> Self::WriteAtResponseFut {
8922        fn _decode(
8923            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8924        ) -> Result<FileWriteAtResult, fidl::Error> {
8925            let _response = fidl::client::decode_transaction_body::<
8926                fidl::encoding::ResultType<FileWriteAtResponse, i32>,
8927                fidl::encoding::DefaultFuchsiaResourceDialect,
8928                0x793eefc0045e792b,
8929            >(_buf?)?;
8930            Ok(_response.map(|x| x.actual_count))
8931        }
8932        self.client.send_query_and_decode::<FileWriteAtRequest, FileWriteAtResult>(
8933            (data, offset),
8934            0x793eefc0045e792b,
8935            fidl::encoding::DynamicFlags::empty(),
8936            _decode,
8937        )
8938    }
8939
8940    type ResizeResponseFut = fidl::client::QueryResponseFut<
8941        FileResizeResult,
8942        fidl::encoding::DefaultFuchsiaResourceDialect,
8943    >;
8944    fn r#resize(&self, mut length: u64) -> Self::ResizeResponseFut {
8945        fn _decode(
8946            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8947        ) -> Result<FileResizeResult, fidl::Error> {
8948            let _response = fidl::client::decode_transaction_body::<
8949                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8950                fidl::encoding::DefaultFuchsiaResourceDialect,
8951                0x2b80825f0535743a,
8952            >(_buf?)?;
8953            Ok(_response.map(|x| x))
8954        }
8955        self.client.send_query_and_decode::<FileResizeRequest, FileResizeResult>(
8956            (length,),
8957            0x2b80825f0535743a,
8958            fidl::encoding::DynamicFlags::empty(),
8959            _decode,
8960        )
8961    }
8962
8963    type GetBackingMemoryResponseFut = fidl::client::QueryResponseFut<
8964        FileGetBackingMemoryResult,
8965        fidl::encoding::DefaultFuchsiaResourceDialect,
8966    >;
8967    fn r#get_backing_memory(&self, mut flags: VmoFlags) -> Self::GetBackingMemoryResponseFut {
8968        fn _decode(
8969            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8970        ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
8971            let _response = fidl::client::decode_transaction_body::<
8972                fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
8973                fidl::encoding::DefaultFuchsiaResourceDialect,
8974                0xa6a9e654cbf62b,
8975            >(_buf?)?;
8976            Ok(_response.map(|x| x.vmo))
8977        }
8978        self.client
8979            .send_query_and_decode::<FileGetBackingMemoryRequest, FileGetBackingMemoryResult>(
8980                (flags,),
8981                0xa6a9e654cbf62b,
8982                fidl::encoding::DynamicFlags::empty(),
8983                _decode,
8984            )
8985    }
8986
8987    type AllocateResponseFut = fidl::client::QueryResponseFut<
8988        FileAllocateResult,
8989        fidl::encoding::DefaultFuchsiaResourceDialect,
8990    >;
8991    fn r#allocate(
8992        &self,
8993        mut offset: u64,
8994        mut length: u64,
8995        mut mode: AllocateMode,
8996    ) -> Self::AllocateResponseFut {
8997        fn _decode(
8998            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8999        ) -> Result<FileAllocateResult, fidl::Error> {
9000            let _response = fidl::client::decode_transaction_body::<
9001                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9002                fidl::encoding::DefaultFuchsiaResourceDialect,
9003                0x77fa0c330b57fd2e,
9004            >(_buf?)?
9005            .into_result::<FileMarker>("allocate")?;
9006            Ok(_response.map(|x| x))
9007        }
9008        self.client.send_query_and_decode::<FileAllocateRequest, FileAllocateResult>(
9009            (offset, length, mode),
9010            0x77fa0c330b57fd2e,
9011            fidl::encoding::DynamicFlags::FLEXIBLE,
9012            _decode,
9013        )
9014    }
9015
9016    type EnableVerityResponseFut = fidl::client::QueryResponseFut<
9017        FileEnableVerityResult,
9018        fidl::encoding::DefaultFuchsiaResourceDialect,
9019    >;
9020    fn r#enable_verity(&self, mut options: &VerificationOptions) -> Self::EnableVerityResponseFut {
9021        fn _decode(
9022            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9023        ) -> Result<FileEnableVerityResult, fidl::Error> {
9024            let _response = fidl::client::decode_transaction_body::<
9025                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9026                fidl::encoding::DefaultFuchsiaResourceDialect,
9027                0x2c421ec3faaeb8bb,
9028            >(_buf?)?
9029            .into_result::<FileMarker>("enable_verity")?;
9030            Ok(_response.map(|x| x))
9031        }
9032        self.client.send_query_and_decode::<FileEnableVerityRequest, FileEnableVerityResult>(
9033            (options,),
9034            0x2c421ec3faaeb8bb,
9035            fidl::encoding::DynamicFlags::FLEXIBLE,
9036            _decode,
9037        )
9038    }
9039}
9040
9041pub struct FileEventStream {
9042    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9043}
9044
9045impl std::marker::Unpin for FileEventStream {}
9046
9047impl futures::stream::FusedStream for FileEventStream {
9048    fn is_terminated(&self) -> bool {
9049        self.event_receiver.is_terminated()
9050    }
9051}
9052
9053impl futures::Stream for FileEventStream {
9054    type Item = Result<FileEvent, fidl::Error>;
9055
9056    fn poll_next(
9057        mut self: std::pin::Pin<&mut Self>,
9058        cx: &mut std::task::Context<'_>,
9059    ) -> std::task::Poll<Option<Self::Item>> {
9060        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9061            &mut self.event_receiver,
9062            cx
9063        )?) {
9064            Some(buf) => std::task::Poll::Ready(Some(FileEvent::decode(buf))),
9065            None => std::task::Poll::Ready(None),
9066        }
9067    }
9068}
9069
9070#[derive(Debug)]
9071pub enum FileEvent {
9072    OnOpen_ {
9073        s: i32,
9074        info: Option<Box<NodeInfoDeprecated>>,
9075    },
9076    OnRepresentation {
9077        payload: Representation,
9078    },
9079    #[non_exhaustive]
9080    _UnknownEvent {
9081        /// Ordinal of the event that was sent.
9082        ordinal: u64,
9083    },
9084}
9085
9086impl FileEvent {
9087    #[allow(irrefutable_let_patterns)]
9088    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
9089        if let FileEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
9090    }
9091    #[allow(irrefutable_let_patterns)]
9092    pub fn into_on_representation(self) -> Option<Representation> {
9093        if let FileEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
9094    }
9095
9096    /// Decodes a message buffer as a [`FileEvent`].
9097    fn decode(
9098        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9099    ) -> Result<FileEvent, fidl::Error> {
9100        let (bytes, _handles) = buf.split_mut();
9101        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9102        debug_assert_eq!(tx_header.tx_id, 0);
9103        match tx_header.ordinal {
9104            0x7fc7bbb1dbfd1972 => {
9105                let mut out = fidl::new_empty!(
9106                    NodeOnOpenRequest,
9107                    fidl::encoding::DefaultFuchsiaResourceDialect
9108                );
9109                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
9110                Ok((FileEvent::OnOpen_ { s: out.s, info: out.info }))
9111            }
9112            0x5cb40567d80a510c => {
9113                let mut out =
9114                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
9115                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
9116                Ok((FileEvent::OnRepresentation { payload: out }))
9117            }
9118            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9119                Ok(FileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9120            }
9121            _ => Err(fidl::Error::UnknownOrdinal {
9122                ordinal: tx_header.ordinal,
9123                protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9124            }),
9125        }
9126    }
9127}
9128
9129/// A Stream of incoming requests for fuchsia.io/File.
9130pub struct FileRequestStream {
9131    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9132    is_terminated: bool,
9133}
9134
9135impl std::marker::Unpin for FileRequestStream {}
9136
9137impl futures::stream::FusedStream for FileRequestStream {
9138    fn is_terminated(&self) -> bool {
9139        self.is_terminated
9140    }
9141}
9142
9143impl fidl::endpoints::RequestStream for FileRequestStream {
9144    type Protocol = FileMarker;
9145    type ControlHandle = FileControlHandle;
9146
9147    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9148        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9149    }
9150
9151    fn control_handle(&self) -> Self::ControlHandle {
9152        FileControlHandle { inner: self.inner.clone() }
9153    }
9154
9155    fn into_inner(
9156        self,
9157    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9158    {
9159        (self.inner, self.is_terminated)
9160    }
9161
9162    fn from_inner(
9163        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9164        is_terminated: bool,
9165    ) -> Self {
9166        Self { inner, is_terminated }
9167    }
9168}
9169
9170impl futures::Stream for FileRequestStream {
9171    type Item = Result<FileRequest, fidl::Error>;
9172
9173    fn poll_next(
9174        mut self: std::pin::Pin<&mut Self>,
9175        cx: &mut std::task::Context<'_>,
9176    ) -> std::task::Poll<Option<Self::Item>> {
9177        let this = &mut *self;
9178        if this.inner.check_shutdown(cx) {
9179            this.is_terminated = true;
9180            return std::task::Poll::Ready(None);
9181        }
9182        if this.is_terminated {
9183            panic!("polled FileRequestStream after completion");
9184        }
9185        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9186            |bytes, handles| {
9187                match this.inner.channel().read_etc(cx, bytes, handles) {
9188                    std::task::Poll::Ready(Ok(())) => {}
9189                    std::task::Poll::Pending => return std::task::Poll::Pending,
9190                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9191                        this.is_terminated = true;
9192                        return std::task::Poll::Ready(None);
9193                    }
9194                    std::task::Poll::Ready(Err(e)) => {
9195                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9196                            e.into(),
9197                        ))));
9198                    }
9199                }
9200
9201                // A message has been received from the channel
9202                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9203
9204                std::task::Poll::Ready(Some(match header.ordinal {
9205                    0x6ee9c0ad53ec87aa => {
9206                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9207                        let mut req = fidl::new_empty!(
9208                            AdvisoryLockingAdvisoryLockRequest,
9209                            fidl::encoding::DefaultFuchsiaResourceDialect
9210                        );
9211                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
9212                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9213                        Ok(FileRequest::AdvisoryLock {
9214                            request: req.request,
9215
9216                            responder: FileAdvisoryLockResponder {
9217                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9218                                tx_id: header.tx_id,
9219                            },
9220                        })
9221                    }
9222                    0x54f3949246a03e74 => {
9223                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9224                        let mut req = fidl::new_empty!(
9225                            LinkableLinkIntoRequest,
9226                            fidl::encoding::DefaultFuchsiaResourceDialect
9227                        );
9228                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
9229                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9230                        Ok(FileRequest::LinkInto {
9231                            dst_parent_token: req.dst_parent_token,
9232                            dst: req.dst,
9233
9234                            responder: FileLinkIntoResponder {
9235                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9236                                tx_id: header.tx_id,
9237                            },
9238                        })
9239                    }
9240                    0x20d8a7aba2168a79 => {
9241                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9242                        let mut req = fidl::new_empty!(
9243                            fidl_fuchsia_unknown::CloneableCloneRequest,
9244                            fidl::encoding::DefaultFuchsiaResourceDialect
9245                        );
9246                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9247                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9248                        Ok(FileRequest::Clone { request: req.request, control_handle })
9249                    }
9250                    0x5ac5d459ad7f657e => {
9251                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9252                        let mut req = fidl::new_empty!(
9253                            fidl::encoding::EmptyPayload,
9254                            fidl::encoding::DefaultFuchsiaResourceDialect
9255                        );
9256                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9257                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9258                        Ok(FileRequest::Close {
9259                            responder: FileCloseResponder {
9260                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9261                                tx_id: header.tx_id,
9262                            },
9263                        })
9264                    }
9265                    0x2658edee9decfc06 => {
9266                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9267                        let mut req = fidl::new_empty!(
9268                            fidl::encoding::EmptyPayload,
9269                            fidl::encoding::DefaultFuchsiaResourceDialect
9270                        );
9271                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9272                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9273                        Ok(FileRequest::Query {
9274                            responder: FileQueryResponder {
9275                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9276                                tx_id: header.tx_id,
9277                            },
9278                        })
9279                    }
9280                    0x5a61678f293ce16f => {
9281                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9282                        let mut req = fidl::new_empty!(
9283                            NodeDeprecatedCloneRequest,
9284                            fidl::encoding::DefaultFuchsiaResourceDialect
9285                        );
9286                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9287                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9288                        Ok(FileRequest::DeprecatedClone {
9289                            flags: req.flags,
9290                            object: req.object,
9291
9292                            control_handle,
9293                        })
9294                    }
9295                    0x78985e216314dafd => {
9296                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9297                        let mut req = fidl::new_empty!(
9298                            fidl::encoding::EmptyPayload,
9299                            fidl::encoding::DefaultFuchsiaResourceDialect
9300                        );
9301                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9302                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9303                        Ok(FileRequest::DeprecatedGetAttr {
9304                            responder: FileDeprecatedGetAttrResponder {
9305                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9306                                tx_id: header.tx_id,
9307                            },
9308                        })
9309                    }
9310                    0x4186c0f40d938f46 => {
9311                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9312                        let mut req = fidl::new_empty!(
9313                            NodeDeprecatedSetAttrRequest,
9314                            fidl::encoding::DefaultFuchsiaResourceDialect
9315                        );
9316                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
9317                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9318                        Ok(FileRequest::DeprecatedSetAttr {
9319                            flags: req.flags,
9320                            attributes: req.attributes,
9321
9322                            responder: FileDeprecatedSetAttrResponder {
9323                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9324                                tx_id: header.tx_id,
9325                            },
9326                        })
9327                    }
9328                    0x5b88fffb8eda3aa1 => {
9329                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9330                        let mut req = fidl::new_empty!(
9331                            fidl::encoding::EmptyPayload,
9332                            fidl::encoding::DefaultFuchsiaResourceDialect
9333                        );
9334                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9335                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9336                        Ok(FileRequest::DeprecatedGetFlags {
9337                            responder: FileDeprecatedGetFlagsResponder {
9338                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9339                                tx_id: header.tx_id,
9340                            },
9341                        })
9342                    }
9343                    0x5295b76c71fde733 => {
9344                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9345                        let mut req = fidl::new_empty!(
9346                            NodeDeprecatedSetFlagsRequest,
9347                            fidl::encoding::DefaultFuchsiaResourceDialect
9348                        );
9349                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9350                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9351                        Ok(FileRequest::DeprecatedSetFlags {
9352                            flags: req.flags,
9353
9354                            responder: FileDeprecatedSetFlagsResponder {
9355                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9356                                tx_id: header.tx_id,
9357                            },
9358                        })
9359                    }
9360                    0x176eb318f64ec23 => {
9361                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9362                        let mut req = fidl::new_empty!(
9363                            fidl::encoding::EmptyPayload,
9364                            fidl::encoding::DefaultFuchsiaResourceDialect
9365                        );
9366                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9367                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9368                        Ok(FileRequest::GetFlags {
9369                            responder: FileGetFlagsResponder {
9370                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9371                                tx_id: header.tx_id,
9372                            },
9373                        })
9374                    }
9375                    0x55a8028685791ea8 => {
9376                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9377                        let mut req = fidl::new_empty!(
9378                            NodeSetFlagsRequest,
9379                            fidl::encoding::DefaultFuchsiaResourceDialect
9380                        );
9381                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9382                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9383                        Ok(FileRequest::SetFlags {
9384                            flags: req.flags,
9385
9386                            responder: FileSetFlagsResponder {
9387                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9388                                tx_id: header.tx_id,
9389                            },
9390                        })
9391                    }
9392                    0x6f344a1c6b0a0610 => {
9393                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9394                        let mut req = fidl::new_empty!(
9395                            fidl::encoding::EmptyPayload,
9396                            fidl::encoding::DefaultFuchsiaResourceDialect
9397                        );
9398                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9399                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9400                        Ok(FileRequest::QueryFilesystem {
9401                            responder: FileQueryFilesystemResponder {
9402                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9403                                tx_id: header.tx_id,
9404                            },
9405                        })
9406                    }
9407                    0x3d4396a638ea053b => {
9408                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9409                        let mut req = fidl::new_empty!(
9410                            NodeGetAttributesRequest,
9411                            fidl::encoding::DefaultFuchsiaResourceDialect
9412                        );
9413                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9414                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9415                        Ok(FileRequest::GetAttributes {
9416                            query: req.query,
9417
9418                            responder: FileGetAttributesResponder {
9419                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9420                                tx_id: header.tx_id,
9421                            },
9422                        })
9423                    }
9424                    0x3308c1da5a89bf08 => {
9425                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9426                        let mut req = fidl::new_empty!(
9427                            MutableNodeAttributes,
9428                            fidl::encoding::DefaultFuchsiaResourceDialect
9429                        );
9430                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
9431                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9432                        Ok(FileRequest::UpdateAttributes {
9433                            payload: req,
9434                            responder: FileUpdateAttributesResponder {
9435                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9436                                tx_id: header.tx_id,
9437                            },
9438                        })
9439                    }
9440                    0x2c5c27ca0ab5dc49 => {
9441                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9442                        let mut req = fidl::new_empty!(
9443                            fidl::encoding::EmptyPayload,
9444                            fidl::encoding::DefaultFuchsiaResourceDialect
9445                        );
9446                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9447                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9448                        Ok(FileRequest::Sync {
9449                            responder: FileSyncResponder {
9450                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9451                                tx_id: header.tx_id,
9452                            },
9453                        })
9454                    }
9455                    0x4b61033de007fcd0 => {
9456                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9457                        let mut req = fidl::new_empty!(
9458                            NodeListExtendedAttributesRequest,
9459                            fidl::encoding::DefaultFuchsiaResourceDialect
9460                        );
9461                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9462                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9463                        Ok(FileRequest::ListExtendedAttributes {
9464                            iterator: req.iterator,
9465
9466                            control_handle,
9467                        })
9468                    }
9469                    0x45ffa3ccfdeb76db => {
9470                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9471                        let mut req = fidl::new_empty!(
9472                            NodeGetExtendedAttributeRequest,
9473                            fidl::encoding::DefaultFuchsiaResourceDialect
9474                        );
9475                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9476                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9477                        Ok(FileRequest::GetExtendedAttribute {
9478                            name: req.name,
9479
9480                            responder: FileGetExtendedAttributeResponder {
9481                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9482                                tx_id: header.tx_id,
9483                            },
9484                        })
9485                    }
9486                    0x4a951362f681f23c => {
9487                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9488                        let mut req = fidl::new_empty!(
9489                            NodeSetExtendedAttributeRequest,
9490                            fidl::encoding::DefaultFuchsiaResourceDialect
9491                        );
9492                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9493                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9494                        Ok(FileRequest::SetExtendedAttribute {
9495                            name: req.name,
9496                            value: req.value,
9497                            mode: req.mode,
9498
9499                            responder: FileSetExtendedAttributeResponder {
9500                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9501                                tx_id: header.tx_id,
9502                            },
9503                        })
9504                    }
9505                    0x7a0b9f3a9bf9032d => {
9506                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9507                        let mut req = fidl::new_empty!(
9508                            NodeRemoveExtendedAttributeRequest,
9509                            fidl::encoding::DefaultFuchsiaResourceDialect
9510                        );
9511                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9512                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9513                        Ok(FileRequest::RemoveExtendedAttribute {
9514                            name: req.name,
9515
9516                            responder: FileRemoveExtendedAttributeResponder {
9517                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9518                                tx_id: header.tx_id,
9519                            },
9520                        })
9521                    }
9522                    0x57e419a298c8ede => {
9523                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9524                        let mut req = fidl::new_empty!(
9525                            ReadableReadRequest,
9526                            fidl::encoding::DefaultFuchsiaResourceDialect
9527                        );
9528                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
9529                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9530                        Ok(FileRequest::Read {
9531                            count: req.count,
9532
9533                            responder: FileReadResponder {
9534                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9535                                tx_id: header.tx_id,
9536                            },
9537                        })
9538                    }
9539                    0x6a31437832469f82 => {
9540                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9541                        let mut req = fidl::new_empty!(
9542                            WritableWriteRequest,
9543                            fidl::encoding::DefaultFuchsiaResourceDialect
9544                        );
9545                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
9546                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9547                        Ok(FileRequest::Write {
9548                            data: req.data,
9549
9550                            responder: FileWriteResponder {
9551                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9552                                tx_id: header.tx_id,
9553                            },
9554                        })
9555                    }
9556                    0x68b5ac00c62906bc => {
9557                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9558                        let mut req = fidl::new_empty!(
9559                            fidl::encoding::EmptyPayload,
9560                            fidl::encoding::DefaultFuchsiaResourceDialect
9561                        );
9562                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9563                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9564                        Ok(FileRequest::Describe {
9565                            responder: FileDescribeResponder {
9566                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9567                                tx_id: header.tx_id,
9568                            },
9569                        })
9570                    }
9571                    0x78079168162c5207 => {
9572                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9573                        let mut req = fidl::new_empty!(
9574                            FileSeekRequest,
9575                            fidl::encoding::DefaultFuchsiaResourceDialect
9576                        );
9577                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileSeekRequest>(&header, _body_bytes, handles, &mut req)?;
9578                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9579                        Ok(FileRequest::Seek {
9580                            origin: req.origin,
9581                            offset: req.offset,
9582
9583                            responder: FileSeekResponder {
9584                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9585                                tx_id: header.tx_id,
9586                            },
9587                        })
9588                    }
9589                    0x1607a293a60d723e => {
9590                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9591                        let mut req = fidl::new_empty!(
9592                            FileReadAtRequest,
9593                            fidl::encoding::DefaultFuchsiaResourceDialect
9594                        );
9595                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileReadAtRequest>(&header, _body_bytes, handles, &mut req)?;
9596                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9597                        Ok(FileRequest::ReadAt {
9598                            count: req.count,
9599                            offset: req.offset,
9600
9601                            responder: FileReadAtResponder {
9602                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9603                                tx_id: header.tx_id,
9604                            },
9605                        })
9606                    }
9607                    0x793eefc0045e792b => {
9608                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9609                        let mut req = fidl::new_empty!(
9610                            FileWriteAtRequest,
9611                            fidl::encoding::DefaultFuchsiaResourceDialect
9612                        );
9613                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileWriteAtRequest>(&header, _body_bytes, handles, &mut req)?;
9614                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9615                        Ok(FileRequest::WriteAt {
9616                            data: req.data,
9617                            offset: req.offset,
9618
9619                            responder: FileWriteAtResponder {
9620                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9621                                tx_id: header.tx_id,
9622                            },
9623                        })
9624                    }
9625                    0x2b80825f0535743a => {
9626                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9627                        let mut req = fidl::new_empty!(
9628                            FileResizeRequest,
9629                            fidl::encoding::DefaultFuchsiaResourceDialect
9630                        );
9631                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileResizeRequest>(&header, _body_bytes, handles, &mut req)?;
9632                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9633                        Ok(FileRequest::Resize {
9634                            length: req.length,
9635
9636                            responder: FileResizeResponder {
9637                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9638                                tx_id: header.tx_id,
9639                            },
9640                        })
9641                    }
9642                    0xa6a9e654cbf62b => {
9643                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9644                        let mut req = fidl::new_empty!(
9645                            FileGetBackingMemoryRequest,
9646                            fidl::encoding::DefaultFuchsiaResourceDialect
9647                        );
9648                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileGetBackingMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
9649                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9650                        Ok(FileRequest::GetBackingMemory {
9651                            flags: req.flags,
9652
9653                            responder: FileGetBackingMemoryResponder {
9654                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9655                                tx_id: header.tx_id,
9656                            },
9657                        })
9658                    }
9659                    0x77fa0c330b57fd2e => {
9660                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9661                        let mut req = fidl::new_empty!(
9662                            FileAllocateRequest,
9663                            fidl::encoding::DefaultFuchsiaResourceDialect
9664                        );
9665                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileAllocateRequest>(&header, _body_bytes, handles, &mut req)?;
9666                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9667                        Ok(FileRequest::Allocate {
9668                            offset: req.offset,
9669                            length: req.length,
9670                            mode: req.mode,
9671
9672                            responder: FileAllocateResponder {
9673                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9674                                tx_id: header.tx_id,
9675                            },
9676                        })
9677                    }
9678                    0x2c421ec3faaeb8bb => {
9679                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9680                        let mut req = fidl::new_empty!(
9681                            FileEnableVerityRequest,
9682                            fidl::encoding::DefaultFuchsiaResourceDialect
9683                        );
9684                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileEnableVerityRequest>(&header, _body_bytes, handles, &mut req)?;
9685                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9686                        Ok(FileRequest::EnableVerity {
9687                            options: req.options,
9688
9689                            responder: FileEnableVerityResponder {
9690                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9691                                tx_id: header.tx_id,
9692                            },
9693                        })
9694                    }
9695                    _ if header.tx_id == 0
9696                        && header
9697                            .dynamic_flags()
9698                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9699                    {
9700                        Ok(FileRequest::_UnknownMethod {
9701                            ordinal: header.ordinal,
9702                            control_handle: FileControlHandle { inner: this.inner.clone() },
9703                            method_type: fidl::MethodType::OneWay,
9704                        })
9705                    }
9706                    _ if header
9707                        .dynamic_flags()
9708                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9709                    {
9710                        this.inner.send_framework_err(
9711                            fidl::encoding::FrameworkErr::UnknownMethod,
9712                            header.tx_id,
9713                            header.ordinal,
9714                            header.dynamic_flags(),
9715                            (bytes, handles),
9716                        )?;
9717                        Ok(FileRequest::_UnknownMethod {
9718                            ordinal: header.ordinal,
9719                            control_handle: FileControlHandle { inner: this.inner.clone() },
9720                            method_type: fidl::MethodType::TwoWay,
9721                        })
9722                    }
9723                    _ => Err(fidl::Error::UnknownOrdinal {
9724                        ordinal: header.ordinal,
9725                        protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9726                    }),
9727                }))
9728            },
9729        )
9730    }
9731}
9732
9733/// A [`Node`] which contains a sequence of bytes of definite length.
9734///
9735/// NOTE: cloned connections do not share their seek offset with their source
9736/// connection.
9737#[derive(Debug)]
9738pub enum FileRequest {
9739    /// Acquires an advisory lock on the underlying file.
9740    ///
9741    /// The lock lasts until either this connection is closed or
9742    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
9743    /// explicitly.
9744    ///
9745    /// Advisory locks are purely advisory. They do not prevent actual read or
9746    /// write operations from occurring on the file, either through this
9747    /// connection or through other connections.
9748    ///
9749    /// This method requires the following rights:
9750    ///
9751    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
9752    /// * [`Rights.WRITE_BYTES`] if `request.type` is
9753    ///   [`AdvisoryLockType.WRITE`].
9754    ///
9755    /// # Errors
9756    ///
9757    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
9758    ///   example, another connection might hold a conflicting lock type.
9759    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
9760    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
9761    ///   to acquire the given type of lock.
9762    AdvisoryLock {
9763        request: AdvisoryLockRequest,
9764        responder: FileAdvisoryLockResponder,
9765    },
9766    /// Creates a link to this this object with name `dst` in the directory represented by
9767    /// `dst_parent_token`.
9768    ///
9769    /// `dst` must be a resolved object name. Including "/" in the string will return
9770    /// `ZX_ERR_INVALID_ARGS`.
9771    ///
9772    /// This method requires the maximal set of rights supported by the filesystem for this object.
9773    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
9774    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
9775    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
9776    /// `ZX_ERR_ACCESS_DENIED`.
9777    ///
9778    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
9779    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
9780    ///
9781    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
9782    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
9783    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
9784    ///
9785    /// This method does not have the same atomicity properties has the `Directory::Link` method,
9786    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
9787    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
9788    LinkInto {
9789        dst_parent_token: fidl::Event,
9790        dst: String,
9791        responder: FileLinkIntoResponder,
9792    },
9793    Clone {
9794        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
9795        control_handle: FileControlHandle,
9796    },
9797    /// Terminates the connection.
9798    ///
9799    /// After calling `Close`, the client must not send any other requests.
9800    ///
9801    /// Servers, after sending the status response, should close the connection
9802    /// regardless of status and without sending an epitaph.
9803    ///
9804    /// Closing the client end of the channel should be semantically equivalent
9805    /// to calling `Close` without knowing when the close has completed or its
9806    /// status.
9807    Close {
9808        responder: FileCloseResponder,
9809    },
9810    Query {
9811        responder: FileQueryResponder,
9812    },
9813    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
9814    DeprecatedClone {
9815        flags: OpenFlags,
9816        object: fidl::endpoints::ServerEnd<NodeMarker>,
9817        control_handle: FileControlHandle,
9818    },
9819    /// DEPRECATED - Use `Node.GetAttributes` instead.
9820    DeprecatedGetAttr {
9821        responder: FileDeprecatedGetAttrResponder,
9822    },
9823    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
9824    DeprecatedSetAttr {
9825        flags: NodeAttributeFlags,
9826        attributes: NodeAttributes,
9827        responder: FileDeprecatedSetAttrResponder,
9828    },
9829    /// [DEPRECATED - Use new GetFlags method instead.]
9830    DeprecatedGetFlags {
9831        responder: FileDeprecatedGetFlagsResponder,
9832    },
9833    /// [DEPRECATED - Use new SetFlags method instead.]
9834    DeprecatedSetFlags {
9835        flags: OpenFlags,
9836        responder: FileDeprecatedSetFlagsResponder,
9837    },
9838    /// Queries the flags that apply to this node after it has been opened/created. This method does
9839    /// not require any rights.
9840    ///
9841    /// Note that the final set of flags that apply to the connection may differ from those
9842    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
9843    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
9844    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
9845    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
9846    GetFlags {
9847        responder: FileGetFlagsResponder,
9848    },
9849    /// Sets the flags that apply to this node after it has been opened. This method does not
9850    /// require any rights.
9851    ///
9852    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
9853    /// clear append mode.
9854    ///
9855    /// Errors:
9856    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
9857    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
9858    SetFlags {
9859        flags: Flags,
9860        responder: FileSetFlagsResponder,
9861    },
9862    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
9863    /// volume has different settings or the storage is accounted seperately from the rest of the
9864    /// filesystem that may be reported instead of filesystem-wide details.
9865    QueryFilesystem {
9866        responder: FileQueryFilesystemResponder,
9867    },
9868    /// Acquires information about the node.
9869    ///
9870    /// The attributes of a node should be stable, independent of the
9871    /// specific protocol used to access it.
9872    ///
9873    /// If a particular attribute is not applicable or not supported,
9874    /// filesystems should leave the corresponding field absent.
9875    ///
9876    /// + `query` a bit-mask specifying which attributes to fetch. The server
9877    ///   should not return more than necessary.
9878    /// - `attributes` the returned attributes.
9879    ///
9880    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9881    GetAttributes {
9882        query: NodeAttributesQuery,
9883        responder: FileGetAttributesResponder,
9884    },
9885    /// Updates information about the node.
9886    ///
9887    /// + `attributes` the presence of a table field in `attributes` indicates
9888    /// the intent to update the corresponding attribute.
9889    ///
9890    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
9891    ///
9892    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
9893    UpdateAttributes {
9894        payload: MutableNodeAttributes,
9895        responder: FileUpdateAttributesResponder,
9896    },
9897    /// Synchronizes updates to the node to the underlying media, if it exists.
9898    ///
9899    /// This method will return when the filesystem server has flushed the
9900    /// relevant updates to the underlying media, but does not guarantee the
9901    /// underlying media has persisted the information, nor that any information
9902    /// is committed to hardware. Clients may use `Sync` to ensure ordering
9903    /// between operations.
9904    ///
9905    /// This method does not require any rights.
9906    Sync {
9907        responder: FileSyncResponder,
9908    },
9909    /// Creates an iterator over all the extended attribute names associated
9910    /// with this node. If an error occurs it is returned as an epitaph on the
9911    /// iterator request channel, and then the channel is closed.
9912    ///
9913    /// GetExtendedAttributes can be used with any of these names to retrieve
9914    /// the associated value.
9915    ///
9916    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9917    ListExtendedAttributes {
9918        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
9919        control_handle: FileControlHandle,
9920    },
9921    /// Get the value associated with the given attribute `name` for this node.
9922    ///
9923    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
9924    /// particular structure is imposed on them.
9925    ///
9926    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9927    GetExtendedAttribute {
9928        name: Vec<u8>,
9929        responder: FileGetExtendedAttributeResponder,
9930    },
9931    /// Set the value for the given attribute `name` to `value` for this node.
9932    ///
9933    /// The attribute name may exist, in which case the attribute is updated.
9934    /// If the attribute doesn't exist, it is created. The name should have no
9935    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
9936    ///
9937    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
9938    SetExtendedAttribute {
9939        name: Vec<u8>,
9940        value: ExtendedAttributeValue,
9941        mode: SetExtendedAttributeMode,
9942        responder: FileSetExtendedAttributeResponder,
9943    },
9944    /// Remove the specified extended attribute.
9945    ///
9946    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
9947    ///
9948    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
9949    RemoveExtendedAttribute {
9950        name: Vec<u8>,
9951        responder: FileRemoveExtendedAttributeResponder,
9952    },
9953    /// Reads up to 'count' bytes at the seek offset.
9954    /// The seek offset is moved forward by the number of bytes read.
9955    ///
9956    /// ## Invariants
9957    ///
9958    /// * The returned `data.length` will never be greater than `count`.
9959    /// * If `data.length` is less than `count`, it means that the seek offset
9960    ///   has reached the end of file as part of this operation.
9961    /// * If `data.length` is zero while `count` is not, it means that the
9962    ///   seek offset is already at or beyond the end of file, and no data could
9963    ///   be read.
9964    /// * If `count` is zero, the server should perform all the checks ensuring
9965    ///   read access without actually read anything, and return an empty
9966    ///   `data` vector.
9967    ///
9968    /// This method requires the [`Rights.READ_BYTES`] right.
9969    ///
9970    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
9971    Read {
9972        count: u64,
9973        responder: FileReadResponder,
9974    },
9975    /// Writes data at the seek offset.
9976    /// The seek offset is moved forward by the number of bytes written.
9977    /// If the file is in append mode, the seek offset is first set to the end
9978    /// of the file, followed by the write, in one atomic step.
9979    ///
9980    /// The file size may grow if the seek offset plus `data.length` is beyond
9981    /// the current end of file.
9982    ///
9983    /// + request `data` the byte buffer to write to the file.
9984    /// - response `actual_count` the number of bytes written.
9985    ///
9986    /// ## Invariants
9987    ///
9988    /// * The returned `actual_count` will never be greater than `data.length`.
9989    /// * If the server is unable to write all the data due to e.g. not enough
9990    ///   space, `actual_count` may be less than `data.length`.  If no bytes
9991    ///   could be written, an error is returned.
9992    /// * If `data.length` is zero, the server should perform all the checks
9993    ///   ensuring write access without mutating the file and return a
9994    ///   successful write of zero bytes.  The seek offset is still updated if
9995    ///   in append mode.
9996    ///
9997    /// This method requires the [`Rights.WRITE_BYTES`] right.
9998    Write {
9999        data: Vec<u8>,
10000        responder: FileWriteResponder,
10001    },
10002    Describe {
10003        responder: FileDescribeResponder,
10004    },
10005    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
10006    /// will occur. The seek offset is specific to each file connection.
10007    ///
10008    /// + request `origin` the reference point where `offset` will be based on.
10009    /// + request `offset` the number of bytes to seek.
10010    /// - response `offset_from_start` the adjusted seek offset, from the start
10011    ///   of the file.
10012    ///
10013    /// This method does not require any rights.
10014    Seek {
10015        origin: SeekOrigin,
10016        offset: i64,
10017        responder: FileSeekResponder,
10018    },
10019    /// Reads up to 'count' bytes at the provided offset.
10020    /// Does not affect the seek offset.
10021    ///
10022    /// ## Invariants
10023    ///
10024    /// * The returned `data.length` will never be greater than `count`.
10025    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
10026    ///   the end of file as part of this operation.
10027    /// * If `data.length` is zero while `count` is not, it means that `offset`
10028    ///   is at or past the end of file, and no data can be read.
10029    /// * If `count` is zero, the server should perform all the checks ensuring
10030    ///   read access without actually reading anything, and return an empty
10031    ///   `data` vector.
10032    ///
10033    /// This method requires the [`Rights.READ_BYTES`] right.
10034    ///
10035    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
10036    ReadAt {
10037        count: u64,
10038        offset: u64,
10039        responder: FileReadAtResponder,
10040    },
10041    /// Writes data at the provided offset.
10042    /// Does not affect the seek offset.
10043    ///
10044    /// The file size may grow if `offset` plus `data.length` is past the
10045    /// current end of file.
10046    ///
10047    /// + request `data` the byte buffer to write to the file.
10048    /// + request `offset` the offset from start of the file to begin writing.
10049    /// - response `actual_count` the number of bytes written.
10050    ///
10051    /// ## Invariants
10052    ///
10053    /// * The returned `actual_count` will never be greater than `data.length`.
10054    /// * If the server is unable to write all the data due to e.g. not enough
10055    ///   space, `actual_count` may be less than `data.length`.  If no bytes
10056    ///   could be written, an error is returned.
10057    /// * If `data.length` is zero, the server should perform all the checks
10058    ///   ensuring write access without mutating the file, and will return a
10059    ///   successful write of zero bytes.
10060    ///
10061    /// This method requires the [`Rights.WRITE_BYTES`] right.
10062    WriteAt {
10063        data: Vec<u8>,
10064        offset: u64,
10065        responder: FileWriteAtResponder,
10066    },
10067    /// Shrinks or grows the file size to 'length' bytes.
10068    ///
10069    /// If file size is reduced by this operation, the extra trailing data'
10070    /// is discarded.
10071    /// If file size is increased by this operation, the extended area appears
10072    /// as if it was zeroed.
10073    ///
10074    /// This method requires the [`Rights.WRITE_BYTES`] right.
10075    Resize {
10076        length: u64,
10077        responder: FileResizeResponder,
10078    },
10079    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
10080    /// with the requested access rights.
10081    ///
10082    /// Implementations are not required to implement files backed by VMOs so
10083    /// this request may fail. Additionally, implementations may only support
10084    /// a certain subset of the flags. Clients should be prepared with fallback
10085    /// behavior if this request fails.
10086    ///
10087    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
10088    /// implementation is free to choose the semantics of the returned VMO.
10089    ///
10090    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
10091    /// - response `vmo` the requested [`zx.Handle:VMO`].
10092    /// * error a [`zx.Status`] value indicating the failure.
10093    ///
10094    /// This method requires the following rights:
10095    ///
10096    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
10097    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
10098    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
10099    GetBackingMemory {
10100        flags: VmoFlags,
10101        responder: FileGetBackingMemoryResponder,
10102    },
10103    /// Pre-allocate on-disk space for this file.
10104    Allocate {
10105        offset: u64,
10106        length: u64,
10107        mode: AllocateMode,
10108        responder: FileAllocateResponder,
10109    },
10110    /// Enables verification for the file (permanently) which involves computing a merkle tree for
10111    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
10112    /// captured. Future reads will be verified against the computed merkle tree and writes will be
10113    /// rejected. This method can take some time to complete as it depends on the size of the file.
10114    /// This method can be aborted by closing the connection that this method was issued on.
10115    ///
10116    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
10117    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
10118    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
10119    /// Also returns any error that might arise from reading the file, or from flushing the file,
10120    /// such as `ZX_ERR_IO`.
10121    EnableVerity {
10122        options: VerificationOptions,
10123        responder: FileEnableVerityResponder,
10124    },
10125    /// An interaction was received which does not match any known method.
10126    #[non_exhaustive]
10127    _UnknownMethod {
10128        /// Ordinal of the method that was called.
10129        ordinal: u64,
10130        control_handle: FileControlHandle,
10131        method_type: fidl::MethodType,
10132    },
10133}
10134
10135impl FileRequest {
10136    #[allow(irrefutable_let_patterns)]
10137    pub fn into_advisory_lock(self) -> Option<(AdvisoryLockRequest, FileAdvisoryLockResponder)> {
10138        if let FileRequest::AdvisoryLock { request, responder } = self {
10139            Some((request, responder))
10140        } else {
10141            None
10142        }
10143    }
10144
10145    #[allow(irrefutable_let_patterns)]
10146    pub fn into_link_into(self) -> Option<(fidl::Event, String, FileLinkIntoResponder)> {
10147        if let FileRequest::LinkInto { dst_parent_token, dst, responder } = self {
10148            Some((dst_parent_token, dst, responder))
10149        } else {
10150            None
10151        }
10152    }
10153
10154    #[allow(irrefutable_let_patterns)]
10155    pub fn into_clone(
10156        self,
10157    ) -> Option<(
10158        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10159        FileControlHandle,
10160    )> {
10161        if let FileRequest::Clone { request, control_handle } = self {
10162            Some((request, control_handle))
10163        } else {
10164            None
10165        }
10166    }
10167
10168    #[allow(irrefutable_let_patterns)]
10169    pub fn into_close(self) -> Option<(FileCloseResponder)> {
10170        if let FileRequest::Close { responder } = self { Some((responder)) } else { None }
10171    }
10172
10173    #[allow(irrefutable_let_patterns)]
10174    pub fn into_query(self) -> Option<(FileQueryResponder)> {
10175        if let FileRequest::Query { responder } = self { Some((responder)) } else { None }
10176    }
10177
10178    #[allow(irrefutable_let_patterns)]
10179    pub fn into_deprecated_clone(
10180        self,
10181    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, FileControlHandle)> {
10182        if let FileRequest::DeprecatedClone { flags, object, control_handle } = self {
10183            Some((flags, object, control_handle))
10184        } else {
10185            None
10186        }
10187    }
10188
10189    #[allow(irrefutable_let_patterns)]
10190    pub fn into_deprecated_get_attr(self) -> Option<(FileDeprecatedGetAttrResponder)> {
10191        if let FileRequest::DeprecatedGetAttr { responder } = self {
10192            Some((responder))
10193        } else {
10194            None
10195        }
10196    }
10197
10198    #[allow(irrefutable_let_patterns)]
10199    pub fn into_deprecated_set_attr(
10200        self,
10201    ) -> Option<(NodeAttributeFlags, NodeAttributes, FileDeprecatedSetAttrResponder)> {
10202        if let FileRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
10203            Some((flags, attributes, responder))
10204        } else {
10205            None
10206        }
10207    }
10208
10209    #[allow(irrefutable_let_patterns)]
10210    pub fn into_deprecated_get_flags(self) -> Option<(FileDeprecatedGetFlagsResponder)> {
10211        if let FileRequest::DeprecatedGetFlags { responder } = self {
10212            Some((responder))
10213        } else {
10214            None
10215        }
10216    }
10217
10218    #[allow(irrefutable_let_patterns)]
10219    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, FileDeprecatedSetFlagsResponder)> {
10220        if let FileRequest::DeprecatedSetFlags { flags, responder } = self {
10221            Some((flags, responder))
10222        } else {
10223            None
10224        }
10225    }
10226
10227    #[allow(irrefutable_let_patterns)]
10228    pub fn into_get_flags(self) -> Option<(FileGetFlagsResponder)> {
10229        if let FileRequest::GetFlags { responder } = self { Some((responder)) } else { None }
10230    }
10231
10232    #[allow(irrefutable_let_patterns)]
10233    pub fn into_set_flags(self) -> Option<(Flags, FileSetFlagsResponder)> {
10234        if let FileRequest::SetFlags { flags, responder } = self {
10235            Some((flags, responder))
10236        } else {
10237            None
10238        }
10239    }
10240
10241    #[allow(irrefutable_let_patterns)]
10242    pub fn into_query_filesystem(self) -> Option<(FileQueryFilesystemResponder)> {
10243        if let FileRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
10244    }
10245
10246    #[allow(irrefutable_let_patterns)]
10247    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, FileGetAttributesResponder)> {
10248        if let FileRequest::GetAttributes { query, responder } = self {
10249            Some((query, responder))
10250        } else {
10251            None
10252        }
10253    }
10254
10255    #[allow(irrefutable_let_patterns)]
10256    pub fn into_update_attributes(
10257        self,
10258    ) -> Option<(MutableNodeAttributes, FileUpdateAttributesResponder)> {
10259        if let FileRequest::UpdateAttributes { payload, responder } = self {
10260            Some((payload, responder))
10261        } else {
10262            None
10263        }
10264    }
10265
10266    #[allow(irrefutable_let_patterns)]
10267    pub fn into_sync(self) -> Option<(FileSyncResponder)> {
10268        if let FileRequest::Sync { responder } = self { Some((responder)) } else { None }
10269    }
10270
10271    #[allow(irrefutable_let_patterns)]
10272    pub fn into_list_extended_attributes(
10273        self,
10274    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, FileControlHandle)>
10275    {
10276        if let FileRequest::ListExtendedAttributes { iterator, control_handle } = self {
10277            Some((iterator, control_handle))
10278        } else {
10279            None
10280        }
10281    }
10282
10283    #[allow(irrefutable_let_patterns)]
10284    pub fn into_get_extended_attribute(
10285        self,
10286    ) -> Option<(Vec<u8>, FileGetExtendedAttributeResponder)> {
10287        if let FileRequest::GetExtendedAttribute { name, responder } = self {
10288            Some((name, responder))
10289        } else {
10290            None
10291        }
10292    }
10293
10294    #[allow(irrefutable_let_patterns)]
10295    pub fn into_set_extended_attribute(
10296        self,
10297    ) -> Option<(
10298        Vec<u8>,
10299        ExtendedAttributeValue,
10300        SetExtendedAttributeMode,
10301        FileSetExtendedAttributeResponder,
10302    )> {
10303        if let FileRequest::SetExtendedAttribute { name, value, mode, responder } = self {
10304            Some((name, value, mode, responder))
10305        } else {
10306            None
10307        }
10308    }
10309
10310    #[allow(irrefutable_let_patterns)]
10311    pub fn into_remove_extended_attribute(
10312        self,
10313    ) -> Option<(Vec<u8>, FileRemoveExtendedAttributeResponder)> {
10314        if let FileRequest::RemoveExtendedAttribute { name, responder } = self {
10315            Some((name, responder))
10316        } else {
10317            None
10318        }
10319    }
10320
10321    #[allow(irrefutable_let_patterns)]
10322    pub fn into_read(self) -> Option<(u64, FileReadResponder)> {
10323        if let FileRequest::Read { count, responder } = self {
10324            Some((count, responder))
10325        } else {
10326            None
10327        }
10328    }
10329
10330    #[allow(irrefutable_let_patterns)]
10331    pub fn into_write(self) -> Option<(Vec<u8>, FileWriteResponder)> {
10332        if let FileRequest::Write { data, responder } = self {
10333            Some((data, responder))
10334        } else {
10335            None
10336        }
10337    }
10338
10339    #[allow(irrefutable_let_patterns)]
10340    pub fn into_describe(self) -> Option<(FileDescribeResponder)> {
10341        if let FileRequest::Describe { responder } = self { Some((responder)) } else { None }
10342    }
10343
10344    #[allow(irrefutable_let_patterns)]
10345    pub fn into_seek(self) -> Option<(SeekOrigin, i64, FileSeekResponder)> {
10346        if let FileRequest::Seek { origin, offset, responder } = self {
10347            Some((origin, offset, responder))
10348        } else {
10349            None
10350        }
10351    }
10352
10353    #[allow(irrefutable_let_patterns)]
10354    pub fn into_read_at(self) -> Option<(u64, u64, FileReadAtResponder)> {
10355        if let FileRequest::ReadAt { count, offset, responder } = self {
10356            Some((count, offset, responder))
10357        } else {
10358            None
10359        }
10360    }
10361
10362    #[allow(irrefutable_let_patterns)]
10363    pub fn into_write_at(self) -> Option<(Vec<u8>, u64, FileWriteAtResponder)> {
10364        if let FileRequest::WriteAt { data, offset, responder } = self {
10365            Some((data, offset, responder))
10366        } else {
10367            None
10368        }
10369    }
10370
10371    #[allow(irrefutable_let_patterns)]
10372    pub fn into_resize(self) -> Option<(u64, FileResizeResponder)> {
10373        if let FileRequest::Resize { length, responder } = self {
10374            Some((length, responder))
10375        } else {
10376            None
10377        }
10378    }
10379
10380    #[allow(irrefutable_let_patterns)]
10381    pub fn into_get_backing_memory(self) -> Option<(VmoFlags, FileGetBackingMemoryResponder)> {
10382        if let FileRequest::GetBackingMemory { flags, responder } = self {
10383            Some((flags, responder))
10384        } else {
10385            None
10386        }
10387    }
10388
10389    #[allow(irrefutable_let_patterns)]
10390    pub fn into_allocate(self) -> Option<(u64, u64, AllocateMode, FileAllocateResponder)> {
10391        if let FileRequest::Allocate { offset, length, mode, responder } = self {
10392            Some((offset, length, mode, responder))
10393        } else {
10394            None
10395        }
10396    }
10397
10398    #[allow(irrefutable_let_patterns)]
10399    pub fn into_enable_verity(self) -> Option<(VerificationOptions, FileEnableVerityResponder)> {
10400        if let FileRequest::EnableVerity { options, responder } = self {
10401            Some((options, responder))
10402        } else {
10403            None
10404        }
10405    }
10406
10407    /// Name of the method defined in FIDL
10408    pub fn method_name(&self) -> &'static str {
10409        match *self {
10410            FileRequest::AdvisoryLock { .. } => "advisory_lock",
10411            FileRequest::LinkInto { .. } => "link_into",
10412            FileRequest::Clone { .. } => "clone",
10413            FileRequest::Close { .. } => "close",
10414            FileRequest::Query { .. } => "query",
10415            FileRequest::DeprecatedClone { .. } => "deprecated_clone",
10416            FileRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
10417            FileRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
10418            FileRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
10419            FileRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
10420            FileRequest::GetFlags { .. } => "get_flags",
10421            FileRequest::SetFlags { .. } => "set_flags",
10422            FileRequest::QueryFilesystem { .. } => "query_filesystem",
10423            FileRequest::GetAttributes { .. } => "get_attributes",
10424            FileRequest::UpdateAttributes { .. } => "update_attributes",
10425            FileRequest::Sync { .. } => "sync",
10426            FileRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
10427            FileRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
10428            FileRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
10429            FileRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
10430            FileRequest::Read { .. } => "read",
10431            FileRequest::Write { .. } => "write",
10432            FileRequest::Describe { .. } => "describe",
10433            FileRequest::Seek { .. } => "seek",
10434            FileRequest::ReadAt { .. } => "read_at",
10435            FileRequest::WriteAt { .. } => "write_at",
10436            FileRequest::Resize { .. } => "resize",
10437            FileRequest::GetBackingMemory { .. } => "get_backing_memory",
10438            FileRequest::Allocate { .. } => "allocate",
10439            FileRequest::EnableVerity { .. } => "enable_verity",
10440            FileRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10441                "unknown one-way method"
10442            }
10443            FileRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10444                "unknown two-way method"
10445            }
10446        }
10447    }
10448}
10449
10450#[derive(Debug, Clone)]
10451pub struct FileControlHandle {
10452    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10453}
10454
10455impl fidl::endpoints::ControlHandle for FileControlHandle {
10456    fn shutdown(&self) {
10457        self.inner.shutdown()
10458    }
10459
10460    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10461        self.inner.shutdown_with_epitaph(status)
10462    }
10463
10464    fn is_closed(&self) -> bool {
10465        self.inner.channel().is_closed()
10466    }
10467    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10468        self.inner.channel().on_closed()
10469    }
10470
10471    #[cfg(target_os = "fuchsia")]
10472    fn signal_peer(
10473        &self,
10474        clear_mask: zx::Signals,
10475        set_mask: zx::Signals,
10476    ) -> Result<(), zx_status::Status> {
10477        use fidl::Peered;
10478        self.inner.channel().signal_peer(clear_mask, set_mask)
10479    }
10480}
10481
10482impl FileControlHandle {
10483    pub fn send_on_open_(
10484        &self,
10485        mut s: i32,
10486        mut info: Option<NodeInfoDeprecated>,
10487    ) -> Result<(), fidl::Error> {
10488        self.inner.send::<NodeOnOpenRequest>(
10489            (s, info.as_mut()),
10490            0,
10491            0x7fc7bbb1dbfd1972,
10492            fidl::encoding::DynamicFlags::FLEXIBLE,
10493        )
10494    }
10495
10496    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
10497        self.inner.send::<Representation>(
10498            &mut payload,
10499            0,
10500            0x5cb40567d80a510c,
10501            fidl::encoding::DynamicFlags::empty(),
10502        )
10503    }
10504}
10505
10506#[must_use = "FIDL methods require a response to be sent"]
10507#[derive(Debug)]
10508pub struct FileAdvisoryLockResponder {
10509    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10510    tx_id: u32,
10511}
10512
10513/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10514/// if the responder is dropped without sending a response, so that the client
10515/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10516impl std::ops::Drop for FileAdvisoryLockResponder {
10517    fn drop(&mut self) {
10518        self.control_handle.shutdown();
10519        // Safety: drops once, never accessed again
10520        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10521    }
10522}
10523
10524impl fidl::endpoints::Responder for FileAdvisoryLockResponder {
10525    type ControlHandle = FileControlHandle;
10526
10527    fn control_handle(&self) -> &FileControlHandle {
10528        &self.control_handle
10529    }
10530
10531    fn drop_without_shutdown(mut self) {
10532        // Safety: drops once, never accessed again due to mem::forget
10533        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10534        // Prevent Drop from running (which would shut down the channel)
10535        std::mem::forget(self);
10536    }
10537}
10538
10539impl FileAdvisoryLockResponder {
10540    /// Sends a response to the FIDL transaction.
10541    ///
10542    /// Sets the channel to shutdown if an error occurs.
10543    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10544        let _result = self.send_raw(result);
10545        if _result.is_err() {
10546            self.control_handle.shutdown();
10547        }
10548        self.drop_without_shutdown();
10549        _result
10550    }
10551
10552    /// Similar to "send" but does not shutdown the channel if an error occurs.
10553    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10554        let _result = self.send_raw(result);
10555        self.drop_without_shutdown();
10556        _result
10557    }
10558
10559    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10560        self.control_handle
10561            .inner
10562            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10563                result,
10564                self.tx_id,
10565                0x6ee9c0ad53ec87aa,
10566                fidl::encoding::DynamicFlags::empty(),
10567            )
10568    }
10569}
10570
10571#[must_use = "FIDL methods require a response to be sent"]
10572#[derive(Debug)]
10573pub struct FileLinkIntoResponder {
10574    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10575    tx_id: u32,
10576}
10577
10578/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10579/// if the responder is dropped without sending a response, so that the client
10580/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10581impl std::ops::Drop for FileLinkIntoResponder {
10582    fn drop(&mut self) {
10583        self.control_handle.shutdown();
10584        // Safety: drops once, never accessed again
10585        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10586    }
10587}
10588
10589impl fidl::endpoints::Responder for FileLinkIntoResponder {
10590    type ControlHandle = FileControlHandle;
10591
10592    fn control_handle(&self) -> &FileControlHandle {
10593        &self.control_handle
10594    }
10595
10596    fn drop_without_shutdown(mut self) {
10597        // Safety: drops once, never accessed again due to mem::forget
10598        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10599        // Prevent Drop from running (which would shut down the channel)
10600        std::mem::forget(self);
10601    }
10602}
10603
10604impl FileLinkIntoResponder {
10605    /// Sends a response to the FIDL transaction.
10606    ///
10607    /// Sets the channel to shutdown if an error occurs.
10608    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10609        let _result = self.send_raw(result);
10610        if _result.is_err() {
10611            self.control_handle.shutdown();
10612        }
10613        self.drop_without_shutdown();
10614        _result
10615    }
10616
10617    /// Similar to "send" but does not shutdown the channel if an error occurs.
10618    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10619        let _result = self.send_raw(result);
10620        self.drop_without_shutdown();
10621        _result
10622    }
10623
10624    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10625        self.control_handle
10626            .inner
10627            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10628                result,
10629                self.tx_id,
10630                0x54f3949246a03e74,
10631                fidl::encoding::DynamicFlags::empty(),
10632            )
10633    }
10634}
10635
10636#[must_use = "FIDL methods require a response to be sent"]
10637#[derive(Debug)]
10638pub struct FileCloseResponder {
10639    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10640    tx_id: u32,
10641}
10642
10643/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10644/// if the responder is dropped without sending a response, so that the client
10645/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10646impl std::ops::Drop for FileCloseResponder {
10647    fn drop(&mut self) {
10648        self.control_handle.shutdown();
10649        // Safety: drops once, never accessed again
10650        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10651    }
10652}
10653
10654impl fidl::endpoints::Responder for FileCloseResponder {
10655    type ControlHandle = FileControlHandle;
10656
10657    fn control_handle(&self) -> &FileControlHandle {
10658        &self.control_handle
10659    }
10660
10661    fn drop_without_shutdown(mut self) {
10662        // Safety: drops once, never accessed again due to mem::forget
10663        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10664        // Prevent Drop from running (which would shut down the channel)
10665        std::mem::forget(self);
10666    }
10667}
10668
10669impl FileCloseResponder {
10670    /// Sends a response to the FIDL transaction.
10671    ///
10672    /// Sets the channel to shutdown if an error occurs.
10673    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10674        let _result = self.send_raw(result);
10675        if _result.is_err() {
10676            self.control_handle.shutdown();
10677        }
10678        self.drop_without_shutdown();
10679        _result
10680    }
10681
10682    /// Similar to "send" but does not shutdown the channel if an error occurs.
10683    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10684        let _result = self.send_raw(result);
10685        self.drop_without_shutdown();
10686        _result
10687    }
10688
10689    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10690        self.control_handle
10691            .inner
10692            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10693                result,
10694                self.tx_id,
10695                0x5ac5d459ad7f657e,
10696                fidl::encoding::DynamicFlags::empty(),
10697            )
10698    }
10699}
10700
10701#[must_use = "FIDL methods require a response to be sent"]
10702#[derive(Debug)]
10703pub struct FileQueryResponder {
10704    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10705    tx_id: u32,
10706}
10707
10708/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10709/// if the responder is dropped without sending a response, so that the client
10710/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10711impl std::ops::Drop for FileQueryResponder {
10712    fn drop(&mut self) {
10713        self.control_handle.shutdown();
10714        // Safety: drops once, never accessed again
10715        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10716    }
10717}
10718
10719impl fidl::endpoints::Responder for FileQueryResponder {
10720    type ControlHandle = FileControlHandle;
10721
10722    fn control_handle(&self) -> &FileControlHandle {
10723        &self.control_handle
10724    }
10725
10726    fn drop_without_shutdown(mut self) {
10727        // Safety: drops once, never accessed again due to mem::forget
10728        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10729        // Prevent Drop from running (which would shut down the channel)
10730        std::mem::forget(self);
10731    }
10732}
10733
10734impl FileQueryResponder {
10735    /// Sends a response to the FIDL transaction.
10736    ///
10737    /// Sets the channel to shutdown if an error occurs.
10738    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10739        let _result = self.send_raw(protocol);
10740        if _result.is_err() {
10741            self.control_handle.shutdown();
10742        }
10743        self.drop_without_shutdown();
10744        _result
10745    }
10746
10747    /// Similar to "send" but does not shutdown the channel if an error occurs.
10748    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10749        let _result = self.send_raw(protocol);
10750        self.drop_without_shutdown();
10751        _result
10752    }
10753
10754    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10755        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
10756            (protocol,),
10757            self.tx_id,
10758            0x2658edee9decfc06,
10759            fidl::encoding::DynamicFlags::empty(),
10760        )
10761    }
10762}
10763
10764#[must_use = "FIDL methods require a response to be sent"]
10765#[derive(Debug)]
10766pub struct FileDeprecatedGetAttrResponder {
10767    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10768    tx_id: u32,
10769}
10770
10771/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10772/// if the responder is dropped without sending a response, so that the client
10773/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10774impl std::ops::Drop for FileDeprecatedGetAttrResponder {
10775    fn drop(&mut self) {
10776        self.control_handle.shutdown();
10777        // Safety: drops once, never accessed again
10778        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10779    }
10780}
10781
10782impl fidl::endpoints::Responder for FileDeprecatedGetAttrResponder {
10783    type ControlHandle = FileControlHandle;
10784
10785    fn control_handle(&self) -> &FileControlHandle {
10786        &self.control_handle
10787    }
10788
10789    fn drop_without_shutdown(mut self) {
10790        // Safety: drops once, never accessed again due to mem::forget
10791        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10792        // Prevent Drop from running (which would shut down the channel)
10793        std::mem::forget(self);
10794    }
10795}
10796
10797impl FileDeprecatedGetAttrResponder {
10798    /// Sends a response to the FIDL transaction.
10799    ///
10800    /// Sets the channel to shutdown if an error occurs.
10801    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
10802        let _result = self.send_raw(s, attributes);
10803        if _result.is_err() {
10804            self.control_handle.shutdown();
10805        }
10806        self.drop_without_shutdown();
10807        _result
10808    }
10809
10810    /// Similar to "send" but does not shutdown the channel if an error occurs.
10811    pub fn send_no_shutdown_on_err(
10812        self,
10813        mut s: i32,
10814        mut attributes: &NodeAttributes,
10815    ) -> Result<(), fidl::Error> {
10816        let _result = self.send_raw(s, attributes);
10817        self.drop_without_shutdown();
10818        _result
10819    }
10820
10821    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
10822        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
10823            (s, attributes),
10824            self.tx_id,
10825            0x78985e216314dafd,
10826            fidl::encoding::DynamicFlags::empty(),
10827        )
10828    }
10829}
10830
10831#[must_use = "FIDL methods require a response to be sent"]
10832#[derive(Debug)]
10833pub struct FileDeprecatedSetAttrResponder {
10834    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10835    tx_id: u32,
10836}
10837
10838/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10839/// if the responder is dropped without sending a response, so that the client
10840/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10841impl std::ops::Drop for FileDeprecatedSetAttrResponder {
10842    fn drop(&mut self) {
10843        self.control_handle.shutdown();
10844        // Safety: drops once, never accessed again
10845        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10846    }
10847}
10848
10849impl fidl::endpoints::Responder for FileDeprecatedSetAttrResponder {
10850    type ControlHandle = FileControlHandle;
10851
10852    fn control_handle(&self) -> &FileControlHandle {
10853        &self.control_handle
10854    }
10855
10856    fn drop_without_shutdown(mut self) {
10857        // Safety: drops once, never accessed again due to mem::forget
10858        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10859        // Prevent Drop from running (which would shut down the channel)
10860        std::mem::forget(self);
10861    }
10862}
10863
10864impl FileDeprecatedSetAttrResponder {
10865    /// Sends a response to the FIDL transaction.
10866    ///
10867    /// Sets the channel to shutdown if an error occurs.
10868    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
10869        let _result = self.send_raw(s);
10870        if _result.is_err() {
10871            self.control_handle.shutdown();
10872        }
10873        self.drop_without_shutdown();
10874        _result
10875    }
10876
10877    /// Similar to "send" but does not shutdown the channel if an error occurs.
10878    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
10879        let _result = self.send_raw(s);
10880        self.drop_without_shutdown();
10881        _result
10882    }
10883
10884    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
10885        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
10886            (s,),
10887            self.tx_id,
10888            0x4186c0f40d938f46,
10889            fidl::encoding::DynamicFlags::empty(),
10890        )
10891    }
10892}
10893
10894#[must_use = "FIDL methods require a response to be sent"]
10895#[derive(Debug)]
10896pub struct FileDeprecatedGetFlagsResponder {
10897    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10898    tx_id: u32,
10899}
10900
10901/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10902/// if the responder is dropped without sending a response, so that the client
10903/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10904impl std::ops::Drop for FileDeprecatedGetFlagsResponder {
10905    fn drop(&mut self) {
10906        self.control_handle.shutdown();
10907        // Safety: drops once, never accessed again
10908        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10909    }
10910}
10911
10912impl fidl::endpoints::Responder for FileDeprecatedGetFlagsResponder {
10913    type ControlHandle = FileControlHandle;
10914
10915    fn control_handle(&self) -> &FileControlHandle {
10916        &self.control_handle
10917    }
10918
10919    fn drop_without_shutdown(mut self) {
10920        // Safety: drops once, never accessed again due to mem::forget
10921        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10922        // Prevent Drop from running (which would shut down the channel)
10923        std::mem::forget(self);
10924    }
10925}
10926
10927impl FileDeprecatedGetFlagsResponder {
10928    /// Sends a response to the FIDL transaction.
10929    ///
10930    /// Sets the channel to shutdown if an error occurs.
10931    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
10932        let _result = self.send_raw(s, flags);
10933        if _result.is_err() {
10934            self.control_handle.shutdown();
10935        }
10936        self.drop_without_shutdown();
10937        _result
10938    }
10939
10940    /// Similar to "send" but does not shutdown the channel if an error occurs.
10941    pub fn send_no_shutdown_on_err(
10942        self,
10943        mut s: i32,
10944        mut flags: OpenFlags,
10945    ) -> Result<(), fidl::Error> {
10946        let _result = self.send_raw(s, flags);
10947        self.drop_without_shutdown();
10948        _result
10949    }
10950
10951    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
10952        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
10953            (s, flags),
10954            self.tx_id,
10955            0x5b88fffb8eda3aa1,
10956            fidl::encoding::DynamicFlags::empty(),
10957        )
10958    }
10959}
10960
10961#[must_use = "FIDL methods require a response to be sent"]
10962#[derive(Debug)]
10963pub struct FileDeprecatedSetFlagsResponder {
10964    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10965    tx_id: u32,
10966}
10967
10968/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10969/// if the responder is dropped without sending a response, so that the client
10970/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10971impl std::ops::Drop for FileDeprecatedSetFlagsResponder {
10972    fn drop(&mut self) {
10973        self.control_handle.shutdown();
10974        // Safety: drops once, never accessed again
10975        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10976    }
10977}
10978
10979impl fidl::endpoints::Responder for FileDeprecatedSetFlagsResponder {
10980    type ControlHandle = FileControlHandle;
10981
10982    fn control_handle(&self) -> &FileControlHandle {
10983        &self.control_handle
10984    }
10985
10986    fn drop_without_shutdown(mut self) {
10987        // Safety: drops once, never accessed again due to mem::forget
10988        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10989        // Prevent Drop from running (which would shut down the channel)
10990        std::mem::forget(self);
10991    }
10992}
10993
10994impl FileDeprecatedSetFlagsResponder {
10995    /// Sends a response to the FIDL transaction.
10996    ///
10997    /// Sets the channel to shutdown if an error occurs.
10998    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
10999        let _result = self.send_raw(s);
11000        if _result.is_err() {
11001            self.control_handle.shutdown();
11002        }
11003        self.drop_without_shutdown();
11004        _result
11005    }
11006
11007    /// Similar to "send" but does not shutdown the channel if an error occurs.
11008    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
11009        let _result = self.send_raw(s);
11010        self.drop_without_shutdown();
11011        _result
11012    }
11013
11014    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
11015        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
11016            (s,),
11017            self.tx_id,
11018            0x5295b76c71fde733,
11019            fidl::encoding::DynamicFlags::empty(),
11020        )
11021    }
11022}
11023
11024#[must_use = "FIDL methods require a response to be sent"]
11025#[derive(Debug)]
11026pub struct FileGetFlagsResponder {
11027    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11028    tx_id: u32,
11029}
11030
11031/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11032/// if the responder is dropped without sending a response, so that the client
11033/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11034impl std::ops::Drop for FileGetFlagsResponder {
11035    fn drop(&mut self) {
11036        self.control_handle.shutdown();
11037        // Safety: drops once, never accessed again
11038        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11039    }
11040}
11041
11042impl fidl::endpoints::Responder for FileGetFlagsResponder {
11043    type ControlHandle = FileControlHandle;
11044
11045    fn control_handle(&self) -> &FileControlHandle {
11046        &self.control_handle
11047    }
11048
11049    fn drop_without_shutdown(mut self) {
11050        // Safety: drops once, never accessed again due to mem::forget
11051        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11052        // Prevent Drop from running (which would shut down the channel)
11053        std::mem::forget(self);
11054    }
11055}
11056
11057impl FileGetFlagsResponder {
11058    /// Sends a response to the FIDL transaction.
11059    ///
11060    /// Sets the channel to shutdown if an error occurs.
11061    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11062        let _result = self.send_raw(result);
11063        if _result.is_err() {
11064            self.control_handle.shutdown();
11065        }
11066        self.drop_without_shutdown();
11067        _result
11068    }
11069
11070    /// Similar to "send" but does not shutdown the channel if an error occurs.
11071    pub fn send_no_shutdown_on_err(
11072        self,
11073        mut result: Result<Flags, i32>,
11074    ) -> Result<(), fidl::Error> {
11075        let _result = self.send_raw(result);
11076        self.drop_without_shutdown();
11077        _result
11078    }
11079
11080    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11081        self.control_handle
11082            .inner
11083            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
11084                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
11085                self.tx_id,
11086                0x176eb318f64ec23,
11087                fidl::encoding::DynamicFlags::FLEXIBLE,
11088            )
11089    }
11090}
11091
11092#[must_use = "FIDL methods require a response to be sent"]
11093#[derive(Debug)]
11094pub struct FileSetFlagsResponder {
11095    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11096    tx_id: u32,
11097}
11098
11099/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11100/// if the responder is dropped without sending a response, so that the client
11101/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11102impl std::ops::Drop for FileSetFlagsResponder {
11103    fn drop(&mut self) {
11104        self.control_handle.shutdown();
11105        // Safety: drops once, never accessed again
11106        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11107    }
11108}
11109
11110impl fidl::endpoints::Responder for FileSetFlagsResponder {
11111    type ControlHandle = FileControlHandle;
11112
11113    fn control_handle(&self) -> &FileControlHandle {
11114        &self.control_handle
11115    }
11116
11117    fn drop_without_shutdown(mut self) {
11118        // Safety: drops once, never accessed again due to mem::forget
11119        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11120        // Prevent Drop from running (which would shut down the channel)
11121        std::mem::forget(self);
11122    }
11123}
11124
11125impl FileSetFlagsResponder {
11126    /// Sends a response to the FIDL transaction.
11127    ///
11128    /// Sets the channel to shutdown if an error occurs.
11129    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11130        let _result = self.send_raw(result);
11131        if _result.is_err() {
11132            self.control_handle.shutdown();
11133        }
11134        self.drop_without_shutdown();
11135        _result
11136    }
11137
11138    /// Similar to "send" but does not shutdown the channel if an error occurs.
11139    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11140        let _result = self.send_raw(result);
11141        self.drop_without_shutdown();
11142        _result
11143    }
11144
11145    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11146        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11147            fidl::encoding::EmptyStruct,
11148            i32,
11149        >>(
11150            fidl::encoding::FlexibleResult::new(result),
11151            self.tx_id,
11152            0x55a8028685791ea8,
11153            fidl::encoding::DynamicFlags::FLEXIBLE,
11154        )
11155    }
11156}
11157
11158#[must_use = "FIDL methods require a response to be sent"]
11159#[derive(Debug)]
11160pub struct FileQueryFilesystemResponder {
11161    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11162    tx_id: u32,
11163}
11164
11165/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11166/// if the responder is dropped without sending a response, so that the client
11167/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11168impl std::ops::Drop for FileQueryFilesystemResponder {
11169    fn drop(&mut self) {
11170        self.control_handle.shutdown();
11171        // Safety: drops once, never accessed again
11172        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11173    }
11174}
11175
11176impl fidl::endpoints::Responder for FileQueryFilesystemResponder {
11177    type ControlHandle = FileControlHandle;
11178
11179    fn control_handle(&self) -> &FileControlHandle {
11180        &self.control_handle
11181    }
11182
11183    fn drop_without_shutdown(mut self) {
11184        // Safety: drops once, never accessed again due to mem::forget
11185        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11186        // Prevent Drop from running (which would shut down the channel)
11187        std::mem::forget(self);
11188    }
11189}
11190
11191impl FileQueryFilesystemResponder {
11192    /// Sends a response to the FIDL transaction.
11193    ///
11194    /// Sets the channel to shutdown if an error occurs.
11195    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11196        let _result = self.send_raw(s, info);
11197        if _result.is_err() {
11198            self.control_handle.shutdown();
11199        }
11200        self.drop_without_shutdown();
11201        _result
11202    }
11203
11204    /// Similar to "send" but does not shutdown the channel if an error occurs.
11205    pub fn send_no_shutdown_on_err(
11206        self,
11207        mut s: i32,
11208        mut info: Option<&FilesystemInfo>,
11209    ) -> Result<(), fidl::Error> {
11210        let _result = self.send_raw(s, info);
11211        self.drop_without_shutdown();
11212        _result
11213    }
11214
11215    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11216        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
11217            (s, info),
11218            self.tx_id,
11219            0x6f344a1c6b0a0610,
11220            fidl::encoding::DynamicFlags::empty(),
11221        )
11222    }
11223}
11224
11225#[must_use = "FIDL methods require a response to be sent"]
11226#[derive(Debug)]
11227pub struct FileGetAttributesResponder {
11228    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11229    tx_id: u32,
11230}
11231
11232/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11233/// if the responder is dropped without sending a response, so that the client
11234/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11235impl std::ops::Drop for FileGetAttributesResponder {
11236    fn drop(&mut self) {
11237        self.control_handle.shutdown();
11238        // Safety: drops once, never accessed again
11239        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11240    }
11241}
11242
11243impl fidl::endpoints::Responder for FileGetAttributesResponder {
11244    type ControlHandle = FileControlHandle;
11245
11246    fn control_handle(&self) -> &FileControlHandle {
11247        &self.control_handle
11248    }
11249
11250    fn drop_without_shutdown(mut self) {
11251        // Safety: drops once, never accessed again due to mem::forget
11252        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11253        // Prevent Drop from running (which would shut down the channel)
11254        std::mem::forget(self);
11255    }
11256}
11257
11258impl FileGetAttributesResponder {
11259    /// Sends a response to the FIDL transaction.
11260    ///
11261    /// Sets the channel to shutdown if an error occurs.
11262    pub fn send(
11263        self,
11264        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11265    ) -> Result<(), fidl::Error> {
11266        let _result = self.send_raw(result);
11267        if _result.is_err() {
11268            self.control_handle.shutdown();
11269        }
11270        self.drop_without_shutdown();
11271        _result
11272    }
11273
11274    /// Similar to "send" but does not shutdown the channel if an error occurs.
11275    pub fn send_no_shutdown_on_err(
11276        self,
11277        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11278    ) -> Result<(), fidl::Error> {
11279        let _result = self.send_raw(result);
11280        self.drop_without_shutdown();
11281        _result
11282    }
11283
11284    fn send_raw(
11285        &self,
11286        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11287    ) -> Result<(), fidl::Error> {
11288        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
11289            result,
11290            self.tx_id,
11291            0x3d4396a638ea053b,
11292            fidl::encoding::DynamicFlags::empty(),
11293        )
11294    }
11295}
11296
11297#[must_use = "FIDL methods require a response to be sent"]
11298#[derive(Debug)]
11299pub struct FileUpdateAttributesResponder {
11300    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11301    tx_id: u32,
11302}
11303
11304/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11305/// if the responder is dropped without sending a response, so that the client
11306/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11307impl std::ops::Drop for FileUpdateAttributesResponder {
11308    fn drop(&mut self) {
11309        self.control_handle.shutdown();
11310        // Safety: drops once, never accessed again
11311        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11312    }
11313}
11314
11315impl fidl::endpoints::Responder for FileUpdateAttributesResponder {
11316    type ControlHandle = FileControlHandle;
11317
11318    fn control_handle(&self) -> &FileControlHandle {
11319        &self.control_handle
11320    }
11321
11322    fn drop_without_shutdown(mut self) {
11323        // Safety: drops once, never accessed again due to mem::forget
11324        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11325        // Prevent Drop from running (which would shut down the channel)
11326        std::mem::forget(self);
11327    }
11328}
11329
11330impl FileUpdateAttributesResponder {
11331    /// Sends a response to the FIDL transaction.
11332    ///
11333    /// Sets the channel to shutdown if an error occurs.
11334    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11335        let _result = self.send_raw(result);
11336        if _result.is_err() {
11337            self.control_handle.shutdown();
11338        }
11339        self.drop_without_shutdown();
11340        _result
11341    }
11342
11343    /// Similar to "send" but does not shutdown the channel if an error occurs.
11344    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11345        let _result = self.send_raw(result);
11346        self.drop_without_shutdown();
11347        _result
11348    }
11349
11350    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11351        self.control_handle
11352            .inner
11353            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11354                result,
11355                self.tx_id,
11356                0x3308c1da5a89bf08,
11357                fidl::encoding::DynamicFlags::empty(),
11358            )
11359    }
11360}
11361
11362#[must_use = "FIDL methods require a response to be sent"]
11363#[derive(Debug)]
11364pub struct FileSyncResponder {
11365    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11366    tx_id: u32,
11367}
11368
11369/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11370/// if the responder is dropped without sending a response, so that the client
11371/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11372impl std::ops::Drop for FileSyncResponder {
11373    fn drop(&mut self) {
11374        self.control_handle.shutdown();
11375        // Safety: drops once, never accessed again
11376        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11377    }
11378}
11379
11380impl fidl::endpoints::Responder for FileSyncResponder {
11381    type ControlHandle = FileControlHandle;
11382
11383    fn control_handle(&self) -> &FileControlHandle {
11384        &self.control_handle
11385    }
11386
11387    fn drop_without_shutdown(mut self) {
11388        // Safety: drops once, never accessed again due to mem::forget
11389        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11390        // Prevent Drop from running (which would shut down the channel)
11391        std::mem::forget(self);
11392    }
11393}
11394
11395impl FileSyncResponder {
11396    /// Sends a response to the FIDL transaction.
11397    ///
11398    /// Sets the channel to shutdown if an error occurs.
11399    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11400        let _result = self.send_raw(result);
11401        if _result.is_err() {
11402            self.control_handle.shutdown();
11403        }
11404        self.drop_without_shutdown();
11405        _result
11406    }
11407
11408    /// Similar to "send" but does not shutdown the channel if an error occurs.
11409    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11410        let _result = self.send_raw(result);
11411        self.drop_without_shutdown();
11412        _result
11413    }
11414
11415    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11416        self.control_handle
11417            .inner
11418            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11419                result,
11420                self.tx_id,
11421                0x2c5c27ca0ab5dc49,
11422                fidl::encoding::DynamicFlags::empty(),
11423            )
11424    }
11425}
11426
11427#[must_use = "FIDL methods require a response to be sent"]
11428#[derive(Debug)]
11429pub struct FileGetExtendedAttributeResponder {
11430    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11431    tx_id: u32,
11432}
11433
11434/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11435/// if the responder is dropped without sending a response, so that the client
11436/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11437impl std::ops::Drop for FileGetExtendedAttributeResponder {
11438    fn drop(&mut self) {
11439        self.control_handle.shutdown();
11440        // Safety: drops once, never accessed again
11441        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11442    }
11443}
11444
11445impl fidl::endpoints::Responder for FileGetExtendedAttributeResponder {
11446    type ControlHandle = FileControlHandle;
11447
11448    fn control_handle(&self) -> &FileControlHandle {
11449        &self.control_handle
11450    }
11451
11452    fn drop_without_shutdown(mut self) {
11453        // Safety: drops once, never accessed again due to mem::forget
11454        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11455        // Prevent Drop from running (which would shut down the channel)
11456        std::mem::forget(self);
11457    }
11458}
11459
11460impl FileGetExtendedAttributeResponder {
11461    /// Sends a response to the FIDL transaction.
11462    ///
11463    /// Sets the channel to shutdown if an error occurs.
11464    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11465        let _result = self.send_raw(result);
11466        if _result.is_err() {
11467            self.control_handle.shutdown();
11468        }
11469        self.drop_without_shutdown();
11470        _result
11471    }
11472
11473    /// Similar to "send" but does not shutdown the channel if an error occurs.
11474    pub fn send_no_shutdown_on_err(
11475        self,
11476        mut result: Result<ExtendedAttributeValue, i32>,
11477    ) -> Result<(), fidl::Error> {
11478        let _result = self.send_raw(result);
11479        self.drop_without_shutdown();
11480        _result
11481    }
11482
11483    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11484        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
11485            result.as_mut().map_err(|e| *e),
11486            self.tx_id,
11487            0x45ffa3ccfdeb76db,
11488            fidl::encoding::DynamicFlags::empty(),
11489        )
11490    }
11491}
11492
11493#[must_use = "FIDL methods require a response to be sent"]
11494#[derive(Debug)]
11495pub struct FileSetExtendedAttributeResponder {
11496    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11497    tx_id: u32,
11498}
11499
11500/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11501/// if the responder is dropped without sending a response, so that the client
11502/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11503impl std::ops::Drop for FileSetExtendedAttributeResponder {
11504    fn drop(&mut self) {
11505        self.control_handle.shutdown();
11506        // Safety: drops once, never accessed again
11507        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11508    }
11509}
11510
11511impl fidl::endpoints::Responder for FileSetExtendedAttributeResponder {
11512    type ControlHandle = FileControlHandle;
11513
11514    fn control_handle(&self) -> &FileControlHandle {
11515        &self.control_handle
11516    }
11517
11518    fn drop_without_shutdown(mut self) {
11519        // Safety: drops once, never accessed again due to mem::forget
11520        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11521        // Prevent Drop from running (which would shut down the channel)
11522        std::mem::forget(self);
11523    }
11524}
11525
11526impl FileSetExtendedAttributeResponder {
11527    /// Sends a response to the FIDL transaction.
11528    ///
11529    /// Sets the channel to shutdown if an error occurs.
11530    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11531        let _result = self.send_raw(result);
11532        if _result.is_err() {
11533            self.control_handle.shutdown();
11534        }
11535        self.drop_without_shutdown();
11536        _result
11537    }
11538
11539    /// Similar to "send" but does not shutdown the channel if an error occurs.
11540    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11541        let _result = self.send_raw(result);
11542        self.drop_without_shutdown();
11543        _result
11544    }
11545
11546    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11547        self.control_handle
11548            .inner
11549            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11550                result,
11551                self.tx_id,
11552                0x4a951362f681f23c,
11553                fidl::encoding::DynamicFlags::empty(),
11554            )
11555    }
11556}
11557
11558#[must_use = "FIDL methods require a response to be sent"]
11559#[derive(Debug)]
11560pub struct FileRemoveExtendedAttributeResponder {
11561    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11562    tx_id: u32,
11563}
11564
11565/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11566/// if the responder is dropped without sending a response, so that the client
11567/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11568impl std::ops::Drop for FileRemoveExtendedAttributeResponder {
11569    fn drop(&mut self) {
11570        self.control_handle.shutdown();
11571        // Safety: drops once, never accessed again
11572        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11573    }
11574}
11575
11576impl fidl::endpoints::Responder for FileRemoveExtendedAttributeResponder {
11577    type ControlHandle = FileControlHandle;
11578
11579    fn control_handle(&self) -> &FileControlHandle {
11580        &self.control_handle
11581    }
11582
11583    fn drop_without_shutdown(mut self) {
11584        // Safety: drops once, never accessed again due to mem::forget
11585        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11586        // Prevent Drop from running (which would shut down the channel)
11587        std::mem::forget(self);
11588    }
11589}
11590
11591impl FileRemoveExtendedAttributeResponder {
11592    /// Sends a response to the FIDL transaction.
11593    ///
11594    /// Sets the channel to shutdown if an error occurs.
11595    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11596        let _result = self.send_raw(result);
11597        if _result.is_err() {
11598            self.control_handle.shutdown();
11599        }
11600        self.drop_without_shutdown();
11601        _result
11602    }
11603
11604    /// Similar to "send" but does not shutdown the channel if an error occurs.
11605    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11606        let _result = self.send_raw(result);
11607        self.drop_without_shutdown();
11608        _result
11609    }
11610
11611    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11612        self.control_handle
11613            .inner
11614            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11615                result,
11616                self.tx_id,
11617                0x7a0b9f3a9bf9032d,
11618                fidl::encoding::DynamicFlags::empty(),
11619            )
11620    }
11621}
11622
11623#[must_use = "FIDL methods require a response to be sent"]
11624#[derive(Debug)]
11625pub struct FileReadResponder {
11626    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11627    tx_id: u32,
11628}
11629
11630/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11631/// if the responder is dropped without sending a response, so that the client
11632/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11633impl std::ops::Drop for FileReadResponder {
11634    fn drop(&mut self) {
11635        self.control_handle.shutdown();
11636        // Safety: drops once, never accessed again
11637        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11638    }
11639}
11640
11641impl fidl::endpoints::Responder for FileReadResponder {
11642    type ControlHandle = FileControlHandle;
11643
11644    fn control_handle(&self) -> &FileControlHandle {
11645        &self.control_handle
11646    }
11647
11648    fn drop_without_shutdown(mut self) {
11649        // Safety: drops once, never accessed again due to mem::forget
11650        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11651        // Prevent Drop from running (which would shut down the channel)
11652        std::mem::forget(self);
11653    }
11654}
11655
11656impl FileReadResponder {
11657    /// Sends a response to the FIDL transaction.
11658    ///
11659    /// Sets the channel to shutdown if an error occurs.
11660    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11661        let _result = self.send_raw(result);
11662        if _result.is_err() {
11663            self.control_handle.shutdown();
11664        }
11665        self.drop_without_shutdown();
11666        _result
11667    }
11668
11669    /// Similar to "send" but does not shutdown the channel if an error occurs.
11670    pub fn send_no_shutdown_on_err(
11671        self,
11672        mut result: Result<&[u8], i32>,
11673    ) -> Result<(), fidl::Error> {
11674        let _result = self.send_raw(result);
11675        self.drop_without_shutdown();
11676        _result
11677    }
11678
11679    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11680        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
11681            result.map(|data| (data,)),
11682            self.tx_id,
11683            0x57e419a298c8ede,
11684            fidl::encoding::DynamicFlags::empty(),
11685        )
11686    }
11687}
11688
11689#[must_use = "FIDL methods require a response to be sent"]
11690#[derive(Debug)]
11691pub struct FileWriteResponder {
11692    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11693    tx_id: u32,
11694}
11695
11696/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11697/// if the responder is dropped without sending a response, so that the client
11698/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11699impl std::ops::Drop for FileWriteResponder {
11700    fn drop(&mut self) {
11701        self.control_handle.shutdown();
11702        // Safety: drops once, never accessed again
11703        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11704    }
11705}
11706
11707impl fidl::endpoints::Responder for FileWriteResponder {
11708    type ControlHandle = FileControlHandle;
11709
11710    fn control_handle(&self) -> &FileControlHandle {
11711        &self.control_handle
11712    }
11713
11714    fn drop_without_shutdown(mut self) {
11715        // Safety: drops once, never accessed again due to mem::forget
11716        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11717        // Prevent Drop from running (which would shut down the channel)
11718        std::mem::forget(self);
11719    }
11720}
11721
11722impl FileWriteResponder {
11723    /// Sends a response to the FIDL transaction.
11724    ///
11725    /// Sets the channel to shutdown if an error occurs.
11726    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11727        let _result = self.send_raw(result);
11728        if _result.is_err() {
11729            self.control_handle.shutdown();
11730        }
11731        self.drop_without_shutdown();
11732        _result
11733    }
11734
11735    /// Similar to "send" but does not shutdown the channel if an error occurs.
11736    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11737        let _result = self.send_raw(result);
11738        self.drop_without_shutdown();
11739        _result
11740    }
11741
11742    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11743        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
11744            result.map(|actual_count| (actual_count,)),
11745            self.tx_id,
11746            0x6a31437832469f82,
11747            fidl::encoding::DynamicFlags::empty(),
11748        )
11749    }
11750}
11751
11752#[must_use = "FIDL methods require a response to be sent"]
11753#[derive(Debug)]
11754pub struct FileDescribeResponder {
11755    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11756    tx_id: u32,
11757}
11758
11759/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11760/// if the responder is dropped without sending a response, so that the client
11761/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11762impl std::ops::Drop for FileDescribeResponder {
11763    fn drop(&mut self) {
11764        self.control_handle.shutdown();
11765        // Safety: drops once, never accessed again
11766        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11767    }
11768}
11769
11770impl fidl::endpoints::Responder for FileDescribeResponder {
11771    type ControlHandle = FileControlHandle;
11772
11773    fn control_handle(&self) -> &FileControlHandle {
11774        &self.control_handle
11775    }
11776
11777    fn drop_without_shutdown(mut self) {
11778        // Safety: drops once, never accessed again due to mem::forget
11779        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11780        // Prevent Drop from running (which would shut down the channel)
11781        std::mem::forget(self);
11782    }
11783}
11784
11785impl FileDescribeResponder {
11786    /// Sends a response to the FIDL transaction.
11787    ///
11788    /// Sets the channel to shutdown if an error occurs.
11789    pub fn send(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11790        let _result = self.send_raw(payload);
11791        if _result.is_err() {
11792            self.control_handle.shutdown();
11793        }
11794        self.drop_without_shutdown();
11795        _result
11796    }
11797
11798    /// Similar to "send" but does not shutdown the channel if an error occurs.
11799    pub fn send_no_shutdown_on_err(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11800        let _result = self.send_raw(payload);
11801        self.drop_without_shutdown();
11802        _result
11803    }
11804
11805    fn send_raw(&self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11806        self.control_handle.inner.send::<FileInfo>(
11807            &mut payload,
11808            self.tx_id,
11809            0x68b5ac00c62906bc,
11810            fidl::encoding::DynamicFlags::empty(),
11811        )
11812    }
11813}
11814
11815#[must_use = "FIDL methods require a response to be sent"]
11816#[derive(Debug)]
11817pub struct FileSeekResponder {
11818    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11819    tx_id: u32,
11820}
11821
11822/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11823/// if the responder is dropped without sending a response, so that the client
11824/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11825impl std::ops::Drop for FileSeekResponder {
11826    fn drop(&mut self) {
11827        self.control_handle.shutdown();
11828        // Safety: drops once, never accessed again
11829        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11830    }
11831}
11832
11833impl fidl::endpoints::Responder for FileSeekResponder {
11834    type ControlHandle = FileControlHandle;
11835
11836    fn control_handle(&self) -> &FileControlHandle {
11837        &self.control_handle
11838    }
11839
11840    fn drop_without_shutdown(mut self) {
11841        // Safety: drops once, never accessed again due to mem::forget
11842        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11843        // Prevent Drop from running (which would shut down the channel)
11844        std::mem::forget(self);
11845    }
11846}
11847
11848impl FileSeekResponder {
11849    /// Sends a response to the FIDL transaction.
11850    ///
11851    /// Sets the channel to shutdown if an error occurs.
11852    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11853        let _result = self.send_raw(result);
11854        if _result.is_err() {
11855            self.control_handle.shutdown();
11856        }
11857        self.drop_without_shutdown();
11858        _result
11859    }
11860
11861    /// Similar to "send" but does not shutdown the channel if an error occurs.
11862    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11863        let _result = self.send_raw(result);
11864        self.drop_without_shutdown();
11865        _result
11866    }
11867
11868    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11869        self.control_handle.inner.send::<fidl::encoding::ResultType<FileSeekResponse, i32>>(
11870            result.map(|offset_from_start| (offset_from_start,)),
11871            self.tx_id,
11872            0x78079168162c5207,
11873            fidl::encoding::DynamicFlags::empty(),
11874        )
11875    }
11876}
11877
11878#[must_use = "FIDL methods require a response to be sent"]
11879#[derive(Debug)]
11880pub struct FileReadAtResponder {
11881    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11882    tx_id: u32,
11883}
11884
11885/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11886/// if the responder is dropped without sending a response, so that the client
11887/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11888impl std::ops::Drop for FileReadAtResponder {
11889    fn drop(&mut self) {
11890        self.control_handle.shutdown();
11891        // Safety: drops once, never accessed again
11892        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11893    }
11894}
11895
11896impl fidl::endpoints::Responder for FileReadAtResponder {
11897    type ControlHandle = FileControlHandle;
11898
11899    fn control_handle(&self) -> &FileControlHandle {
11900        &self.control_handle
11901    }
11902
11903    fn drop_without_shutdown(mut self) {
11904        // Safety: drops once, never accessed again due to mem::forget
11905        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11906        // Prevent Drop from running (which would shut down the channel)
11907        std::mem::forget(self);
11908    }
11909}
11910
11911impl FileReadAtResponder {
11912    /// Sends a response to the FIDL transaction.
11913    ///
11914    /// Sets the channel to shutdown if an error occurs.
11915    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11916        let _result = self.send_raw(result);
11917        if _result.is_err() {
11918            self.control_handle.shutdown();
11919        }
11920        self.drop_without_shutdown();
11921        _result
11922    }
11923
11924    /// Similar to "send" but does not shutdown the channel if an error occurs.
11925    pub fn send_no_shutdown_on_err(
11926        self,
11927        mut result: Result<&[u8], i32>,
11928    ) -> Result<(), fidl::Error> {
11929        let _result = self.send_raw(result);
11930        self.drop_without_shutdown();
11931        _result
11932    }
11933
11934    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11935        self.control_handle.inner.send::<fidl::encoding::ResultType<FileReadAtResponse, i32>>(
11936            result.map(|data| (data,)),
11937            self.tx_id,
11938            0x1607a293a60d723e,
11939            fidl::encoding::DynamicFlags::empty(),
11940        )
11941    }
11942}
11943
11944#[must_use = "FIDL methods require a response to be sent"]
11945#[derive(Debug)]
11946pub struct FileWriteAtResponder {
11947    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11948    tx_id: u32,
11949}
11950
11951/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11952/// if the responder is dropped without sending a response, so that the client
11953/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11954impl std::ops::Drop for FileWriteAtResponder {
11955    fn drop(&mut self) {
11956        self.control_handle.shutdown();
11957        // Safety: drops once, never accessed again
11958        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11959    }
11960}
11961
11962impl fidl::endpoints::Responder for FileWriteAtResponder {
11963    type ControlHandle = FileControlHandle;
11964
11965    fn control_handle(&self) -> &FileControlHandle {
11966        &self.control_handle
11967    }
11968
11969    fn drop_without_shutdown(mut self) {
11970        // Safety: drops once, never accessed again due to mem::forget
11971        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11972        // Prevent Drop from running (which would shut down the channel)
11973        std::mem::forget(self);
11974    }
11975}
11976
11977impl FileWriteAtResponder {
11978    /// Sends a response to the FIDL transaction.
11979    ///
11980    /// Sets the channel to shutdown if an error occurs.
11981    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11982        let _result = self.send_raw(result);
11983        if _result.is_err() {
11984            self.control_handle.shutdown();
11985        }
11986        self.drop_without_shutdown();
11987        _result
11988    }
11989
11990    /// Similar to "send" but does not shutdown the channel if an error occurs.
11991    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11992        let _result = self.send_raw(result);
11993        self.drop_without_shutdown();
11994        _result
11995    }
11996
11997    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11998        self.control_handle.inner.send::<fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
11999            result.map(|actual_count| (actual_count,)),
12000            self.tx_id,
12001            0x793eefc0045e792b,
12002            fidl::encoding::DynamicFlags::empty(),
12003        )
12004    }
12005}
12006
12007#[must_use = "FIDL methods require a response to be sent"]
12008#[derive(Debug)]
12009pub struct FileResizeResponder {
12010    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12011    tx_id: u32,
12012}
12013
12014/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12015/// if the responder is dropped without sending a response, so that the client
12016/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12017impl std::ops::Drop for FileResizeResponder {
12018    fn drop(&mut self) {
12019        self.control_handle.shutdown();
12020        // Safety: drops once, never accessed again
12021        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12022    }
12023}
12024
12025impl fidl::endpoints::Responder for FileResizeResponder {
12026    type ControlHandle = FileControlHandle;
12027
12028    fn control_handle(&self) -> &FileControlHandle {
12029        &self.control_handle
12030    }
12031
12032    fn drop_without_shutdown(mut self) {
12033        // Safety: drops once, never accessed again due to mem::forget
12034        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12035        // Prevent Drop from running (which would shut down the channel)
12036        std::mem::forget(self);
12037    }
12038}
12039
12040impl FileResizeResponder {
12041    /// Sends a response to the FIDL transaction.
12042    ///
12043    /// Sets the channel to shutdown if an error occurs.
12044    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12045        let _result = self.send_raw(result);
12046        if _result.is_err() {
12047            self.control_handle.shutdown();
12048        }
12049        self.drop_without_shutdown();
12050        _result
12051    }
12052
12053    /// Similar to "send" but does not shutdown the channel if an error occurs.
12054    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12055        let _result = self.send_raw(result);
12056        self.drop_without_shutdown();
12057        _result
12058    }
12059
12060    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12061        self.control_handle
12062            .inner
12063            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12064                result,
12065                self.tx_id,
12066                0x2b80825f0535743a,
12067                fidl::encoding::DynamicFlags::empty(),
12068            )
12069    }
12070}
12071
12072#[must_use = "FIDL methods require a response to be sent"]
12073#[derive(Debug)]
12074pub struct FileGetBackingMemoryResponder {
12075    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12076    tx_id: u32,
12077}
12078
12079/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12080/// if the responder is dropped without sending a response, so that the client
12081/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12082impl std::ops::Drop for FileGetBackingMemoryResponder {
12083    fn drop(&mut self) {
12084        self.control_handle.shutdown();
12085        // Safety: drops once, never accessed again
12086        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12087    }
12088}
12089
12090impl fidl::endpoints::Responder for FileGetBackingMemoryResponder {
12091    type ControlHandle = FileControlHandle;
12092
12093    fn control_handle(&self) -> &FileControlHandle {
12094        &self.control_handle
12095    }
12096
12097    fn drop_without_shutdown(mut self) {
12098        // Safety: drops once, never accessed again due to mem::forget
12099        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12100        // Prevent Drop from running (which would shut down the channel)
12101        std::mem::forget(self);
12102    }
12103}
12104
12105impl FileGetBackingMemoryResponder {
12106    /// Sends a response to the FIDL transaction.
12107    ///
12108    /// Sets the channel to shutdown if an error occurs.
12109    pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12110        let _result = self.send_raw(result);
12111        if _result.is_err() {
12112            self.control_handle.shutdown();
12113        }
12114        self.drop_without_shutdown();
12115        _result
12116    }
12117
12118    /// Similar to "send" but does not shutdown the channel if an error occurs.
12119    pub fn send_no_shutdown_on_err(
12120        self,
12121        mut result: Result<fidl::Vmo, i32>,
12122    ) -> Result<(), fidl::Error> {
12123        let _result = self.send_raw(result);
12124        self.drop_without_shutdown();
12125        _result
12126    }
12127
12128    fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12129        self.control_handle
12130            .inner
12131            .send::<fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>>(
12132                result.map(|vmo| (vmo,)),
12133                self.tx_id,
12134                0xa6a9e654cbf62b,
12135                fidl::encoding::DynamicFlags::empty(),
12136            )
12137    }
12138}
12139
12140#[must_use = "FIDL methods require a response to be sent"]
12141#[derive(Debug)]
12142pub struct FileAllocateResponder {
12143    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12144    tx_id: u32,
12145}
12146
12147/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12148/// if the responder is dropped without sending a response, so that the client
12149/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12150impl std::ops::Drop for FileAllocateResponder {
12151    fn drop(&mut self) {
12152        self.control_handle.shutdown();
12153        // Safety: drops once, never accessed again
12154        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12155    }
12156}
12157
12158impl fidl::endpoints::Responder for FileAllocateResponder {
12159    type ControlHandle = FileControlHandle;
12160
12161    fn control_handle(&self) -> &FileControlHandle {
12162        &self.control_handle
12163    }
12164
12165    fn drop_without_shutdown(mut self) {
12166        // Safety: drops once, never accessed again due to mem::forget
12167        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12168        // Prevent Drop from running (which would shut down the channel)
12169        std::mem::forget(self);
12170    }
12171}
12172
12173impl FileAllocateResponder {
12174    /// Sends a response to the FIDL transaction.
12175    ///
12176    /// Sets the channel to shutdown if an error occurs.
12177    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12178        let _result = self.send_raw(result);
12179        if _result.is_err() {
12180            self.control_handle.shutdown();
12181        }
12182        self.drop_without_shutdown();
12183        _result
12184    }
12185
12186    /// Similar to "send" but does not shutdown the channel if an error occurs.
12187    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12188        let _result = self.send_raw(result);
12189        self.drop_without_shutdown();
12190        _result
12191    }
12192
12193    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12194        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12195            fidl::encoding::EmptyStruct,
12196            i32,
12197        >>(
12198            fidl::encoding::FlexibleResult::new(result),
12199            self.tx_id,
12200            0x77fa0c330b57fd2e,
12201            fidl::encoding::DynamicFlags::FLEXIBLE,
12202        )
12203    }
12204}
12205
12206#[must_use = "FIDL methods require a response to be sent"]
12207#[derive(Debug)]
12208pub struct FileEnableVerityResponder {
12209    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12210    tx_id: u32,
12211}
12212
12213/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12214/// if the responder is dropped without sending a response, so that the client
12215/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12216impl std::ops::Drop for FileEnableVerityResponder {
12217    fn drop(&mut self) {
12218        self.control_handle.shutdown();
12219        // Safety: drops once, never accessed again
12220        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12221    }
12222}
12223
12224impl fidl::endpoints::Responder for FileEnableVerityResponder {
12225    type ControlHandle = FileControlHandle;
12226
12227    fn control_handle(&self) -> &FileControlHandle {
12228        &self.control_handle
12229    }
12230
12231    fn drop_without_shutdown(mut self) {
12232        // Safety: drops once, never accessed again due to mem::forget
12233        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12234        // Prevent Drop from running (which would shut down the channel)
12235        std::mem::forget(self);
12236    }
12237}
12238
12239impl FileEnableVerityResponder {
12240    /// Sends a response to the FIDL transaction.
12241    ///
12242    /// Sets the channel to shutdown if an error occurs.
12243    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12244        let _result = self.send_raw(result);
12245        if _result.is_err() {
12246            self.control_handle.shutdown();
12247        }
12248        self.drop_without_shutdown();
12249        _result
12250    }
12251
12252    /// Similar to "send" but does not shutdown the channel if an error occurs.
12253    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12254        let _result = self.send_raw(result);
12255        self.drop_without_shutdown();
12256        _result
12257    }
12258
12259    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12260        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12261            fidl::encoding::EmptyStruct,
12262            i32,
12263        >>(
12264            fidl::encoding::FlexibleResult::new(result),
12265            self.tx_id,
12266            0x2c421ec3faaeb8bb,
12267            fidl::encoding::DynamicFlags::FLEXIBLE,
12268        )
12269    }
12270}
12271
12272#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12273pub struct LinkableMarker;
12274
12275impl fidl::endpoints::ProtocolMarker for LinkableMarker {
12276    type Proxy = LinkableProxy;
12277    type RequestStream = LinkableRequestStream;
12278    #[cfg(target_os = "fuchsia")]
12279    type SynchronousProxy = LinkableSynchronousProxy;
12280
12281    const DEBUG_NAME: &'static str = "(anonymous) Linkable";
12282}
12283pub type LinkableLinkIntoResult = Result<(), i32>;
12284
12285pub trait LinkableProxyInterface: Send + Sync {
12286    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
12287        + Send;
12288    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
12289}
12290#[derive(Debug)]
12291#[cfg(target_os = "fuchsia")]
12292pub struct LinkableSynchronousProxy {
12293    client: fidl::client::sync::Client,
12294}
12295
12296#[cfg(target_os = "fuchsia")]
12297impl fidl::endpoints::SynchronousProxy for LinkableSynchronousProxy {
12298    type Proxy = LinkableProxy;
12299    type Protocol = LinkableMarker;
12300
12301    fn from_channel(inner: fidl::Channel) -> Self {
12302        Self::new(inner)
12303    }
12304
12305    fn into_channel(self) -> fidl::Channel {
12306        self.client.into_channel()
12307    }
12308
12309    fn as_channel(&self) -> &fidl::Channel {
12310        self.client.as_channel()
12311    }
12312}
12313
12314#[cfg(target_os = "fuchsia")]
12315impl LinkableSynchronousProxy {
12316    pub fn new(channel: fidl::Channel) -> Self {
12317        let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12318        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
12319    }
12320
12321    pub fn into_channel(self) -> fidl::Channel {
12322        self.client.into_channel()
12323    }
12324
12325    /// Waits until an event arrives and returns it. It is safe for other
12326    /// threads to make concurrent requests while waiting for an event.
12327    pub fn wait_for_event(
12328        &self,
12329        deadline: zx::MonotonicInstant,
12330    ) -> Result<LinkableEvent, fidl::Error> {
12331        LinkableEvent::decode(self.client.wait_for_event(deadline)?)
12332    }
12333
12334    /// Creates a link to this this object with name `dst` in the directory represented by
12335    /// `dst_parent_token`.
12336    ///
12337    /// `dst` must be a resolved object name. Including "/" in the string will return
12338    /// `ZX_ERR_INVALID_ARGS`.
12339    ///
12340    /// This method requires the maximal set of rights supported by the filesystem for this object.
12341    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12342    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12343    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12344    /// `ZX_ERR_ACCESS_DENIED`.
12345    ///
12346    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12347    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12348    ///
12349    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12350    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12351    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12352    ///
12353    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12354    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12355    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12356    pub fn r#link_into(
12357        &self,
12358        mut dst_parent_token: fidl::Event,
12359        mut dst: &str,
12360        ___deadline: zx::MonotonicInstant,
12361    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12362        let _response = self.client.send_query::<
12363            LinkableLinkIntoRequest,
12364            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12365        >(
12366            (dst_parent_token, dst,),
12367            0x54f3949246a03e74,
12368            fidl::encoding::DynamicFlags::empty(),
12369            ___deadline,
12370        )?;
12371        Ok(_response.map(|x| x))
12372    }
12373}
12374
12375#[cfg(target_os = "fuchsia")]
12376impl From<LinkableSynchronousProxy> for zx::NullableHandle {
12377    fn from(value: LinkableSynchronousProxy) -> Self {
12378        value.into_channel().into()
12379    }
12380}
12381
12382#[cfg(target_os = "fuchsia")]
12383impl From<fidl::Channel> for LinkableSynchronousProxy {
12384    fn from(value: fidl::Channel) -> Self {
12385        Self::new(value)
12386    }
12387}
12388
12389#[cfg(target_os = "fuchsia")]
12390impl fidl::endpoints::FromClient for LinkableSynchronousProxy {
12391    type Protocol = LinkableMarker;
12392
12393    fn from_client(value: fidl::endpoints::ClientEnd<LinkableMarker>) -> Self {
12394        Self::new(value.into_channel())
12395    }
12396}
12397
12398#[derive(Debug, Clone)]
12399pub struct LinkableProxy {
12400    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
12401}
12402
12403impl fidl::endpoints::Proxy for LinkableProxy {
12404    type Protocol = LinkableMarker;
12405
12406    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
12407        Self::new(inner)
12408    }
12409
12410    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
12411        self.client.into_channel().map_err(|client| Self { client })
12412    }
12413
12414    fn as_channel(&self) -> &::fidl::AsyncChannel {
12415        self.client.as_channel()
12416    }
12417}
12418
12419impl LinkableProxy {
12420    /// Create a new Proxy for fuchsia.io/Linkable.
12421    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
12422        let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12423        Self { client: fidl::client::Client::new(channel, protocol_name) }
12424    }
12425
12426    /// Get a Stream of events from the remote end of the protocol.
12427    ///
12428    /// # Panics
12429    ///
12430    /// Panics if the event stream was already taken.
12431    pub fn take_event_stream(&self) -> LinkableEventStream {
12432        LinkableEventStream { event_receiver: self.client.take_event_receiver() }
12433    }
12434
12435    /// Creates a link to this this object with name `dst` in the directory represented by
12436    /// `dst_parent_token`.
12437    ///
12438    /// `dst` must be a resolved object name. Including "/" in the string will return
12439    /// `ZX_ERR_INVALID_ARGS`.
12440    ///
12441    /// This method requires the maximal set of rights supported by the filesystem for this object.
12442    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12443    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12444    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12445    /// `ZX_ERR_ACCESS_DENIED`.
12446    ///
12447    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12448    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12449    ///
12450    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12451    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12452    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12453    ///
12454    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12455    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12456    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12457    pub fn r#link_into(
12458        &self,
12459        mut dst_parent_token: fidl::Event,
12460        mut dst: &str,
12461    ) -> fidl::client::QueryResponseFut<
12462        LinkableLinkIntoResult,
12463        fidl::encoding::DefaultFuchsiaResourceDialect,
12464    > {
12465        LinkableProxyInterface::r#link_into(self, dst_parent_token, dst)
12466    }
12467}
12468
12469impl LinkableProxyInterface for LinkableProxy {
12470    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
12471        LinkableLinkIntoResult,
12472        fidl::encoding::DefaultFuchsiaResourceDialect,
12473    >;
12474    fn r#link_into(
12475        &self,
12476        mut dst_parent_token: fidl::Event,
12477        mut dst: &str,
12478    ) -> Self::LinkIntoResponseFut {
12479        fn _decode(
12480            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
12481        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12482            let _response = fidl::client::decode_transaction_body::<
12483                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12484                fidl::encoding::DefaultFuchsiaResourceDialect,
12485                0x54f3949246a03e74,
12486            >(_buf?)?;
12487            Ok(_response.map(|x| x))
12488        }
12489        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
12490            (dst_parent_token, dst),
12491            0x54f3949246a03e74,
12492            fidl::encoding::DynamicFlags::empty(),
12493            _decode,
12494        )
12495    }
12496}
12497
12498pub struct LinkableEventStream {
12499    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
12500}
12501
12502impl std::marker::Unpin for LinkableEventStream {}
12503
12504impl futures::stream::FusedStream for LinkableEventStream {
12505    fn is_terminated(&self) -> bool {
12506        self.event_receiver.is_terminated()
12507    }
12508}
12509
12510impl futures::Stream for LinkableEventStream {
12511    type Item = Result<LinkableEvent, fidl::Error>;
12512
12513    fn poll_next(
12514        mut self: std::pin::Pin<&mut Self>,
12515        cx: &mut std::task::Context<'_>,
12516    ) -> std::task::Poll<Option<Self::Item>> {
12517        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
12518            &mut self.event_receiver,
12519            cx
12520        )?) {
12521            Some(buf) => std::task::Poll::Ready(Some(LinkableEvent::decode(buf))),
12522            None => std::task::Poll::Ready(None),
12523        }
12524    }
12525}
12526
12527#[derive(Debug)]
12528pub enum LinkableEvent {}
12529
12530impl LinkableEvent {
12531    /// Decodes a message buffer as a [`LinkableEvent`].
12532    fn decode(
12533        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
12534    ) -> Result<LinkableEvent, fidl::Error> {
12535        let (bytes, _handles) = buf.split_mut();
12536        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12537        debug_assert_eq!(tx_header.tx_id, 0);
12538        match tx_header.ordinal {
12539            _ => Err(fidl::Error::UnknownOrdinal {
12540                ordinal: tx_header.ordinal,
12541                protocol_name: <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12542            }),
12543        }
12544    }
12545}
12546
12547/// A Stream of incoming requests for fuchsia.io/Linkable.
12548pub struct LinkableRequestStream {
12549    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12550    is_terminated: bool,
12551}
12552
12553impl std::marker::Unpin for LinkableRequestStream {}
12554
12555impl futures::stream::FusedStream for LinkableRequestStream {
12556    fn is_terminated(&self) -> bool {
12557        self.is_terminated
12558    }
12559}
12560
12561impl fidl::endpoints::RequestStream for LinkableRequestStream {
12562    type Protocol = LinkableMarker;
12563    type ControlHandle = LinkableControlHandle;
12564
12565    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
12566        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
12567    }
12568
12569    fn control_handle(&self) -> Self::ControlHandle {
12570        LinkableControlHandle { inner: self.inner.clone() }
12571    }
12572
12573    fn into_inner(
12574        self,
12575    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
12576    {
12577        (self.inner, self.is_terminated)
12578    }
12579
12580    fn from_inner(
12581        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12582        is_terminated: bool,
12583    ) -> Self {
12584        Self { inner, is_terminated }
12585    }
12586}
12587
12588impl futures::Stream for LinkableRequestStream {
12589    type Item = Result<LinkableRequest, fidl::Error>;
12590
12591    fn poll_next(
12592        mut self: std::pin::Pin<&mut Self>,
12593        cx: &mut std::task::Context<'_>,
12594    ) -> std::task::Poll<Option<Self::Item>> {
12595        let this = &mut *self;
12596        if this.inner.check_shutdown(cx) {
12597            this.is_terminated = true;
12598            return std::task::Poll::Ready(None);
12599        }
12600        if this.is_terminated {
12601            panic!("polled LinkableRequestStream after completion");
12602        }
12603        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
12604            |bytes, handles| {
12605                match this.inner.channel().read_etc(cx, bytes, handles) {
12606                    std::task::Poll::Ready(Ok(())) => {}
12607                    std::task::Poll::Pending => return std::task::Poll::Pending,
12608                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
12609                        this.is_terminated = true;
12610                        return std::task::Poll::Ready(None);
12611                    }
12612                    std::task::Poll::Ready(Err(e)) => {
12613                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
12614                            e.into(),
12615                        ))));
12616                    }
12617                }
12618
12619                // A message has been received from the channel
12620                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12621
12622                std::task::Poll::Ready(Some(match header.ordinal {
12623                    0x54f3949246a03e74 => {
12624                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12625                        let mut req = fidl::new_empty!(
12626                            LinkableLinkIntoRequest,
12627                            fidl::encoding::DefaultFuchsiaResourceDialect
12628                        );
12629                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
12630                        let control_handle = LinkableControlHandle { inner: this.inner.clone() };
12631                        Ok(LinkableRequest::LinkInto {
12632                            dst_parent_token: req.dst_parent_token,
12633                            dst: req.dst,
12634
12635                            responder: LinkableLinkIntoResponder {
12636                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12637                                tx_id: header.tx_id,
12638                            },
12639                        })
12640                    }
12641                    _ => Err(fidl::Error::UnknownOrdinal {
12642                        ordinal: header.ordinal,
12643                        protocol_name:
12644                            <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12645                    }),
12646                }))
12647            },
12648        )
12649    }
12650}
12651
12652#[derive(Debug)]
12653pub enum LinkableRequest {
12654    /// Creates a link to this this object with name `dst` in the directory represented by
12655    /// `dst_parent_token`.
12656    ///
12657    /// `dst` must be a resolved object name. Including "/" in the string will return
12658    /// `ZX_ERR_INVALID_ARGS`.
12659    ///
12660    /// This method requires the maximal set of rights supported by the filesystem for this object.
12661    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12662    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12663    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12664    /// `ZX_ERR_ACCESS_DENIED`.
12665    ///
12666    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12667    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12668    ///
12669    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12670    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12671    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12672    ///
12673    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12674    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12675    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12676    LinkInto { dst_parent_token: fidl::Event, dst: String, responder: LinkableLinkIntoResponder },
12677}
12678
12679impl LinkableRequest {
12680    #[allow(irrefutable_let_patterns)]
12681    pub fn into_link_into(self) -> Option<(fidl::Event, String, LinkableLinkIntoResponder)> {
12682        if let LinkableRequest::LinkInto { dst_parent_token, dst, responder } = self {
12683            Some((dst_parent_token, dst, responder))
12684        } else {
12685            None
12686        }
12687    }
12688
12689    /// Name of the method defined in FIDL
12690    pub fn method_name(&self) -> &'static str {
12691        match *self {
12692            LinkableRequest::LinkInto { .. } => "link_into",
12693        }
12694    }
12695}
12696
12697#[derive(Debug, Clone)]
12698pub struct LinkableControlHandle {
12699    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12700}
12701
12702impl fidl::endpoints::ControlHandle for LinkableControlHandle {
12703    fn shutdown(&self) {
12704        self.inner.shutdown()
12705    }
12706
12707    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
12708        self.inner.shutdown_with_epitaph(status)
12709    }
12710
12711    fn is_closed(&self) -> bool {
12712        self.inner.channel().is_closed()
12713    }
12714    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
12715        self.inner.channel().on_closed()
12716    }
12717
12718    #[cfg(target_os = "fuchsia")]
12719    fn signal_peer(
12720        &self,
12721        clear_mask: zx::Signals,
12722        set_mask: zx::Signals,
12723    ) -> Result<(), zx_status::Status> {
12724        use fidl::Peered;
12725        self.inner.channel().signal_peer(clear_mask, set_mask)
12726    }
12727}
12728
12729impl LinkableControlHandle {}
12730
12731#[must_use = "FIDL methods require a response to be sent"]
12732#[derive(Debug)]
12733pub struct LinkableLinkIntoResponder {
12734    control_handle: std::mem::ManuallyDrop<LinkableControlHandle>,
12735    tx_id: u32,
12736}
12737
12738/// Set the the channel to be shutdown (see [`LinkableControlHandle::shutdown`])
12739/// if the responder is dropped without sending a response, so that the client
12740/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12741impl std::ops::Drop for LinkableLinkIntoResponder {
12742    fn drop(&mut self) {
12743        self.control_handle.shutdown();
12744        // Safety: drops once, never accessed again
12745        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12746    }
12747}
12748
12749impl fidl::endpoints::Responder for LinkableLinkIntoResponder {
12750    type ControlHandle = LinkableControlHandle;
12751
12752    fn control_handle(&self) -> &LinkableControlHandle {
12753        &self.control_handle
12754    }
12755
12756    fn drop_without_shutdown(mut self) {
12757        // Safety: drops once, never accessed again due to mem::forget
12758        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12759        // Prevent Drop from running (which would shut down the channel)
12760        std::mem::forget(self);
12761    }
12762}
12763
12764impl LinkableLinkIntoResponder {
12765    /// Sends a response to the FIDL transaction.
12766    ///
12767    /// Sets the channel to shutdown if an error occurs.
12768    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12769        let _result = self.send_raw(result);
12770        if _result.is_err() {
12771            self.control_handle.shutdown();
12772        }
12773        self.drop_without_shutdown();
12774        _result
12775    }
12776
12777    /// Similar to "send" but does not shutdown the channel if an error occurs.
12778    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12779        let _result = self.send_raw(result);
12780        self.drop_without_shutdown();
12781        _result
12782    }
12783
12784    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12785        self.control_handle
12786            .inner
12787            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12788                result,
12789                self.tx_id,
12790                0x54f3949246a03e74,
12791                fidl::encoding::DynamicFlags::empty(),
12792            )
12793    }
12794}
12795
12796#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12797pub struct NodeMarker;
12798
12799impl fidl::endpoints::ProtocolMarker for NodeMarker {
12800    type Proxy = NodeProxy;
12801    type RequestStream = NodeRequestStream;
12802    #[cfg(target_os = "fuchsia")]
12803    type SynchronousProxy = NodeSynchronousProxy;
12804
12805    const DEBUG_NAME: &'static str = "fuchsia.io.Node";
12806}
12807impl fidl::endpoints::DiscoverableProtocolMarker for NodeMarker {}
12808pub type NodeGetFlagsResult = Result<Flags, i32>;
12809pub type NodeSetFlagsResult = Result<(), i32>;
12810pub type NodeGetAttributesResult = Result<(MutableNodeAttributes, ImmutableNodeAttributes), i32>;
12811pub type NodeUpdateAttributesResult = Result<(), i32>;
12812pub type NodeSyncResult = Result<(), i32>;
12813pub type NodeGetExtendedAttributeResult = Result<ExtendedAttributeValue, i32>;
12814pub type NodeSetExtendedAttributeResult = Result<(), i32>;
12815pub type NodeRemoveExtendedAttributeResult = Result<(), i32>;
12816
12817pub trait NodeProxyInterface: Send + Sync {
12818    fn r#clone(
12819        &self,
12820        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12821    ) -> Result<(), fidl::Error>;
12822    type CloseResponseFut: std::future::Future<
12823            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
12824        > + Send;
12825    fn r#close(&self) -> Self::CloseResponseFut;
12826    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
12827    fn r#query(&self) -> Self::QueryResponseFut;
12828    fn r#deprecated_clone(
12829        &self,
12830        flags: OpenFlags,
12831        object: fidl::endpoints::ServerEnd<NodeMarker>,
12832    ) -> Result<(), fidl::Error>;
12833    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
12834        + Send;
12835    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
12836    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
12837    fn r#deprecated_set_attr(
12838        &self,
12839        flags: NodeAttributeFlags,
12840        attributes: &NodeAttributes,
12841    ) -> Self::DeprecatedSetAttrResponseFut;
12842    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
12843        + Send;
12844    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
12845    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
12846        + Send;
12847    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
12848    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
12849        + Send;
12850    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
12851    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
12852        + Send;
12853    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
12854    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
12855        + Send;
12856    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
12857    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
12858        + Send;
12859    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
12860    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
12861        + Send;
12862    fn r#update_attributes(
12863        &self,
12864        payload: &MutableNodeAttributes,
12865    ) -> Self::UpdateAttributesResponseFut;
12866    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
12867    fn r#sync(&self) -> Self::SyncResponseFut;
12868    fn r#list_extended_attributes(
12869        &self,
12870        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
12871    ) -> Result<(), fidl::Error>;
12872    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
12873        + Send;
12874    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
12875    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
12876        + Send;
12877    fn r#set_extended_attribute(
12878        &self,
12879        name: &[u8],
12880        value: ExtendedAttributeValue,
12881        mode: SetExtendedAttributeMode,
12882    ) -> Self::SetExtendedAttributeResponseFut;
12883    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
12884        + Send;
12885    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
12886}
12887#[derive(Debug)]
12888#[cfg(target_os = "fuchsia")]
12889pub struct NodeSynchronousProxy {
12890    client: fidl::client::sync::Client,
12891}
12892
12893#[cfg(target_os = "fuchsia")]
12894impl fidl::endpoints::SynchronousProxy for NodeSynchronousProxy {
12895    type Proxy = NodeProxy;
12896    type Protocol = NodeMarker;
12897
12898    fn from_channel(inner: fidl::Channel) -> Self {
12899        Self::new(inner)
12900    }
12901
12902    fn into_channel(self) -> fidl::Channel {
12903        self.client.into_channel()
12904    }
12905
12906    fn as_channel(&self) -> &fidl::Channel {
12907        self.client.as_channel()
12908    }
12909}
12910
12911#[cfg(target_os = "fuchsia")]
12912impl NodeSynchronousProxy {
12913    pub fn new(channel: fidl::Channel) -> Self {
12914        let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12915        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
12916    }
12917
12918    pub fn into_channel(self) -> fidl::Channel {
12919        self.client.into_channel()
12920    }
12921
12922    /// Waits until an event arrives and returns it. It is safe for other
12923    /// threads to make concurrent requests while waiting for an event.
12924    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<NodeEvent, fidl::Error> {
12925        NodeEvent::decode(self.client.wait_for_event(deadline)?)
12926    }
12927
12928    pub fn r#clone(
12929        &self,
12930        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12931    ) -> Result<(), fidl::Error> {
12932        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
12933            (request,),
12934            0x20d8a7aba2168a79,
12935            fidl::encoding::DynamicFlags::empty(),
12936        )
12937    }
12938
12939    /// Terminates the connection.
12940    ///
12941    /// After calling `Close`, the client must not send any other requests.
12942    ///
12943    /// Servers, after sending the status response, should close the connection
12944    /// regardless of status and without sending an epitaph.
12945    ///
12946    /// Closing the client end of the channel should be semantically equivalent
12947    /// to calling `Close` without knowing when the close has completed or its
12948    /// status.
12949    pub fn r#close(
12950        &self,
12951        ___deadline: zx::MonotonicInstant,
12952    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
12953        let _response = self.client.send_query::<
12954            fidl::encoding::EmptyPayload,
12955            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12956        >(
12957            (),
12958            0x5ac5d459ad7f657e,
12959            fidl::encoding::DynamicFlags::empty(),
12960            ___deadline,
12961        )?;
12962        Ok(_response.map(|x| x))
12963    }
12964
12965    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
12966        let _response = self.client.send_query::<
12967            fidl::encoding::EmptyPayload,
12968            fidl_fuchsia_unknown::QueryableQueryResponse,
12969        >(
12970            (),
12971            0x2658edee9decfc06,
12972            fidl::encoding::DynamicFlags::empty(),
12973            ___deadline,
12974        )?;
12975        Ok(_response.protocol)
12976    }
12977
12978    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
12979    pub fn r#deprecated_clone(
12980        &self,
12981        mut flags: OpenFlags,
12982        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
12983    ) -> Result<(), fidl::Error> {
12984        self.client.send::<NodeDeprecatedCloneRequest>(
12985            (flags, object),
12986            0x5a61678f293ce16f,
12987            fidl::encoding::DynamicFlags::FLEXIBLE,
12988        )
12989    }
12990
12991    /// DEPRECATED - Use `Node.GetAttributes` instead.
12992    pub fn r#deprecated_get_attr(
12993        &self,
12994        ___deadline: zx::MonotonicInstant,
12995    ) -> Result<(i32, NodeAttributes), fidl::Error> {
12996        let _response =
12997            self.client.send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse>(
12998                (),
12999                0x78985e216314dafd,
13000                fidl::encoding::DynamicFlags::empty(),
13001                ___deadline,
13002            )?;
13003        Ok((_response.s, _response.attributes))
13004    }
13005
13006    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
13007    pub fn r#deprecated_set_attr(
13008        &self,
13009        mut flags: NodeAttributeFlags,
13010        mut attributes: &NodeAttributes,
13011        ___deadline: zx::MonotonicInstant,
13012    ) -> Result<i32, fidl::Error> {
13013        let _response =
13014            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
13015                (flags, attributes),
13016                0x4186c0f40d938f46,
13017                fidl::encoding::DynamicFlags::empty(),
13018                ___deadline,
13019            )?;
13020        Ok(_response.s)
13021    }
13022
13023    /// [DEPRECATED - Use new GetFlags method instead.]
13024    pub fn r#deprecated_get_flags(
13025        &self,
13026        ___deadline: zx::MonotonicInstant,
13027    ) -> Result<(i32, OpenFlags), fidl::Error> {
13028        let _response = self
13029            .client
13030            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
13031                (),
13032                0x5b88fffb8eda3aa1,
13033                fidl::encoding::DynamicFlags::empty(),
13034                ___deadline,
13035            )?;
13036        Ok((_response.s, _response.flags))
13037    }
13038
13039    /// [DEPRECATED - Use new SetFlags method instead.]
13040    pub fn r#deprecated_set_flags(
13041        &self,
13042        mut flags: OpenFlags,
13043        ___deadline: zx::MonotonicInstant,
13044    ) -> Result<i32, fidl::Error> {
13045        let _response = self
13046            .client
13047            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
13048                (flags,),
13049                0x5295b76c71fde733,
13050                fidl::encoding::DynamicFlags::empty(),
13051                ___deadline,
13052            )?;
13053        Ok(_response.s)
13054    }
13055
13056    /// Queries the flags that apply to this node after it has been opened/created. This method does
13057    /// not require any rights.
13058    ///
13059    /// Note that the final set of flags that apply to the connection may differ from those
13060    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13061    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13062    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13063    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13064    pub fn r#get_flags(
13065        &self,
13066        ___deadline: zx::MonotonicInstant,
13067    ) -> Result<NodeGetFlagsResult, fidl::Error> {
13068        let _response = self.client.send_query::<
13069            fidl::encoding::EmptyPayload,
13070            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
13071        >(
13072            (),
13073            0x176eb318f64ec23,
13074            fidl::encoding::DynamicFlags::FLEXIBLE,
13075            ___deadline,
13076        )?
13077        .into_result::<NodeMarker>("get_flags")?;
13078        Ok(_response.map(|x| x.flags))
13079    }
13080
13081    /// Sets the flags that apply to this node after it has been opened. This method does not
13082    /// require any rights.
13083    ///
13084    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13085    /// clear append mode.
13086    ///
13087    /// Errors:
13088    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13089    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13090    pub fn r#set_flags(
13091        &self,
13092        mut flags: Flags,
13093        ___deadline: zx::MonotonicInstant,
13094    ) -> Result<NodeSetFlagsResult, fidl::Error> {
13095        let _response = self.client.send_query::<
13096            NodeSetFlagsRequest,
13097            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
13098        >(
13099            (flags,),
13100            0x55a8028685791ea8,
13101            fidl::encoding::DynamicFlags::FLEXIBLE,
13102            ___deadline,
13103        )?
13104        .into_result::<NodeMarker>("set_flags")?;
13105        Ok(_response.map(|x| x))
13106    }
13107
13108    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
13109    /// volume has different settings or the storage is accounted seperately from the rest of the
13110    /// filesystem that may be reported instead of filesystem-wide details.
13111    pub fn r#query_filesystem(
13112        &self,
13113        ___deadline: zx::MonotonicInstant,
13114    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
13115        let _response =
13116            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
13117                (),
13118                0x6f344a1c6b0a0610,
13119                fidl::encoding::DynamicFlags::empty(),
13120                ___deadline,
13121            )?;
13122        Ok((_response.s, _response.info))
13123    }
13124
13125    /// Acquires information about the node.
13126    ///
13127    /// The attributes of a node should be stable, independent of the
13128    /// specific protocol used to access it.
13129    ///
13130    /// If a particular attribute is not applicable or not supported,
13131    /// filesystems should leave the corresponding field absent.
13132    ///
13133    /// + `query` a bit-mask specifying which attributes to fetch. The server
13134    ///   should not return more than necessary.
13135    /// - `attributes` the returned attributes.
13136    ///
13137    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13138    pub fn r#get_attributes(
13139        &self,
13140        mut query: NodeAttributesQuery,
13141        ___deadline: zx::MonotonicInstant,
13142    ) -> Result<NodeGetAttributesResult, fidl::Error> {
13143        let _response = self.client.send_query::<
13144            NodeGetAttributesRequest,
13145            fidl::encoding::ResultType<NodeAttributes2, i32>,
13146        >(
13147            (query,),
13148            0x3d4396a638ea053b,
13149            fidl::encoding::DynamicFlags::empty(),
13150            ___deadline,
13151        )?;
13152        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
13153    }
13154
13155    /// Updates information about the node.
13156    ///
13157    /// + `attributes` the presence of a table field in `attributes` indicates
13158    /// the intent to update the corresponding attribute.
13159    ///
13160    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13161    ///
13162    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13163    pub fn r#update_attributes(
13164        &self,
13165        mut payload: &MutableNodeAttributes,
13166        ___deadline: zx::MonotonicInstant,
13167    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
13168        let _response = self.client.send_query::<
13169            MutableNodeAttributes,
13170            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13171        >(
13172            payload,
13173            0x3308c1da5a89bf08,
13174            fidl::encoding::DynamicFlags::empty(),
13175            ___deadline,
13176        )?;
13177        Ok(_response.map(|x| x))
13178    }
13179
13180    /// Synchronizes updates to the node to the underlying media, if it exists.
13181    ///
13182    /// This method will return when the filesystem server has flushed the
13183    /// relevant updates to the underlying media, but does not guarantee the
13184    /// underlying media has persisted the information, nor that any information
13185    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13186    /// between operations.
13187    ///
13188    /// This method does not require any rights.
13189    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
13190        let _response = self.client.send_query::<
13191            fidl::encoding::EmptyPayload,
13192            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13193        >(
13194            (),
13195            0x2c5c27ca0ab5dc49,
13196            fidl::encoding::DynamicFlags::empty(),
13197            ___deadline,
13198        )?;
13199        Ok(_response.map(|x| x))
13200    }
13201
13202    /// Creates an iterator over all the extended attribute names associated
13203    /// with this node. If an error occurs it is returned as an epitaph on the
13204    /// iterator request channel, and then the channel is closed.
13205    ///
13206    /// GetExtendedAttributes can be used with any of these names to retrieve
13207    /// the associated value.
13208    ///
13209    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13210    pub fn r#list_extended_attributes(
13211        &self,
13212        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13213    ) -> Result<(), fidl::Error> {
13214        self.client.send::<NodeListExtendedAttributesRequest>(
13215            (iterator,),
13216            0x4b61033de007fcd0,
13217            fidl::encoding::DynamicFlags::empty(),
13218        )
13219    }
13220
13221    /// Get the value associated with the given attribute `name` for this node.
13222    ///
13223    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13224    /// particular structure is imposed on them.
13225    ///
13226    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13227    pub fn r#get_extended_attribute(
13228        &self,
13229        mut name: &[u8],
13230        ___deadline: zx::MonotonicInstant,
13231    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
13232        let _response = self.client.send_query::<
13233            NodeGetExtendedAttributeRequest,
13234            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
13235        >(
13236            (name,),
13237            0x45ffa3ccfdeb76db,
13238            fidl::encoding::DynamicFlags::empty(),
13239            ___deadline,
13240        )?;
13241        Ok(_response.map(|x| x))
13242    }
13243
13244    /// Set the value for the given attribute `name` to `value` for this node.
13245    ///
13246    /// The attribute name may exist, in which case the attribute is updated.
13247    /// If the attribute doesn't exist, it is created. The name should have no
13248    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13249    ///
13250    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13251    pub fn r#set_extended_attribute(
13252        &self,
13253        mut name: &[u8],
13254        mut value: ExtendedAttributeValue,
13255        mut mode: SetExtendedAttributeMode,
13256        ___deadline: zx::MonotonicInstant,
13257    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
13258        let _response = self.client.send_query::<
13259            NodeSetExtendedAttributeRequest,
13260            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13261        >(
13262            (name, &mut value, mode,),
13263            0x4a951362f681f23c,
13264            fidl::encoding::DynamicFlags::empty(),
13265            ___deadline,
13266        )?;
13267        Ok(_response.map(|x| x))
13268    }
13269
13270    /// Remove the specified extended attribute.
13271    ///
13272    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13273    ///
13274    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13275    pub fn r#remove_extended_attribute(
13276        &self,
13277        mut name: &[u8],
13278        ___deadline: zx::MonotonicInstant,
13279    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
13280        let _response = self.client.send_query::<
13281            NodeRemoveExtendedAttributeRequest,
13282            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13283        >(
13284            (name,),
13285            0x7a0b9f3a9bf9032d,
13286            fidl::encoding::DynamicFlags::empty(),
13287            ___deadline,
13288        )?;
13289        Ok(_response.map(|x| x))
13290    }
13291}
13292
13293#[cfg(target_os = "fuchsia")]
13294impl From<NodeSynchronousProxy> for zx::NullableHandle {
13295    fn from(value: NodeSynchronousProxy) -> Self {
13296        value.into_channel().into()
13297    }
13298}
13299
13300#[cfg(target_os = "fuchsia")]
13301impl From<fidl::Channel> for NodeSynchronousProxy {
13302    fn from(value: fidl::Channel) -> Self {
13303        Self::new(value)
13304    }
13305}
13306
13307#[cfg(target_os = "fuchsia")]
13308impl fidl::endpoints::FromClient for NodeSynchronousProxy {
13309    type Protocol = NodeMarker;
13310
13311    fn from_client(value: fidl::endpoints::ClientEnd<NodeMarker>) -> Self {
13312        Self::new(value.into_channel())
13313    }
13314}
13315
13316#[derive(Debug, Clone)]
13317pub struct NodeProxy {
13318    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
13319}
13320
13321impl fidl::endpoints::Proxy for NodeProxy {
13322    type Protocol = NodeMarker;
13323
13324    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
13325        Self::new(inner)
13326    }
13327
13328    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
13329        self.client.into_channel().map_err(|client| Self { client })
13330    }
13331
13332    fn as_channel(&self) -> &::fidl::AsyncChannel {
13333        self.client.as_channel()
13334    }
13335}
13336
13337impl NodeProxy {
13338    /// Create a new Proxy for fuchsia.io/Node.
13339    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
13340        let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
13341        Self { client: fidl::client::Client::new(channel, protocol_name) }
13342    }
13343
13344    /// Get a Stream of events from the remote end of the protocol.
13345    ///
13346    /// # Panics
13347    ///
13348    /// Panics if the event stream was already taken.
13349    pub fn take_event_stream(&self) -> NodeEventStream {
13350        NodeEventStream { event_receiver: self.client.take_event_receiver() }
13351    }
13352
13353    pub fn r#clone(
13354        &self,
13355        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13356    ) -> Result<(), fidl::Error> {
13357        NodeProxyInterface::r#clone(self, request)
13358    }
13359
13360    /// Terminates the connection.
13361    ///
13362    /// After calling `Close`, the client must not send any other requests.
13363    ///
13364    /// Servers, after sending the status response, should close the connection
13365    /// regardless of status and without sending an epitaph.
13366    ///
13367    /// Closing the client end of the channel should be semantically equivalent
13368    /// to calling `Close` without knowing when the close has completed or its
13369    /// status.
13370    pub fn r#close(
13371        &self,
13372    ) -> fidl::client::QueryResponseFut<
13373        fidl_fuchsia_unknown::CloseableCloseResult,
13374        fidl::encoding::DefaultFuchsiaResourceDialect,
13375    > {
13376        NodeProxyInterface::r#close(self)
13377    }
13378
13379    pub fn r#query(
13380        &self,
13381    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
13382    {
13383        NodeProxyInterface::r#query(self)
13384    }
13385
13386    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
13387    pub fn r#deprecated_clone(
13388        &self,
13389        mut flags: OpenFlags,
13390        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13391    ) -> Result<(), fidl::Error> {
13392        NodeProxyInterface::r#deprecated_clone(self, flags, object)
13393    }
13394
13395    /// DEPRECATED - Use `Node.GetAttributes` instead.
13396    pub fn r#deprecated_get_attr(
13397        &self,
13398    ) -> fidl::client::QueryResponseFut<
13399        (i32, NodeAttributes),
13400        fidl::encoding::DefaultFuchsiaResourceDialect,
13401    > {
13402        NodeProxyInterface::r#deprecated_get_attr(self)
13403    }
13404
13405    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
13406    pub fn r#deprecated_set_attr(
13407        &self,
13408        mut flags: NodeAttributeFlags,
13409        mut attributes: &NodeAttributes,
13410    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13411        NodeProxyInterface::r#deprecated_set_attr(self, flags, attributes)
13412    }
13413
13414    /// [DEPRECATED - Use new GetFlags method instead.]
13415    pub fn r#deprecated_get_flags(
13416        &self,
13417    ) -> fidl::client::QueryResponseFut<
13418        (i32, OpenFlags),
13419        fidl::encoding::DefaultFuchsiaResourceDialect,
13420    > {
13421        NodeProxyInterface::r#deprecated_get_flags(self)
13422    }
13423
13424    /// [DEPRECATED - Use new SetFlags method instead.]
13425    pub fn r#deprecated_set_flags(
13426        &self,
13427        mut flags: OpenFlags,
13428    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13429        NodeProxyInterface::r#deprecated_set_flags(self, flags)
13430    }
13431
13432    /// Queries the flags that apply to this node after it has been opened/created. This method does
13433    /// not require any rights.
13434    ///
13435    /// Note that the final set of flags that apply to the connection may differ from those
13436    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13437    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13438    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13439    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13440    pub fn r#get_flags(
13441        &self,
13442    ) -> fidl::client::QueryResponseFut<
13443        NodeGetFlagsResult,
13444        fidl::encoding::DefaultFuchsiaResourceDialect,
13445    > {
13446        NodeProxyInterface::r#get_flags(self)
13447    }
13448
13449    /// Sets the flags that apply to this node after it has been opened. This method does not
13450    /// require any rights.
13451    ///
13452    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13453    /// clear append mode.
13454    ///
13455    /// Errors:
13456    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13457    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13458    pub fn r#set_flags(
13459        &self,
13460        mut flags: Flags,
13461    ) -> fidl::client::QueryResponseFut<
13462        NodeSetFlagsResult,
13463        fidl::encoding::DefaultFuchsiaResourceDialect,
13464    > {
13465        NodeProxyInterface::r#set_flags(self, flags)
13466    }
13467
13468    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
13469    /// volume has different settings or the storage is accounted seperately from the rest of the
13470    /// filesystem that may be reported instead of filesystem-wide details.
13471    pub fn r#query_filesystem(
13472        &self,
13473    ) -> fidl::client::QueryResponseFut<
13474        (i32, Option<Box<FilesystemInfo>>),
13475        fidl::encoding::DefaultFuchsiaResourceDialect,
13476    > {
13477        NodeProxyInterface::r#query_filesystem(self)
13478    }
13479
13480    /// Acquires information about the node.
13481    ///
13482    /// The attributes of a node should be stable, independent of the
13483    /// specific protocol used to access it.
13484    ///
13485    /// If a particular attribute is not applicable or not supported,
13486    /// filesystems should leave the corresponding field absent.
13487    ///
13488    /// + `query` a bit-mask specifying which attributes to fetch. The server
13489    ///   should not return more than necessary.
13490    /// - `attributes` the returned attributes.
13491    ///
13492    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13493    pub fn r#get_attributes(
13494        &self,
13495        mut query: NodeAttributesQuery,
13496    ) -> fidl::client::QueryResponseFut<
13497        NodeGetAttributesResult,
13498        fidl::encoding::DefaultFuchsiaResourceDialect,
13499    > {
13500        NodeProxyInterface::r#get_attributes(self, query)
13501    }
13502
13503    /// Updates information about the node.
13504    ///
13505    /// + `attributes` the presence of a table field in `attributes` indicates
13506    /// the intent to update the corresponding attribute.
13507    ///
13508    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13509    ///
13510    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13511    pub fn r#update_attributes(
13512        &self,
13513        mut payload: &MutableNodeAttributes,
13514    ) -> fidl::client::QueryResponseFut<
13515        NodeUpdateAttributesResult,
13516        fidl::encoding::DefaultFuchsiaResourceDialect,
13517    > {
13518        NodeProxyInterface::r#update_attributes(self, payload)
13519    }
13520
13521    /// Synchronizes updates to the node to the underlying media, if it exists.
13522    ///
13523    /// This method will return when the filesystem server has flushed the
13524    /// relevant updates to the underlying media, but does not guarantee the
13525    /// underlying media has persisted the information, nor that any information
13526    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13527    /// between operations.
13528    ///
13529    /// This method does not require any rights.
13530    pub fn r#sync(
13531        &self,
13532    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
13533    {
13534        NodeProxyInterface::r#sync(self)
13535    }
13536
13537    /// Creates an iterator over all the extended attribute names associated
13538    /// with this node. If an error occurs it is returned as an epitaph on the
13539    /// iterator request channel, and then the channel is closed.
13540    ///
13541    /// GetExtendedAttributes can be used with any of these names to retrieve
13542    /// the associated value.
13543    ///
13544    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13545    pub fn r#list_extended_attributes(
13546        &self,
13547        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13548    ) -> Result<(), fidl::Error> {
13549        NodeProxyInterface::r#list_extended_attributes(self, iterator)
13550    }
13551
13552    /// Get the value associated with the given attribute `name` for this node.
13553    ///
13554    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13555    /// particular structure is imposed on them.
13556    ///
13557    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13558    pub fn r#get_extended_attribute(
13559        &self,
13560        mut name: &[u8],
13561    ) -> fidl::client::QueryResponseFut<
13562        NodeGetExtendedAttributeResult,
13563        fidl::encoding::DefaultFuchsiaResourceDialect,
13564    > {
13565        NodeProxyInterface::r#get_extended_attribute(self, name)
13566    }
13567
13568    /// Set the value for the given attribute `name` to `value` for this node.
13569    ///
13570    /// The attribute name may exist, in which case the attribute is updated.
13571    /// If the attribute doesn't exist, it is created. The name should have no
13572    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13573    ///
13574    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13575    pub fn r#set_extended_attribute(
13576        &self,
13577        mut name: &[u8],
13578        mut value: ExtendedAttributeValue,
13579        mut mode: SetExtendedAttributeMode,
13580    ) -> fidl::client::QueryResponseFut<
13581        NodeSetExtendedAttributeResult,
13582        fidl::encoding::DefaultFuchsiaResourceDialect,
13583    > {
13584        NodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
13585    }
13586
13587    /// Remove the specified extended attribute.
13588    ///
13589    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13590    ///
13591    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13592    pub fn r#remove_extended_attribute(
13593        &self,
13594        mut name: &[u8],
13595    ) -> fidl::client::QueryResponseFut<
13596        NodeRemoveExtendedAttributeResult,
13597        fidl::encoding::DefaultFuchsiaResourceDialect,
13598    > {
13599        NodeProxyInterface::r#remove_extended_attribute(self, name)
13600    }
13601}
13602
13603impl NodeProxyInterface for NodeProxy {
13604    fn r#clone(
13605        &self,
13606        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13607    ) -> Result<(), fidl::Error> {
13608        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
13609            (request,),
13610            0x20d8a7aba2168a79,
13611            fidl::encoding::DynamicFlags::empty(),
13612        )
13613    }
13614
13615    type CloseResponseFut = fidl::client::QueryResponseFut<
13616        fidl_fuchsia_unknown::CloseableCloseResult,
13617        fidl::encoding::DefaultFuchsiaResourceDialect,
13618    >;
13619    fn r#close(&self) -> Self::CloseResponseFut {
13620        fn _decode(
13621            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13622        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
13623            let _response = fidl::client::decode_transaction_body::<
13624                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13625                fidl::encoding::DefaultFuchsiaResourceDialect,
13626                0x5ac5d459ad7f657e,
13627            >(_buf?)?;
13628            Ok(_response.map(|x| x))
13629        }
13630        self.client.send_query_and_decode::<
13631            fidl::encoding::EmptyPayload,
13632            fidl_fuchsia_unknown::CloseableCloseResult,
13633        >(
13634            (),
13635            0x5ac5d459ad7f657e,
13636            fidl::encoding::DynamicFlags::empty(),
13637            _decode,
13638        )
13639    }
13640
13641    type QueryResponseFut =
13642        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
13643    fn r#query(&self) -> Self::QueryResponseFut {
13644        fn _decode(
13645            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13646        ) -> Result<Vec<u8>, fidl::Error> {
13647            let _response = fidl::client::decode_transaction_body::<
13648                fidl_fuchsia_unknown::QueryableQueryResponse,
13649                fidl::encoding::DefaultFuchsiaResourceDialect,
13650                0x2658edee9decfc06,
13651            >(_buf?)?;
13652            Ok(_response.protocol)
13653        }
13654        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
13655            (),
13656            0x2658edee9decfc06,
13657            fidl::encoding::DynamicFlags::empty(),
13658            _decode,
13659        )
13660    }
13661
13662    fn r#deprecated_clone(
13663        &self,
13664        mut flags: OpenFlags,
13665        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13666    ) -> Result<(), fidl::Error> {
13667        self.client.send::<NodeDeprecatedCloneRequest>(
13668            (flags, object),
13669            0x5a61678f293ce16f,
13670            fidl::encoding::DynamicFlags::FLEXIBLE,
13671        )
13672    }
13673
13674    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
13675        (i32, NodeAttributes),
13676        fidl::encoding::DefaultFuchsiaResourceDialect,
13677    >;
13678    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
13679        fn _decode(
13680            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13681        ) -> Result<(i32, NodeAttributes), fidl::Error> {
13682            let _response = fidl::client::decode_transaction_body::<
13683                NodeDeprecatedGetAttrResponse,
13684                fidl::encoding::DefaultFuchsiaResourceDialect,
13685                0x78985e216314dafd,
13686            >(_buf?)?;
13687            Ok((_response.s, _response.attributes))
13688        }
13689        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
13690            (),
13691            0x78985e216314dafd,
13692            fidl::encoding::DynamicFlags::empty(),
13693            _decode,
13694        )
13695    }
13696
13697    type DeprecatedSetAttrResponseFut =
13698        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
13699    fn r#deprecated_set_attr(
13700        &self,
13701        mut flags: NodeAttributeFlags,
13702        mut attributes: &NodeAttributes,
13703    ) -> Self::DeprecatedSetAttrResponseFut {
13704        fn _decode(
13705            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13706        ) -> Result<i32, fidl::Error> {
13707            let _response = fidl::client::decode_transaction_body::<
13708                NodeDeprecatedSetAttrResponse,
13709                fidl::encoding::DefaultFuchsiaResourceDialect,
13710                0x4186c0f40d938f46,
13711            >(_buf?)?;
13712            Ok(_response.s)
13713        }
13714        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
13715            (flags, attributes),
13716            0x4186c0f40d938f46,
13717            fidl::encoding::DynamicFlags::empty(),
13718            _decode,
13719        )
13720    }
13721
13722    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
13723        (i32, OpenFlags),
13724        fidl::encoding::DefaultFuchsiaResourceDialect,
13725    >;
13726    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
13727        fn _decode(
13728            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13729        ) -> Result<(i32, OpenFlags), fidl::Error> {
13730            let _response = fidl::client::decode_transaction_body::<
13731                NodeDeprecatedGetFlagsResponse,
13732                fidl::encoding::DefaultFuchsiaResourceDialect,
13733                0x5b88fffb8eda3aa1,
13734            >(_buf?)?;
13735            Ok((_response.s, _response.flags))
13736        }
13737        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
13738            (),
13739            0x5b88fffb8eda3aa1,
13740            fidl::encoding::DynamicFlags::empty(),
13741            _decode,
13742        )
13743    }
13744
13745    type DeprecatedSetFlagsResponseFut =
13746        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
13747    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
13748        fn _decode(
13749            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13750        ) -> Result<i32, fidl::Error> {
13751            let _response = fidl::client::decode_transaction_body::<
13752                NodeDeprecatedSetFlagsResponse,
13753                fidl::encoding::DefaultFuchsiaResourceDialect,
13754                0x5295b76c71fde733,
13755            >(_buf?)?;
13756            Ok(_response.s)
13757        }
13758        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
13759            (flags,),
13760            0x5295b76c71fde733,
13761            fidl::encoding::DynamicFlags::empty(),
13762            _decode,
13763        )
13764    }
13765
13766    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
13767        NodeGetFlagsResult,
13768        fidl::encoding::DefaultFuchsiaResourceDialect,
13769    >;
13770    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
13771        fn _decode(
13772            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13773        ) -> Result<NodeGetFlagsResult, fidl::Error> {
13774            let _response = fidl::client::decode_transaction_body::<
13775                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
13776                fidl::encoding::DefaultFuchsiaResourceDialect,
13777                0x176eb318f64ec23,
13778            >(_buf?)?
13779            .into_result::<NodeMarker>("get_flags")?;
13780            Ok(_response.map(|x| x.flags))
13781        }
13782        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
13783            (),
13784            0x176eb318f64ec23,
13785            fidl::encoding::DynamicFlags::FLEXIBLE,
13786            _decode,
13787        )
13788    }
13789
13790    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
13791        NodeSetFlagsResult,
13792        fidl::encoding::DefaultFuchsiaResourceDialect,
13793    >;
13794    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
13795        fn _decode(
13796            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13797        ) -> Result<NodeSetFlagsResult, fidl::Error> {
13798            let _response = fidl::client::decode_transaction_body::<
13799                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
13800                fidl::encoding::DefaultFuchsiaResourceDialect,
13801                0x55a8028685791ea8,
13802            >(_buf?)?
13803            .into_result::<NodeMarker>("set_flags")?;
13804            Ok(_response.map(|x| x))
13805        }
13806        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
13807            (flags,),
13808            0x55a8028685791ea8,
13809            fidl::encoding::DynamicFlags::FLEXIBLE,
13810            _decode,
13811        )
13812    }
13813
13814    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
13815        (i32, Option<Box<FilesystemInfo>>),
13816        fidl::encoding::DefaultFuchsiaResourceDialect,
13817    >;
13818    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
13819        fn _decode(
13820            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13821        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
13822            let _response = fidl::client::decode_transaction_body::<
13823                NodeQueryFilesystemResponse,
13824                fidl::encoding::DefaultFuchsiaResourceDialect,
13825                0x6f344a1c6b0a0610,
13826            >(_buf?)?;
13827            Ok((_response.s, _response.info))
13828        }
13829        self.client.send_query_and_decode::<
13830            fidl::encoding::EmptyPayload,
13831            (i32, Option<Box<FilesystemInfo>>),
13832        >(
13833            (),
13834            0x6f344a1c6b0a0610,
13835            fidl::encoding::DynamicFlags::empty(),
13836            _decode,
13837        )
13838    }
13839
13840    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
13841        NodeGetAttributesResult,
13842        fidl::encoding::DefaultFuchsiaResourceDialect,
13843    >;
13844    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
13845        fn _decode(
13846            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13847        ) -> Result<NodeGetAttributesResult, fidl::Error> {
13848            let _response = fidl::client::decode_transaction_body::<
13849                fidl::encoding::ResultType<NodeAttributes2, i32>,
13850                fidl::encoding::DefaultFuchsiaResourceDialect,
13851                0x3d4396a638ea053b,
13852            >(_buf?)?;
13853            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
13854        }
13855        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
13856            (query,),
13857            0x3d4396a638ea053b,
13858            fidl::encoding::DynamicFlags::empty(),
13859            _decode,
13860        )
13861    }
13862
13863    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
13864        NodeUpdateAttributesResult,
13865        fidl::encoding::DefaultFuchsiaResourceDialect,
13866    >;
13867    fn r#update_attributes(
13868        &self,
13869        mut payload: &MutableNodeAttributes,
13870    ) -> Self::UpdateAttributesResponseFut {
13871        fn _decode(
13872            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13873        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
13874            let _response = fidl::client::decode_transaction_body::<
13875                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13876                fidl::encoding::DefaultFuchsiaResourceDialect,
13877                0x3308c1da5a89bf08,
13878            >(_buf?)?;
13879            Ok(_response.map(|x| x))
13880        }
13881        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
13882            payload,
13883            0x3308c1da5a89bf08,
13884            fidl::encoding::DynamicFlags::empty(),
13885            _decode,
13886        )
13887    }
13888
13889    type SyncResponseFut = fidl::client::QueryResponseFut<
13890        NodeSyncResult,
13891        fidl::encoding::DefaultFuchsiaResourceDialect,
13892    >;
13893    fn r#sync(&self) -> Self::SyncResponseFut {
13894        fn _decode(
13895            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13896        ) -> Result<NodeSyncResult, fidl::Error> {
13897            let _response = fidl::client::decode_transaction_body::<
13898                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13899                fidl::encoding::DefaultFuchsiaResourceDialect,
13900                0x2c5c27ca0ab5dc49,
13901            >(_buf?)?;
13902            Ok(_response.map(|x| x))
13903        }
13904        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
13905            (),
13906            0x2c5c27ca0ab5dc49,
13907            fidl::encoding::DynamicFlags::empty(),
13908            _decode,
13909        )
13910    }
13911
13912    fn r#list_extended_attributes(
13913        &self,
13914        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13915    ) -> Result<(), fidl::Error> {
13916        self.client.send::<NodeListExtendedAttributesRequest>(
13917            (iterator,),
13918            0x4b61033de007fcd0,
13919            fidl::encoding::DynamicFlags::empty(),
13920        )
13921    }
13922
13923    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
13924        NodeGetExtendedAttributeResult,
13925        fidl::encoding::DefaultFuchsiaResourceDialect,
13926    >;
13927    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
13928        fn _decode(
13929            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13930        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
13931            let _response = fidl::client::decode_transaction_body::<
13932                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
13933                fidl::encoding::DefaultFuchsiaResourceDialect,
13934                0x45ffa3ccfdeb76db,
13935            >(_buf?)?;
13936            Ok(_response.map(|x| x))
13937        }
13938        self.client.send_query_and_decode::<
13939            NodeGetExtendedAttributeRequest,
13940            NodeGetExtendedAttributeResult,
13941        >(
13942            (name,),
13943            0x45ffa3ccfdeb76db,
13944            fidl::encoding::DynamicFlags::empty(),
13945            _decode,
13946        )
13947    }
13948
13949    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
13950        NodeSetExtendedAttributeResult,
13951        fidl::encoding::DefaultFuchsiaResourceDialect,
13952    >;
13953    fn r#set_extended_attribute(
13954        &self,
13955        mut name: &[u8],
13956        mut value: ExtendedAttributeValue,
13957        mut mode: SetExtendedAttributeMode,
13958    ) -> Self::SetExtendedAttributeResponseFut {
13959        fn _decode(
13960            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13961        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
13962            let _response = fidl::client::decode_transaction_body::<
13963                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13964                fidl::encoding::DefaultFuchsiaResourceDialect,
13965                0x4a951362f681f23c,
13966            >(_buf?)?;
13967            Ok(_response.map(|x| x))
13968        }
13969        self.client.send_query_and_decode::<
13970            NodeSetExtendedAttributeRequest,
13971            NodeSetExtendedAttributeResult,
13972        >(
13973            (name, &mut value, mode,),
13974            0x4a951362f681f23c,
13975            fidl::encoding::DynamicFlags::empty(),
13976            _decode,
13977        )
13978    }
13979
13980    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
13981        NodeRemoveExtendedAttributeResult,
13982        fidl::encoding::DefaultFuchsiaResourceDialect,
13983    >;
13984    fn r#remove_extended_attribute(
13985        &self,
13986        mut name: &[u8],
13987    ) -> Self::RemoveExtendedAttributeResponseFut {
13988        fn _decode(
13989            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13990        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
13991            let _response = fidl::client::decode_transaction_body::<
13992                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13993                fidl::encoding::DefaultFuchsiaResourceDialect,
13994                0x7a0b9f3a9bf9032d,
13995            >(_buf?)?;
13996            Ok(_response.map(|x| x))
13997        }
13998        self.client.send_query_and_decode::<
13999            NodeRemoveExtendedAttributeRequest,
14000            NodeRemoveExtendedAttributeResult,
14001        >(
14002            (name,),
14003            0x7a0b9f3a9bf9032d,
14004            fidl::encoding::DynamicFlags::empty(),
14005            _decode,
14006        )
14007    }
14008}
14009
14010pub struct NodeEventStream {
14011    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
14012}
14013
14014impl std::marker::Unpin for NodeEventStream {}
14015
14016impl futures::stream::FusedStream for NodeEventStream {
14017    fn is_terminated(&self) -> bool {
14018        self.event_receiver.is_terminated()
14019    }
14020}
14021
14022impl futures::Stream for NodeEventStream {
14023    type Item = Result<NodeEvent, fidl::Error>;
14024
14025    fn poll_next(
14026        mut self: std::pin::Pin<&mut Self>,
14027        cx: &mut std::task::Context<'_>,
14028    ) -> std::task::Poll<Option<Self::Item>> {
14029        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
14030            &mut self.event_receiver,
14031            cx
14032        )?) {
14033            Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
14034            None => std::task::Poll::Ready(None),
14035        }
14036    }
14037}
14038
14039#[derive(Debug)]
14040pub enum NodeEvent {
14041    OnOpen_ {
14042        s: i32,
14043        info: Option<Box<NodeInfoDeprecated>>,
14044    },
14045    OnRepresentation {
14046        payload: Representation,
14047    },
14048    #[non_exhaustive]
14049    _UnknownEvent {
14050        /// Ordinal of the event that was sent.
14051        ordinal: u64,
14052    },
14053}
14054
14055impl NodeEvent {
14056    #[allow(irrefutable_let_patterns)]
14057    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
14058        if let NodeEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
14059    }
14060    #[allow(irrefutable_let_patterns)]
14061    pub fn into_on_representation(self) -> Option<Representation> {
14062        if let NodeEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
14063    }
14064
14065    /// Decodes a message buffer as a [`NodeEvent`].
14066    fn decode(
14067        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
14068    ) -> Result<NodeEvent, fidl::Error> {
14069        let (bytes, _handles) = buf.split_mut();
14070        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14071        debug_assert_eq!(tx_header.tx_id, 0);
14072        match tx_header.ordinal {
14073            0x7fc7bbb1dbfd1972 => {
14074                let mut out = fidl::new_empty!(
14075                    NodeOnOpenRequest,
14076                    fidl::encoding::DefaultFuchsiaResourceDialect
14077                );
14078                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
14079                Ok((NodeEvent::OnOpen_ { s: out.s, info: out.info }))
14080            }
14081            0x5cb40567d80a510c => {
14082                let mut out =
14083                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
14084                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
14085                Ok((NodeEvent::OnRepresentation { payload: out }))
14086            }
14087            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
14088                Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
14089            }
14090            _ => Err(fidl::Error::UnknownOrdinal {
14091                ordinal: tx_header.ordinal,
14092                protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14093            }),
14094        }
14095    }
14096}
14097
14098/// A Stream of incoming requests for fuchsia.io/Node.
14099pub struct NodeRequestStream {
14100    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14101    is_terminated: bool,
14102}
14103
14104impl std::marker::Unpin for NodeRequestStream {}
14105
14106impl futures::stream::FusedStream for NodeRequestStream {
14107    fn is_terminated(&self) -> bool {
14108        self.is_terminated
14109    }
14110}
14111
14112impl fidl::endpoints::RequestStream for NodeRequestStream {
14113    type Protocol = NodeMarker;
14114    type ControlHandle = NodeControlHandle;
14115
14116    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
14117        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
14118    }
14119
14120    fn control_handle(&self) -> Self::ControlHandle {
14121        NodeControlHandle { inner: self.inner.clone() }
14122    }
14123
14124    fn into_inner(
14125        self,
14126    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
14127    {
14128        (self.inner, self.is_terminated)
14129    }
14130
14131    fn from_inner(
14132        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14133        is_terminated: bool,
14134    ) -> Self {
14135        Self { inner, is_terminated }
14136    }
14137}
14138
14139impl futures::Stream for NodeRequestStream {
14140    type Item = Result<NodeRequest, fidl::Error>;
14141
14142    fn poll_next(
14143        mut self: std::pin::Pin<&mut Self>,
14144        cx: &mut std::task::Context<'_>,
14145    ) -> std::task::Poll<Option<Self::Item>> {
14146        let this = &mut *self;
14147        if this.inner.check_shutdown(cx) {
14148            this.is_terminated = true;
14149            return std::task::Poll::Ready(None);
14150        }
14151        if this.is_terminated {
14152            panic!("polled NodeRequestStream after completion");
14153        }
14154        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
14155            |bytes, handles| {
14156                match this.inner.channel().read_etc(cx, bytes, handles) {
14157                    std::task::Poll::Ready(Ok(())) => {}
14158                    std::task::Poll::Pending => return std::task::Poll::Pending,
14159                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
14160                        this.is_terminated = true;
14161                        return std::task::Poll::Ready(None);
14162                    }
14163                    std::task::Poll::Ready(Err(e)) => {
14164                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
14165                            e.into(),
14166                        ))));
14167                    }
14168                }
14169
14170                // A message has been received from the channel
14171                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14172
14173                std::task::Poll::Ready(Some(match header.ordinal {
14174                    0x20d8a7aba2168a79 => {
14175                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14176                        let mut req = fidl::new_empty!(
14177                            fidl_fuchsia_unknown::CloneableCloneRequest,
14178                            fidl::encoding::DefaultFuchsiaResourceDialect
14179                        );
14180                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14181                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14182                        Ok(NodeRequest::Clone { request: req.request, control_handle })
14183                    }
14184                    0x5ac5d459ad7f657e => {
14185                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14186                        let mut req = fidl::new_empty!(
14187                            fidl::encoding::EmptyPayload,
14188                            fidl::encoding::DefaultFuchsiaResourceDialect
14189                        );
14190                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14191                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14192                        Ok(NodeRequest::Close {
14193                            responder: NodeCloseResponder {
14194                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14195                                tx_id: header.tx_id,
14196                            },
14197                        })
14198                    }
14199                    0x2658edee9decfc06 => {
14200                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14201                        let mut req = fidl::new_empty!(
14202                            fidl::encoding::EmptyPayload,
14203                            fidl::encoding::DefaultFuchsiaResourceDialect
14204                        );
14205                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14206                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14207                        Ok(NodeRequest::Query {
14208                            responder: NodeQueryResponder {
14209                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14210                                tx_id: header.tx_id,
14211                            },
14212                        })
14213                    }
14214                    0x5a61678f293ce16f => {
14215                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14216                        let mut req = fidl::new_empty!(
14217                            NodeDeprecatedCloneRequest,
14218                            fidl::encoding::DefaultFuchsiaResourceDialect
14219                        );
14220                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14221                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14222                        Ok(NodeRequest::DeprecatedClone {
14223                            flags: req.flags,
14224                            object: req.object,
14225
14226                            control_handle,
14227                        })
14228                    }
14229                    0x78985e216314dafd => {
14230                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14231                        let mut req = fidl::new_empty!(
14232                            fidl::encoding::EmptyPayload,
14233                            fidl::encoding::DefaultFuchsiaResourceDialect
14234                        );
14235                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14236                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14237                        Ok(NodeRequest::DeprecatedGetAttr {
14238                            responder: NodeDeprecatedGetAttrResponder {
14239                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14240                                tx_id: header.tx_id,
14241                            },
14242                        })
14243                    }
14244                    0x4186c0f40d938f46 => {
14245                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14246                        let mut req = fidl::new_empty!(
14247                            NodeDeprecatedSetAttrRequest,
14248                            fidl::encoding::DefaultFuchsiaResourceDialect
14249                        );
14250                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
14251                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14252                        Ok(NodeRequest::DeprecatedSetAttr {
14253                            flags: req.flags,
14254                            attributes: req.attributes,
14255
14256                            responder: NodeDeprecatedSetAttrResponder {
14257                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14258                                tx_id: header.tx_id,
14259                            },
14260                        })
14261                    }
14262                    0x5b88fffb8eda3aa1 => {
14263                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14264                        let mut req = fidl::new_empty!(
14265                            fidl::encoding::EmptyPayload,
14266                            fidl::encoding::DefaultFuchsiaResourceDialect
14267                        );
14268                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14269                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14270                        Ok(NodeRequest::DeprecatedGetFlags {
14271                            responder: NodeDeprecatedGetFlagsResponder {
14272                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14273                                tx_id: header.tx_id,
14274                            },
14275                        })
14276                    }
14277                    0x5295b76c71fde733 => {
14278                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14279                        let mut req = fidl::new_empty!(
14280                            NodeDeprecatedSetFlagsRequest,
14281                            fidl::encoding::DefaultFuchsiaResourceDialect
14282                        );
14283                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14284                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14285                        Ok(NodeRequest::DeprecatedSetFlags {
14286                            flags: req.flags,
14287
14288                            responder: NodeDeprecatedSetFlagsResponder {
14289                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14290                                tx_id: header.tx_id,
14291                            },
14292                        })
14293                    }
14294                    0x176eb318f64ec23 => {
14295                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14296                        let mut req = fidl::new_empty!(
14297                            fidl::encoding::EmptyPayload,
14298                            fidl::encoding::DefaultFuchsiaResourceDialect
14299                        );
14300                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14301                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14302                        Ok(NodeRequest::GetFlags {
14303                            responder: NodeGetFlagsResponder {
14304                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14305                                tx_id: header.tx_id,
14306                            },
14307                        })
14308                    }
14309                    0x55a8028685791ea8 => {
14310                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14311                        let mut req = fidl::new_empty!(
14312                            NodeSetFlagsRequest,
14313                            fidl::encoding::DefaultFuchsiaResourceDialect
14314                        );
14315                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14316                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14317                        Ok(NodeRequest::SetFlags {
14318                            flags: req.flags,
14319
14320                            responder: NodeSetFlagsResponder {
14321                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14322                                tx_id: header.tx_id,
14323                            },
14324                        })
14325                    }
14326                    0x6f344a1c6b0a0610 => {
14327                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14328                        let mut req = fidl::new_empty!(
14329                            fidl::encoding::EmptyPayload,
14330                            fidl::encoding::DefaultFuchsiaResourceDialect
14331                        );
14332                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14333                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14334                        Ok(NodeRequest::QueryFilesystem {
14335                            responder: NodeQueryFilesystemResponder {
14336                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14337                                tx_id: header.tx_id,
14338                            },
14339                        })
14340                    }
14341                    0x3d4396a638ea053b => {
14342                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14343                        let mut req = fidl::new_empty!(
14344                            NodeGetAttributesRequest,
14345                            fidl::encoding::DefaultFuchsiaResourceDialect
14346                        );
14347                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14348                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14349                        Ok(NodeRequest::GetAttributes {
14350                            query: req.query,
14351
14352                            responder: NodeGetAttributesResponder {
14353                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14354                                tx_id: header.tx_id,
14355                            },
14356                        })
14357                    }
14358                    0x3308c1da5a89bf08 => {
14359                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14360                        let mut req = fidl::new_empty!(
14361                            MutableNodeAttributes,
14362                            fidl::encoding::DefaultFuchsiaResourceDialect
14363                        );
14364                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
14365                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14366                        Ok(NodeRequest::UpdateAttributes {
14367                            payload: req,
14368                            responder: NodeUpdateAttributesResponder {
14369                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14370                                tx_id: header.tx_id,
14371                            },
14372                        })
14373                    }
14374                    0x2c5c27ca0ab5dc49 => {
14375                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14376                        let mut req = fidl::new_empty!(
14377                            fidl::encoding::EmptyPayload,
14378                            fidl::encoding::DefaultFuchsiaResourceDialect
14379                        );
14380                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14381                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14382                        Ok(NodeRequest::Sync {
14383                            responder: NodeSyncResponder {
14384                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14385                                tx_id: header.tx_id,
14386                            },
14387                        })
14388                    }
14389                    0x4b61033de007fcd0 => {
14390                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14391                        let mut req = fidl::new_empty!(
14392                            NodeListExtendedAttributesRequest,
14393                            fidl::encoding::DefaultFuchsiaResourceDialect
14394                        );
14395                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14396                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14397                        Ok(NodeRequest::ListExtendedAttributes {
14398                            iterator: req.iterator,
14399
14400                            control_handle,
14401                        })
14402                    }
14403                    0x45ffa3ccfdeb76db => {
14404                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14405                        let mut req = fidl::new_empty!(
14406                            NodeGetExtendedAttributeRequest,
14407                            fidl::encoding::DefaultFuchsiaResourceDialect
14408                        );
14409                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14410                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14411                        Ok(NodeRequest::GetExtendedAttribute {
14412                            name: req.name,
14413
14414                            responder: NodeGetExtendedAttributeResponder {
14415                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14416                                tx_id: header.tx_id,
14417                            },
14418                        })
14419                    }
14420                    0x4a951362f681f23c => {
14421                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14422                        let mut req = fidl::new_empty!(
14423                            NodeSetExtendedAttributeRequest,
14424                            fidl::encoding::DefaultFuchsiaResourceDialect
14425                        );
14426                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14427                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14428                        Ok(NodeRequest::SetExtendedAttribute {
14429                            name: req.name,
14430                            value: req.value,
14431                            mode: req.mode,
14432
14433                            responder: NodeSetExtendedAttributeResponder {
14434                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14435                                tx_id: header.tx_id,
14436                            },
14437                        })
14438                    }
14439                    0x7a0b9f3a9bf9032d => {
14440                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14441                        let mut req = fidl::new_empty!(
14442                            NodeRemoveExtendedAttributeRequest,
14443                            fidl::encoding::DefaultFuchsiaResourceDialect
14444                        );
14445                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14446                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14447                        Ok(NodeRequest::RemoveExtendedAttribute {
14448                            name: req.name,
14449
14450                            responder: NodeRemoveExtendedAttributeResponder {
14451                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14452                                tx_id: header.tx_id,
14453                            },
14454                        })
14455                    }
14456                    _ if header.tx_id == 0
14457                        && header
14458                            .dynamic_flags()
14459                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14460                    {
14461                        Ok(NodeRequest::_UnknownMethod {
14462                            ordinal: header.ordinal,
14463                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14464                            method_type: fidl::MethodType::OneWay,
14465                        })
14466                    }
14467                    _ if header
14468                        .dynamic_flags()
14469                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14470                    {
14471                        this.inner.send_framework_err(
14472                            fidl::encoding::FrameworkErr::UnknownMethod,
14473                            header.tx_id,
14474                            header.ordinal,
14475                            header.dynamic_flags(),
14476                            (bytes, handles),
14477                        )?;
14478                        Ok(NodeRequest::_UnknownMethod {
14479                            ordinal: header.ordinal,
14480                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14481                            method_type: fidl::MethodType::TwoWay,
14482                        })
14483                    }
14484                    _ => Err(fidl::Error::UnknownOrdinal {
14485                        ordinal: header.ordinal,
14486                        protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14487                    }),
14488                }))
14489            },
14490        )
14491    }
14492}
14493
14494/// Node defines the minimal interface for entities which can be accessed in a filesystem.
14495#[derive(Debug)]
14496pub enum NodeRequest {
14497    Clone {
14498        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
14499        control_handle: NodeControlHandle,
14500    },
14501    /// Terminates the connection.
14502    ///
14503    /// After calling `Close`, the client must not send any other requests.
14504    ///
14505    /// Servers, after sending the status response, should close the connection
14506    /// regardless of status and without sending an epitaph.
14507    ///
14508    /// Closing the client end of the channel should be semantically equivalent
14509    /// to calling `Close` without knowing when the close has completed or its
14510    /// status.
14511    Close {
14512        responder: NodeCloseResponder,
14513    },
14514    Query {
14515        responder: NodeQueryResponder,
14516    },
14517    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
14518    DeprecatedClone {
14519        flags: OpenFlags,
14520        object: fidl::endpoints::ServerEnd<NodeMarker>,
14521        control_handle: NodeControlHandle,
14522    },
14523    /// DEPRECATED - Use `Node.GetAttributes` instead.
14524    DeprecatedGetAttr {
14525        responder: NodeDeprecatedGetAttrResponder,
14526    },
14527    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
14528    DeprecatedSetAttr {
14529        flags: NodeAttributeFlags,
14530        attributes: NodeAttributes,
14531        responder: NodeDeprecatedSetAttrResponder,
14532    },
14533    /// [DEPRECATED - Use new GetFlags method instead.]
14534    DeprecatedGetFlags {
14535        responder: NodeDeprecatedGetFlagsResponder,
14536    },
14537    /// [DEPRECATED - Use new SetFlags method instead.]
14538    DeprecatedSetFlags {
14539        flags: OpenFlags,
14540        responder: NodeDeprecatedSetFlagsResponder,
14541    },
14542    /// Queries the flags that apply to this node after it has been opened/created. This method does
14543    /// not require any rights.
14544    ///
14545    /// Note that the final set of flags that apply to the connection may differ from those
14546    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
14547    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
14548    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
14549    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
14550    GetFlags {
14551        responder: NodeGetFlagsResponder,
14552    },
14553    /// Sets the flags that apply to this node after it has been opened. This method does not
14554    /// require any rights.
14555    ///
14556    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
14557    /// clear append mode.
14558    ///
14559    /// Errors:
14560    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
14561    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
14562    SetFlags {
14563        flags: Flags,
14564        responder: NodeSetFlagsResponder,
14565    },
14566    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
14567    /// volume has different settings or the storage is accounted seperately from the rest of the
14568    /// filesystem that may be reported instead of filesystem-wide details.
14569    QueryFilesystem {
14570        responder: NodeQueryFilesystemResponder,
14571    },
14572    /// Acquires information about the node.
14573    ///
14574    /// The attributes of a node should be stable, independent of the
14575    /// specific protocol used to access it.
14576    ///
14577    /// If a particular attribute is not applicable or not supported,
14578    /// filesystems should leave the corresponding field absent.
14579    ///
14580    /// + `query` a bit-mask specifying which attributes to fetch. The server
14581    ///   should not return more than necessary.
14582    /// - `attributes` the returned attributes.
14583    ///
14584    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14585    GetAttributes {
14586        query: NodeAttributesQuery,
14587        responder: NodeGetAttributesResponder,
14588    },
14589    /// Updates information about the node.
14590    ///
14591    /// + `attributes` the presence of a table field in `attributes` indicates
14592    /// the intent to update the corresponding attribute.
14593    ///
14594    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
14595    ///
14596    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14597    UpdateAttributes {
14598        payload: MutableNodeAttributes,
14599        responder: NodeUpdateAttributesResponder,
14600    },
14601    /// Synchronizes updates to the node to the underlying media, if it exists.
14602    ///
14603    /// This method will return when the filesystem server has flushed the
14604    /// relevant updates to the underlying media, but does not guarantee the
14605    /// underlying media has persisted the information, nor that any information
14606    /// is committed to hardware. Clients may use `Sync` to ensure ordering
14607    /// between operations.
14608    ///
14609    /// This method does not require any rights.
14610    Sync {
14611        responder: NodeSyncResponder,
14612    },
14613    /// Creates an iterator over all the extended attribute names associated
14614    /// with this node. If an error occurs it is returned as an epitaph on the
14615    /// iterator request channel, and then the channel is closed.
14616    ///
14617    /// GetExtendedAttributes can be used with any of these names to retrieve
14618    /// the associated value.
14619    ///
14620    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14621    ListExtendedAttributes {
14622        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
14623        control_handle: NodeControlHandle,
14624    },
14625    /// Get the value associated with the given attribute `name` for this node.
14626    ///
14627    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
14628    /// particular structure is imposed on them.
14629    ///
14630    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14631    GetExtendedAttribute {
14632        name: Vec<u8>,
14633        responder: NodeGetExtendedAttributeResponder,
14634    },
14635    /// Set the value for the given attribute `name` to `value` for this node.
14636    ///
14637    /// The attribute name may exist, in which case the attribute is updated.
14638    /// If the attribute doesn't exist, it is created. The name should have no
14639    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
14640    ///
14641    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14642    SetExtendedAttribute {
14643        name: Vec<u8>,
14644        value: ExtendedAttributeValue,
14645        mode: SetExtendedAttributeMode,
14646        responder: NodeSetExtendedAttributeResponder,
14647    },
14648    /// Remove the specified extended attribute.
14649    ///
14650    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
14651    ///
14652    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14653    RemoveExtendedAttribute {
14654        name: Vec<u8>,
14655        responder: NodeRemoveExtendedAttributeResponder,
14656    },
14657    /// An interaction was received which does not match any known method.
14658    #[non_exhaustive]
14659    _UnknownMethod {
14660        /// Ordinal of the method that was called.
14661        ordinal: u64,
14662        control_handle: NodeControlHandle,
14663        method_type: fidl::MethodType,
14664    },
14665}
14666
14667impl NodeRequest {
14668    #[allow(irrefutable_let_patterns)]
14669    pub fn into_clone(
14670        self,
14671    ) -> Option<(
14672        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
14673        NodeControlHandle,
14674    )> {
14675        if let NodeRequest::Clone { request, control_handle } = self {
14676            Some((request, control_handle))
14677        } else {
14678            None
14679        }
14680    }
14681
14682    #[allow(irrefutable_let_patterns)]
14683    pub fn into_close(self) -> Option<(NodeCloseResponder)> {
14684        if let NodeRequest::Close { responder } = self { Some((responder)) } else { None }
14685    }
14686
14687    #[allow(irrefutable_let_patterns)]
14688    pub fn into_query(self) -> Option<(NodeQueryResponder)> {
14689        if let NodeRequest::Query { responder } = self { Some((responder)) } else { None }
14690    }
14691
14692    #[allow(irrefutable_let_patterns)]
14693    pub fn into_deprecated_clone(
14694        self,
14695    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, NodeControlHandle)> {
14696        if let NodeRequest::DeprecatedClone { flags, object, control_handle } = self {
14697            Some((flags, object, control_handle))
14698        } else {
14699            None
14700        }
14701    }
14702
14703    #[allow(irrefutable_let_patterns)]
14704    pub fn into_deprecated_get_attr(self) -> Option<(NodeDeprecatedGetAttrResponder)> {
14705        if let NodeRequest::DeprecatedGetAttr { responder } = self {
14706            Some((responder))
14707        } else {
14708            None
14709        }
14710    }
14711
14712    #[allow(irrefutable_let_patterns)]
14713    pub fn into_deprecated_set_attr(
14714        self,
14715    ) -> Option<(NodeAttributeFlags, NodeAttributes, NodeDeprecatedSetAttrResponder)> {
14716        if let NodeRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
14717            Some((flags, attributes, responder))
14718        } else {
14719            None
14720        }
14721    }
14722
14723    #[allow(irrefutable_let_patterns)]
14724    pub fn into_deprecated_get_flags(self) -> Option<(NodeDeprecatedGetFlagsResponder)> {
14725        if let NodeRequest::DeprecatedGetFlags { responder } = self {
14726            Some((responder))
14727        } else {
14728            None
14729        }
14730    }
14731
14732    #[allow(irrefutable_let_patterns)]
14733    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, NodeDeprecatedSetFlagsResponder)> {
14734        if let NodeRequest::DeprecatedSetFlags { flags, responder } = self {
14735            Some((flags, responder))
14736        } else {
14737            None
14738        }
14739    }
14740
14741    #[allow(irrefutable_let_patterns)]
14742    pub fn into_get_flags(self) -> Option<(NodeGetFlagsResponder)> {
14743        if let NodeRequest::GetFlags { responder } = self { Some((responder)) } else { None }
14744    }
14745
14746    #[allow(irrefutable_let_patterns)]
14747    pub fn into_set_flags(self) -> Option<(Flags, NodeSetFlagsResponder)> {
14748        if let NodeRequest::SetFlags { flags, responder } = self {
14749            Some((flags, responder))
14750        } else {
14751            None
14752        }
14753    }
14754
14755    #[allow(irrefutable_let_patterns)]
14756    pub fn into_query_filesystem(self) -> Option<(NodeQueryFilesystemResponder)> {
14757        if let NodeRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
14758    }
14759
14760    #[allow(irrefutable_let_patterns)]
14761    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, NodeGetAttributesResponder)> {
14762        if let NodeRequest::GetAttributes { query, responder } = self {
14763            Some((query, responder))
14764        } else {
14765            None
14766        }
14767    }
14768
14769    #[allow(irrefutable_let_patterns)]
14770    pub fn into_update_attributes(
14771        self,
14772    ) -> Option<(MutableNodeAttributes, NodeUpdateAttributesResponder)> {
14773        if let NodeRequest::UpdateAttributes { payload, responder } = self {
14774            Some((payload, responder))
14775        } else {
14776            None
14777        }
14778    }
14779
14780    #[allow(irrefutable_let_patterns)]
14781    pub fn into_sync(self) -> Option<(NodeSyncResponder)> {
14782        if let NodeRequest::Sync { responder } = self { Some((responder)) } else { None }
14783    }
14784
14785    #[allow(irrefutable_let_patterns)]
14786    pub fn into_list_extended_attributes(
14787        self,
14788    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, NodeControlHandle)>
14789    {
14790        if let NodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
14791            Some((iterator, control_handle))
14792        } else {
14793            None
14794        }
14795    }
14796
14797    #[allow(irrefutable_let_patterns)]
14798    pub fn into_get_extended_attribute(
14799        self,
14800    ) -> Option<(Vec<u8>, NodeGetExtendedAttributeResponder)> {
14801        if let NodeRequest::GetExtendedAttribute { name, responder } = self {
14802            Some((name, responder))
14803        } else {
14804            None
14805        }
14806    }
14807
14808    #[allow(irrefutable_let_patterns)]
14809    pub fn into_set_extended_attribute(
14810        self,
14811    ) -> Option<(
14812        Vec<u8>,
14813        ExtendedAttributeValue,
14814        SetExtendedAttributeMode,
14815        NodeSetExtendedAttributeResponder,
14816    )> {
14817        if let NodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
14818            Some((name, value, mode, responder))
14819        } else {
14820            None
14821        }
14822    }
14823
14824    #[allow(irrefutable_let_patterns)]
14825    pub fn into_remove_extended_attribute(
14826        self,
14827    ) -> Option<(Vec<u8>, NodeRemoveExtendedAttributeResponder)> {
14828        if let NodeRequest::RemoveExtendedAttribute { name, responder } = self {
14829            Some((name, responder))
14830        } else {
14831            None
14832        }
14833    }
14834
14835    /// Name of the method defined in FIDL
14836    pub fn method_name(&self) -> &'static str {
14837        match *self {
14838            NodeRequest::Clone { .. } => "clone",
14839            NodeRequest::Close { .. } => "close",
14840            NodeRequest::Query { .. } => "query",
14841            NodeRequest::DeprecatedClone { .. } => "deprecated_clone",
14842            NodeRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
14843            NodeRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
14844            NodeRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
14845            NodeRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
14846            NodeRequest::GetFlags { .. } => "get_flags",
14847            NodeRequest::SetFlags { .. } => "set_flags",
14848            NodeRequest::QueryFilesystem { .. } => "query_filesystem",
14849            NodeRequest::GetAttributes { .. } => "get_attributes",
14850            NodeRequest::UpdateAttributes { .. } => "update_attributes",
14851            NodeRequest::Sync { .. } => "sync",
14852            NodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
14853            NodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
14854            NodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
14855            NodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
14856            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
14857                "unknown one-way method"
14858            }
14859            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
14860                "unknown two-way method"
14861            }
14862        }
14863    }
14864}
14865
14866#[derive(Debug, Clone)]
14867pub struct NodeControlHandle {
14868    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14869}
14870
14871impl fidl::endpoints::ControlHandle for NodeControlHandle {
14872    fn shutdown(&self) {
14873        self.inner.shutdown()
14874    }
14875
14876    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
14877        self.inner.shutdown_with_epitaph(status)
14878    }
14879
14880    fn is_closed(&self) -> bool {
14881        self.inner.channel().is_closed()
14882    }
14883    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
14884        self.inner.channel().on_closed()
14885    }
14886
14887    #[cfg(target_os = "fuchsia")]
14888    fn signal_peer(
14889        &self,
14890        clear_mask: zx::Signals,
14891        set_mask: zx::Signals,
14892    ) -> Result<(), zx_status::Status> {
14893        use fidl::Peered;
14894        self.inner.channel().signal_peer(clear_mask, set_mask)
14895    }
14896}
14897
14898impl NodeControlHandle {
14899    pub fn send_on_open_(
14900        &self,
14901        mut s: i32,
14902        mut info: Option<NodeInfoDeprecated>,
14903    ) -> Result<(), fidl::Error> {
14904        self.inner.send::<NodeOnOpenRequest>(
14905            (s, info.as_mut()),
14906            0,
14907            0x7fc7bbb1dbfd1972,
14908            fidl::encoding::DynamicFlags::FLEXIBLE,
14909        )
14910    }
14911
14912    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
14913        self.inner.send::<Representation>(
14914            &mut payload,
14915            0,
14916            0x5cb40567d80a510c,
14917            fidl::encoding::DynamicFlags::empty(),
14918        )
14919    }
14920}
14921
14922#[must_use = "FIDL methods require a response to be sent"]
14923#[derive(Debug)]
14924pub struct NodeCloseResponder {
14925    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
14926    tx_id: u32,
14927}
14928
14929/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
14930/// if the responder is dropped without sending a response, so that the client
14931/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
14932impl std::ops::Drop for NodeCloseResponder {
14933    fn drop(&mut self) {
14934        self.control_handle.shutdown();
14935        // Safety: drops once, never accessed again
14936        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14937    }
14938}
14939
14940impl fidl::endpoints::Responder for NodeCloseResponder {
14941    type ControlHandle = NodeControlHandle;
14942
14943    fn control_handle(&self) -> &NodeControlHandle {
14944        &self.control_handle
14945    }
14946
14947    fn drop_without_shutdown(mut self) {
14948        // Safety: drops once, never accessed again due to mem::forget
14949        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14950        // Prevent Drop from running (which would shut down the channel)
14951        std::mem::forget(self);
14952    }
14953}
14954
14955impl NodeCloseResponder {
14956    /// Sends a response to the FIDL transaction.
14957    ///
14958    /// Sets the channel to shutdown if an error occurs.
14959    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
14960        let _result = self.send_raw(result);
14961        if _result.is_err() {
14962            self.control_handle.shutdown();
14963        }
14964        self.drop_without_shutdown();
14965        _result
14966    }
14967
14968    /// Similar to "send" but does not shutdown the channel if an error occurs.
14969    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
14970        let _result = self.send_raw(result);
14971        self.drop_without_shutdown();
14972        _result
14973    }
14974
14975    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
14976        self.control_handle
14977            .inner
14978            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
14979                result,
14980                self.tx_id,
14981                0x5ac5d459ad7f657e,
14982                fidl::encoding::DynamicFlags::empty(),
14983            )
14984    }
14985}
14986
14987#[must_use = "FIDL methods require a response to be sent"]
14988#[derive(Debug)]
14989pub struct NodeQueryResponder {
14990    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
14991    tx_id: u32,
14992}
14993
14994/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
14995/// if the responder is dropped without sending a response, so that the client
14996/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
14997impl std::ops::Drop for NodeQueryResponder {
14998    fn drop(&mut self) {
14999        self.control_handle.shutdown();
15000        // Safety: drops once, never accessed again
15001        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15002    }
15003}
15004
15005impl fidl::endpoints::Responder for NodeQueryResponder {
15006    type ControlHandle = NodeControlHandle;
15007
15008    fn control_handle(&self) -> &NodeControlHandle {
15009        &self.control_handle
15010    }
15011
15012    fn drop_without_shutdown(mut self) {
15013        // Safety: drops once, never accessed again due to mem::forget
15014        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15015        // Prevent Drop from running (which would shut down the channel)
15016        std::mem::forget(self);
15017    }
15018}
15019
15020impl NodeQueryResponder {
15021    /// Sends a response to the FIDL transaction.
15022    ///
15023    /// Sets the channel to shutdown if an error occurs.
15024    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15025        let _result = self.send_raw(protocol);
15026        if _result.is_err() {
15027            self.control_handle.shutdown();
15028        }
15029        self.drop_without_shutdown();
15030        _result
15031    }
15032
15033    /// Similar to "send" but does not shutdown the channel if an error occurs.
15034    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15035        let _result = self.send_raw(protocol);
15036        self.drop_without_shutdown();
15037        _result
15038    }
15039
15040    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15041        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
15042            (protocol,),
15043            self.tx_id,
15044            0x2658edee9decfc06,
15045            fidl::encoding::DynamicFlags::empty(),
15046        )
15047    }
15048}
15049
15050#[must_use = "FIDL methods require a response to be sent"]
15051#[derive(Debug)]
15052pub struct NodeDeprecatedGetAttrResponder {
15053    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15054    tx_id: u32,
15055}
15056
15057/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15058/// if the responder is dropped without sending a response, so that the client
15059/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15060impl std::ops::Drop for NodeDeprecatedGetAttrResponder {
15061    fn drop(&mut self) {
15062        self.control_handle.shutdown();
15063        // Safety: drops once, never accessed again
15064        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15065    }
15066}
15067
15068impl fidl::endpoints::Responder for NodeDeprecatedGetAttrResponder {
15069    type ControlHandle = NodeControlHandle;
15070
15071    fn control_handle(&self) -> &NodeControlHandle {
15072        &self.control_handle
15073    }
15074
15075    fn drop_without_shutdown(mut self) {
15076        // Safety: drops once, never accessed again due to mem::forget
15077        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15078        // Prevent Drop from running (which would shut down the channel)
15079        std::mem::forget(self);
15080    }
15081}
15082
15083impl NodeDeprecatedGetAttrResponder {
15084    /// Sends a response to the FIDL transaction.
15085    ///
15086    /// Sets the channel to shutdown if an error occurs.
15087    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15088        let _result = self.send_raw(s, attributes);
15089        if _result.is_err() {
15090            self.control_handle.shutdown();
15091        }
15092        self.drop_without_shutdown();
15093        _result
15094    }
15095
15096    /// Similar to "send" but does not shutdown the channel if an error occurs.
15097    pub fn send_no_shutdown_on_err(
15098        self,
15099        mut s: i32,
15100        mut attributes: &NodeAttributes,
15101    ) -> Result<(), fidl::Error> {
15102        let _result = self.send_raw(s, attributes);
15103        self.drop_without_shutdown();
15104        _result
15105    }
15106
15107    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15108        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
15109            (s, attributes),
15110            self.tx_id,
15111            0x78985e216314dafd,
15112            fidl::encoding::DynamicFlags::empty(),
15113        )
15114    }
15115}
15116
15117#[must_use = "FIDL methods require a response to be sent"]
15118#[derive(Debug)]
15119pub struct NodeDeprecatedSetAttrResponder {
15120    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15121    tx_id: u32,
15122}
15123
15124/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15125/// if the responder is dropped without sending a response, so that the client
15126/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15127impl std::ops::Drop for NodeDeprecatedSetAttrResponder {
15128    fn drop(&mut self) {
15129        self.control_handle.shutdown();
15130        // Safety: drops once, never accessed again
15131        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15132    }
15133}
15134
15135impl fidl::endpoints::Responder for NodeDeprecatedSetAttrResponder {
15136    type ControlHandle = NodeControlHandle;
15137
15138    fn control_handle(&self) -> &NodeControlHandle {
15139        &self.control_handle
15140    }
15141
15142    fn drop_without_shutdown(mut self) {
15143        // Safety: drops once, never accessed again due to mem::forget
15144        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15145        // Prevent Drop from running (which would shut down the channel)
15146        std::mem::forget(self);
15147    }
15148}
15149
15150impl NodeDeprecatedSetAttrResponder {
15151    /// Sends a response to the FIDL transaction.
15152    ///
15153    /// Sets the channel to shutdown if an error occurs.
15154    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15155        let _result = self.send_raw(s);
15156        if _result.is_err() {
15157            self.control_handle.shutdown();
15158        }
15159        self.drop_without_shutdown();
15160        _result
15161    }
15162
15163    /// Similar to "send" but does not shutdown the channel if an error occurs.
15164    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15165        let _result = self.send_raw(s);
15166        self.drop_without_shutdown();
15167        _result
15168    }
15169
15170    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15171        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
15172            (s,),
15173            self.tx_id,
15174            0x4186c0f40d938f46,
15175            fidl::encoding::DynamicFlags::empty(),
15176        )
15177    }
15178}
15179
15180#[must_use = "FIDL methods require a response to be sent"]
15181#[derive(Debug)]
15182pub struct NodeDeprecatedGetFlagsResponder {
15183    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15184    tx_id: u32,
15185}
15186
15187/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15188/// if the responder is dropped without sending a response, so that the client
15189/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15190impl std::ops::Drop for NodeDeprecatedGetFlagsResponder {
15191    fn drop(&mut self) {
15192        self.control_handle.shutdown();
15193        // Safety: drops once, never accessed again
15194        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15195    }
15196}
15197
15198impl fidl::endpoints::Responder for NodeDeprecatedGetFlagsResponder {
15199    type ControlHandle = NodeControlHandle;
15200
15201    fn control_handle(&self) -> &NodeControlHandle {
15202        &self.control_handle
15203    }
15204
15205    fn drop_without_shutdown(mut self) {
15206        // Safety: drops once, never accessed again due to mem::forget
15207        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15208        // Prevent Drop from running (which would shut down the channel)
15209        std::mem::forget(self);
15210    }
15211}
15212
15213impl NodeDeprecatedGetFlagsResponder {
15214    /// Sends a response to the FIDL transaction.
15215    ///
15216    /// Sets the channel to shutdown if an error occurs.
15217    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15218        let _result = self.send_raw(s, flags);
15219        if _result.is_err() {
15220            self.control_handle.shutdown();
15221        }
15222        self.drop_without_shutdown();
15223        _result
15224    }
15225
15226    /// Similar to "send" but does not shutdown the channel if an error occurs.
15227    pub fn send_no_shutdown_on_err(
15228        self,
15229        mut s: i32,
15230        mut flags: OpenFlags,
15231    ) -> Result<(), fidl::Error> {
15232        let _result = self.send_raw(s, flags);
15233        self.drop_without_shutdown();
15234        _result
15235    }
15236
15237    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15238        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
15239            (s, flags),
15240            self.tx_id,
15241            0x5b88fffb8eda3aa1,
15242            fidl::encoding::DynamicFlags::empty(),
15243        )
15244    }
15245}
15246
15247#[must_use = "FIDL methods require a response to be sent"]
15248#[derive(Debug)]
15249pub struct NodeDeprecatedSetFlagsResponder {
15250    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15251    tx_id: u32,
15252}
15253
15254/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15255/// if the responder is dropped without sending a response, so that the client
15256/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15257impl std::ops::Drop for NodeDeprecatedSetFlagsResponder {
15258    fn drop(&mut self) {
15259        self.control_handle.shutdown();
15260        // Safety: drops once, never accessed again
15261        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15262    }
15263}
15264
15265impl fidl::endpoints::Responder for NodeDeprecatedSetFlagsResponder {
15266    type ControlHandle = NodeControlHandle;
15267
15268    fn control_handle(&self) -> &NodeControlHandle {
15269        &self.control_handle
15270    }
15271
15272    fn drop_without_shutdown(mut self) {
15273        // Safety: drops once, never accessed again due to mem::forget
15274        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15275        // Prevent Drop from running (which would shut down the channel)
15276        std::mem::forget(self);
15277    }
15278}
15279
15280impl NodeDeprecatedSetFlagsResponder {
15281    /// Sends a response to the FIDL transaction.
15282    ///
15283    /// Sets the channel to shutdown if an error occurs.
15284    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15285        let _result = self.send_raw(s);
15286        if _result.is_err() {
15287            self.control_handle.shutdown();
15288        }
15289        self.drop_without_shutdown();
15290        _result
15291    }
15292
15293    /// Similar to "send" but does not shutdown the channel if an error occurs.
15294    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15295        let _result = self.send_raw(s);
15296        self.drop_without_shutdown();
15297        _result
15298    }
15299
15300    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15301        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
15302            (s,),
15303            self.tx_id,
15304            0x5295b76c71fde733,
15305            fidl::encoding::DynamicFlags::empty(),
15306        )
15307    }
15308}
15309
15310#[must_use = "FIDL methods require a response to be sent"]
15311#[derive(Debug)]
15312pub struct NodeGetFlagsResponder {
15313    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15314    tx_id: u32,
15315}
15316
15317/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15318/// if the responder is dropped without sending a response, so that the client
15319/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15320impl std::ops::Drop for NodeGetFlagsResponder {
15321    fn drop(&mut self) {
15322        self.control_handle.shutdown();
15323        // Safety: drops once, never accessed again
15324        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15325    }
15326}
15327
15328impl fidl::endpoints::Responder for NodeGetFlagsResponder {
15329    type ControlHandle = NodeControlHandle;
15330
15331    fn control_handle(&self) -> &NodeControlHandle {
15332        &self.control_handle
15333    }
15334
15335    fn drop_without_shutdown(mut self) {
15336        // Safety: drops once, never accessed again due to mem::forget
15337        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15338        // Prevent Drop from running (which would shut down the channel)
15339        std::mem::forget(self);
15340    }
15341}
15342
15343impl NodeGetFlagsResponder {
15344    /// Sends a response to the FIDL transaction.
15345    ///
15346    /// Sets the channel to shutdown if an error occurs.
15347    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15348        let _result = self.send_raw(result);
15349        if _result.is_err() {
15350            self.control_handle.shutdown();
15351        }
15352        self.drop_without_shutdown();
15353        _result
15354    }
15355
15356    /// Similar to "send" but does not shutdown the channel if an error occurs.
15357    pub fn send_no_shutdown_on_err(
15358        self,
15359        mut result: Result<Flags, i32>,
15360    ) -> Result<(), fidl::Error> {
15361        let _result = self.send_raw(result);
15362        self.drop_without_shutdown();
15363        _result
15364    }
15365
15366    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15367        self.control_handle
15368            .inner
15369            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
15370                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
15371                self.tx_id,
15372                0x176eb318f64ec23,
15373                fidl::encoding::DynamicFlags::FLEXIBLE,
15374            )
15375    }
15376}
15377
15378#[must_use = "FIDL methods require a response to be sent"]
15379#[derive(Debug)]
15380pub struct NodeSetFlagsResponder {
15381    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15382    tx_id: u32,
15383}
15384
15385/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15386/// if the responder is dropped without sending a response, so that the client
15387/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15388impl std::ops::Drop for NodeSetFlagsResponder {
15389    fn drop(&mut self) {
15390        self.control_handle.shutdown();
15391        // Safety: drops once, never accessed again
15392        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15393    }
15394}
15395
15396impl fidl::endpoints::Responder for NodeSetFlagsResponder {
15397    type ControlHandle = NodeControlHandle;
15398
15399    fn control_handle(&self) -> &NodeControlHandle {
15400        &self.control_handle
15401    }
15402
15403    fn drop_without_shutdown(mut self) {
15404        // Safety: drops once, never accessed again due to mem::forget
15405        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15406        // Prevent Drop from running (which would shut down the channel)
15407        std::mem::forget(self);
15408    }
15409}
15410
15411impl NodeSetFlagsResponder {
15412    /// Sends a response to the FIDL transaction.
15413    ///
15414    /// Sets the channel to shutdown if an error occurs.
15415    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15416        let _result = self.send_raw(result);
15417        if _result.is_err() {
15418            self.control_handle.shutdown();
15419        }
15420        self.drop_without_shutdown();
15421        _result
15422    }
15423
15424    /// Similar to "send" but does not shutdown the channel if an error occurs.
15425    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15426        let _result = self.send_raw(result);
15427        self.drop_without_shutdown();
15428        _result
15429    }
15430
15431    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15432        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
15433            fidl::encoding::EmptyStruct,
15434            i32,
15435        >>(
15436            fidl::encoding::FlexibleResult::new(result),
15437            self.tx_id,
15438            0x55a8028685791ea8,
15439            fidl::encoding::DynamicFlags::FLEXIBLE,
15440        )
15441    }
15442}
15443
15444#[must_use = "FIDL methods require a response to be sent"]
15445#[derive(Debug)]
15446pub struct NodeQueryFilesystemResponder {
15447    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15448    tx_id: u32,
15449}
15450
15451/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15452/// if the responder is dropped without sending a response, so that the client
15453/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15454impl std::ops::Drop for NodeQueryFilesystemResponder {
15455    fn drop(&mut self) {
15456        self.control_handle.shutdown();
15457        // Safety: drops once, never accessed again
15458        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15459    }
15460}
15461
15462impl fidl::endpoints::Responder for NodeQueryFilesystemResponder {
15463    type ControlHandle = NodeControlHandle;
15464
15465    fn control_handle(&self) -> &NodeControlHandle {
15466        &self.control_handle
15467    }
15468
15469    fn drop_without_shutdown(mut self) {
15470        // Safety: drops once, never accessed again due to mem::forget
15471        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15472        // Prevent Drop from running (which would shut down the channel)
15473        std::mem::forget(self);
15474    }
15475}
15476
15477impl NodeQueryFilesystemResponder {
15478    /// Sends a response to the FIDL transaction.
15479    ///
15480    /// Sets the channel to shutdown if an error occurs.
15481    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15482        let _result = self.send_raw(s, info);
15483        if _result.is_err() {
15484            self.control_handle.shutdown();
15485        }
15486        self.drop_without_shutdown();
15487        _result
15488    }
15489
15490    /// Similar to "send" but does not shutdown the channel if an error occurs.
15491    pub fn send_no_shutdown_on_err(
15492        self,
15493        mut s: i32,
15494        mut info: Option<&FilesystemInfo>,
15495    ) -> Result<(), fidl::Error> {
15496        let _result = self.send_raw(s, info);
15497        self.drop_without_shutdown();
15498        _result
15499    }
15500
15501    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15502        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
15503            (s, info),
15504            self.tx_id,
15505            0x6f344a1c6b0a0610,
15506            fidl::encoding::DynamicFlags::empty(),
15507        )
15508    }
15509}
15510
15511#[must_use = "FIDL methods require a response to be sent"]
15512#[derive(Debug)]
15513pub struct NodeGetAttributesResponder {
15514    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15515    tx_id: u32,
15516}
15517
15518/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15519/// if the responder is dropped without sending a response, so that the client
15520/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15521impl std::ops::Drop for NodeGetAttributesResponder {
15522    fn drop(&mut self) {
15523        self.control_handle.shutdown();
15524        // Safety: drops once, never accessed again
15525        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15526    }
15527}
15528
15529impl fidl::endpoints::Responder for NodeGetAttributesResponder {
15530    type ControlHandle = NodeControlHandle;
15531
15532    fn control_handle(&self) -> &NodeControlHandle {
15533        &self.control_handle
15534    }
15535
15536    fn drop_without_shutdown(mut self) {
15537        // Safety: drops once, never accessed again due to mem::forget
15538        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15539        // Prevent Drop from running (which would shut down the channel)
15540        std::mem::forget(self);
15541    }
15542}
15543
15544impl NodeGetAttributesResponder {
15545    /// Sends a response to the FIDL transaction.
15546    ///
15547    /// Sets the channel to shutdown if an error occurs.
15548    pub fn send(
15549        self,
15550        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15551    ) -> Result<(), fidl::Error> {
15552        let _result = self.send_raw(result);
15553        if _result.is_err() {
15554            self.control_handle.shutdown();
15555        }
15556        self.drop_without_shutdown();
15557        _result
15558    }
15559
15560    /// Similar to "send" but does not shutdown the channel if an error occurs.
15561    pub fn send_no_shutdown_on_err(
15562        self,
15563        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15564    ) -> Result<(), fidl::Error> {
15565        let _result = self.send_raw(result);
15566        self.drop_without_shutdown();
15567        _result
15568    }
15569
15570    fn send_raw(
15571        &self,
15572        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15573    ) -> Result<(), fidl::Error> {
15574        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
15575            result,
15576            self.tx_id,
15577            0x3d4396a638ea053b,
15578            fidl::encoding::DynamicFlags::empty(),
15579        )
15580    }
15581}
15582
15583#[must_use = "FIDL methods require a response to be sent"]
15584#[derive(Debug)]
15585pub struct NodeUpdateAttributesResponder {
15586    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15587    tx_id: u32,
15588}
15589
15590/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15591/// if the responder is dropped without sending a response, so that the client
15592/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15593impl std::ops::Drop for NodeUpdateAttributesResponder {
15594    fn drop(&mut self) {
15595        self.control_handle.shutdown();
15596        // Safety: drops once, never accessed again
15597        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15598    }
15599}
15600
15601impl fidl::endpoints::Responder for NodeUpdateAttributesResponder {
15602    type ControlHandle = NodeControlHandle;
15603
15604    fn control_handle(&self) -> &NodeControlHandle {
15605        &self.control_handle
15606    }
15607
15608    fn drop_without_shutdown(mut self) {
15609        // Safety: drops once, never accessed again due to mem::forget
15610        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15611        // Prevent Drop from running (which would shut down the channel)
15612        std::mem::forget(self);
15613    }
15614}
15615
15616impl NodeUpdateAttributesResponder {
15617    /// Sends a response to the FIDL transaction.
15618    ///
15619    /// Sets the channel to shutdown if an error occurs.
15620    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15621        let _result = self.send_raw(result);
15622        if _result.is_err() {
15623            self.control_handle.shutdown();
15624        }
15625        self.drop_without_shutdown();
15626        _result
15627    }
15628
15629    /// Similar to "send" but does not shutdown the channel if an error occurs.
15630    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15631        let _result = self.send_raw(result);
15632        self.drop_without_shutdown();
15633        _result
15634    }
15635
15636    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15637        self.control_handle
15638            .inner
15639            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15640                result,
15641                self.tx_id,
15642                0x3308c1da5a89bf08,
15643                fidl::encoding::DynamicFlags::empty(),
15644            )
15645    }
15646}
15647
15648#[must_use = "FIDL methods require a response to be sent"]
15649#[derive(Debug)]
15650pub struct NodeSyncResponder {
15651    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15652    tx_id: u32,
15653}
15654
15655/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15656/// if the responder is dropped without sending a response, so that the client
15657/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15658impl std::ops::Drop for NodeSyncResponder {
15659    fn drop(&mut self) {
15660        self.control_handle.shutdown();
15661        // Safety: drops once, never accessed again
15662        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15663    }
15664}
15665
15666impl fidl::endpoints::Responder for NodeSyncResponder {
15667    type ControlHandle = NodeControlHandle;
15668
15669    fn control_handle(&self) -> &NodeControlHandle {
15670        &self.control_handle
15671    }
15672
15673    fn drop_without_shutdown(mut self) {
15674        // Safety: drops once, never accessed again due to mem::forget
15675        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15676        // Prevent Drop from running (which would shut down the channel)
15677        std::mem::forget(self);
15678    }
15679}
15680
15681impl NodeSyncResponder {
15682    /// Sends a response to the FIDL transaction.
15683    ///
15684    /// Sets the channel to shutdown if an error occurs.
15685    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15686        let _result = self.send_raw(result);
15687        if _result.is_err() {
15688            self.control_handle.shutdown();
15689        }
15690        self.drop_without_shutdown();
15691        _result
15692    }
15693
15694    /// Similar to "send" but does not shutdown the channel if an error occurs.
15695    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15696        let _result = self.send_raw(result);
15697        self.drop_without_shutdown();
15698        _result
15699    }
15700
15701    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15702        self.control_handle
15703            .inner
15704            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15705                result,
15706                self.tx_id,
15707                0x2c5c27ca0ab5dc49,
15708                fidl::encoding::DynamicFlags::empty(),
15709            )
15710    }
15711}
15712
15713#[must_use = "FIDL methods require a response to be sent"]
15714#[derive(Debug)]
15715pub struct NodeGetExtendedAttributeResponder {
15716    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15717    tx_id: u32,
15718}
15719
15720/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15721/// if the responder is dropped without sending a response, so that the client
15722/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15723impl std::ops::Drop for NodeGetExtendedAttributeResponder {
15724    fn drop(&mut self) {
15725        self.control_handle.shutdown();
15726        // Safety: drops once, never accessed again
15727        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15728    }
15729}
15730
15731impl fidl::endpoints::Responder for NodeGetExtendedAttributeResponder {
15732    type ControlHandle = NodeControlHandle;
15733
15734    fn control_handle(&self) -> &NodeControlHandle {
15735        &self.control_handle
15736    }
15737
15738    fn drop_without_shutdown(mut self) {
15739        // Safety: drops once, never accessed again due to mem::forget
15740        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15741        // Prevent Drop from running (which would shut down the channel)
15742        std::mem::forget(self);
15743    }
15744}
15745
15746impl NodeGetExtendedAttributeResponder {
15747    /// Sends a response to the FIDL transaction.
15748    ///
15749    /// Sets the channel to shutdown if an error occurs.
15750    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
15751        let _result = self.send_raw(result);
15752        if _result.is_err() {
15753            self.control_handle.shutdown();
15754        }
15755        self.drop_without_shutdown();
15756        _result
15757    }
15758
15759    /// Similar to "send" but does not shutdown the channel if an error occurs.
15760    pub fn send_no_shutdown_on_err(
15761        self,
15762        mut result: Result<ExtendedAttributeValue, i32>,
15763    ) -> Result<(), fidl::Error> {
15764        let _result = self.send_raw(result);
15765        self.drop_without_shutdown();
15766        _result
15767    }
15768
15769    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
15770        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
15771            result.as_mut().map_err(|e| *e),
15772            self.tx_id,
15773            0x45ffa3ccfdeb76db,
15774            fidl::encoding::DynamicFlags::empty(),
15775        )
15776    }
15777}
15778
15779#[must_use = "FIDL methods require a response to be sent"]
15780#[derive(Debug)]
15781pub struct NodeSetExtendedAttributeResponder {
15782    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15783    tx_id: u32,
15784}
15785
15786/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15787/// if the responder is dropped without sending a response, so that the client
15788/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15789impl std::ops::Drop for NodeSetExtendedAttributeResponder {
15790    fn drop(&mut self) {
15791        self.control_handle.shutdown();
15792        // Safety: drops once, never accessed again
15793        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15794    }
15795}
15796
15797impl fidl::endpoints::Responder for NodeSetExtendedAttributeResponder {
15798    type ControlHandle = NodeControlHandle;
15799
15800    fn control_handle(&self) -> &NodeControlHandle {
15801        &self.control_handle
15802    }
15803
15804    fn drop_without_shutdown(mut self) {
15805        // Safety: drops once, never accessed again due to mem::forget
15806        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15807        // Prevent Drop from running (which would shut down the channel)
15808        std::mem::forget(self);
15809    }
15810}
15811
15812impl NodeSetExtendedAttributeResponder {
15813    /// Sends a response to the FIDL transaction.
15814    ///
15815    /// Sets the channel to shutdown if an error occurs.
15816    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15817        let _result = self.send_raw(result);
15818        if _result.is_err() {
15819            self.control_handle.shutdown();
15820        }
15821        self.drop_without_shutdown();
15822        _result
15823    }
15824
15825    /// Similar to "send" but does not shutdown the channel if an error occurs.
15826    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15827        let _result = self.send_raw(result);
15828        self.drop_without_shutdown();
15829        _result
15830    }
15831
15832    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15833        self.control_handle
15834            .inner
15835            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15836                result,
15837                self.tx_id,
15838                0x4a951362f681f23c,
15839                fidl::encoding::DynamicFlags::empty(),
15840            )
15841    }
15842}
15843
15844#[must_use = "FIDL methods require a response to be sent"]
15845#[derive(Debug)]
15846pub struct NodeRemoveExtendedAttributeResponder {
15847    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15848    tx_id: u32,
15849}
15850
15851/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15852/// if the responder is dropped without sending a response, so that the client
15853/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15854impl std::ops::Drop for NodeRemoveExtendedAttributeResponder {
15855    fn drop(&mut self) {
15856        self.control_handle.shutdown();
15857        // Safety: drops once, never accessed again
15858        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15859    }
15860}
15861
15862impl fidl::endpoints::Responder for NodeRemoveExtendedAttributeResponder {
15863    type ControlHandle = NodeControlHandle;
15864
15865    fn control_handle(&self) -> &NodeControlHandle {
15866        &self.control_handle
15867    }
15868
15869    fn drop_without_shutdown(mut self) {
15870        // Safety: drops once, never accessed again due to mem::forget
15871        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15872        // Prevent Drop from running (which would shut down the channel)
15873        std::mem::forget(self);
15874    }
15875}
15876
15877impl NodeRemoveExtendedAttributeResponder {
15878    /// Sends a response to the FIDL transaction.
15879    ///
15880    /// Sets the channel to shutdown if an error occurs.
15881    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15882        let _result = self.send_raw(result);
15883        if _result.is_err() {
15884            self.control_handle.shutdown();
15885        }
15886        self.drop_without_shutdown();
15887        _result
15888    }
15889
15890    /// Similar to "send" but does not shutdown the channel if an error occurs.
15891    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15892        let _result = self.send_raw(result);
15893        self.drop_without_shutdown();
15894        _result
15895    }
15896
15897    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15898        self.control_handle
15899            .inner
15900            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15901                result,
15902                self.tx_id,
15903                0x7a0b9f3a9bf9032d,
15904                fidl::encoding::DynamicFlags::empty(),
15905            )
15906    }
15907}
15908
15909#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15910pub struct ReadableMarker;
15911
15912impl fidl::endpoints::ProtocolMarker for ReadableMarker {
15913    type Proxy = ReadableProxy;
15914    type RequestStream = ReadableRequestStream;
15915    #[cfg(target_os = "fuchsia")]
15916    type SynchronousProxy = ReadableSynchronousProxy;
15917
15918    const DEBUG_NAME: &'static str = "(anonymous) Readable";
15919}
15920pub type ReadableReadResult = Result<Vec<u8>, i32>;
15921
15922pub trait ReadableProxyInterface: Send + Sync {
15923    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
15924        + Send;
15925    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
15926}
15927#[derive(Debug)]
15928#[cfg(target_os = "fuchsia")]
15929pub struct ReadableSynchronousProxy {
15930    client: fidl::client::sync::Client,
15931}
15932
15933#[cfg(target_os = "fuchsia")]
15934impl fidl::endpoints::SynchronousProxy for ReadableSynchronousProxy {
15935    type Proxy = ReadableProxy;
15936    type Protocol = ReadableMarker;
15937
15938    fn from_channel(inner: fidl::Channel) -> Self {
15939        Self::new(inner)
15940    }
15941
15942    fn into_channel(self) -> fidl::Channel {
15943        self.client.into_channel()
15944    }
15945
15946    fn as_channel(&self) -> &fidl::Channel {
15947        self.client.as_channel()
15948    }
15949}
15950
15951#[cfg(target_os = "fuchsia")]
15952impl ReadableSynchronousProxy {
15953    pub fn new(channel: fidl::Channel) -> Self {
15954        let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
15955        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
15956    }
15957
15958    pub fn into_channel(self) -> fidl::Channel {
15959        self.client.into_channel()
15960    }
15961
15962    /// Waits until an event arrives and returns it. It is safe for other
15963    /// threads to make concurrent requests while waiting for an event.
15964    pub fn wait_for_event(
15965        &self,
15966        deadline: zx::MonotonicInstant,
15967    ) -> Result<ReadableEvent, fidl::Error> {
15968        ReadableEvent::decode(self.client.wait_for_event(deadline)?)
15969    }
15970
15971    /// Reads up to 'count' bytes at the seek offset.
15972    /// The seek offset is moved forward by the number of bytes read.
15973    ///
15974    /// ## Invariants
15975    ///
15976    /// * The returned `data.length` will never be greater than `count`.
15977    /// * If `data.length` is less than `count`, it means that the seek offset
15978    ///   has reached the end of file as part of this operation.
15979    /// * If `data.length` is zero while `count` is not, it means that the
15980    ///   seek offset is already at or beyond the end of file, and no data could
15981    ///   be read.
15982    /// * If `count` is zero, the server should perform all the checks ensuring
15983    ///   read access without actually read anything, and return an empty
15984    ///   `data` vector.
15985    ///
15986    /// This method requires the [`Rights.READ_BYTES`] right.
15987    ///
15988    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
15989    pub fn r#read(
15990        &self,
15991        mut count: u64,
15992        ___deadline: zx::MonotonicInstant,
15993    ) -> Result<ReadableReadResult, fidl::Error> {
15994        let _response = self.client.send_query::<
15995            ReadableReadRequest,
15996            fidl::encoding::ResultType<ReadableReadResponse, i32>,
15997        >(
15998            (count,),
15999            0x57e419a298c8ede,
16000            fidl::encoding::DynamicFlags::empty(),
16001            ___deadline,
16002        )?;
16003        Ok(_response.map(|x| x.data))
16004    }
16005}
16006
16007#[cfg(target_os = "fuchsia")]
16008impl From<ReadableSynchronousProxy> for zx::NullableHandle {
16009    fn from(value: ReadableSynchronousProxy) -> Self {
16010        value.into_channel().into()
16011    }
16012}
16013
16014#[cfg(target_os = "fuchsia")]
16015impl From<fidl::Channel> for ReadableSynchronousProxy {
16016    fn from(value: fidl::Channel) -> Self {
16017        Self::new(value)
16018    }
16019}
16020
16021#[cfg(target_os = "fuchsia")]
16022impl fidl::endpoints::FromClient for ReadableSynchronousProxy {
16023    type Protocol = ReadableMarker;
16024
16025    fn from_client(value: fidl::endpoints::ClientEnd<ReadableMarker>) -> Self {
16026        Self::new(value.into_channel())
16027    }
16028}
16029
16030#[derive(Debug, Clone)]
16031pub struct ReadableProxy {
16032    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
16033}
16034
16035impl fidl::endpoints::Proxy for ReadableProxy {
16036    type Protocol = ReadableMarker;
16037
16038    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
16039        Self::new(inner)
16040    }
16041
16042    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
16043        self.client.into_channel().map_err(|client| Self { client })
16044    }
16045
16046    fn as_channel(&self) -> &::fidl::AsyncChannel {
16047        self.client.as_channel()
16048    }
16049}
16050
16051impl ReadableProxy {
16052    /// Create a new Proxy for fuchsia.io/Readable.
16053    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
16054        let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16055        Self { client: fidl::client::Client::new(channel, protocol_name) }
16056    }
16057
16058    /// Get a Stream of events from the remote end of the protocol.
16059    ///
16060    /// # Panics
16061    ///
16062    /// Panics if the event stream was already taken.
16063    pub fn take_event_stream(&self) -> ReadableEventStream {
16064        ReadableEventStream { event_receiver: self.client.take_event_receiver() }
16065    }
16066
16067    /// Reads up to 'count' bytes at the seek offset.
16068    /// The seek offset is moved forward by the number of bytes read.
16069    ///
16070    /// ## Invariants
16071    ///
16072    /// * The returned `data.length` will never be greater than `count`.
16073    /// * If `data.length` is less than `count`, it means that the seek offset
16074    ///   has reached the end of file as part of this operation.
16075    /// * If `data.length` is zero while `count` is not, it means that the
16076    ///   seek offset is already at or beyond the end of file, and no data could
16077    ///   be read.
16078    /// * If `count` is zero, the server should perform all the checks ensuring
16079    ///   read access without actually read anything, and return an empty
16080    ///   `data` vector.
16081    ///
16082    /// This method requires the [`Rights.READ_BYTES`] right.
16083    ///
16084    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16085    pub fn r#read(
16086        &self,
16087        mut count: u64,
16088    ) -> fidl::client::QueryResponseFut<
16089        ReadableReadResult,
16090        fidl::encoding::DefaultFuchsiaResourceDialect,
16091    > {
16092        ReadableProxyInterface::r#read(self, count)
16093    }
16094}
16095
16096impl ReadableProxyInterface for ReadableProxy {
16097    type ReadResponseFut = fidl::client::QueryResponseFut<
16098        ReadableReadResult,
16099        fidl::encoding::DefaultFuchsiaResourceDialect,
16100    >;
16101    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
16102        fn _decode(
16103            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
16104        ) -> Result<ReadableReadResult, fidl::Error> {
16105            let _response = fidl::client::decode_transaction_body::<
16106                fidl::encoding::ResultType<ReadableReadResponse, i32>,
16107                fidl::encoding::DefaultFuchsiaResourceDialect,
16108                0x57e419a298c8ede,
16109            >(_buf?)?;
16110            Ok(_response.map(|x| x.data))
16111        }
16112        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
16113            (count,),
16114            0x57e419a298c8ede,
16115            fidl::encoding::DynamicFlags::empty(),
16116            _decode,
16117        )
16118    }
16119}
16120
16121pub struct ReadableEventStream {
16122    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
16123}
16124
16125impl std::marker::Unpin for ReadableEventStream {}
16126
16127impl futures::stream::FusedStream for ReadableEventStream {
16128    fn is_terminated(&self) -> bool {
16129        self.event_receiver.is_terminated()
16130    }
16131}
16132
16133impl futures::Stream for ReadableEventStream {
16134    type Item = Result<ReadableEvent, fidl::Error>;
16135
16136    fn poll_next(
16137        mut self: std::pin::Pin<&mut Self>,
16138        cx: &mut std::task::Context<'_>,
16139    ) -> std::task::Poll<Option<Self::Item>> {
16140        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
16141            &mut self.event_receiver,
16142            cx
16143        )?) {
16144            Some(buf) => std::task::Poll::Ready(Some(ReadableEvent::decode(buf))),
16145            None => std::task::Poll::Ready(None),
16146        }
16147    }
16148}
16149
16150#[derive(Debug)]
16151pub enum ReadableEvent {}
16152
16153impl ReadableEvent {
16154    /// Decodes a message buffer as a [`ReadableEvent`].
16155    fn decode(
16156        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
16157    ) -> Result<ReadableEvent, fidl::Error> {
16158        let (bytes, _handles) = buf.split_mut();
16159        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16160        debug_assert_eq!(tx_header.tx_id, 0);
16161        match tx_header.ordinal {
16162            _ => Err(fidl::Error::UnknownOrdinal {
16163                ordinal: tx_header.ordinal,
16164                protocol_name: <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16165            }),
16166        }
16167    }
16168}
16169
16170/// A Stream of incoming requests for fuchsia.io/Readable.
16171pub struct ReadableRequestStream {
16172    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16173    is_terminated: bool,
16174}
16175
16176impl std::marker::Unpin for ReadableRequestStream {}
16177
16178impl futures::stream::FusedStream for ReadableRequestStream {
16179    fn is_terminated(&self) -> bool {
16180        self.is_terminated
16181    }
16182}
16183
16184impl fidl::endpoints::RequestStream for ReadableRequestStream {
16185    type Protocol = ReadableMarker;
16186    type ControlHandle = ReadableControlHandle;
16187
16188    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
16189        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
16190    }
16191
16192    fn control_handle(&self) -> Self::ControlHandle {
16193        ReadableControlHandle { inner: self.inner.clone() }
16194    }
16195
16196    fn into_inner(
16197        self,
16198    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
16199    {
16200        (self.inner, self.is_terminated)
16201    }
16202
16203    fn from_inner(
16204        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16205        is_terminated: bool,
16206    ) -> Self {
16207        Self { inner, is_terminated }
16208    }
16209}
16210
16211impl futures::Stream for ReadableRequestStream {
16212    type Item = Result<ReadableRequest, fidl::Error>;
16213
16214    fn poll_next(
16215        mut self: std::pin::Pin<&mut Self>,
16216        cx: &mut std::task::Context<'_>,
16217    ) -> std::task::Poll<Option<Self::Item>> {
16218        let this = &mut *self;
16219        if this.inner.check_shutdown(cx) {
16220            this.is_terminated = true;
16221            return std::task::Poll::Ready(None);
16222        }
16223        if this.is_terminated {
16224            panic!("polled ReadableRequestStream after completion");
16225        }
16226        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
16227            |bytes, handles| {
16228                match this.inner.channel().read_etc(cx, bytes, handles) {
16229                    std::task::Poll::Ready(Ok(())) => {}
16230                    std::task::Poll::Pending => return std::task::Poll::Pending,
16231                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
16232                        this.is_terminated = true;
16233                        return std::task::Poll::Ready(None);
16234                    }
16235                    std::task::Poll::Ready(Err(e)) => {
16236                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
16237                            e.into(),
16238                        ))));
16239                    }
16240                }
16241
16242                // A message has been received from the channel
16243                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16244
16245                std::task::Poll::Ready(Some(match header.ordinal {
16246                    0x57e419a298c8ede => {
16247                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
16248                        let mut req = fidl::new_empty!(
16249                            ReadableReadRequest,
16250                            fidl::encoding::DefaultFuchsiaResourceDialect
16251                        );
16252                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
16253                        let control_handle = ReadableControlHandle { inner: this.inner.clone() };
16254                        Ok(ReadableRequest::Read {
16255                            count: req.count,
16256
16257                            responder: ReadableReadResponder {
16258                                control_handle: std::mem::ManuallyDrop::new(control_handle),
16259                                tx_id: header.tx_id,
16260                            },
16261                        })
16262                    }
16263                    _ => Err(fidl::Error::UnknownOrdinal {
16264                        ordinal: header.ordinal,
16265                        protocol_name:
16266                            <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16267                    }),
16268                }))
16269            },
16270        )
16271    }
16272}
16273
16274#[derive(Debug)]
16275pub enum ReadableRequest {
16276    /// Reads up to 'count' bytes at the seek offset.
16277    /// The seek offset is moved forward by the number of bytes read.
16278    ///
16279    /// ## Invariants
16280    ///
16281    /// * The returned `data.length` will never be greater than `count`.
16282    /// * If `data.length` is less than `count`, it means that the seek offset
16283    ///   has reached the end of file as part of this operation.
16284    /// * If `data.length` is zero while `count` is not, it means that the
16285    ///   seek offset is already at or beyond the end of file, and no data could
16286    ///   be read.
16287    /// * If `count` is zero, the server should perform all the checks ensuring
16288    ///   read access without actually read anything, and return an empty
16289    ///   `data` vector.
16290    ///
16291    /// This method requires the [`Rights.READ_BYTES`] right.
16292    ///
16293    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16294    Read { count: u64, responder: ReadableReadResponder },
16295}
16296
16297impl ReadableRequest {
16298    #[allow(irrefutable_let_patterns)]
16299    pub fn into_read(self) -> Option<(u64, ReadableReadResponder)> {
16300        if let ReadableRequest::Read { count, responder } = self {
16301            Some((count, responder))
16302        } else {
16303            None
16304        }
16305    }
16306
16307    /// Name of the method defined in FIDL
16308    pub fn method_name(&self) -> &'static str {
16309        match *self {
16310            ReadableRequest::Read { .. } => "read",
16311        }
16312    }
16313}
16314
16315#[derive(Debug, Clone)]
16316pub struct ReadableControlHandle {
16317    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16318}
16319
16320impl fidl::endpoints::ControlHandle for ReadableControlHandle {
16321    fn shutdown(&self) {
16322        self.inner.shutdown()
16323    }
16324
16325    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
16326        self.inner.shutdown_with_epitaph(status)
16327    }
16328
16329    fn is_closed(&self) -> bool {
16330        self.inner.channel().is_closed()
16331    }
16332    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
16333        self.inner.channel().on_closed()
16334    }
16335
16336    #[cfg(target_os = "fuchsia")]
16337    fn signal_peer(
16338        &self,
16339        clear_mask: zx::Signals,
16340        set_mask: zx::Signals,
16341    ) -> Result<(), zx_status::Status> {
16342        use fidl::Peered;
16343        self.inner.channel().signal_peer(clear_mask, set_mask)
16344    }
16345}
16346
16347impl ReadableControlHandle {}
16348
16349#[must_use = "FIDL methods require a response to be sent"]
16350#[derive(Debug)]
16351pub struct ReadableReadResponder {
16352    control_handle: std::mem::ManuallyDrop<ReadableControlHandle>,
16353    tx_id: u32,
16354}
16355
16356/// Set the the channel to be shutdown (see [`ReadableControlHandle::shutdown`])
16357/// if the responder is dropped without sending a response, so that the client
16358/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16359impl std::ops::Drop for ReadableReadResponder {
16360    fn drop(&mut self) {
16361        self.control_handle.shutdown();
16362        // Safety: drops once, never accessed again
16363        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16364    }
16365}
16366
16367impl fidl::endpoints::Responder for ReadableReadResponder {
16368    type ControlHandle = ReadableControlHandle;
16369
16370    fn control_handle(&self) -> &ReadableControlHandle {
16371        &self.control_handle
16372    }
16373
16374    fn drop_without_shutdown(mut self) {
16375        // Safety: drops once, never accessed again due to mem::forget
16376        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16377        // Prevent Drop from running (which would shut down the channel)
16378        std::mem::forget(self);
16379    }
16380}
16381
16382impl ReadableReadResponder {
16383    /// Sends a response to the FIDL transaction.
16384    ///
16385    /// Sets the channel to shutdown if an error occurs.
16386    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
16387        let _result = self.send_raw(result);
16388        if _result.is_err() {
16389            self.control_handle.shutdown();
16390        }
16391        self.drop_without_shutdown();
16392        _result
16393    }
16394
16395    /// Similar to "send" but does not shutdown the channel if an error occurs.
16396    pub fn send_no_shutdown_on_err(
16397        self,
16398        mut result: Result<&[u8], i32>,
16399    ) -> Result<(), fidl::Error> {
16400        let _result = self.send_raw(result);
16401        self.drop_without_shutdown();
16402        _result
16403    }
16404
16405    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
16406        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
16407            result.map(|data| (data,)),
16408            self.tx_id,
16409            0x57e419a298c8ede,
16410            fidl::encoding::DynamicFlags::empty(),
16411        )
16412    }
16413}
16414
16415#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
16416pub struct SymlinkMarker;
16417
16418impl fidl::endpoints::ProtocolMarker for SymlinkMarker {
16419    type Proxy = SymlinkProxy;
16420    type RequestStream = SymlinkRequestStream;
16421    #[cfg(target_os = "fuchsia")]
16422    type SynchronousProxy = SymlinkSynchronousProxy;
16423
16424    const DEBUG_NAME: &'static str = "fuchsia.io.Symlink";
16425}
16426impl fidl::endpoints::DiscoverableProtocolMarker for SymlinkMarker {}
16427
16428pub trait SymlinkProxyInterface: Send + Sync {
16429    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
16430        + Send;
16431    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
16432    fn r#clone(
16433        &self,
16434        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
16435    ) -> Result<(), fidl::Error>;
16436    type CloseResponseFut: std::future::Future<
16437            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
16438        > + Send;
16439    fn r#close(&self) -> Self::CloseResponseFut;
16440    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
16441    fn r#query(&self) -> Self::QueryResponseFut;
16442    fn r#deprecated_clone(
16443        &self,
16444        flags: OpenFlags,
16445        object: fidl::endpoints::ServerEnd<NodeMarker>,
16446    ) -> Result<(), fidl::Error>;
16447    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
16448        + Send;
16449    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
16450    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
16451    fn r#deprecated_set_attr(
16452        &self,
16453        flags: NodeAttributeFlags,
16454        attributes: &NodeAttributes,
16455    ) -> Self::DeprecatedSetAttrResponseFut;
16456    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
16457        + Send;
16458    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
16459    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
16460        + Send;
16461    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
16462    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
16463        + Send;
16464    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
16465    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
16466        + Send;
16467    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
16468    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
16469        + Send;
16470    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
16471    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
16472        + Send;
16473    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
16474    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
16475        + Send;
16476    fn r#update_attributes(
16477        &self,
16478        payload: &MutableNodeAttributes,
16479    ) -> Self::UpdateAttributesResponseFut;
16480    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
16481    fn r#sync(&self) -> Self::SyncResponseFut;
16482    fn r#list_extended_attributes(
16483        &self,
16484        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
16485    ) -> Result<(), fidl::Error>;
16486    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
16487        + Send;
16488    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
16489    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
16490        + Send;
16491    fn r#set_extended_attribute(
16492        &self,
16493        name: &[u8],
16494        value: ExtendedAttributeValue,
16495        mode: SetExtendedAttributeMode,
16496    ) -> Self::SetExtendedAttributeResponseFut;
16497    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
16498        + Send;
16499    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
16500    type DescribeResponseFut: std::future::Future<Output = Result<SymlinkInfo, fidl::Error>> + Send;
16501    fn r#describe(&self) -> Self::DescribeResponseFut;
16502}
16503#[derive(Debug)]
16504#[cfg(target_os = "fuchsia")]
16505pub struct SymlinkSynchronousProxy {
16506    client: fidl::client::sync::Client,
16507}
16508
16509#[cfg(target_os = "fuchsia")]
16510impl fidl::endpoints::SynchronousProxy for SymlinkSynchronousProxy {
16511    type Proxy = SymlinkProxy;
16512    type Protocol = SymlinkMarker;
16513
16514    fn from_channel(inner: fidl::Channel) -> Self {
16515        Self::new(inner)
16516    }
16517
16518    fn into_channel(self) -> fidl::Channel {
16519        self.client.into_channel()
16520    }
16521
16522    fn as_channel(&self) -> &fidl::Channel {
16523        self.client.as_channel()
16524    }
16525}
16526
16527#[cfg(target_os = "fuchsia")]
16528impl SymlinkSynchronousProxy {
16529    pub fn new(channel: fidl::Channel) -> Self {
16530        let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16531        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
16532    }
16533
16534    pub fn into_channel(self) -> fidl::Channel {
16535        self.client.into_channel()
16536    }
16537
16538    /// Waits until an event arrives and returns it. It is safe for other
16539    /// threads to make concurrent requests while waiting for an event.
16540    pub fn wait_for_event(
16541        &self,
16542        deadline: zx::MonotonicInstant,
16543    ) -> Result<SymlinkEvent, fidl::Error> {
16544        SymlinkEvent::decode(self.client.wait_for_event(deadline)?)
16545    }
16546
16547    /// Creates a link to this this object with name `dst` in the directory represented by
16548    /// `dst_parent_token`.
16549    ///
16550    /// `dst` must be a resolved object name. Including "/" in the string will return
16551    /// `ZX_ERR_INVALID_ARGS`.
16552    ///
16553    /// This method requires the maximal set of rights supported by the filesystem for this object.
16554    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
16555    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
16556    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
16557    /// `ZX_ERR_ACCESS_DENIED`.
16558    ///
16559    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
16560    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
16561    ///
16562    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
16563    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
16564    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
16565    ///
16566    /// This method does not have the same atomicity properties has the `Directory::Link` method,
16567    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
16568    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
16569    pub fn r#link_into(
16570        &self,
16571        mut dst_parent_token: fidl::Event,
16572        mut dst: &str,
16573        ___deadline: zx::MonotonicInstant,
16574    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
16575        let _response = self.client.send_query::<
16576            LinkableLinkIntoRequest,
16577            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16578        >(
16579            (dst_parent_token, dst,),
16580            0x54f3949246a03e74,
16581            fidl::encoding::DynamicFlags::empty(),
16582            ___deadline,
16583        )?;
16584        Ok(_response.map(|x| x))
16585    }
16586
16587    pub fn r#clone(
16588        &self,
16589        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
16590    ) -> Result<(), fidl::Error> {
16591        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
16592            (request,),
16593            0x20d8a7aba2168a79,
16594            fidl::encoding::DynamicFlags::empty(),
16595        )
16596    }
16597
16598    /// Terminates the connection.
16599    ///
16600    /// After calling `Close`, the client must not send any other requests.
16601    ///
16602    /// Servers, after sending the status response, should close the connection
16603    /// regardless of status and without sending an epitaph.
16604    ///
16605    /// Closing the client end of the channel should be semantically equivalent
16606    /// to calling `Close` without knowing when the close has completed or its
16607    /// status.
16608    pub fn r#close(
16609        &self,
16610        ___deadline: zx::MonotonicInstant,
16611    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
16612        let _response = self.client.send_query::<
16613            fidl::encoding::EmptyPayload,
16614            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16615        >(
16616            (),
16617            0x5ac5d459ad7f657e,
16618            fidl::encoding::DynamicFlags::empty(),
16619            ___deadline,
16620        )?;
16621        Ok(_response.map(|x| x))
16622    }
16623
16624    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
16625        let _response = self.client.send_query::<
16626            fidl::encoding::EmptyPayload,
16627            fidl_fuchsia_unknown::QueryableQueryResponse,
16628        >(
16629            (),
16630            0x2658edee9decfc06,
16631            fidl::encoding::DynamicFlags::empty(),
16632            ___deadline,
16633        )?;
16634        Ok(_response.protocol)
16635    }
16636
16637    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
16638    pub fn r#deprecated_clone(
16639        &self,
16640        mut flags: OpenFlags,
16641        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
16642    ) -> Result<(), fidl::Error> {
16643        self.client.send::<NodeDeprecatedCloneRequest>(
16644            (flags, object),
16645            0x5a61678f293ce16f,
16646            fidl::encoding::DynamicFlags::FLEXIBLE,
16647        )
16648    }
16649
16650    /// DEPRECATED - Use `Node.GetAttributes` instead.
16651    pub fn r#deprecated_get_attr(
16652        &self,
16653        ___deadline: zx::MonotonicInstant,
16654    ) -> Result<(i32, NodeAttributes), fidl::Error> {
16655        let _response =
16656            self.client.send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse>(
16657                (),
16658                0x78985e216314dafd,
16659                fidl::encoding::DynamicFlags::empty(),
16660                ___deadline,
16661            )?;
16662        Ok((_response.s, _response.attributes))
16663    }
16664
16665    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
16666    pub fn r#deprecated_set_attr(
16667        &self,
16668        mut flags: NodeAttributeFlags,
16669        mut attributes: &NodeAttributes,
16670        ___deadline: zx::MonotonicInstant,
16671    ) -> Result<i32, fidl::Error> {
16672        let _response =
16673            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
16674                (flags, attributes),
16675                0x4186c0f40d938f46,
16676                fidl::encoding::DynamicFlags::empty(),
16677                ___deadline,
16678            )?;
16679        Ok(_response.s)
16680    }
16681
16682    /// [DEPRECATED - Use new GetFlags method instead.]
16683    pub fn r#deprecated_get_flags(
16684        &self,
16685        ___deadline: zx::MonotonicInstant,
16686    ) -> Result<(i32, OpenFlags), fidl::Error> {
16687        let _response = self
16688            .client
16689            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
16690                (),
16691                0x5b88fffb8eda3aa1,
16692                fidl::encoding::DynamicFlags::empty(),
16693                ___deadline,
16694            )?;
16695        Ok((_response.s, _response.flags))
16696    }
16697
16698    /// [DEPRECATED - Use new SetFlags method instead.]
16699    pub fn r#deprecated_set_flags(
16700        &self,
16701        mut flags: OpenFlags,
16702        ___deadline: zx::MonotonicInstant,
16703    ) -> Result<i32, fidl::Error> {
16704        let _response = self
16705            .client
16706            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
16707                (flags,),
16708                0x5295b76c71fde733,
16709                fidl::encoding::DynamicFlags::empty(),
16710                ___deadline,
16711            )?;
16712        Ok(_response.s)
16713    }
16714
16715    /// Queries the flags that apply to this node after it has been opened/created. This method does
16716    /// not require any rights.
16717    ///
16718    /// Note that the final set of flags that apply to the connection may differ from those
16719    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
16720    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
16721    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
16722    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
16723    pub fn r#get_flags(
16724        &self,
16725        ___deadline: zx::MonotonicInstant,
16726    ) -> Result<NodeGetFlagsResult, fidl::Error> {
16727        let _response = self.client.send_query::<
16728            fidl::encoding::EmptyPayload,
16729            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
16730        >(
16731            (),
16732            0x176eb318f64ec23,
16733            fidl::encoding::DynamicFlags::FLEXIBLE,
16734            ___deadline,
16735        )?
16736        .into_result::<SymlinkMarker>("get_flags")?;
16737        Ok(_response.map(|x| x.flags))
16738    }
16739
16740    /// Sets the flags that apply to this node after it has been opened. This method does not
16741    /// require any rights.
16742    ///
16743    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
16744    /// clear append mode.
16745    ///
16746    /// Errors:
16747    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
16748    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
16749    pub fn r#set_flags(
16750        &self,
16751        mut flags: Flags,
16752        ___deadline: zx::MonotonicInstant,
16753    ) -> Result<NodeSetFlagsResult, fidl::Error> {
16754        let _response = self.client.send_query::<
16755            NodeSetFlagsRequest,
16756            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
16757        >(
16758            (flags,),
16759            0x55a8028685791ea8,
16760            fidl::encoding::DynamicFlags::FLEXIBLE,
16761            ___deadline,
16762        )?
16763        .into_result::<SymlinkMarker>("set_flags")?;
16764        Ok(_response.map(|x| x))
16765    }
16766
16767    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
16768    /// volume has different settings or the storage is accounted seperately from the rest of the
16769    /// filesystem that may be reported instead of filesystem-wide details.
16770    pub fn r#query_filesystem(
16771        &self,
16772        ___deadline: zx::MonotonicInstant,
16773    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
16774        let _response =
16775            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
16776                (),
16777                0x6f344a1c6b0a0610,
16778                fidl::encoding::DynamicFlags::empty(),
16779                ___deadline,
16780            )?;
16781        Ok((_response.s, _response.info))
16782    }
16783
16784    /// Acquires information about the node.
16785    ///
16786    /// The attributes of a node should be stable, independent of the
16787    /// specific protocol used to access it.
16788    ///
16789    /// If a particular attribute is not applicable or not supported,
16790    /// filesystems should leave the corresponding field absent.
16791    ///
16792    /// + `query` a bit-mask specifying which attributes to fetch. The server
16793    ///   should not return more than necessary.
16794    /// - `attributes` the returned attributes.
16795    ///
16796    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
16797    pub fn r#get_attributes(
16798        &self,
16799        mut query: NodeAttributesQuery,
16800        ___deadline: zx::MonotonicInstant,
16801    ) -> Result<NodeGetAttributesResult, fidl::Error> {
16802        let _response = self.client.send_query::<
16803            NodeGetAttributesRequest,
16804            fidl::encoding::ResultType<NodeAttributes2, i32>,
16805        >(
16806            (query,),
16807            0x3d4396a638ea053b,
16808            fidl::encoding::DynamicFlags::empty(),
16809            ___deadline,
16810        )?;
16811        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
16812    }
16813
16814    /// Updates information about the node.
16815    ///
16816    /// + `attributes` the presence of a table field in `attributes` indicates
16817    /// the intent to update the corresponding attribute.
16818    ///
16819    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
16820    ///
16821    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
16822    pub fn r#update_attributes(
16823        &self,
16824        mut payload: &MutableNodeAttributes,
16825        ___deadline: zx::MonotonicInstant,
16826    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
16827        let _response = self.client.send_query::<
16828            MutableNodeAttributes,
16829            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16830        >(
16831            payload,
16832            0x3308c1da5a89bf08,
16833            fidl::encoding::DynamicFlags::empty(),
16834            ___deadline,
16835        )?;
16836        Ok(_response.map(|x| x))
16837    }
16838
16839    /// Synchronizes updates to the node to the underlying media, if it exists.
16840    ///
16841    /// This method will return when the filesystem server has flushed the
16842    /// relevant updates to the underlying media, but does not guarantee the
16843    /// underlying media has persisted the information, nor that any information
16844    /// is committed to hardware. Clients may use `Sync` to ensure ordering
16845    /// between operations.
16846    ///
16847    /// This method does not require any rights.
16848    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
16849        let _response = self.client.send_query::<
16850            fidl::encoding::EmptyPayload,
16851            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16852        >(
16853            (),
16854            0x2c5c27ca0ab5dc49,
16855            fidl::encoding::DynamicFlags::empty(),
16856            ___deadline,
16857        )?;
16858        Ok(_response.map(|x| x))
16859    }
16860
16861    /// Creates an iterator over all the extended attribute names associated
16862    /// with this node. If an error occurs it is returned as an epitaph on the
16863    /// iterator request channel, and then the channel is closed.
16864    ///
16865    /// GetExtendedAttributes can be used with any of these names to retrieve
16866    /// the associated value.
16867    ///
16868    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
16869    pub fn r#list_extended_attributes(
16870        &self,
16871        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
16872    ) -> Result<(), fidl::Error> {
16873        self.client.send::<NodeListExtendedAttributesRequest>(
16874            (iterator,),
16875            0x4b61033de007fcd0,
16876            fidl::encoding::DynamicFlags::empty(),
16877        )
16878    }
16879
16880    /// Get the value associated with the given attribute `name` for this node.
16881    ///
16882    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
16883    /// particular structure is imposed on them.
16884    ///
16885    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
16886    pub fn r#get_extended_attribute(
16887        &self,
16888        mut name: &[u8],
16889        ___deadline: zx::MonotonicInstant,
16890    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
16891        let _response = self.client.send_query::<
16892            NodeGetExtendedAttributeRequest,
16893            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
16894        >(
16895            (name,),
16896            0x45ffa3ccfdeb76db,
16897            fidl::encoding::DynamicFlags::empty(),
16898            ___deadline,
16899        )?;
16900        Ok(_response.map(|x| x))
16901    }
16902
16903    /// Set the value for the given attribute `name` to `value` for this node.
16904    ///
16905    /// The attribute name may exist, in which case the attribute is updated.
16906    /// If the attribute doesn't exist, it is created. The name should have no
16907    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
16908    ///
16909    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
16910    pub fn r#set_extended_attribute(
16911        &self,
16912        mut name: &[u8],
16913        mut value: ExtendedAttributeValue,
16914        mut mode: SetExtendedAttributeMode,
16915        ___deadline: zx::MonotonicInstant,
16916    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
16917        let _response = self.client.send_query::<
16918            NodeSetExtendedAttributeRequest,
16919            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16920        >(
16921            (name, &mut value, mode,),
16922            0x4a951362f681f23c,
16923            fidl::encoding::DynamicFlags::empty(),
16924            ___deadline,
16925        )?;
16926        Ok(_response.map(|x| x))
16927    }
16928
16929    /// Remove the specified extended attribute.
16930    ///
16931    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
16932    ///
16933    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
16934    pub fn r#remove_extended_attribute(
16935        &self,
16936        mut name: &[u8],
16937        ___deadline: zx::MonotonicInstant,
16938    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
16939        let _response = self.client.send_query::<
16940            NodeRemoveExtendedAttributeRequest,
16941            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16942        >(
16943            (name,),
16944            0x7a0b9f3a9bf9032d,
16945            fidl::encoding::DynamicFlags::empty(),
16946            ___deadline,
16947        )?;
16948        Ok(_response.map(|x| x))
16949    }
16950
16951    pub fn r#describe(
16952        &self,
16953        ___deadline: zx::MonotonicInstant,
16954    ) -> Result<SymlinkInfo, fidl::Error> {
16955        let _response = self
16956            .client
16957            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleType<SymlinkInfo>>(
16958                (),
16959                0x742c2ea5e89831f3,
16960                fidl::encoding::DynamicFlags::FLEXIBLE,
16961                ___deadline,
16962            )?
16963            .into_result::<SymlinkMarker>("describe")?;
16964        Ok(_response)
16965    }
16966}
16967
16968#[cfg(target_os = "fuchsia")]
16969impl From<SymlinkSynchronousProxy> for zx::NullableHandle {
16970    fn from(value: SymlinkSynchronousProxy) -> Self {
16971        value.into_channel().into()
16972    }
16973}
16974
16975#[cfg(target_os = "fuchsia")]
16976impl From<fidl::Channel> for SymlinkSynchronousProxy {
16977    fn from(value: fidl::Channel) -> Self {
16978        Self::new(value)
16979    }
16980}
16981
16982#[cfg(target_os = "fuchsia")]
16983impl fidl::endpoints::FromClient for SymlinkSynchronousProxy {
16984    type Protocol = SymlinkMarker;
16985
16986    fn from_client(value: fidl::endpoints::ClientEnd<SymlinkMarker>) -> Self {
16987        Self::new(value.into_channel())
16988    }
16989}
16990
16991#[derive(Debug, Clone)]
16992pub struct SymlinkProxy {
16993    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
16994}
16995
16996impl fidl::endpoints::Proxy for SymlinkProxy {
16997    type Protocol = SymlinkMarker;
16998
16999    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
17000        Self::new(inner)
17001    }
17002
17003    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
17004        self.client.into_channel().map_err(|client| Self { client })
17005    }
17006
17007    fn as_channel(&self) -> &::fidl::AsyncChannel {
17008        self.client.as_channel()
17009    }
17010}
17011
17012impl SymlinkProxy {
17013    /// Create a new Proxy for fuchsia.io/Symlink.
17014    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
17015        let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
17016        Self { client: fidl::client::Client::new(channel, protocol_name) }
17017    }
17018
17019    /// Get a Stream of events from the remote end of the protocol.
17020    ///
17021    /// # Panics
17022    ///
17023    /// Panics if the event stream was already taken.
17024    pub fn take_event_stream(&self) -> SymlinkEventStream {
17025        SymlinkEventStream { event_receiver: self.client.take_event_receiver() }
17026    }
17027
17028    /// Creates a link to this this object with name `dst` in the directory represented by
17029    /// `dst_parent_token`.
17030    ///
17031    /// `dst` must be a resolved object name. Including "/" in the string will return
17032    /// `ZX_ERR_INVALID_ARGS`.
17033    ///
17034    /// This method requires the maximal set of rights supported by the filesystem for this object.
17035    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
17036    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
17037    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
17038    /// `ZX_ERR_ACCESS_DENIED`.
17039    ///
17040    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
17041    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
17042    ///
17043    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
17044    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
17045    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
17046    ///
17047    /// This method does not have the same atomicity properties has the `Directory::Link` method,
17048    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
17049    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
17050    pub fn r#link_into(
17051        &self,
17052        mut dst_parent_token: fidl::Event,
17053        mut dst: &str,
17054    ) -> fidl::client::QueryResponseFut<
17055        LinkableLinkIntoResult,
17056        fidl::encoding::DefaultFuchsiaResourceDialect,
17057    > {
17058        SymlinkProxyInterface::r#link_into(self, dst_parent_token, dst)
17059    }
17060
17061    pub fn r#clone(
17062        &self,
17063        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17064    ) -> Result<(), fidl::Error> {
17065        SymlinkProxyInterface::r#clone(self, request)
17066    }
17067
17068    /// Terminates the connection.
17069    ///
17070    /// After calling `Close`, the client must not send any other requests.
17071    ///
17072    /// Servers, after sending the status response, should close the connection
17073    /// regardless of status and without sending an epitaph.
17074    ///
17075    /// Closing the client end of the channel should be semantically equivalent
17076    /// to calling `Close` without knowing when the close has completed or its
17077    /// status.
17078    pub fn r#close(
17079        &self,
17080    ) -> fidl::client::QueryResponseFut<
17081        fidl_fuchsia_unknown::CloseableCloseResult,
17082        fidl::encoding::DefaultFuchsiaResourceDialect,
17083    > {
17084        SymlinkProxyInterface::r#close(self)
17085    }
17086
17087    pub fn r#query(
17088        &self,
17089    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
17090    {
17091        SymlinkProxyInterface::r#query(self)
17092    }
17093
17094    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
17095    pub fn r#deprecated_clone(
17096        &self,
17097        mut flags: OpenFlags,
17098        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17099    ) -> Result<(), fidl::Error> {
17100        SymlinkProxyInterface::r#deprecated_clone(self, flags, object)
17101    }
17102
17103    /// DEPRECATED - Use `Node.GetAttributes` instead.
17104    pub fn r#deprecated_get_attr(
17105        &self,
17106    ) -> fidl::client::QueryResponseFut<
17107        (i32, NodeAttributes),
17108        fidl::encoding::DefaultFuchsiaResourceDialect,
17109    > {
17110        SymlinkProxyInterface::r#deprecated_get_attr(self)
17111    }
17112
17113    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
17114    pub fn r#deprecated_set_attr(
17115        &self,
17116        mut flags: NodeAttributeFlags,
17117        mut attributes: &NodeAttributes,
17118    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
17119        SymlinkProxyInterface::r#deprecated_set_attr(self, flags, attributes)
17120    }
17121
17122    /// [DEPRECATED - Use new GetFlags method instead.]
17123    pub fn r#deprecated_get_flags(
17124        &self,
17125    ) -> fidl::client::QueryResponseFut<
17126        (i32, OpenFlags),
17127        fidl::encoding::DefaultFuchsiaResourceDialect,
17128    > {
17129        SymlinkProxyInterface::r#deprecated_get_flags(self)
17130    }
17131
17132    /// [DEPRECATED - Use new SetFlags method instead.]
17133    pub fn r#deprecated_set_flags(
17134        &self,
17135        mut flags: OpenFlags,
17136    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
17137        SymlinkProxyInterface::r#deprecated_set_flags(self, flags)
17138    }
17139
17140    /// Queries the flags that apply to this node after it has been opened/created. This method does
17141    /// not require any rights.
17142    ///
17143    /// Note that the final set of flags that apply to the connection may differ from those
17144    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
17145    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
17146    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
17147    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
17148    pub fn r#get_flags(
17149        &self,
17150    ) -> fidl::client::QueryResponseFut<
17151        NodeGetFlagsResult,
17152        fidl::encoding::DefaultFuchsiaResourceDialect,
17153    > {
17154        SymlinkProxyInterface::r#get_flags(self)
17155    }
17156
17157    /// Sets the flags that apply to this node after it has been opened. This method does not
17158    /// require any rights.
17159    ///
17160    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
17161    /// clear append mode.
17162    ///
17163    /// Errors:
17164    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
17165    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
17166    pub fn r#set_flags(
17167        &self,
17168        mut flags: Flags,
17169    ) -> fidl::client::QueryResponseFut<
17170        NodeSetFlagsResult,
17171        fidl::encoding::DefaultFuchsiaResourceDialect,
17172    > {
17173        SymlinkProxyInterface::r#set_flags(self, flags)
17174    }
17175
17176    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
17177    /// volume has different settings or the storage is accounted seperately from the rest of the
17178    /// filesystem that may be reported instead of filesystem-wide details.
17179    pub fn r#query_filesystem(
17180        &self,
17181    ) -> fidl::client::QueryResponseFut<
17182        (i32, Option<Box<FilesystemInfo>>),
17183        fidl::encoding::DefaultFuchsiaResourceDialect,
17184    > {
17185        SymlinkProxyInterface::r#query_filesystem(self)
17186    }
17187
17188    /// Acquires information about the node.
17189    ///
17190    /// The attributes of a node should be stable, independent of the
17191    /// specific protocol used to access it.
17192    ///
17193    /// If a particular attribute is not applicable or not supported,
17194    /// filesystems should leave the corresponding field absent.
17195    ///
17196    /// + `query` a bit-mask specifying which attributes to fetch. The server
17197    ///   should not return more than necessary.
17198    /// - `attributes` the returned attributes.
17199    ///
17200    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17201    pub fn r#get_attributes(
17202        &self,
17203        mut query: NodeAttributesQuery,
17204    ) -> fidl::client::QueryResponseFut<
17205        NodeGetAttributesResult,
17206        fidl::encoding::DefaultFuchsiaResourceDialect,
17207    > {
17208        SymlinkProxyInterface::r#get_attributes(self, query)
17209    }
17210
17211    /// Updates information about the node.
17212    ///
17213    /// + `attributes` the presence of a table field in `attributes` indicates
17214    /// the intent to update the corresponding attribute.
17215    ///
17216    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
17217    ///
17218    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17219    pub fn r#update_attributes(
17220        &self,
17221        mut payload: &MutableNodeAttributes,
17222    ) -> fidl::client::QueryResponseFut<
17223        NodeUpdateAttributesResult,
17224        fidl::encoding::DefaultFuchsiaResourceDialect,
17225    > {
17226        SymlinkProxyInterface::r#update_attributes(self, payload)
17227    }
17228
17229    /// Synchronizes updates to the node to the underlying media, if it exists.
17230    ///
17231    /// This method will return when the filesystem server has flushed the
17232    /// relevant updates to the underlying media, but does not guarantee the
17233    /// underlying media has persisted the information, nor that any information
17234    /// is committed to hardware. Clients may use `Sync` to ensure ordering
17235    /// between operations.
17236    ///
17237    /// This method does not require any rights.
17238    pub fn r#sync(
17239        &self,
17240    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
17241    {
17242        SymlinkProxyInterface::r#sync(self)
17243    }
17244
17245    /// Creates an iterator over all the extended attribute names associated
17246    /// with this node. If an error occurs it is returned as an epitaph on the
17247    /// iterator request channel, and then the channel is closed.
17248    ///
17249    /// GetExtendedAttributes can be used with any of these names to retrieve
17250    /// the associated value.
17251    ///
17252    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17253    pub fn r#list_extended_attributes(
17254        &self,
17255        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17256    ) -> Result<(), fidl::Error> {
17257        SymlinkProxyInterface::r#list_extended_attributes(self, iterator)
17258    }
17259
17260    /// Get the value associated with the given attribute `name` for this node.
17261    ///
17262    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
17263    /// particular structure is imposed on them.
17264    ///
17265    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17266    pub fn r#get_extended_attribute(
17267        &self,
17268        mut name: &[u8],
17269    ) -> fidl::client::QueryResponseFut<
17270        NodeGetExtendedAttributeResult,
17271        fidl::encoding::DefaultFuchsiaResourceDialect,
17272    > {
17273        SymlinkProxyInterface::r#get_extended_attribute(self, name)
17274    }
17275
17276    /// Set the value for the given attribute `name` to `value` for this node.
17277    ///
17278    /// The attribute name may exist, in which case the attribute is updated.
17279    /// If the attribute doesn't exist, it is created. The name should have no
17280    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
17281    ///
17282    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17283    pub fn r#set_extended_attribute(
17284        &self,
17285        mut name: &[u8],
17286        mut value: ExtendedAttributeValue,
17287        mut mode: SetExtendedAttributeMode,
17288    ) -> fidl::client::QueryResponseFut<
17289        NodeSetExtendedAttributeResult,
17290        fidl::encoding::DefaultFuchsiaResourceDialect,
17291    > {
17292        SymlinkProxyInterface::r#set_extended_attribute(self, name, value, mode)
17293    }
17294
17295    /// Remove the specified extended attribute.
17296    ///
17297    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
17298    ///
17299    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17300    pub fn r#remove_extended_attribute(
17301        &self,
17302        mut name: &[u8],
17303    ) -> fidl::client::QueryResponseFut<
17304        NodeRemoveExtendedAttributeResult,
17305        fidl::encoding::DefaultFuchsiaResourceDialect,
17306    > {
17307        SymlinkProxyInterface::r#remove_extended_attribute(self, name)
17308    }
17309
17310    pub fn r#describe(
17311        &self,
17312    ) -> fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
17313    {
17314        SymlinkProxyInterface::r#describe(self)
17315    }
17316}
17317
17318impl SymlinkProxyInterface for SymlinkProxy {
17319    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
17320        LinkableLinkIntoResult,
17321        fidl::encoding::DefaultFuchsiaResourceDialect,
17322    >;
17323    fn r#link_into(
17324        &self,
17325        mut dst_parent_token: fidl::Event,
17326        mut dst: &str,
17327    ) -> Self::LinkIntoResponseFut {
17328        fn _decode(
17329            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17330        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
17331            let _response = fidl::client::decode_transaction_body::<
17332                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17333                fidl::encoding::DefaultFuchsiaResourceDialect,
17334                0x54f3949246a03e74,
17335            >(_buf?)?;
17336            Ok(_response.map(|x| x))
17337        }
17338        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
17339            (dst_parent_token, dst),
17340            0x54f3949246a03e74,
17341            fidl::encoding::DynamicFlags::empty(),
17342            _decode,
17343        )
17344    }
17345
17346    fn r#clone(
17347        &self,
17348        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17349    ) -> Result<(), fidl::Error> {
17350        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
17351            (request,),
17352            0x20d8a7aba2168a79,
17353            fidl::encoding::DynamicFlags::empty(),
17354        )
17355    }
17356
17357    type CloseResponseFut = fidl::client::QueryResponseFut<
17358        fidl_fuchsia_unknown::CloseableCloseResult,
17359        fidl::encoding::DefaultFuchsiaResourceDialect,
17360    >;
17361    fn r#close(&self) -> Self::CloseResponseFut {
17362        fn _decode(
17363            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17364        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
17365            let _response = fidl::client::decode_transaction_body::<
17366                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17367                fidl::encoding::DefaultFuchsiaResourceDialect,
17368                0x5ac5d459ad7f657e,
17369            >(_buf?)?;
17370            Ok(_response.map(|x| x))
17371        }
17372        self.client.send_query_and_decode::<
17373            fidl::encoding::EmptyPayload,
17374            fidl_fuchsia_unknown::CloseableCloseResult,
17375        >(
17376            (),
17377            0x5ac5d459ad7f657e,
17378            fidl::encoding::DynamicFlags::empty(),
17379            _decode,
17380        )
17381    }
17382
17383    type QueryResponseFut =
17384        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
17385    fn r#query(&self) -> Self::QueryResponseFut {
17386        fn _decode(
17387            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17388        ) -> Result<Vec<u8>, fidl::Error> {
17389            let _response = fidl::client::decode_transaction_body::<
17390                fidl_fuchsia_unknown::QueryableQueryResponse,
17391                fidl::encoding::DefaultFuchsiaResourceDialect,
17392                0x2658edee9decfc06,
17393            >(_buf?)?;
17394            Ok(_response.protocol)
17395        }
17396        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
17397            (),
17398            0x2658edee9decfc06,
17399            fidl::encoding::DynamicFlags::empty(),
17400            _decode,
17401        )
17402    }
17403
17404    fn r#deprecated_clone(
17405        &self,
17406        mut flags: OpenFlags,
17407        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17408    ) -> Result<(), fidl::Error> {
17409        self.client.send::<NodeDeprecatedCloneRequest>(
17410            (flags, object),
17411            0x5a61678f293ce16f,
17412            fidl::encoding::DynamicFlags::FLEXIBLE,
17413        )
17414    }
17415
17416    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
17417        (i32, NodeAttributes),
17418        fidl::encoding::DefaultFuchsiaResourceDialect,
17419    >;
17420    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
17421        fn _decode(
17422            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17423        ) -> Result<(i32, NodeAttributes), fidl::Error> {
17424            let _response = fidl::client::decode_transaction_body::<
17425                NodeDeprecatedGetAttrResponse,
17426                fidl::encoding::DefaultFuchsiaResourceDialect,
17427                0x78985e216314dafd,
17428            >(_buf?)?;
17429            Ok((_response.s, _response.attributes))
17430        }
17431        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
17432            (),
17433            0x78985e216314dafd,
17434            fidl::encoding::DynamicFlags::empty(),
17435            _decode,
17436        )
17437    }
17438
17439    type DeprecatedSetAttrResponseFut =
17440        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
17441    fn r#deprecated_set_attr(
17442        &self,
17443        mut flags: NodeAttributeFlags,
17444        mut attributes: &NodeAttributes,
17445    ) -> Self::DeprecatedSetAttrResponseFut {
17446        fn _decode(
17447            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17448        ) -> Result<i32, fidl::Error> {
17449            let _response = fidl::client::decode_transaction_body::<
17450                NodeDeprecatedSetAttrResponse,
17451                fidl::encoding::DefaultFuchsiaResourceDialect,
17452                0x4186c0f40d938f46,
17453            >(_buf?)?;
17454            Ok(_response.s)
17455        }
17456        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
17457            (flags, attributes),
17458            0x4186c0f40d938f46,
17459            fidl::encoding::DynamicFlags::empty(),
17460            _decode,
17461        )
17462    }
17463
17464    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
17465        (i32, OpenFlags),
17466        fidl::encoding::DefaultFuchsiaResourceDialect,
17467    >;
17468    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
17469        fn _decode(
17470            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17471        ) -> Result<(i32, OpenFlags), fidl::Error> {
17472            let _response = fidl::client::decode_transaction_body::<
17473                NodeDeprecatedGetFlagsResponse,
17474                fidl::encoding::DefaultFuchsiaResourceDialect,
17475                0x5b88fffb8eda3aa1,
17476            >(_buf?)?;
17477            Ok((_response.s, _response.flags))
17478        }
17479        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
17480            (),
17481            0x5b88fffb8eda3aa1,
17482            fidl::encoding::DynamicFlags::empty(),
17483            _decode,
17484        )
17485    }
17486
17487    type DeprecatedSetFlagsResponseFut =
17488        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
17489    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
17490        fn _decode(
17491            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17492        ) -> Result<i32, fidl::Error> {
17493            let _response = fidl::client::decode_transaction_body::<
17494                NodeDeprecatedSetFlagsResponse,
17495                fidl::encoding::DefaultFuchsiaResourceDialect,
17496                0x5295b76c71fde733,
17497            >(_buf?)?;
17498            Ok(_response.s)
17499        }
17500        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
17501            (flags,),
17502            0x5295b76c71fde733,
17503            fidl::encoding::DynamicFlags::empty(),
17504            _decode,
17505        )
17506    }
17507
17508    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
17509        NodeGetFlagsResult,
17510        fidl::encoding::DefaultFuchsiaResourceDialect,
17511    >;
17512    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
17513        fn _decode(
17514            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17515        ) -> Result<NodeGetFlagsResult, fidl::Error> {
17516            let _response = fidl::client::decode_transaction_body::<
17517                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
17518                fidl::encoding::DefaultFuchsiaResourceDialect,
17519                0x176eb318f64ec23,
17520            >(_buf?)?
17521            .into_result::<SymlinkMarker>("get_flags")?;
17522            Ok(_response.map(|x| x.flags))
17523        }
17524        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
17525            (),
17526            0x176eb318f64ec23,
17527            fidl::encoding::DynamicFlags::FLEXIBLE,
17528            _decode,
17529        )
17530    }
17531
17532    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
17533        NodeSetFlagsResult,
17534        fidl::encoding::DefaultFuchsiaResourceDialect,
17535    >;
17536    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
17537        fn _decode(
17538            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17539        ) -> Result<NodeSetFlagsResult, fidl::Error> {
17540            let _response = fidl::client::decode_transaction_body::<
17541                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
17542                fidl::encoding::DefaultFuchsiaResourceDialect,
17543                0x55a8028685791ea8,
17544            >(_buf?)?
17545            .into_result::<SymlinkMarker>("set_flags")?;
17546            Ok(_response.map(|x| x))
17547        }
17548        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
17549            (flags,),
17550            0x55a8028685791ea8,
17551            fidl::encoding::DynamicFlags::FLEXIBLE,
17552            _decode,
17553        )
17554    }
17555
17556    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
17557        (i32, Option<Box<FilesystemInfo>>),
17558        fidl::encoding::DefaultFuchsiaResourceDialect,
17559    >;
17560    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
17561        fn _decode(
17562            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17563        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
17564            let _response = fidl::client::decode_transaction_body::<
17565                NodeQueryFilesystemResponse,
17566                fidl::encoding::DefaultFuchsiaResourceDialect,
17567                0x6f344a1c6b0a0610,
17568            >(_buf?)?;
17569            Ok((_response.s, _response.info))
17570        }
17571        self.client.send_query_and_decode::<
17572            fidl::encoding::EmptyPayload,
17573            (i32, Option<Box<FilesystemInfo>>),
17574        >(
17575            (),
17576            0x6f344a1c6b0a0610,
17577            fidl::encoding::DynamicFlags::empty(),
17578            _decode,
17579        )
17580    }
17581
17582    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
17583        NodeGetAttributesResult,
17584        fidl::encoding::DefaultFuchsiaResourceDialect,
17585    >;
17586    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
17587        fn _decode(
17588            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17589        ) -> Result<NodeGetAttributesResult, fidl::Error> {
17590            let _response = fidl::client::decode_transaction_body::<
17591                fidl::encoding::ResultType<NodeAttributes2, i32>,
17592                fidl::encoding::DefaultFuchsiaResourceDialect,
17593                0x3d4396a638ea053b,
17594            >(_buf?)?;
17595            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
17596        }
17597        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
17598            (query,),
17599            0x3d4396a638ea053b,
17600            fidl::encoding::DynamicFlags::empty(),
17601            _decode,
17602        )
17603    }
17604
17605    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
17606        NodeUpdateAttributesResult,
17607        fidl::encoding::DefaultFuchsiaResourceDialect,
17608    >;
17609    fn r#update_attributes(
17610        &self,
17611        mut payload: &MutableNodeAttributes,
17612    ) -> Self::UpdateAttributesResponseFut {
17613        fn _decode(
17614            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17615        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
17616            let _response = fidl::client::decode_transaction_body::<
17617                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17618                fidl::encoding::DefaultFuchsiaResourceDialect,
17619                0x3308c1da5a89bf08,
17620            >(_buf?)?;
17621            Ok(_response.map(|x| x))
17622        }
17623        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
17624            payload,
17625            0x3308c1da5a89bf08,
17626            fidl::encoding::DynamicFlags::empty(),
17627            _decode,
17628        )
17629    }
17630
17631    type SyncResponseFut = fidl::client::QueryResponseFut<
17632        NodeSyncResult,
17633        fidl::encoding::DefaultFuchsiaResourceDialect,
17634    >;
17635    fn r#sync(&self) -> Self::SyncResponseFut {
17636        fn _decode(
17637            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17638        ) -> Result<NodeSyncResult, fidl::Error> {
17639            let _response = fidl::client::decode_transaction_body::<
17640                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17641                fidl::encoding::DefaultFuchsiaResourceDialect,
17642                0x2c5c27ca0ab5dc49,
17643            >(_buf?)?;
17644            Ok(_response.map(|x| x))
17645        }
17646        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
17647            (),
17648            0x2c5c27ca0ab5dc49,
17649            fidl::encoding::DynamicFlags::empty(),
17650            _decode,
17651        )
17652    }
17653
17654    fn r#list_extended_attributes(
17655        &self,
17656        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17657    ) -> Result<(), fidl::Error> {
17658        self.client.send::<NodeListExtendedAttributesRequest>(
17659            (iterator,),
17660            0x4b61033de007fcd0,
17661            fidl::encoding::DynamicFlags::empty(),
17662        )
17663    }
17664
17665    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
17666        NodeGetExtendedAttributeResult,
17667        fidl::encoding::DefaultFuchsiaResourceDialect,
17668    >;
17669    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
17670        fn _decode(
17671            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17672        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
17673            let _response = fidl::client::decode_transaction_body::<
17674                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
17675                fidl::encoding::DefaultFuchsiaResourceDialect,
17676                0x45ffa3ccfdeb76db,
17677            >(_buf?)?;
17678            Ok(_response.map(|x| x))
17679        }
17680        self.client.send_query_and_decode::<
17681            NodeGetExtendedAttributeRequest,
17682            NodeGetExtendedAttributeResult,
17683        >(
17684            (name,),
17685            0x45ffa3ccfdeb76db,
17686            fidl::encoding::DynamicFlags::empty(),
17687            _decode,
17688        )
17689    }
17690
17691    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
17692        NodeSetExtendedAttributeResult,
17693        fidl::encoding::DefaultFuchsiaResourceDialect,
17694    >;
17695    fn r#set_extended_attribute(
17696        &self,
17697        mut name: &[u8],
17698        mut value: ExtendedAttributeValue,
17699        mut mode: SetExtendedAttributeMode,
17700    ) -> Self::SetExtendedAttributeResponseFut {
17701        fn _decode(
17702            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17703        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
17704            let _response = fidl::client::decode_transaction_body::<
17705                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17706                fidl::encoding::DefaultFuchsiaResourceDialect,
17707                0x4a951362f681f23c,
17708            >(_buf?)?;
17709            Ok(_response.map(|x| x))
17710        }
17711        self.client.send_query_and_decode::<
17712            NodeSetExtendedAttributeRequest,
17713            NodeSetExtendedAttributeResult,
17714        >(
17715            (name, &mut value, mode,),
17716            0x4a951362f681f23c,
17717            fidl::encoding::DynamicFlags::empty(),
17718            _decode,
17719        )
17720    }
17721
17722    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
17723        NodeRemoveExtendedAttributeResult,
17724        fidl::encoding::DefaultFuchsiaResourceDialect,
17725    >;
17726    fn r#remove_extended_attribute(
17727        &self,
17728        mut name: &[u8],
17729    ) -> Self::RemoveExtendedAttributeResponseFut {
17730        fn _decode(
17731            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17732        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
17733            let _response = fidl::client::decode_transaction_body::<
17734                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17735                fidl::encoding::DefaultFuchsiaResourceDialect,
17736                0x7a0b9f3a9bf9032d,
17737            >(_buf?)?;
17738            Ok(_response.map(|x| x))
17739        }
17740        self.client.send_query_and_decode::<
17741            NodeRemoveExtendedAttributeRequest,
17742            NodeRemoveExtendedAttributeResult,
17743        >(
17744            (name,),
17745            0x7a0b9f3a9bf9032d,
17746            fidl::encoding::DynamicFlags::empty(),
17747            _decode,
17748        )
17749    }
17750
17751    type DescribeResponseFut =
17752        fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
17753    fn r#describe(&self) -> Self::DescribeResponseFut {
17754        fn _decode(
17755            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17756        ) -> Result<SymlinkInfo, fidl::Error> {
17757            let _response = fidl::client::decode_transaction_body::<
17758                fidl::encoding::FlexibleType<SymlinkInfo>,
17759                fidl::encoding::DefaultFuchsiaResourceDialect,
17760                0x742c2ea5e89831f3,
17761            >(_buf?)?
17762            .into_result::<SymlinkMarker>("describe")?;
17763            Ok(_response)
17764        }
17765        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SymlinkInfo>(
17766            (),
17767            0x742c2ea5e89831f3,
17768            fidl::encoding::DynamicFlags::FLEXIBLE,
17769            _decode,
17770        )
17771    }
17772}
17773
17774pub struct SymlinkEventStream {
17775    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
17776}
17777
17778impl std::marker::Unpin for SymlinkEventStream {}
17779
17780impl futures::stream::FusedStream for SymlinkEventStream {
17781    fn is_terminated(&self) -> bool {
17782        self.event_receiver.is_terminated()
17783    }
17784}
17785
17786impl futures::Stream for SymlinkEventStream {
17787    type Item = Result<SymlinkEvent, fidl::Error>;
17788
17789    fn poll_next(
17790        mut self: std::pin::Pin<&mut Self>,
17791        cx: &mut std::task::Context<'_>,
17792    ) -> std::task::Poll<Option<Self::Item>> {
17793        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
17794            &mut self.event_receiver,
17795            cx
17796        )?) {
17797            Some(buf) => std::task::Poll::Ready(Some(SymlinkEvent::decode(buf))),
17798            None => std::task::Poll::Ready(None),
17799        }
17800    }
17801}
17802
17803#[derive(Debug)]
17804pub enum SymlinkEvent {
17805    OnOpen_ {
17806        s: i32,
17807        info: Option<Box<NodeInfoDeprecated>>,
17808    },
17809    OnRepresentation {
17810        payload: Representation,
17811    },
17812    #[non_exhaustive]
17813    _UnknownEvent {
17814        /// Ordinal of the event that was sent.
17815        ordinal: u64,
17816    },
17817}
17818
17819impl SymlinkEvent {
17820    #[allow(irrefutable_let_patterns)]
17821    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
17822        if let SymlinkEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
17823    }
17824    #[allow(irrefutable_let_patterns)]
17825    pub fn into_on_representation(self) -> Option<Representation> {
17826        if let SymlinkEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
17827    }
17828
17829    /// Decodes a message buffer as a [`SymlinkEvent`].
17830    fn decode(
17831        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
17832    ) -> Result<SymlinkEvent, fidl::Error> {
17833        let (bytes, _handles) = buf.split_mut();
17834        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17835        debug_assert_eq!(tx_header.tx_id, 0);
17836        match tx_header.ordinal {
17837            0x7fc7bbb1dbfd1972 => {
17838                let mut out = fidl::new_empty!(
17839                    NodeOnOpenRequest,
17840                    fidl::encoding::DefaultFuchsiaResourceDialect
17841                );
17842                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
17843                Ok((SymlinkEvent::OnOpen_ { s: out.s, info: out.info }))
17844            }
17845            0x5cb40567d80a510c => {
17846                let mut out =
17847                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
17848                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
17849                Ok((SymlinkEvent::OnRepresentation { payload: out }))
17850            }
17851            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
17852                Ok(SymlinkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
17853            }
17854            _ => Err(fidl::Error::UnknownOrdinal {
17855                ordinal: tx_header.ordinal,
17856                protocol_name: <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
17857            }),
17858        }
17859    }
17860}
17861
17862/// A Stream of incoming requests for fuchsia.io/Symlink.
17863pub struct SymlinkRequestStream {
17864    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
17865    is_terminated: bool,
17866}
17867
17868impl std::marker::Unpin for SymlinkRequestStream {}
17869
17870impl futures::stream::FusedStream for SymlinkRequestStream {
17871    fn is_terminated(&self) -> bool {
17872        self.is_terminated
17873    }
17874}
17875
17876impl fidl::endpoints::RequestStream for SymlinkRequestStream {
17877    type Protocol = SymlinkMarker;
17878    type ControlHandle = SymlinkControlHandle;
17879
17880    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
17881        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
17882    }
17883
17884    fn control_handle(&self) -> Self::ControlHandle {
17885        SymlinkControlHandle { inner: self.inner.clone() }
17886    }
17887
17888    fn into_inner(
17889        self,
17890    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
17891    {
17892        (self.inner, self.is_terminated)
17893    }
17894
17895    fn from_inner(
17896        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
17897        is_terminated: bool,
17898    ) -> Self {
17899        Self { inner, is_terminated }
17900    }
17901}
17902
17903impl futures::Stream for SymlinkRequestStream {
17904    type Item = Result<SymlinkRequest, fidl::Error>;
17905
17906    fn poll_next(
17907        mut self: std::pin::Pin<&mut Self>,
17908        cx: &mut std::task::Context<'_>,
17909    ) -> std::task::Poll<Option<Self::Item>> {
17910        let this = &mut *self;
17911        if this.inner.check_shutdown(cx) {
17912            this.is_terminated = true;
17913            return std::task::Poll::Ready(None);
17914        }
17915        if this.is_terminated {
17916            panic!("polled SymlinkRequestStream after completion");
17917        }
17918        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
17919            |bytes, handles| {
17920                match this.inner.channel().read_etc(cx, bytes, handles) {
17921                    std::task::Poll::Ready(Ok(())) => {}
17922                    std::task::Poll::Pending => return std::task::Poll::Pending,
17923                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
17924                        this.is_terminated = true;
17925                        return std::task::Poll::Ready(None);
17926                    }
17927                    std::task::Poll::Ready(Err(e)) => {
17928                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
17929                            e.into(),
17930                        ))));
17931                    }
17932                }
17933
17934                // A message has been received from the channel
17935                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17936
17937                std::task::Poll::Ready(Some(match header.ordinal {
17938                    0x54f3949246a03e74 => {
17939                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17940                        let mut req = fidl::new_empty!(
17941                            LinkableLinkIntoRequest,
17942                            fidl::encoding::DefaultFuchsiaResourceDialect
17943                        );
17944                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
17945                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17946                        Ok(SymlinkRequest::LinkInto {
17947                            dst_parent_token: req.dst_parent_token,
17948                            dst: req.dst,
17949
17950                            responder: SymlinkLinkIntoResponder {
17951                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17952                                tx_id: header.tx_id,
17953                            },
17954                        })
17955                    }
17956                    0x20d8a7aba2168a79 => {
17957                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
17958                        let mut req = fidl::new_empty!(
17959                            fidl_fuchsia_unknown::CloneableCloneRequest,
17960                            fidl::encoding::DefaultFuchsiaResourceDialect
17961                        );
17962                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
17963                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17964                        Ok(SymlinkRequest::Clone { request: req.request, control_handle })
17965                    }
17966                    0x5ac5d459ad7f657e => {
17967                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17968                        let mut req = fidl::new_empty!(
17969                            fidl::encoding::EmptyPayload,
17970                            fidl::encoding::DefaultFuchsiaResourceDialect
17971                        );
17972                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
17973                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17974                        Ok(SymlinkRequest::Close {
17975                            responder: SymlinkCloseResponder {
17976                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17977                                tx_id: header.tx_id,
17978                            },
17979                        })
17980                    }
17981                    0x2658edee9decfc06 => {
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::Query {
17990                            responder: SymlinkQueryResponder {
17991                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17992                                tx_id: header.tx_id,
17993                            },
17994                        })
17995                    }
17996                    0x5a61678f293ce16f => {
17997                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
17998                        let mut req = fidl::new_empty!(
17999                            NodeDeprecatedCloneRequest,
18000                            fidl::encoding::DefaultFuchsiaResourceDialect
18001                        );
18002                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
18003                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18004                        Ok(SymlinkRequest::DeprecatedClone {
18005                            flags: req.flags,
18006                            object: req.object,
18007
18008                            control_handle,
18009                        })
18010                    }
18011                    0x78985e216314dafd => {
18012                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18013                        let mut req = fidl::new_empty!(
18014                            fidl::encoding::EmptyPayload,
18015                            fidl::encoding::DefaultFuchsiaResourceDialect
18016                        );
18017                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18018                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18019                        Ok(SymlinkRequest::DeprecatedGetAttr {
18020                            responder: SymlinkDeprecatedGetAttrResponder {
18021                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18022                                tx_id: header.tx_id,
18023                            },
18024                        })
18025                    }
18026                    0x4186c0f40d938f46 => {
18027                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18028                        let mut req = fidl::new_empty!(
18029                            NodeDeprecatedSetAttrRequest,
18030                            fidl::encoding::DefaultFuchsiaResourceDialect
18031                        );
18032                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
18033                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18034                        Ok(SymlinkRequest::DeprecatedSetAttr {
18035                            flags: req.flags,
18036                            attributes: req.attributes,
18037
18038                            responder: SymlinkDeprecatedSetAttrResponder {
18039                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18040                                tx_id: header.tx_id,
18041                            },
18042                        })
18043                    }
18044                    0x5b88fffb8eda3aa1 => {
18045                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18046                        let mut req = fidl::new_empty!(
18047                            fidl::encoding::EmptyPayload,
18048                            fidl::encoding::DefaultFuchsiaResourceDialect
18049                        );
18050                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18051                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18052                        Ok(SymlinkRequest::DeprecatedGetFlags {
18053                            responder: SymlinkDeprecatedGetFlagsResponder {
18054                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18055                                tx_id: header.tx_id,
18056                            },
18057                        })
18058                    }
18059                    0x5295b76c71fde733 => {
18060                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18061                        let mut req = fidl::new_empty!(
18062                            NodeDeprecatedSetFlagsRequest,
18063                            fidl::encoding::DefaultFuchsiaResourceDialect
18064                        );
18065                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
18066                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18067                        Ok(SymlinkRequest::DeprecatedSetFlags {
18068                            flags: req.flags,
18069
18070                            responder: SymlinkDeprecatedSetFlagsResponder {
18071                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18072                                tx_id: header.tx_id,
18073                            },
18074                        })
18075                    }
18076                    0x176eb318f64ec23 => {
18077                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18078                        let mut req = fidl::new_empty!(
18079                            fidl::encoding::EmptyPayload,
18080                            fidl::encoding::DefaultFuchsiaResourceDialect
18081                        );
18082                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18083                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18084                        Ok(SymlinkRequest::GetFlags {
18085                            responder: SymlinkGetFlagsResponder {
18086                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18087                                tx_id: header.tx_id,
18088                            },
18089                        })
18090                    }
18091                    0x55a8028685791ea8 => {
18092                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18093                        let mut req = fidl::new_empty!(
18094                            NodeSetFlagsRequest,
18095                            fidl::encoding::DefaultFuchsiaResourceDialect
18096                        );
18097                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
18098                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18099                        Ok(SymlinkRequest::SetFlags {
18100                            flags: req.flags,
18101
18102                            responder: SymlinkSetFlagsResponder {
18103                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18104                                tx_id: header.tx_id,
18105                            },
18106                        })
18107                    }
18108                    0x6f344a1c6b0a0610 => {
18109                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18110                        let mut req = fidl::new_empty!(
18111                            fidl::encoding::EmptyPayload,
18112                            fidl::encoding::DefaultFuchsiaResourceDialect
18113                        );
18114                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18115                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18116                        Ok(SymlinkRequest::QueryFilesystem {
18117                            responder: SymlinkQueryFilesystemResponder {
18118                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18119                                tx_id: header.tx_id,
18120                            },
18121                        })
18122                    }
18123                    0x3d4396a638ea053b => {
18124                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18125                        let mut req = fidl::new_empty!(
18126                            NodeGetAttributesRequest,
18127                            fidl::encoding::DefaultFuchsiaResourceDialect
18128                        );
18129                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
18130                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18131                        Ok(SymlinkRequest::GetAttributes {
18132                            query: req.query,
18133
18134                            responder: SymlinkGetAttributesResponder {
18135                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18136                                tx_id: header.tx_id,
18137                            },
18138                        })
18139                    }
18140                    0x3308c1da5a89bf08 => {
18141                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18142                        let mut req = fidl::new_empty!(
18143                            MutableNodeAttributes,
18144                            fidl::encoding::DefaultFuchsiaResourceDialect
18145                        );
18146                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
18147                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18148                        Ok(SymlinkRequest::UpdateAttributes {
18149                            payload: req,
18150                            responder: SymlinkUpdateAttributesResponder {
18151                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18152                                tx_id: header.tx_id,
18153                            },
18154                        })
18155                    }
18156                    0x2c5c27ca0ab5dc49 => {
18157                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18158                        let mut req = fidl::new_empty!(
18159                            fidl::encoding::EmptyPayload,
18160                            fidl::encoding::DefaultFuchsiaResourceDialect
18161                        );
18162                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18163                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18164                        Ok(SymlinkRequest::Sync {
18165                            responder: SymlinkSyncResponder {
18166                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18167                                tx_id: header.tx_id,
18168                            },
18169                        })
18170                    }
18171                    0x4b61033de007fcd0 => {
18172                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18173                        let mut req = fidl::new_empty!(
18174                            NodeListExtendedAttributesRequest,
18175                            fidl::encoding::DefaultFuchsiaResourceDialect
18176                        );
18177                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
18178                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18179                        Ok(SymlinkRequest::ListExtendedAttributes {
18180                            iterator: req.iterator,
18181
18182                            control_handle,
18183                        })
18184                    }
18185                    0x45ffa3ccfdeb76db => {
18186                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18187                        let mut req = fidl::new_empty!(
18188                            NodeGetExtendedAttributeRequest,
18189                            fidl::encoding::DefaultFuchsiaResourceDialect
18190                        );
18191                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18192                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18193                        Ok(SymlinkRequest::GetExtendedAttribute {
18194                            name: req.name,
18195
18196                            responder: SymlinkGetExtendedAttributeResponder {
18197                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18198                                tx_id: header.tx_id,
18199                            },
18200                        })
18201                    }
18202                    0x4a951362f681f23c => {
18203                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18204                        let mut req = fidl::new_empty!(
18205                            NodeSetExtendedAttributeRequest,
18206                            fidl::encoding::DefaultFuchsiaResourceDialect
18207                        );
18208                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18209                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18210                        Ok(SymlinkRequest::SetExtendedAttribute {
18211                            name: req.name,
18212                            value: req.value,
18213                            mode: req.mode,
18214
18215                            responder: SymlinkSetExtendedAttributeResponder {
18216                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18217                                tx_id: header.tx_id,
18218                            },
18219                        })
18220                    }
18221                    0x7a0b9f3a9bf9032d => {
18222                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18223                        let mut req = fidl::new_empty!(
18224                            NodeRemoveExtendedAttributeRequest,
18225                            fidl::encoding::DefaultFuchsiaResourceDialect
18226                        );
18227                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18228                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18229                        Ok(SymlinkRequest::RemoveExtendedAttribute {
18230                            name: req.name,
18231
18232                            responder: SymlinkRemoveExtendedAttributeResponder {
18233                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18234                                tx_id: header.tx_id,
18235                            },
18236                        })
18237                    }
18238                    0x742c2ea5e89831f3 => {
18239                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18240                        let mut req = fidl::new_empty!(
18241                            fidl::encoding::EmptyPayload,
18242                            fidl::encoding::DefaultFuchsiaResourceDialect
18243                        );
18244                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18245                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18246                        Ok(SymlinkRequest::Describe {
18247                            responder: SymlinkDescribeResponder {
18248                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18249                                tx_id: header.tx_id,
18250                            },
18251                        })
18252                    }
18253                    _ if header.tx_id == 0
18254                        && header
18255                            .dynamic_flags()
18256                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
18257                    {
18258                        Ok(SymlinkRequest::_UnknownMethod {
18259                            ordinal: header.ordinal,
18260                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
18261                            method_type: fidl::MethodType::OneWay,
18262                        })
18263                    }
18264                    _ if header
18265                        .dynamic_flags()
18266                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
18267                    {
18268                        this.inner.send_framework_err(
18269                            fidl::encoding::FrameworkErr::UnknownMethod,
18270                            header.tx_id,
18271                            header.ordinal,
18272                            header.dynamic_flags(),
18273                            (bytes, handles),
18274                        )?;
18275                        Ok(SymlinkRequest::_UnknownMethod {
18276                            ordinal: header.ordinal,
18277                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
18278                            method_type: fidl::MethodType::TwoWay,
18279                        })
18280                    }
18281                    _ => Err(fidl::Error::UnknownOrdinal {
18282                        ordinal: header.ordinal,
18283                        protocol_name:
18284                            <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
18285                    }),
18286                }))
18287            },
18288        )
18289    }
18290}
18291
18292/// A ['Node'] which contains a symbolic link.
18293#[derive(Debug)]
18294pub enum SymlinkRequest {
18295    /// Creates a link to this this object with name `dst` in the directory represented by
18296    /// `dst_parent_token`.
18297    ///
18298    /// `dst` must be a resolved object name. Including "/" in the string will return
18299    /// `ZX_ERR_INVALID_ARGS`.
18300    ///
18301    /// This method requires the maximal set of rights supported by the filesystem for this object.
18302    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
18303    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
18304    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
18305    /// `ZX_ERR_ACCESS_DENIED`.
18306    ///
18307    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
18308    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
18309    ///
18310    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
18311    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
18312    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
18313    ///
18314    /// This method does not have the same atomicity properties has the `Directory::Link` method,
18315    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
18316    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
18317    LinkInto {
18318        dst_parent_token: fidl::Event,
18319        dst: String,
18320        responder: SymlinkLinkIntoResponder,
18321    },
18322    Clone {
18323        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
18324        control_handle: SymlinkControlHandle,
18325    },
18326    /// Terminates the connection.
18327    ///
18328    /// After calling `Close`, the client must not send any other requests.
18329    ///
18330    /// Servers, after sending the status response, should close the connection
18331    /// regardless of status and without sending an epitaph.
18332    ///
18333    /// Closing the client end of the channel should be semantically equivalent
18334    /// to calling `Close` without knowing when the close has completed or its
18335    /// status.
18336    Close {
18337        responder: SymlinkCloseResponder,
18338    },
18339    Query {
18340        responder: SymlinkQueryResponder,
18341    },
18342    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
18343    DeprecatedClone {
18344        flags: OpenFlags,
18345        object: fidl::endpoints::ServerEnd<NodeMarker>,
18346        control_handle: SymlinkControlHandle,
18347    },
18348    /// DEPRECATED - Use `Node.GetAttributes` instead.
18349    DeprecatedGetAttr {
18350        responder: SymlinkDeprecatedGetAttrResponder,
18351    },
18352    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
18353    DeprecatedSetAttr {
18354        flags: NodeAttributeFlags,
18355        attributes: NodeAttributes,
18356        responder: SymlinkDeprecatedSetAttrResponder,
18357    },
18358    /// [DEPRECATED - Use new GetFlags method instead.]
18359    DeprecatedGetFlags {
18360        responder: SymlinkDeprecatedGetFlagsResponder,
18361    },
18362    /// [DEPRECATED - Use new SetFlags method instead.]
18363    DeprecatedSetFlags {
18364        flags: OpenFlags,
18365        responder: SymlinkDeprecatedSetFlagsResponder,
18366    },
18367    /// Queries the flags that apply to this node after it has been opened/created. This method does
18368    /// not require any rights.
18369    ///
18370    /// Note that the final set of flags that apply to the connection may differ from those
18371    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
18372    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
18373    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
18374    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
18375    GetFlags {
18376        responder: SymlinkGetFlagsResponder,
18377    },
18378    /// Sets the flags that apply to this node after it has been opened. This method does not
18379    /// require any rights.
18380    ///
18381    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
18382    /// clear append mode.
18383    ///
18384    /// Errors:
18385    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
18386    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
18387    SetFlags {
18388        flags: Flags,
18389        responder: SymlinkSetFlagsResponder,
18390    },
18391    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
18392    /// volume has different settings or the storage is accounted seperately from the rest of the
18393    /// filesystem that may be reported instead of filesystem-wide details.
18394    QueryFilesystem {
18395        responder: SymlinkQueryFilesystemResponder,
18396    },
18397    /// Acquires information about the node.
18398    ///
18399    /// The attributes of a node should be stable, independent of the
18400    /// specific protocol used to access it.
18401    ///
18402    /// If a particular attribute is not applicable or not supported,
18403    /// filesystems should leave the corresponding field absent.
18404    ///
18405    /// + `query` a bit-mask specifying which attributes to fetch. The server
18406    ///   should not return more than necessary.
18407    /// - `attributes` the returned attributes.
18408    ///
18409    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18410    GetAttributes {
18411        query: NodeAttributesQuery,
18412        responder: SymlinkGetAttributesResponder,
18413    },
18414    /// Updates information about the node.
18415    ///
18416    /// + `attributes` the presence of a table field in `attributes` indicates
18417    /// the intent to update the corresponding attribute.
18418    ///
18419    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
18420    ///
18421    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
18422    UpdateAttributes {
18423        payload: MutableNodeAttributes,
18424        responder: SymlinkUpdateAttributesResponder,
18425    },
18426    /// Synchronizes updates to the node to the underlying media, if it exists.
18427    ///
18428    /// This method will return when the filesystem server has flushed the
18429    /// relevant updates to the underlying media, but does not guarantee the
18430    /// underlying media has persisted the information, nor that any information
18431    /// is committed to hardware. Clients may use `Sync` to ensure ordering
18432    /// between operations.
18433    ///
18434    /// This method does not require any rights.
18435    Sync {
18436        responder: SymlinkSyncResponder,
18437    },
18438    /// Creates an iterator over all the extended attribute names associated
18439    /// with this node. If an error occurs it is returned as an epitaph on the
18440    /// iterator request channel, and then the channel is closed.
18441    ///
18442    /// GetExtendedAttributes can be used with any of these names to retrieve
18443    /// the associated value.
18444    ///
18445    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18446    ListExtendedAttributes {
18447        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
18448        control_handle: SymlinkControlHandle,
18449    },
18450    /// Get the value associated with the given attribute `name` for this node.
18451    ///
18452    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
18453    /// particular structure is imposed on them.
18454    ///
18455    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18456    GetExtendedAttribute {
18457        name: Vec<u8>,
18458        responder: SymlinkGetExtendedAttributeResponder,
18459    },
18460    /// Set the value for the given attribute `name` to `value` for this node.
18461    ///
18462    /// The attribute name may exist, in which case the attribute is updated.
18463    /// If the attribute doesn't exist, it is created. The name should have no
18464    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
18465    ///
18466    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
18467    SetExtendedAttribute {
18468        name: Vec<u8>,
18469        value: ExtendedAttributeValue,
18470        mode: SetExtendedAttributeMode,
18471        responder: SymlinkSetExtendedAttributeResponder,
18472    },
18473    /// Remove the specified extended attribute.
18474    ///
18475    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
18476    ///
18477    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
18478    RemoveExtendedAttribute {
18479        name: Vec<u8>,
18480        responder: SymlinkRemoveExtendedAttributeResponder,
18481    },
18482    Describe {
18483        responder: SymlinkDescribeResponder,
18484    },
18485    /// An interaction was received which does not match any known method.
18486    #[non_exhaustive]
18487    _UnknownMethod {
18488        /// Ordinal of the method that was called.
18489        ordinal: u64,
18490        control_handle: SymlinkControlHandle,
18491        method_type: fidl::MethodType,
18492    },
18493}
18494
18495impl SymlinkRequest {
18496    #[allow(irrefutable_let_patterns)]
18497    pub fn into_link_into(self) -> Option<(fidl::Event, String, SymlinkLinkIntoResponder)> {
18498        if let SymlinkRequest::LinkInto { dst_parent_token, dst, responder } = self {
18499            Some((dst_parent_token, dst, responder))
18500        } else {
18501            None
18502        }
18503    }
18504
18505    #[allow(irrefutable_let_patterns)]
18506    pub fn into_clone(
18507        self,
18508    ) -> Option<(
18509        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
18510        SymlinkControlHandle,
18511    )> {
18512        if let SymlinkRequest::Clone { request, control_handle } = self {
18513            Some((request, control_handle))
18514        } else {
18515            None
18516        }
18517    }
18518
18519    #[allow(irrefutable_let_patterns)]
18520    pub fn into_close(self) -> Option<(SymlinkCloseResponder)> {
18521        if let SymlinkRequest::Close { responder } = self { Some((responder)) } else { None }
18522    }
18523
18524    #[allow(irrefutable_let_patterns)]
18525    pub fn into_query(self) -> Option<(SymlinkQueryResponder)> {
18526        if let SymlinkRequest::Query { responder } = self { Some((responder)) } else { None }
18527    }
18528
18529    #[allow(irrefutable_let_patterns)]
18530    pub fn into_deprecated_clone(
18531        self,
18532    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, SymlinkControlHandle)> {
18533        if let SymlinkRequest::DeprecatedClone { flags, object, control_handle } = self {
18534            Some((flags, object, control_handle))
18535        } else {
18536            None
18537        }
18538    }
18539
18540    #[allow(irrefutable_let_patterns)]
18541    pub fn into_deprecated_get_attr(self) -> Option<(SymlinkDeprecatedGetAttrResponder)> {
18542        if let SymlinkRequest::DeprecatedGetAttr { responder } = self {
18543            Some((responder))
18544        } else {
18545            None
18546        }
18547    }
18548
18549    #[allow(irrefutable_let_patterns)]
18550    pub fn into_deprecated_set_attr(
18551        self,
18552    ) -> Option<(NodeAttributeFlags, NodeAttributes, SymlinkDeprecatedSetAttrResponder)> {
18553        if let SymlinkRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
18554            Some((flags, attributes, responder))
18555        } else {
18556            None
18557        }
18558    }
18559
18560    #[allow(irrefutable_let_patterns)]
18561    pub fn into_deprecated_get_flags(self) -> Option<(SymlinkDeprecatedGetFlagsResponder)> {
18562        if let SymlinkRequest::DeprecatedGetFlags { responder } = self {
18563            Some((responder))
18564        } else {
18565            None
18566        }
18567    }
18568
18569    #[allow(irrefutable_let_patterns)]
18570    pub fn into_deprecated_set_flags(
18571        self,
18572    ) -> Option<(OpenFlags, SymlinkDeprecatedSetFlagsResponder)> {
18573        if let SymlinkRequest::DeprecatedSetFlags { flags, responder } = self {
18574            Some((flags, responder))
18575        } else {
18576            None
18577        }
18578    }
18579
18580    #[allow(irrefutable_let_patterns)]
18581    pub fn into_get_flags(self) -> Option<(SymlinkGetFlagsResponder)> {
18582        if let SymlinkRequest::GetFlags { responder } = self { Some((responder)) } else { None }
18583    }
18584
18585    #[allow(irrefutable_let_patterns)]
18586    pub fn into_set_flags(self) -> Option<(Flags, SymlinkSetFlagsResponder)> {
18587        if let SymlinkRequest::SetFlags { flags, responder } = self {
18588            Some((flags, responder))
18589        } else {
18590            None
18591        }
18592    }
18593
18594    #[allow(irrefutable_let_patterns)]
18595    pub fn into_query_filesystem(self) -> Option<(SymlinkQueryFilesystemResponder)> {
18596        if let SymlinkRequest::QueryFilesystem { responder } = self {
18597            Some((responder))
18598        } else {
18599            None
18600        }
18601    }
18602
18603    #[allow(irrefutable_let_patterns)]
18604    pub fn into_get_attributes(
18605        self,
18606    ) -> Option<(NodeAttributesQuery, SymlinkGetAttributesResponder)> {
18607        if let SymlinkRequest::GetAttributes { query, responder } = self {
18608            Some((query, responder))
18609        } else {
18610            None
18611        }
18612    }
18613
18614    #[allow(irrefutable_let_patterns)]
18615    pub fn into_update_attributes(
18616        self,
18617    ) -> Option<(MutableNodeAttributes, SymlinkUpdateAttributesResponder)> {
18618        if let SymlinkRequest::UpdateAttributes { payload, responder } = self {
18619            Some((payload, responder))
18620        } else {
18621            None
18622        }
18623    }
18624
18625    #[allow(irrefutable_let_patterns)]
18626    pub fn into_sync(self) -> Option<(SymlinkSyncResponder)> {
18627        if let SymlinkRequest::Sync { responder } = self { Some((responder)) } else { None }
18628    }
18629
18630    #[allow(irrefutable_let_patterns)]
18631    pub fn into_list_extended_attributes(
18632        self,
18633    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, SymlinkControlHandle)>
18634    {
18635        if let SymlinkRequest::ListExtendedAttributes { iterator, control_handle } = self {
18636            Some((iterator, control_handle))
18637        } else {
18638            None
18639        }
18640    }
18641
18642    #[allow(irrefutable_let_patterns)]
18643    pub fn into_get_extended_attribute(
18644        self,
18645    ) -> Option<(Vec<u8>, SymlinkGetExtendedAttributeResponder)> {
18646        if let SymlinkRequest::GetExtendedAttribute { name, responder } = self {
18647            Some((name, responder))
18648        } else {
18649            None
18650        }
18651    }
18652
18653    #[allow(irrefutable_let_patterns)]
18654    pub fn into_set_extended_attribute(
18655        self,
18656    ) -> Option<(
18657        Vec<u8>,
18658        ExtendedAttributeValue,
18659        SetExtendedAttributeMode,
18660        SymlinkSetExtendedAttributeResponder,
18661    )> {
18662        if let SymlinkRequest::SetExtendedAttribute { name, value, mode, responder } = self {
18663            Some((name, value, mode, responder))
18664        } else {
18665            None
18666        }
18667    }
18668
18669    #[allow(irrefutable_let_patterns)]
18670    pub fn into_remove_extended_attribute(
18671        self,
18672    ) -> Option<(Vec<u8>, SymlinkRemoveExtendedAttributeResponder)> {
18673        if let SymlinkRequest::RemoveExtendedAttribute { name, responder } = self {
18674            Some((name, responder))
18675        } else {
18676            None
18677        }
18678    }
18679
18680    #[allow(irrefutable_let_patterns)]
18681    pub fn into_describe(self) -> Option<(SymlinkDescribeResponder)> {
18682        if let SymlinkRequest::Describe { responder } = self { Some((responder)) } else { None }
18683    }
18684
18685    /// Name of the method defined in FIDL
18686    pub fn method_name(&self) -> &'static str {
18687        match *self {
18688            SymlinkRequest::LinkInto { .. } => "link_into",
18689            SymlinkRequest::Clone { .. } => "clone",
18690            SymlinkRequest::Close { .. } => "close",
18691            SymlinkRequest::Query { .. } => "query",
18692            SymlinkRequest::DeprecatedClone { .. } => "deprecated_clone",
18693            SymlinkRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
18694            SymlinkRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
18695            SymlinkRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
18696            SymlinkRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
18697            SymlinkRequest::GetFlags { .. } => "get_flags",
18698            SymlinkRequest::SetFlags { .. } => "set_flags",
18699            SymlinkRequest::QueryFilesystem { .. } => "query_filesystem",
18700            SymlinkRequest::GetAttributes { .. } => "get_attributes",
18701            SymlinkRequest::UpdateAttributes { .. } => "update_attributes",
18702            SymlinkRequest::Sync { .. } => "sync",
18703            SymlinkRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
18704            SymlinkRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
18705            SymlinkRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
18706            SymlinkRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
18707            SymlinkRequest::Describe { .. } => "describe",
18708            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
18709                "unknown one-way method"
18710            }
18711            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
18712                "unknown two-way method"
18713            }
18714        }
18715    }
18716}
18717
18718#[derive(Debug, Clone)]
18719pub struct SymlinkControlHandle {
18720    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
18721}
18722
18723impl fidl::endpoints::ControlHandle for SymlinkControlHandle {
18724    fn shutdown(&self) {
18725        self.inner.shutdown()
18726    }
18727
18728    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
18729        self.inner.shutdown_with_epitaph(status)
18730    }
18731
18732    fn is_closed(&self) -> bool {
18733        self.inner.channel().is_closed()
18734    }
18735    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
18736        self.inner.channel().on_closed()
18737    }
18738
18739    #[cfg(target_os = "fuchsia")]
18740    fn signal_peer(
18741        &self,
18742        clear_mask: zx::Signals,
18743        set_mask: zx::Signals,
18744    ) -> Result<(), zx_status::Status> {
18745        use fidl::Peered;
18746        self.inner.channel().signal_peer(clear_mask, set_mask)
18747    }
18748}
18749
18750impl SymlinkControlHandle {
18751    pub fn send_on_open_(
18752        &self,
18753        mut s: i32,
18754        mut info: Option<NodeInfoDeprecated>,
18755    ) -> Result<(), fidl::Error> {
18756        self.inner.send::<NodeOnOpenRequest>(
18757            (s, info.as_mut()),
18758            0,
18759            0x7fc7bbb1dbfd1972,
18760            fidl::encoding::DynamicFlags::FLEXIBLE,
18761        )
18762    }
18763
18764    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
18765        self.inner.send::<Representation>(
18766            &mut payload,
18767            0,
18768            0x5cb40567d80a510c,
18769            fidl::encoding::DynamicFlags::empty(),
18770        )
18771    }
18772}
18773
18774#[must_use = "FIDL methods require a response to be sent"]
18775#[derive(Debug)]
18776pub struct SymlinkLinkIntoResponder {
18777    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18778    tx_id: u32,
18779}
18780
18781/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18782/// if the responder is dropped without sending a response, so that the client
18783/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18784impl std::ops::Drop for SymlinkLinkIntoResponder {
18785    fn drop(&mut self) {
18786        self.control_handle.shutdown();
18787        // Safety: drops once, never accessed again
18788        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18789    }
18790}
18791
18792impl fidl::endpoints::Responder for SymlinkLinkIntoResponder {
18793    type ControlHandle = SymlinkControlHandle;
18794
18795    fn control_handle(&self) -> &SymlinkControlHandle {
18796        &self.control_handle
18797    }
18798
18799    fn drop_without_shutdown(mut self) {
18800        // Safety: drops once, never accessed again due to mem::forget
18801        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18802        // Prevent Drop from running (which would shut down the channel)
18803        std::mem::forget(self);
18804    }
18805}
18806
18807impl SymlinkLinkIntoResponder {
18808    /// Sends a response to the FIDL transaction.
18809    ///
18810    /// Sets the channel to shutdown if an error occurs.
18811    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18812        let _result = self.send_raw(result);
18813        if _result.is_err() {
18814            self.control_handle.shutdown();
18815        }
18816        self.drop_without_shutdown();
18817        _result
18818    }
18819
18820    /// Similar to "send" but does not shutdown the channel if an error occurs.
18821    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18822        let _result = self.send_raw(result);
18823        self.drop_without_shutdown();
18824        _result
18825    }
18826
18827    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18828        self.control_handle
18829            .inner
18830            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
18831                result,
18832                self.tx_id,
18833                0x54f3949246a03e74,
18834                fidl::encoding::DynamicFlags::empty(),
18835            )
18836    }
18837}
18838
18839#[must_use = "FIDL methods require a response to be sent"]
18840#[derive(Debug)]
18841pub struct SymlinkCloseResponder {
18842    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18843    tx_id: u32,
18844}
18845
18846/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18847/// if the responder is dropped without sending a response, so that the client
18848/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18849impl std::ops::Drop for SymlinkCloseResponder {
18850    fn drop(&mut self) {
18851        self.control_handle.shutdown();
18852        // Safety: drops once, never accessed again
18853        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18854    }
18855}
18856
18857impl fidl::endpoints::Responder for SymlinkCloseResponder {
18858    type ControlHandle = SymlinkControlHandle;
18859
18860    fn control_handle(&self) -> &SymlinkControlHandle {
18861        &self.control_handle
18862    }
18863
18864    fn drop_without_shutdown(mut self) {
18865        // Safety: drops once, never accessed again due to mem::forget
18866        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18867        // Prevent Drop from running (which would shut down the channel)
18868        std::mem::forget(self);
18869    }
18870}
18871
18872impl SymlinkCloseResponder {
18873    /// Sends a response to the FIDL transaction.
18874    ///
18875    /// Sets the channel to shutdown if an error occurs.
18876    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18877        let _result = self.send_raw(result);
18878        if _result.is_err() {
18879            self.control_handle.shutdown();
18880        }
18881        self.drop_without_shutdown();
18882        _result
18883    }
18884
18885    /// Similar to "send" but does not shutdown the channel if an error occurs.
18886    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18887        let _result = self.send_raw(result);
18888        self.drop_without_shutdown();
18889        _result
18890    }
18891
18892    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18893        self.control_handle
18894            .inner
18895            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
18896                result,
18897                self.tx_id,
18898                0x5ac5d459ad7f657e,
18899                fidl::encoding::DynamicFlags::empty(),
18900            )
18901    }
18902}
18903
18904#[must_use = "FIDL methods require a response to be sent"]
18905#[derive(Debug)]
18906pub struct SymlinkQueryResponder {
18907    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18908    tx_id: u32,
18909}
18910
18911/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18912/// if the responder is dropped without sending a response, so that the client
18913/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18914impl std::ops::Drop for SymlinkQueryResponder {
18915    fn drop(&mut self) {
18916        self.control_handle.shutdown();
18917        // Safety: drops once, never accessed again
18918        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18919    }
18920}
18921
18922impl fidl::endpoints::Responder for SymlinkQueryResponder {
18923    type ControlHandle = SymlinkControlHandle;
18924
18925    fn control_handle(&self) -> &SymlinkControlHandle {
18926        &self.control_handle
18927    }
18928
18929    fn drop_without_shutdown(mut self) {
18930        // Safety: drops once, never accessed again due to mem::forget
18931        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18932        // Prevent Drop from running (which would shut down the channel)
18933        std::mem::forget(self);
18934    }
18935}
18936
18937impl SymlinkQueryResponder {
18938    /// Sends a response to the FIDL transaction.
18939    ///
18940    /// Sets the channel to shutdown if an error occurs.
18941    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
18942        let _result = self.send_raw(protocol);
18943        if _result.is_err() {
18944            self.control_handle.shutdown();
18945        }
18946        self.drop_without_shutdown();
18947        _result
18948    }
18949
18950    /// Similar to "send" but does not shutdown the channel if an error occurs.
18951    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
18952        let _result = self.send_raw(protocol);
18953        self.drop_without_shutdown();
18954        _result
18955    }
18956
18957    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
18958        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
18959            (protocol,),
18960            self.tx_id,
18961            0x2658edee9decfc06,
18962            fidl::encoding::DynamicFlags::empty(),
18963        )
18964    }
18965}
18966
18967#[must_use = "FIDL methods require a response to be sent"]
18968#[derive(Debug)]
18969pub struct SymlinkDeprecatedGetAttrResponder {
18970    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18971    tx_id: u32,
18972}
18973
18974/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18975/// if the responder is dropped without sending a response, so that the client
18976/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18977impl std::ops::Drop for SymlinkDeprecatedGetAttrResponder {
18978    fn drop(&mut self) {
18979        self.control_handle.shutdown();
18980        // Safety: drops once, never accessed again
18981        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18982    }
18983}
18984
18985impl fidl::endpoints::Responder for SymlinkDeprecatedGetAttrResponder {
18986    type ControlHandle = SymlinkControlHandle;
18987
18988    fn control_handle(&self) -> &SymlinkControlHandle {
18989        &self.control_handle
18990    }
18991
18992    fn drop_without_shutdown(mut self) {
18993        // Safety: drops once, never accessed again due to mem::forget
18994        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18995        // Prevent Drop from running (which would shut down the channel)
18996        std::mem::forget(self);
18997    }
18998}
18999
19000impl SymlinkDeprecatedGetAttrResponder {
19001    /// Sends a response to the FIDL transaction.
19002    ///
19003    /// Sets the channel to shutdown if an error occurs.
19004    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
19005        let _result = self.send_raw(s, attributes);
19006        if _result.is_err() {
19007            self.control_handle.shutdown();
19008        }
19009        self.drop_without_shutdown();
19010        _result
19011    }
19012
19013    /// Similar to "send" but does not shutdown the channel if an error occurs.
19014    pub fn send_no_shutdown_on_err(
19015        self,
19016        mut s: i32,
19017        mut attributes: &NodeAttributes,
19018    ) -> Result<(), fidl::Error> {
19019        let _result = self.send_raw(s, attributes);
19020        self.drop_without_shutdown();
19021        _result
19022    }
19023
19024    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
19025        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
19026            (s, attributes),
19027            self.tx_id,
19028            0x78985e216314dafd,
19029            fidl::encoding::DynamicFlags::empty(),
19030        )
19031    }
19032}
19033
19034#[must_use = "FIDL methods require a response to be sent"]
19035#[derive(Debug)]
19036pub struct SymlinkDeprecatedSetAttrResponder {
19037    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19038    tx_id: u32,
19039}
19040
19041/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19042/// if the responder is dropped without sending a response, so that the client
19043/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19044impl std::ops::Drop for SymlinkDeprecatedSetAttrResponder {
19045    fn drop(&mut self) {
19046        self.control_handle.shutdown();
19047        // Safety: drops once, never accessed again
19048        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19049    }
19050}
19051
19052impl fidl::endpoints::Responder for SymlinkDeprecatedSetAttrResponder {
19053    type ControlHandle = SymlinkControlHandle;
19054
19055    fn control_handle(&self) -> &SymlinkControlHandle {
19056        &self.control_handle
19057    }
19058
19059    fn drop_without_shutdown(mut self) {
19060        // Safety: drops once, never accessed again due to mem::forget
19061        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19062        // Prevent Drop from running (which would shut down the channel)
19063        std::mem::forget(self);
19064    }
19065}
19066
19067impl SymlinkDeprecatedSetAttrResponder {
19068    /// Sends a response to the FIDL transaction.
19069    ///
19070    /// Sets the channel to shutdown if an error occurs.
19071    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
19072        let _result = self.send_raw(s);
19073        if _result.is_err() {
19074            self.control_handle.shutdown();
19075        }
19076        self.drop_without_shutdown();
19077        _result
19078    }
19079
19080    /// Similar to "send" but does not shutdown the channel if an error occurs.
19081    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
19082        let _result = self.send_raw(s);
19083        self.drop_without_shutdown();
19084        _result
19085    }
19086
19087    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
19088        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
19089            (s,),
19090            self.tx_id,
19091            0x4186c0f40d938f46,
19092            fidl::encoding::DynamicFlags::empty(),
19093        )
19094    }
19095}
19096
19097#[must_use = "FIDL methods require a response to be sent"]
19098#[derive(Debug)]
19099pub struct SymlinkDeprecatedGetFlagsResponder {
19100    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19101    tx_id: u32,
19102}
19103
19104/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19105/// if the responder is dropped without sending a response, so that the client
19106/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19107impl std::ops::Drop for SymlinkDeprecatedGetFlagsResponder {
19108    fn drop(&mut self) {
19109        self.control_handle.shutdown();
19110        // Safety: drops once, never accessed again
19111        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19112    }
19113}
19114
19115impl fidl::endpoints::Responder for SymlinkDeprecatedGetFlagsResponder {
19116    type ControlHandle = SymlinkControlHandle;
19117
19118    fn control_handle(&self) -> &SymlinkControlHandle {
19119        &self.control_handle
19120    }
19121
19122    fn drop_without_shutdown(mut self) {
19123        // Safety: drops once, never accessed again due to mem::forget
19124        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19125        // Prevent Drop from running (which would shut down the channel)
19126        std::mem::forget(self);
19127    }
19128}
19129
19130impl SymlinkDeprecatedGetFlagsResponder {
19131    /// Sends a response to the FIDL transaction.
19132    ///
19133    /// Sets the channel to shutdown if an error occurs.
19134    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
19135        let _result = self.send_raw(s, flags);
19136        if _result.is_err() {
19137            self.control_handle.shutdown();
19138        }
19139        self.drop_without_shutdown();
19140        _result
19141    }
19142
19143    /// Similar to "send" but does not shutdown the channel if an error occurs.
19144    pub fn send_no_shutdown_on_err(
19145        self,
19146        mut s: i32,
19147        mut flags: OpenFlags,
19148    ) -> Result<(), fidl::Error> {
19149        let _result = self.send_raw(s, flags);
19150        self.drop_without_shutdown();
19151        _result
19152    }
19153
19154    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
19155        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
19156            (s, flags),
19157            self.tx_id,
19158            0x5b88fffb8eda3aa1,
19159            fidl::encoding::DynamicFlags::empty(),
19160        )
19161    }
19162}
19163
19164#[must_use = "FIDL methods require a response to be sent"]
19165#[derive(Debug)]
19166pub struct SymlinkDeprecatedSetFlagsResponder {
19167    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19168    tx_id: u32,
19169}
19170
19171/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19172/// if the responder is dropped without sending a response, so that the client
19173/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19174impl std::ops::Drop for SymlinkDeprecatedSetFlagsResponder {
19175    fn drop(&mut self) {
19176        self.control_handle.shutdown();
19177        // Safety: drops once, never accessed again
19178        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19179    }
19180}
19181
19182impl fidl::endpoints::Responder for SymlinkDeprecatedSetFlagsResponder {
19183    type ControlHandle = SymlinkControlHandle;
19184
19185    fn control_handle(&self) -> &SymlinkControlHandle {
19186        &self.control_handle
19187    }
19188
19189    fn drop_without_shutdown(mut self) {
19190        // Safety: drops once, never accessed again due to mem::forget
19191        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19192        // Prevent Drop from running (which would shut down the channel)
19193        std::mem::forget(self);
19194    }
19195}
19196
19197impl SymlinkDeprecatedSetFlagsResponder {
19198    /// Sends a response to the FIDL transaction.
19199    ///
19200    /// Sets the channel to shutdown if an error occurs.
19201    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
19202        let _result = self.send_raw(s);
19203        if _result.is_err() {
19204            self.control_handle.shutdown();
19205        }
19206        self.drop_without_shutdown();
19207        _result
19208    }
19209
19210    /// Similar to "send" but does not shutdown the channel if an error occurs.
19211    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
19212        let _result = self.send_raw(s);
19213        self.drop_without_shutdown();
19214        _result
19215    }
19216
19217    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
19218        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
19219            (s,),
19220            self.tx_id,
19221            0x5295b76c71fde733,
19222            fidl::encoding::DynamicFlags::empty(),
19223        )
19224    }
19225}
19226
19227#[must_use = "FIDL methods require a response to be sent"]
19228#[derive(Debug)]
19229pub struct SymlinkGetFlagsResponder {
19230    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19231    tx_id: u32,
19232}
19233
19234/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19235/// if the responder is dropped without sending a response, so that the client
19236/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19237impl std::ops::Drop for SymlinkGetFlagsResponder {
19238    fn drop(&mut self) {
19239        self.control_handle.shutdown();
19240        // Safety: drops once, never accessed again
19241        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19242    }
19243}
19244
19245impl fidl::endpoints::Responder for SymlinkGetFlagsResponder {
19246    type ControlHandle = SymlinkControlHandle;
19247
19248    fn control_handle(&self) -> &SymlinkControlHandle {
19249        &self.control_handle
19250    }
19251
19252    fn drop_without_shutdown(mut self) {
19253        // Safety: drops once, never accessed again due to mem::forget
19254        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19255        // Prevent Drop from running (which would shut down the channel)
19256        std::mem::forget(self);
19257    }
19258}
19259
19260impl SymlinkGetFlagsResponder {
19261    /// Sends a response to the FIDL transaction.
19262    ///
19263    /// Sets the channel to shutdown if an error occurs.
19264    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
19265        let _result = self.send_raw(result);
19266        if _result.is_err() {
19267            self.control_handle.shutdown();
19268        }
19269        self.drop_without_shutdown();
19270        _result
19271    }
19272
19273    /// Similar to "send" but does not shutdown the channel if an error occurs.
19274    pub fn send_no_shutdown_on_err(
19275        self,
19276        mut result: Result<Flags, i32>,
19277    ) -> Result<(), fidl::Error> {
19278        let _result = self.send_raw(result);
19279        self.drop_without_shutdown();
19280        _result
19281    }
19282
19283    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
19284        self.control_handle
19285            .inner
19286            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
19287                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
19288                self.tx_id,
19289                0x176eb318f64ec23,
19290                fidl::encoding::DynamicFlags::FLEXIBLE,
19291            )
19292    }
19293}
19294
19295#[must_use = "FIDL methods require a response to be sent"]
19296#[derive(Debug)]
19297pub struct SymlinkSetFlagsResponder {
19298    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19299    tx_id: u32,
19300}
19301
19302/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19303/// if the responder is dropped without sending a response, so that the client
19304/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19305impl std::ops::Drop for SymlinkSetFlagsResponder {
19306    fn drop(&mut self) {
19307        self.control_handle.shutdown();
19308        // Safety: drops once, never accessed again
19309        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19310    }
19311}
19312
19313impl fidl::endpoints::Responder for SymlinkSetFlagsResponder {
19314    type ControlHandle = SymlinkControlHandle;
19315
19316    fn control_handle(&self) -> &SymlinkControlHandle {
19317        &self.control_handle
19318    }
19319
19320    fn drop_without_shutdown(mut self) {
19321        // Safety: drops once, never accessed again due to mem::forget
19322        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19323        // Prevent Drop from running (which would shut down the channel)
19324        std::mem::forget(self);
19325    }
19326}
19327
19328impl SymlinkSetFlagsResponder {
19329    /// Sends a response to the FIDL transaction.
19330    ///
19331    /// Sets the channel to shutdown if an error occurs.
19332    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19333        let _result = self.send_raw(result);
19334        if _result.is_err() {
19335            self.control_handle.shutdown();
19336        }
19337        self.drop_without_shutdown();
19338        _result
19339    }
19340
19341    /// Similar to "send" but does not shutdown the channel if an error occurs.
19342    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19343        let _result = self.send_raw(result);
19344        self.drop_without_shutdown();
19345        _result
19346    }
19347
19348    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19349        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
19350            fidl::encoding::EmptyStruct,
19351            i32,
19352        >>(
19353            fidl::encoding::FlexibleResult::new(result),
19354            self.tx_id,
19355            0x55a8028685791ea8,
19356            fidl::encoding::DynamicFlags::FLEXIBLE,
19357        )
19358    }
19359}
19360
19361#[must_use = "FIDL methods require a response to be sent"]
19362#[derive(Debug)]
19363pub struct SymlinkQueryFilesystemResponder {
19364    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19365    tx_id: u32,
19366}
19367
19368/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19369/// if the responder is dropped without sending a response, so that the client
19370/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19371impl std::ops::Drop for SymlinkQueryFilesystemResponder {
19372    fn drop(&mut self) {
19373        self.control_handle.shutdown();
19374        // Safety: drops once, never accessed again
19375        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19376    }
19377}
19378
19379impl fidl::endpoints::Responder for SymlinkQueryFilesystemResponder {
19380    type ControlHandle = SymlinkControlHandle;
19381
19382    fn control_handle(&self) -> &SymlinkControlHandle {
19383        &self.control_handle
19384    }
19385
19386    fn drop_without_shutdown(mut self) {
19387        // Safety: drops once, never accessed again due to mem::forget
19388        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19389        // Prevent Drop from running (which would shut down the channel)
19390        std::mem::forget(self);
19391    }
19392}
19393
19394impl SymlinkQueryFilesystemResponder {
19395    /// Sends a response to the FIDL transaction.
19396    ///
19397    /// Sets the channel to shutdown if an error occurs.
19398    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
19399        let _result = self.send_raw(s, info);
19400        if _result.is_err() {
19401            self.control_handle.shutdown();
19402        }
19403        self.drop_without_shutdown();
19404        _result
19405    }
19406
19407    /// Similar to "send" but does not shutdown the channel if an error occurs.
19408    pub fn send_no_shutdown_on_err(
19409        self,
19410        mut s: i32,
19411        mut info: Option<&FilesystemInfo>,
19412    ) -> Result<(), fidl::Error> {
19413        let _result = self.send_raw(s, info);
19414        self.drop_without_shutdown();
19415        _result
19416    }
19417
19418    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
19419        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
19420            (s, info),
19421            self.tx_id,
19422            0x6f344a1c6b0a0610,
19423            fidl::encoding::DynamicFlags::empty(),
19424        )
19425    }
19426}
19427
19428#[must_use = "FIDL methods require a response to be sent"]
19429#[derive(Debug)]
19430pub struct SymlinkGetAttributesResponder {
19431    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19432    tx_id: u32,
19433}
19434
19435/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19436/// if the responder is dropped without sending a response, so that the client
19437/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19438impl std::ops::Drop for SymlinkGetAttributesResponder {
19439    fn drop(&mut self) {
19440        self.control_handle.shutdown();
19441        // Safety: drops once, never accessed again
19442        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19443    }
19444}
19445
19446impl fidl::endpoints::Responder for SymlinkGetAttributesResponder {
19447    type ControlHandle = SymlinkControlHandle;
19448
19449    fn control_handle(&self) -> &SymlinkControlHandle {
19450        &self.control_handle
19451    }
19452
19453    fn drop_without_shutdown(mut self) {
19454        // Safety: drops once, never accessed again due to mem::forget
19455        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19456        // Prevent Drop from running (which would shut down the channel)
19457        std::mem::forget(self);
19458    }
19459}
19460
19461impl SymlinkGetAttributesResponder {
19462    /// Sends a response to the FIDL transaction.
19463    ///
19464    /// Sets the channel to shutdown if an error occurs.
19465    pub fn send(
19466        self,
19467        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
19468    ) -> Result<(), fidl::Error> {
19469        let _result = self.send_raw(result);
19470        if _result.is_err() {
19471            self.control_handle.shutdown();
19472        }
19473        self.drop_without_shutdown();
19474        _result
19475    }
19476
19477    /// Similar to "send" but does not shutdown the channel if an error occurs.
19478    pub fn send_no_shutdown_on_err(
19479        self,
19480        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
19481    ) -> Result<(), fidl::Error> {
19482        let _result = self.send_raw(result);
19483        self.drop_without_shutdown();
19484        _result
19485    }
19486
19487    fn send_raw(
19488        &self,
19489        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
19490    ) -> Result<(), fidl::Error> {
19491        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
19492            result,
19493            self.tx_id,
19494            0x3d4396a638ea053b,
19495            fidl::encoding::DynamicFlags::empty(),
19496        )
19497    }
19498}
19499
19500#[must_use = "FIDL methods require a response to be sent"]
19501#[derive(Debug)]
19502pub struct SymlinkUpdateAttributesResponder {
19503    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19504    tx_id: u32,
19505}
19506
19507/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19508/// if the responder is dropped without sending a response, so that the client
19509/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19510impl std::ops::Drop for SymlinkUpdateAttributesResponder {
19511    fn drop(&mut self) {
19512        self.control_handle.shutdown();
19513        // Safety: drops once, never accessed again
19514        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19515    }
19516}
19517
19518impl fidl::endpoints::Responder for SymlinkUpdateAttributesResponder {
19519    type ControlHandle = SymlinkControlHandle;
19520
19521    fn control_handle(&self) -> &SymlinkControlHandle {
19522        &self.control_handle
19523    }
19524
19525    fn drop_without_shutdown(mut self) {
19526        // Safety: drops once, never accessed again due to mem::forget
19527        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19528        // Prevent Drop from running (which would shut down the channel)
19529        std::mem::forget(self);
19530    }
19531}
19532
19533impl SymlinkUpdateAttributesResponder {
19534    /// Sends a response to the FIDL transaction.
19535    ///
19536    /// Sets the channel to shutdown if an error occurs.
19537    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19538        let _result = self.send_raw(result);
19539        if _result.is_err() {
19540            self.control_handle.shutdown();
19541        }
19542        self.drop_without_shutdown();
19543        _result
19544    }
19545
19546    /// Similar to "send" but does not shutdown the channel if an error occurs.
19547    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19548        let _result = self.send_raw(result);
19549        self.drop_without_shutdown();
19550        _result
19551    }
19552
19553    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19554        self.control_handle
19555            .inner
19556            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19557                result,
19558                self.tx_id,
19559                0x3308c1da5a89bf08,
19560                fidl::encoding::DynamicFlags::empty(),
19561            )
19562    }
19563}
19564
19565#[must_use = "FIDL methods require a response to be sent"]
19566#[derive(Debug)]
19567pub struct SymlinkSyncResponder {
19568    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19569    tx_id: u32,
19570}
19571
19572/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19573/// if the responder is dropped without sending a response, so that the client
19574/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19575impl std::ops::Drop for SymlinkSyncResponder {
19576    fn drop(&mut self) {
19577        self.control_handle.shutdown();
19578        // Safety: drops once, never accessed again
19579        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19580    }
19581}
19582
19583impl fidl::endpoints::Responder for SymlinkSyncResponder {
19584    type ControlHandle = SymlinkControlHandle;
19585
19586    fn control_handle(&self) -> &SymlinkControlHandle {
19587        &self.control_handle
19588    }
19589
19590    fn drop_without_shutdown(mut self) {
19591        // Safety: drops once, never accessed again due to mem::forget
19592        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19593        // Prevent Drop from running (which would shut down the channel)
19594        std::mem::forget(self);
19595    }
19596}
19597
19598impl SymlinkSyncResponder {
19599    /// Sends a response to the FIDL transaction.
19600    ///
19601    /// Sets the channel to shutdown if an error occurs.
19602    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19603        let _result = self.send_raw(result);
19604        if _result.is_err() {
19605            self.control_handle.shutdown();
19606        }
19607        self.drop_without_shutdown();
19608        _result
19609    }
19610
19611    /// Similar to "send" but does not shutdown the channel if an error occurs.
19612    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19613        let _result = self.send_raw(result);
19614        self.drop_without_shutdown();
19615        _result
19616    }
19617
19618    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19619        self.control_handle
19620            .inner
19621            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19622                result,
19623                self.tx_id,
19624                0x2c5c27ca0ab5dc49,
19625                fidl::encoding::DynamicFlags::empty(),
19626            )
19627    }
19628}
19629
19630#[must_use = "FIDL methods require a response to be sent"]
19631#[derive(Debug)]
19632pub struct SymlinkGetExtendedAttributeResponder {
19633    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19634    tx_id: u32,
19635}
19636
19637/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19638/// if the responder is dropped without sending a response, so that the client
19639/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19640impl std::ops::Drop for SymlinkGetExtendedAttributeResponder {
19641    fn drop(&mut self) {
19642        self.control_handle.shutdown();
19643        // Safety: drops once, never accessed again
19644        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19645    }
19646}
19647
19648impl fidl::endpoints::Responder for SymlinkGetExtendedAttributeResponder {
19649    type ControlHandle = SymlinkControlHandle;
19650
19651    fn control_handle(&self) -> &SymlinkControlHandle {
19652        &self.control_handle
19653    }
19654
19655    fn drop_without_shutdown(mut self) {
19656        // Safety: drops once, never accessed again due to mem::forget
19657        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19658        // Prevent Drop from running (which would shut down the channel)
19659        std::mem::forget(self);
19660    }
19661}
19662
19663impl SymlinkGetExtendedAttributeResponder {
19664    /// Sends a response to the FIDL transaction.
19665    ///
19666    /// Sets the channel to shutdown if an error occurs.
19667    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
19668        let _result = self.send_raw(result);
19669        if _result.is_err() {
19670            self.control_handle.shutdown();
19671        }
19672        self.drop_without_shutdown();
19673        _result
19674    }
19675
19676    /// Similar to "send" but does not shutdown the channel if an error occurs.
19677    pub fn send_no_shutdown_on_err(
19678        self,
19679        mut result: Result<ExtendedAttributeValue, i32>,
19680    ) -> Result<(), fidl::Error> {
19681        let _result = self.send_raw(result);
19682        self.drop_without_shutdown();
19683        _result
19684    }
19685
19686    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
19687        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
19688            result.as_mut().map_err(|e| *e),
19689            self.tx_id,
19690            0x45ffa3ccfdeb76db,
19691            fidl::encoding::DynamicFlags::empty(),
19692        )
19693    }
19694}
19695
19696#[must_use = "FIDL methods require a response to be sent"]
19697#[derive(Debug)]
19698pub struct SymlinkSetExtendedAttributeResponder {
19699    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19700    tx_id: u32,
19701}
19702
19703/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19704/// if the responder is dropped without sending a response, so that the client
19705/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19706impl std::ops::Drop for SymlinkSetExtendedAttributeResponder {
19707    fn drop(&mut self) {
19708        self.control_handle.shutdown();
19709        // Safety: drops once, never accessed again
19710        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19711    }
19712}
19713
19714impl fidl::endpoints::Responder for SymlinkSetExtendedAttributeResponder {
19715    type ControlHandle = SymlinkControlHandle;
19716
19717    fn control_handle(&self) -> &SymlinkControlHandle {
19718        &self.control_handle
19719    }
19720
19721    fn drop_without_shutdown(mut self) {
19722        // Safety: drops once, never accessed again due to mem::forget
19723        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19724        // Prevent Drop from running (which would shut down the channel)
19725        std::mem::forget(self);
19726    }
19727}
19728
19729impl SymlinkSetExtendedAttributeResponder {
19730    /// Sends a response to the FIDL transaction.
19731    ///
19732    /// Sets the channel to shutdown if an error occurs.
19733    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19734        let _result = self.send_raw(result);
19735        if _result.is_err() {
19736            self.control_handle.shutdown();
19737        }
19738        self.drop_without_shutdown();
19739        _result
19740    }
19741
19742    /// Similar to "send" but does not shutdown the channel if an error occurs.
19743    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19744        let _result = self.send_raw(result);
19745        self.drop_without_shutdown();
19746        _result
19747    }
19748
19749    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19750        self.control_handle
19751            .inner
19752            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19753                result,
19754                self.tx_id,
19755                0x4a951362f681f23c,
19756                fidl::encoding::DynamicFlags::empty(),
19757            )
19758    }
19759}
19760
19761#[must_use = "FIDL methods require a response to be sent"]
19762#[derive(Debug)]
19763pub struct SymlinkRemoveExtendedAttributeResponder {
19764    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19765    tx_id: u32,
19766}
19767
19768/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19769/// if the responder is dropped without sending a response, so that the client
19770/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19771impl std::ops::Drop for SymlinkRemoveExtendedAttributeResponder {
19772    fn drop(&mut self) {
19773        self.control_handle.shutdown();
19774        // Safety: drops once, never accessed again
19775        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19776    }
19777}
19778
19779impl fidl::endpoints::Responder for SymlinkRemoveExtendedAttributeResponder {
19780    type ControlHandle = SymlinkControlHandle;
19781
19782    fn control_handle(&self) -> &SymlinkControlHandle {
19783        &self.control_handle
19784    }
19785
19786    fn drop_without_shutdown(mut self) {
19787        // Safety: drops once, never accessed again due to mem::forget
19788        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19789        // Prevent Drop from running (which would shut down the channel)
19790        std::mem::forget(self);
19791    }
19792}
19793
19794impl SymlinkRemoveExtendedAttributeResponder {
19795    /// Sends a response to the FIDL transaction.
19796    ///
19797    /// Sets the channel to shutdown if an error occurs.
19798    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19799        let _result = self.send_raw(result);
19800        if _result.is_err() {
19801            self.control_handle.shutdown();
19802        }
19803        self.drop_without_shutdown();
19804        _result
19805    }
19806
19807    /// Similar to "send" but does not shutdown the channel if an error occurs.
19808    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19809        let _result = self.send_raw(result);
19810        self.drop_without_shutdown();
19811        _result
19812    }
19813
19814    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19815        self.control_handle
19816            .inner
19817            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19818                result,
19819                self.tx_id,
19820                0x7a0b9f3a9bf9032d,
19821                fidl::encoding::DynamicFlags::empty(),
19822            )
19823    }
19824}
19825
19826#[must_use = "FIDL methods require a response to be sent"]
19827#[derive(Debug)]
19828pub struct SymlinkDescribeResponder {
19829    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19830    tx_id: u32,
19831}
19832
19833/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19834/// if the responder is dropped without sending a response, so that the client
19835/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19836impl std::ops::Drop for SymlinkDescribeResponder {
19837    fn drop(&mut self) {
19838        self.control_handle.shutdown();
19839        // Safety: drops once, never accessed again
19840        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19841    }
19842}
19843
19844impl fidl::endpoints::Responder for SymlinkDescribeResponder {
19845    type ControlHandle = SymlinkControlHandle;
19846
19847    fn control_handle(&self) -> &SymlinkControlHandle {
19848        &self.control_handle
19849    }
19850
19851    fn drop_without_shutdown(mut self) {
19852        // Safety: drops once, never accessed again due to mem::forget
19853        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19854        // Prevent Drop from running (which would shut down the channel)
19855        std::mem::forget(self);
19856    }
19857}
19858
19859impl SymlinkDescribeResponder {
19860    /// Sends a response to the FIDL transaction.
19861    ///
19862    /// Sets the channel to shutdown if an error occurs.
19863    pub fn send(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
19864        let _result = self.send_raw(payload);
19865        if _result.is_err() {
19866            self.control_handle.shutdown();
19867        }
19868        self.drop_without_shutdown();
19869        _result
19870    }
19871
19872    /// Similar to "send" but does not shutdown the channel if an error occurs.
19873    pub fn send_no_shutdown_on_err(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
19874        let _result = self.send_raw(payload);
19875        self.drop_without_shutdown();
19876        _result
19877    }
19878
19879    fn send_raw(&self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
19880        self.control_handle.inner.send::<fidl::encoding::FlexibleType<SymlinkInfo>>(
19881            fidl::encoding::Flexible::new(payload),
19882            self.tx_id,
19883            0x742c2ea5e89831f3,
19884            fidl::encoding::DynamicFlags::FLEXIBLE,
19885        )
19886    }
19887}
19888
19889#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
19890pub struct WritableMarker;
19891
19892impl fidl::endpoints::ProtocolMarker for WritableMarker {
19893    type Proxy = WritableProxy;
19894    type RequestStream = WritableRequestStream;
19895    #[cfg(target_os = "fuchsia")]
19896    type SynchronousProxy = WritableSynchronousProxy;
19897
19898    const DEBUG_NAME: &'static str = "(anonymous) Writable";
19899}
19900pub type WritableWriteResult = Result<u64, i32>;
19901
19902pub trait WritableProxyInterface: Send + Sync {
19903    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
19904        + Send;
19905    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
19906}
19907#[derive(Debug)]
19908#[cfg(target_os = "fuchsia")]
19909pub struct WritableSynchronousProxy {
19910    client: fidl::client::sync::Client,
19911}
19912
19913#[cfg(target_os = "fuchsia")]
19914impl fidl::endpoints::SynchronousProxy for WritableSynchronousProxy {
19915    type Proxy = WritableProxy;
19916    type Protocol = WritableMarker;
19917
19918    fn from_channel(inner: fidl::Channel) -> Self {
19919        Self::new(inner)
19920    }
19921
19922    fn into_channel(self) -> fidl::Channel {
19923        self.client.into_channel()
19924    }
19925
19926    fn as_channel(&self) -> &fidl::Channel {
19927        self.client.as_channel()
19928    }
19929}
19930
19931#[cfg(target_os = "fuchsia")]
19932impl WritableSynchronousProxy {
19933    pub fn new(channel: fidl::Channel) -> Self {
19934        let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
19935        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
19936    }
19937
19938    pub fn into_channel(self) -> fidl::Channel {
19939        self.client.into_channel()
19940    }
19941
19942    /// Waits until an event arrives and returns it. It is safe for other
19943    /// threads to make concurrent requests while waiting for an event.
19944    pub fn wait_for_event(
19945        &self,
19946        deadline: zx::MonotonicInstant,
19947    ) -> Result<WritableEvent, fidl::Error> {
19948        WritableEvent::decode(self.client.wait_for_event(deadline)?)
19949    }
19950
19951    /// Writes data at the seek offset.
19952    /// The seek offset is moved forward by the number of bytes written.
19953    /// If the file is in append mode, the seek offset is first set to the end
19954    /// of the file, followed by the write, in one atomic step.
19955    ///
19956    /// The file size may grow if the seek offset plus `data.length` is beyond
19957    /// the current end of file.
19958    ///
19959    /// + request `data` the byte buffer to write to the file.
19960    /// - response `actual_count` the number of bytes written.
19961    ///
19962    /// ## Invariants
19963    ///
19964    /// * The returned `actual_count` will never be greater than `data.length`.
19965    /// * If the server is unable to write all the data due to e.g. not enough
19966    ///   space, `actual_count` may be less than `data.length`.  If no bytes
19967    ///   could be written, an error is returned.
19968    /// * If `data.length` is zero, the server should perform all the checks
19969    ///   ensuring write access without mutating the file and return a
19970    ///   successful write of zero bytes.  The seek offset is still updated if
19971    ///   in append mode.
19972    ///
19973    /// This method requires the [`Rights.WRITE_BYTES`] right.
19974    pub fn r#write(
19975        &self,
19976        mut data: &[u8],
19977        ___deadline: zx::MonotonicInstant,
19978    ) -> Result<WritableWriteResult, fidl::Error> {
19979        let _response = self.client.send_query::<
19980            WritableWriteRequest,
19981            fidl::encoding::ResultType<WritableWriteResponse, i32>,
19982        >(
19983            (data,),
19984            0x6a31437832469f82,
19985            fidl::encoding::DynamicFlags::empty(),
19986            ___deadline,
19987        )?;
19988        Ok(_response.map(|x| x.actual_count))
19989    }
19990}
19991
19992#[cfg(target_os = "fuchsia")]
19993impl From<WritableSynchronousProxy> for zx::NullableHandle {
19994    fn from(value: WritableSynchronousProxy) -> Self {
19995        value.into_channel().into()
19996    }
19997}
19998
19999#[cfg(target_os = "fuchsia")]
20000impl From<fidl::Channel> for WritableSynchronousProxy {
20001    fn from(value: fidl::Channel) -> Self {
20002        Self::new(value)
20003    }
20004}
20005
20006#[cfg(target_os = "fuchsia")]
20007impl fidl::endpoints::FromClient for WritableSynchronousProxy {
20008    type Protocol = WritableMarker;
20009
20010    fn from_client(value: fidl::endpoints::ClientEnd<WritableMarker>) -> Self {
20011        Self::new(value.into_channel())
20012    }
20013}
20014
20015#[derive(Debug, Clone)]
20016pub struct WritableProxy {
20017    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
20018}
20019
20020impl fidl::endpoints::Proxy for WritableProxy {
20021    type Protocol = WritableMarker;
20022
20023    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
20024        Self::new(inner)
20025    }
20026
20027    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
20028        self.client.into_channel().map_err(|client| Self { client })
20029    }
20030
20031    fn as_channel(&self) -> &::fidl::AsyncChannel {
20032        self.client.as_channel()
20033    }
20034}
20035
20036impl WritableProxy {
20037    /// Create a new Proxy for fuchsia.io/Writable.
20038    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
20039        let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
20040        Self { client: fidl::client::Client::new(channel, protocol_name) }
20041    }
20042
20043    /// Get a Stream of events from the remote end of the protocol.
20044    ///
20045    /// # Panics
20046    ///
20047    /// Panics if the event stream was already taken.
20048    pub fn take_event_stream(&self) -> WritableEventStream {
20049        WritableEventStream { event_receiver: self.client.take_event_receiver() }
20050    }
20051
20052    /// Writes data at the seek offset.
20053    /// The seek offset is moved forward by the number of bytes written.
20054    /// If the file is in append mode, the seek offset is first set to the end
20055    /// of the file, followed by the write, in one atomic step.
20056    ///
20057    /// The file size may grow if the seek offset plus `data.length` is beyond
20058    /// the current end of file.
20059    ///
20060    /// + request `data` the byte buffer to write to the file.
20061    /// - response `actual_count` the number of bytes written.
20062    ///
20063    /// ## Invariants
20064    ///
20065    /// * The returned `actual_count` will never be greater than `data.length`.
20066    /// * If the server is unable to write all the data due to e.g. not enough
20067    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20068    ///   could be written, an error is returned.
20069    /// * If `data.length` is zero, the server should perform all the checks
20070    ///   ensuring write access without mutating the file and return a
20071    ///   successful write of zero bytes.  The seek offset is still updated if
20072    ///   in append mode.
20073    ///
20074    /// This method requires the [`Rights.WRITE_BYTES`] right.
20075    pub fn r#write(
20076        &self,
20077        mut data: &[u8],
20078    ) -> fidl::client::QueryResponseFut<
20079        WritableWriteResult,
20080        fidl::encoding::DefaultFuchsiaResourceDialect,
20081    > {
20082        WritableProxyInterface::r#write(self, data)
20083    }
20084}
20085
20086impl WritableProxyInterface for WritableProxy {
20087    type WriteResponseFut = fidl::client::QueryResponseFut<
20088        WritableWriteResult,
20089        fidl::encoding::DefaultFuchsiaResourceDialect,
20090    >;
20091    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
20092        fn _decode(
20093            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
20094        ) -> Result<WritableWriteResult, fidl::Error> {
20095            let _response = fidl::client::decode_transaction_body::<
20096                fidl::encoding::ResultType<WritableWriteResponse, i32>,
20097                fidl::encoding::DefaultFuchsiaResourceDialect,
20098                0x6a31437832469f82,
20099            >(_buf?)?;
20100            Ok(_response.map(|x| x.actual_count))
20101        }
20102        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
20103            (data,),
20104            0x6a31437832469f82,
20105            fidl::encoding::DynamicFlags::empty(),
20106            _decode,
20107        )
20108    }
20109}
20110
20111pub struct WritableEventStream {
20112    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
20113}
20114
20115impl std::marker::Unpin for WritableEventStream {}
20116
20117impl futures::stream::FusedStream for WritableEventStream {
20118    fn is_terminated(&self) -> bool {
20119        self.event_receiver.is_terminated()
20120    }
20121}
20122
20123impl futures::Stream for WritableEventStream {
20124    type Item = Result<WritableEvent, fidl::Error>;
20125
20126    fn poll_next(
20127        mut self: std::pin::Pin<&mut Self>,
20128        cx: &mut std::task::Context<'_>,
20129    ) -> std::task::Poll<Option<Self::Item>> {
20130        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
20131            &mut self.event_receiver,
20132            cx
20133        )?) {
20134            Some(buf) => std::task::Poll::Ready(Some(WritableEvent::decode(buf))),
20135            None => std::task::Poll::Ready(None),
20136        }
20137    }
20138}
20139
20140#[derive(Debug)]
20141pub enum WritableEvent {}
20142
20143impl WritableEvent {
20144    /// Decodes a message buffer as a [`WritableEvent`].
20145    fn decode(
20146        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
20147    ) -> Result<WritableEvent, fidl::Error> {
20148        let (bytes, _handles) = buf.split_mut();
20149        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
20150        debug_assert_eq!(tx_header.tx_id, 0);
20151        match tx_header.ordinal {
20152            _ => Err(fidl::Error::UnknownOrdinal {
20153                ordinal: tx_header.ordinal,
20154                protocol_name: <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
20155            }),
20156        }
20157    }
20158}
20159
20160/// A Stream of incoming requests for fuchsia.io/Writable.
20161pub struct WritableRequestStream {
20162    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20163    is_terminated: bool,
20164}
20165
20166impl std::marker::Unpin for WritableRequestStream {}
20167
20168impl futures::stream::FusedStream for WritableRequestStream {
20169    fn is_terminated(&self) -> bool {
20170        self.is_terminated
20171    }
20172}
20173
20174impl fidl::endpoints::RequestStream for WritableRequestStream {
20175    type Protocol = WritableMarker;
20176    type ControlHandle = WritableControlHandle;
20177
20178    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
20179        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
20180    }
20181
20182    fn control_handle(&self) -> Self::ControlHandle {
20183        WritableControlHandle { inner: self.inner.clone() }
20184    }
20185
20186    fn into_inner(
20187        self,
20188    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
20189    {
20190        (self.inner, self.is_terminated)
20191    }
20192
20193    fn from_inner(
20194        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20195        is_terminated: bool,
20196    ) -> Self {
20197        Self { inner, is_terminated }
20198    }
20199}
20200
20201impl futures::Stream for WritableRequestStream {
20202    type Item = Result<WritableRequest, fidl::Error>;
20203
20204    fn poll_next(
20205        mut self: std::pin::Pin<&mut Self>,
20206        cx: &mut std::task::Context<'_>,
20207    ) -> std::task::Poll<Option<Self::Item>> {
20208        let this = &mut *self;
20209        if this.inner.check_shutdown(cx) {
20210            this.is_terminated = true;
20211            return std::task::Poll::Ready(None);
20212        }
20213        if this.is_terminated {
20214            panic!("polled WritableRequestStream after completion");
20215        }
20216        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
20217            |bytes, handles| {
20218                match this.inner.channel().read_etc(cx, bytes, handles) {
20219                    std::task::Poll::Ready(Ok(())) => {}
20220                    std::task::Poll::Pending => return std::task::Poll::Pending,
20221                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
20222                        this.is_terminated = true;
20223                        return std::task::Poll::Ready(None);
20224                    }
20225                    std::task::Poll::Ready(Err(e)) => {
20226                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
20227                            e.into(),
20228                        ))));
20229                    }
20230                }
20231
20232                // A message has been received from the channel
20233                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
20234
20235                std::task::Poll::Ready(Some(match header.ordinal {
20236                    0x6a31437832469f82 => {
20237                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
20238                        let mut req = fidl::new_empty!(
20239                            WritableWriteRequest,
20240                            fidl::encoding::DefaultFuchsiaResourceDialect
20241                        );
20242                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
20243                        let control_handle = WritableControlHandle { inner: this.inner.clone() };
20244                        Ok(WritableRequest::Write {
20245                            data: req.data,
20246
20247                            responder: WritableWriteResponder {
20248                                control_handle: std::mem::ManuallyDrop::new(control_handle),
20249                                tx_id: header.tx_id,
20250                            },
20251                        })
20252                    }
20253                    _ => Err(fidl::Error::UnknownOrdinal {
20254                        ordinal: header.ordinal,
20255                        protocol_name:
20256                            <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
20257                    }),
20258                }))
20259            },
20260        )
20261    }
20262}
20263
20264#[derive(Debug)]
20265pub enum WritableRequest {
20266    /// Writes data at the seek offset.
20267    /// The seek offset is moved forward by the number of bytes written.
20268    /// If the file is in append mode, the seek offset is first set to the end
20269    /// of the file, followed by the write, in one atomic step.
20270    ///
20271    /// The file size may grow if the seek offset plus `data.length` is beyond
20272    /// the current end of file.
20273    ///
20274    /// + request `data` the byte buffer to write to the file.
20275    /// - response `actual_count` the number of bytes written.
20276    ///
20277    /// ## Invariants
20278    ///
20279    /// * The returned `actual_count` will never be greater than `data.length`.
20280    /// * If the server is unable to write all the data due to e.g. not enough
20281    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20282    ///   could be written, an error is returned.
20283    /// * If `data.length` is zero, the server should perform all the checks
20284    ///   ensuring write access without mutating the file and return a
20285    ///   successful write of zero bytes.  The seek offset is still updated if
20286    ///   in append mode.
20287    ///
20288    /// This method requires the [`Rights.WRITE_BYTES`] right.
20289    Write { data: Vec<u8>, responder: WritableWriteResponder },
20290}
20291
20292impl WritableRequest {
20293    #[allow(irrefutable_let_patterns)]
20294    pub fn into_write(self) -> Option<(Vec<u8>, WritableWriteResponder)> {
20295        if let WritableRequest::Write { data, responder } = self {
20296            Some((data, responder))
20297        } else {
20298            None
20299        }
20300    }
20301
20302    /// Name of the method defined in FIDL
20303    pub fn method_name(&self) -> &'static str {
20304        match *self {
20305            WritableRequest::Write { .. } => "write",
20306        }
20307    }
20308}
20309
20310#[derive(Debug, Clone)]
20311pub struct WritableControlHandle {
20312    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20313}
20314
20315impl fidl::endpoints::ControlHandle for WritableControlHandle {
20316    fn shutdown(&self) {
20317        self.inner.shutdown()
20318    }
20319
20320    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
20321        self.inner.shutdown_with_epitaph(status)
20322    }
20323
20324    fn is_closed(&self) -> bool {
20325        self.inner.channel().is_closed()
20326    }
20327    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
20328        self.inner.channel().on_closed()
20329    }
20330
20331    #[cfg(target_os = "fuchsia")]
20332    fn signal_peer(
20333        &self,
20334        clear_mask: zx::Signals,
20335        set_mask: zx::Signals,
20336    ) -> Result<(), zx_status::Status> {
20337        use fidl::Peered;
20338        self.inner.channel().signal_peer(clear_mask, set_mask)
20339    }
20340}
20341
20342impl WritableControlHandle {}
20343
20344#[must_use = "FIDL methods require a response to be sent"]
20345#[derive(Debug)]
20346pub struct WritableWriteResponder {
20347    control_handle: std::mem::ManuallyDrop<WritableControlHandle>,
20348    tx_id: u32,
20349}
20350
20351/// Set the the channel to be shutdown (see [`WritableControlHandle::shutdown`])
20352/// if the responder is dropped without sending a response, so that the client
20353/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20354impl std::ops::Drop for WritableWriteResponder {
20355    fn drop(&mut self) {
20356        self.control_handle.shutdown();
20357        // Safety: drops once, never accessed again
20358        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20359    }
20360}
20361
20362impl fidl::endpoints::Responder for WritableWriteResponder {
20363    type ControlHandle = WritableControlHandle;
20364
20365    fn control_handle(&self) -> &WritableControlHandle {
20366        &self.control_handle
20367    }
20368
20369    fn drop_without_shutdown(mut self) {
20370        // Safety: drops once, never accessed again due to mem::forget
20371        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20372        // Prevent Drop from running (which would shut down the channel)
20373        std::mem::forget(self);
20374    }
20375}
20376
20377impl WritableWriteResponder {
20378    /// Sends a response to the FIDL transaction.
20379    ///
20380    /// Sets the channel to shutdown if an error occurs.
20381    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
20382        let _result = self.send_raw(result);
20383        if _result.is_err() {
20384            self.control_handle.shutdown();
20385        }
20386        self.drop_without_shutdown();
20387        _result
20388    }
20389
20390    /// Similar to "send" but does not shutdown the channel if an error occurs.
20391    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
20392        let _result = self.send_raw(result);
20393        self.drop_without_shutdown();
20394        _result
20395    }
20396
20397    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
20398        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
20399            result.map(|actual_count| (actual_count,)),
20400            self.tx_id,
20401            0x6a31437832469f82,
20402            fidl::encoding::DynamicFlags::empty(),
20403        )
20404    }
20405}
20406
20407mod internal {
20408    use super::*;
20409
20410    impl fidl::encoding::ResourceTypeMarker for DirectoryCreateSymlinkRequest {
20411        type Borrowed<'a> = &'a mut Self;
20412        fn take_or_borrow<'a>(
20413            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20414        ) -> Self::Borrowed<'a> {
20415            value
20416        }
20417    }
20418
20419    unsafe impl fidl::encoding::TypeMarker for DirectoryCreateSymlinkRequest {
20420        type Owned = Self;
20421
20422        #[inline(always)]
20423        fn inline_align(_context: fidl::encoding::Context) -> usize {
20424            8
20425        }
20426
20427        #[inline(always)]
20428        fn inline_size(_context: fidl::encoding::Context) -> usize {
20429            40
20430        }
20431    }
20432
20433    unsafe impl
20434        fidl::encoding::Encode<
20435            DirectoryCreateSymlinkRequest,
20436            fidl::encoding::DefaultFuchsiaResourceDialect,
20437        > for &mut DirectoryCreateSymlinkRequest
20438    {
20439        #[inline]
20440        unsafe fn encode(
20441            self,
20442            encoder: &mut fidl::encoding::Encoder<
20443                '_,
20444                fidl::encoding::DefaultFuchsiaResourceDialect,
20445            >,
20446            offset: usize,
20447            _depth: fidl::encoding::Depth,
20448        ) -> fidl::Result<()> {
20449            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
20450            // Delegate to tuple encoding.
20451            fidl::encoding::Encode::<
20452                DirectoryCreateSymlinkRequest,
20453                fidl::encoding::DefaultFuchsiaResourceDialect,
20454            >::encode(
20455                (
20456                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
20457                        &self.name,
20458                    ),
20459                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
20460                        &self.target,
20461                    ),
20462                    <fidl::encoding::Optional<
20463                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20464                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20465                        &mut self.connection
20466                    ),
20467                ),
20468                encoder,
20469                offset,
20470                _depth,
20471            )
20472        }
20473    }
20474    unsafe impl<
20475        T0: fidl::encoding::Encode<
20476                fidl::encoding::BoundedString<255>,
20477                fidl::encoding::DefaultFuchsiaResourceDialect,
20478            >,
20479        T1: fidl::encoding::Encode<
20480                fidl::encoding::Vector<u8, 4095>,
20481                fidl::encoding::DefaultFuchsiaResourceDialect,
20482            >,
20483        T2: fidl::encoding::Encode<
20484                fidl::encoding::Optional<
20485                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20486                >,
20487                fidl::encoding::DefaultFuchsiaResourceDialect,
20488            >,
20489    >
20490        fidl::encoding::Encode<
20491            DirectoryCreateSymlinkRequest,
20492            fidl::encoding::DefaultFuchsiaResourceDialect,
20493        > for (T0, T1, T2)
20494    {
20495        #[inline]
20496        unsafe fn encode(
20497            self,
20498            encoder: &mut fidl::encoding::Encoder<
20499                '_,
20500                fidl::encoding::DefaultFuchsiaResourceDialect,
20501            >,
20502            offset: usize,
20503            depth: fidl::encoding::Depth,
20504        ) -> fidl::Result<()> {
20505            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
20506            // Zero out padding regions. There's no need to apply masks
20507            // because the unmasked parts will be overwritten by fields.
20508            unsafe {
20509                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
20510                (ptr as *mut u64).write_unaligned(0);
20511            }
20512            // Write the fields.
20513            self.0.encode(encoder, offset + 0, depth)?;
20514            self.1.encode(encoder, offset + 16, depth)?;
20515            self.2.encode(encoder, offset + 32, depth)?;
20516            Ok(())
20517        }
20518    }
20519
20520    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20521        for DirectoryCreateSymlinkRequest
20522    {
20523        #[inline(always)]
20524        fn new_empty() -> Self {
20525            Self {
20526                name: fidl::new_empty!(
20527                    fidl::encoding::BoundedString<255>,
20528                    fidl::encoding::DefaultFuchsiaResourceDialect
20529                ),
20530                target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect),
20531                connection: fidl::new_empty!(
20532                    fidl::encoding::Optional<
20533                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20534                    >,
20535                    fidl::encoding::DefaultFuchsiaResourceDialect
20536                ),
20537            }
20538        }
20539
20540        #[inline]
20541        unsafe fn decode(
20542            &mut self,
20543            decoder: &mut fidl::encoding::Decoder<
20544                '_,
20545                fidl::encoding::DefaultFuchsiaResourceDialect,
20546            >,
20547            offset: usize,
20548            _depth: fidl::encoding::Depth,
20549        ) -> fidl::Result<()> {
20550            decoder.debug_check_bounds::<Self>(offset);
20551            // Verify that padding bytes are zero.
20552            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
20553            let padval = unsafe { (ptr as *const u64).read_unaligned() };
20554            let mask = 0xffffffff00000000u64;
20555            let maskedval = padval & mask;
20556            if maskedval != 0 {
20557                return Err(fidl::Error::NonZeroPadding {
20558                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
20559                });
20560            }
20561            fidl::decode!(
20562                fidl::encoding::BoundedString<255>,
20563                fidl::encoding::DefaultFuchsiaResourceDialect,
20564                &mut self.name,
20565                decoder,
20566                offset + 0,
20567                _depth
20568            )?;
20569            fidl::decode!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.target, decoder, offset + 16, _depth)?;
20570            fidl::decode!(
20571                fidl::encoding::Optional<
20572                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20573                >,
20574                fidl::encoding::DefaultFuchsiaResourceDialect,
20575                &mut self.connection,
20576                decoder,
20577                offset + 32,
20578                _depth
20579            )?;
20580            Ok(())
20581        }
20582    }
20583
20584    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedOpenRequest {
20585        type Borrowed<'a> = &'a mut Self;
20586        fn take_or_borrow<'a>(
20587            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20588        ) -> Self::Borrowed<'a> {
20589            value
20590        }
20591    }
20592
20593    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedOpenRequest {
20594        type Owned = Self;
20595
20596        #[inline(always)]
20597        fn inline_align(_context: fidl::encoding::Context) -> usize {
20598            8
20599        }
20600
20601        #[inline(always)]
20602        fn inline_size(_context: fidl::encoding::Context) -> usize {
20603            32
20604        }
20605    }
20606
20607    unsafe impl
20608        fidl::encoding::Encode<
20609            DirectoryDeprecatedOpenRequest,
20610            fidl::encoding::DefaultFuchsiaResourceDialect,
20611        > for &mut DirectoryDeprecatedOpenRequest
20612    {
20613        #[inline]
20614        unsafe fn encode(
20615            self,
20616            encoder: &mut fidl::encoding::Encoder<
20617                '_,
20618                fidl::encoding::DefaultFuchsiaResourceDialect,
20619            >,
20620            offset: usize,
20621            _depth: fidl::encoding::Depth,
20622        ) -> fidl::Result<()> {
20623            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
20624            // Delegate to tuple encoding.
20625            fidl::encoding::Encode::<DirectoryDeprecatedOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
20626                (
20627                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
20628                    <ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
20629                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
20630                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
20631                ),
20632                encoder, offset, _depth
20633            )
20634        }
20635    }
20636    unsafe impl<
20637        T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
20638        T1: fidl::encoding::Encode<ModeType, fidl::encoding::DefaultFuchsiaResourceDialect>,
20639        T2: fidl::encoding::Encode<
20640                fidl::encoding::BoundedString<4095>,
20641                fidl::encoding::DefaultFuchsiaResourceDialect,
20642            >,
20643        T3: fidl::encoding::Encode<
20644                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
20645                fidl::encoding::DefaultFuchsiaResourceDialect,
20646            >,
20647    >
20648        fidl::encoding::Encode<
20649            DirectoryDeprecatedOpenRequest,
20650            fidl::encoding::DefaultFuchsiaResourceDialect,
20651        > for (T0, T1, T2, T3)
20652    {
20653        #[inline]
20654        unsafe fn encode(
20655            self,
20656            encoder: &mut fidl::encoding::Encoder<
20657                '_,
20658                fidl::encoding::DefaultFuchsiaResourceDialect,
20659            >,
20660            offset: usize,
20661            depth: fidl::encoding::Depth,
20662        ) -> fidl::Result<()> {
20663            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
20664            // Zero out padding regions. There's no need to apply masks
20665            // because the unmasked parts will be overwritten by fields.
20666            unsafe {
20667                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
20668                (ptr as *mut u64).write_unaligned(0);
20669            }
20670            // Write the fields.
20671            self.0.encode(encoder, offset + 0, depth)?;
20672            self.1.encode(encoder, offset + 4, depth)?;
20673            self.2.encode(encoder, offset + 8, depth)?;
20674            self.3.encode(encoder, offset + 24, depth)?;
20675            Ok(())
20676        }
20677    }
20678
20679    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20680        for DirectoryDeprecatedOpenRequest
20681    {
20682        #[inline(always)]
20683        fn new_empty() -> Self {
20684            Self {
20685                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
20686                mode: fidl::new_empty!(ModeType, fidl::encoding::DefaultFuchsiaResourceDialect),
20687                path: fidl::new_empty!(
20688                    fidl::encoding::BoundedString<4095>,
20689                    fidl::encoding::DefaultFuchsiaResourceDialect
20690                ),
20691                object: fidl::new_empty!(
20692                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
20693                    fidl::encoding::DefaultFuchsiaResourceDialect
20694                ),
20695            }
20696        }
20697
20698        #[inline]
20699        unsafe fn decode(
20700            &mut self,
20701            decoder: &mut fidl::encoding::Decoder<
20702                '_,
20703                fidl::encoding::DefaultFuchsiaResourceDialect,
20704            >,
20705            offset: usize,
20706            _depth: fidl::encoding::Depth,
20707        ) -> fidl::Result<()> {
20708            decoder.debug_check_bounds::<Self>(offset);
20709            // Verify that padding bytes are zero.
20710            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
20711            let padval = unsafe { (ptr as *const u64).read_unaligned() };
20712            let mask = 0xffffffff00000000u64;
20713            let maskedval = padval & mask;
20714            if maskedval != 0 {
20715                return Err(fidl::Error::NonZeroPadding {
20716                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
20717                });
20718            }
20719            fidl::decode!(
20720                OpenFlags,
20721                fidl::encoding::DefaultFuchsiaResourceDialect,
20722                &mut self.flags,
20723                decoder,
20724                offset + 0,
20725                _depth
20726            )?;
20727            fidl::decode!(
20728                ModeType,
20729                fidl::encoding::DefaultFuchsiaResourceDialect,
20730                &mut self.mode,
20731                decoder,
20732                offset + 4,
20733                _depth
20734            )?;
20735            fidl::decode!(
20736                fidl::encoding::BoundedString<4095>,
20737                fidl::encoding::DefaultFuchsiaResourceDialect,
20738                &mut self.path,
20739                decoder,
20740                offset + 8,
20741                _depth
20742            )?;
20743            fidl::decode!(
20744                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
20745                fidl::encoding::DefaultFuchsiaResourceDialect,
20746                &mut self.object,
20747                decoder,
20748                offset + 24,
20749                _depth
20750            )?;
20751            Ok(())
20752        }
20753    }
20754
20755    impl fidl::encoding::ResourceTypeMarker for DirectoryGetTokenResponse {
20756        type Borrowed<'a> = &'a mut Self;
20757        fn take_or_borrow<'a>(
20758            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20759        ) -> Self::Borrowed<'a> {
20760            value
20761        }
20762    }
20763
20764    unsafe impl fidl::encoding::TypeMarker for DirectoryGetTokenResponse {
20765        type Owned = Self;
20766
20767        #[inline(always)]
20768        fn inline_align(_context: fidl::encoding::Context) -> usize {
20769            4
20770        }
20771
20772        #[inline(always)]
20773        fn inline_size(_context: fidl::encoding::Context) -> usize {
20774            8
20775        }
20776    }
20777
20778    unsafe impl
20779        fidl::encoding::Encode<
20780            DirectoryGetTokenResponse,
20781            fidl::encoding::DefaultFuchsiaResourceDialect,
20782        > for &mut DirectoryGetTokenResponse
20783    {
20784        #[inline]
20785        unsafe fn encode(
20786            self,
20787            encoder: &mut fidl::encoding::Encoder<
20788                '_,
20789                fidl::encoding::DefaultFuchsiaResourceDialect,
20790            >,
20791            offset: usize,
20792            _depth: fidl::encoding::Depth,
20793        ) -> fidl::Result<()> {
20794            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
20795            // Delegate to tuple encoding.
20796            fidl::encoding::Encode::<
20797                DirectoryGetTokenResponse,
20798                fidl::encoding::DefaultFuchsiaResourceDialect,
20799            >::encode(
20800                (
20801                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
20802                    <fidl::encoding::Optional<
20803                        fidl::encoding::HandleType<
20804                            fidl::NullableHandle,
20805                            { fidl::ObjectType::NONE.into_raw() },
20806                            2147483648,
20807                        >,
20808                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20809                        &mut self.token
20810                    ),
20811                ),
20812                encoder,
20813                offset,
20814                _depth,
20815            )
20816        }
20817    }
20818    unsafe impl<
20819        T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
20820        T1: fidl::encoding::Encode<
20821                fidl::encoding::Optional<
20822                    fidl::encoding::HandleType<
20823                        fidl::NullableHandle,
20824                        { fidl::ObjectType::NONE.into_raw() },
20825                        2147483648,
20826                    >,
20827                >,
20828                fidl::encoding::DefaultFuchsiaResourceDialect,
20829            >,
20830    >
20831        fidl::encoding::Encode<
20832            DirectoryGetTokenResponse,
20833            fidl::encoding::DefaultFuchsiaResourceDialect,
20834        > for (T0, T1)
20835    {
20836        #[inline]
20837        unsafe fn encode(
20838            self,
20839            encoder: &mut fidl::encoding::Encoder<
20840                '_,
20841                fidl::encoding::DefaultFuchsiaResourceDialect,
20842            >,
20843            offset: usize,
20844            depth: fidl::encoding::Depth,
20845        ) -> fidl::Result<()> {
20846            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
20847            // Zero out padding regions. There's no need to apply masks
20848            // because the unmasked parts will be overwritten by fields.
20849            // Write the fields.
20850            self.0.encode(encoder, offset + 0, depth)?;
20851            self.1.encode(encoder, offset + 4, depth)?;
20852            Ok(())
20853        }
20854    }
20855
20856    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20857        for DirectoryGetTokenResponse
20858    {
20859        #[inline(always)]
20860        fn new_empty() -> Self {
20861            Self {
20862                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
20863                token: fidl::new_empty!(
20864                    fidl::encoding::Optional<
20865                        fidl::encoding::HandleType<
20866                            fidl::NullableHandle,
20867                            { fidl::ObjectType::NONE.into_raw() },
20868                            2147483648,
20869                        >,
20870                    >,
20871                    fidl::encoding::DefaultFuchsiaResourceDialect
20872                ),
20873            }
20874        }
20875
20876        #[inline]
20877        unsafe fn decode(
20878            &mut self,
20879            decoder: &mut fidl::encoding::Decoder<
20880                '_,
20881                fidl::encoding::DefaultFuchsiaResourceDialect,
20882            >,
20883            offset: usize,
20884            _depth: fidl::encoding::Depth,
20885        ) -> fidl::Result<()> {
20886            decoder.debug_check_bounds::<Self>(offset);
20887            // Verify that padding bytes are zero.
20888            fidl::decode!(
20889                i32,
20890                fidl::encoding::DefaultFuchsiaResourceDialect,
20891                &mut self.s,
20892                decoder,
20893                offset + 0,
20894                _depth
20895            )?;
20896            fidl::decode!(
20897                fidl::encoding::Optional<
20898                    fidl::encoding::HandleType<
20899                        fidl::NullableHandle,
20900                        { fidl::ObjectType::NONE.into_raw() },
20901                        2147483648,
20902                    >,
20903                >,
20904                fidl::encoding::DefaultFuchsiaResourceDialect,
20905                &mut self.token,
20906                decoder,
20907                offset + 4,
20908                _depth
20909            )?;
20910            Ok(())
20911        }
20912    }
20913
20914    impl fidl::encoding::ResourceTypeMarker for DirectoryLinkRequest {
20915        type Borrowed<'a> = &'a mut Self;
20916        fn take_or_borrow<'a>(
20917            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20918        ) -> Self::Borrowed<'a> {
20919            value
20920        }
20921    }
20922
20923    unsafe impl fidl::encoding::TypeMarker for DirectoryLinkRequest {
20924        type Owned = Self;
20925
20926        #[inline(always)]
20927        fn inline_align(_context: fidl::encoding::Context) -> usize {
20928            8
20929        }
20930
20931        #[inline(always)]
20932        fn inline_size(_context: fidl::encoding::Context) -> usize {
20933            40
20934        }
20935    }
20936
20937    unsafe impl
20938        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
20939        for &mut DirectoryLinkRequest
20940    {
20941        #[inline]
20942        unsafe fn encode(
20943            self,
20944            encoder: &mut fidl::encoding::Encoder<
20945                '_,
20946                fidl::encoding::DefaultFuchsiaResourceDialect,
20947            >,
20948            offset: usize,
20949            _depth: fidl::encoding::Depth,
20950        ) -> fidl::Result<()> {
20951            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
20952            // Delegate to tuple encoding.
20953            fidl::encoding::Encode::<
20954                DirectoryLinkRequest,
20955                fidl::encoding::DefaultFuchsiaResourceDialect,
20956            >::encode(
20957                (
20958                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
20959                        &self.src,
20960                    ),
20961                    <fidl::encoding::HandleType<
20962                        fidl::NullableHandle,
20963                        { fidl::ObjectType::NONE.into_raw() },
20964                        2147483648,
20965                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20966                        &mut self.dst_parent_token,
20967                    ),
20968                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
20969                        &self.dst,
20970                    ),
20971                ),
20972                encoder,
20973                offset,
20974                _depth,
20975            )
20976        }
20977    }
20978    unsafe impl<
20979        T0: fidl::encoding::Encode<
20980                fidl::encoding::BoundedString<255>,
20981                fidl::encoding::DefaultFuchsiaResourceDialect,
20982            >,
20983        T1: fidl::encoding::Encode<
20984                fidl::encoding::HandleType<
20985                    fidl::NullableHandle,
20986                    { fidl::ObjectType::NONE.into_raw() },
20987                    2147483648,
20988                >,
20989                fidl::encoding::DefaultFuchsiaResourceDialect,
20990            >,
20991        T2: fidl::encoding::Encode<
20992                fidl::encoding::BoundedString<255>,
20993                fidl::encoding::DefaultFuchsiaResourceDialect,
20994            >,
20995    >
20996        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
20997        for (T0, T1, T2)
20998    {
20999        #[inline]
21000        unsafe fn encode(
21001            self,
21002            encoder: &mut fidl::encoding::Encoder<
21003                '_,
21004                fidl::encoding::DefaultFuchsiaResourceDialect,
21005            >,
21006            offset: usize,
21007            depth: fidl::encoding::Depth,
21008        ) -> fidl::Result<()> {
21009            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
21010            // Zero out padding regions. There's no need to apply masks
21011            // because the unmasked parts will be overwritten by fields.
21012            unsafe {
21013                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21014                (ptr as *mut u64).write_unaligned(0);
21015            }
21016            // Write the fields.
21017            self.0.encode(encoder, offset + 0, depth)?;
21018            self.1.encode(encoder, offset + 16, depth)?;
21019            self.2.encode(encoder, offset + 24, depth)?;
21020            Ok(())
21021        }
21022    }
21023
21024    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21025        for DirectoryLinkRequest
21026    {
21027        #[inline(always)]
21028        fn new_empty() -> Self {
21029            Self {
21030                src: fidl::new_empty!(
21031                    fidl::encoding::BoundedString<255>,
21032                    fidl::encoding::DefaultFuchsiaResourceDialect
21033                ),
21034                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21035                dst: fidl::new_empty!(
21036                    fidl::encoding::BoundedString<255>,
21037                    fidl::encoding::DefaultFuchsiaResourceDialect
21038                ),
21039            }
21040        }
21041
21042        #[inline]
21043        unsafe fn decode(
21044            &mut self,
21045            decoder: &mut fidl::encoding::Decoder<
21046                '_,
21047                fidl::encoding::DefaultFuchsiaResourceDialect,
21048            >,
21049            offset: usize,
21050            _depth: fidl::encoding::Depth,
21051        ) -> fidl::Result<()> {
21052            decoder.debug_check_bounds::<Self>(offset);
21053            // Verify that padding bytes are zero.
21054            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21055            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21056            let mask = 0xffffffff00000000u64;
21057            let maskedval = padval & mask;
21058            if maskedval != 0 {
21059                return Err(fidl::Error::NonZeroPadding {
21060                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21061                });
21062            }
21063            fidl::decode!(
21064                fidl::encoding::BoundedString<255>,
21065                fidl::encoding::DefaultFuchsiaResourceDialect,
21066                &mut self.src,
21067                decoder,
21068                offset + 0,
21069                _depth
21070            )?;
21071            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)?;
21072            fidl::decode!(
21073                fidl::encoding::BoundedString<255>,
21074                fidl::encoding::DefaultFuchsiaResourceDialect,
21075                &mut self.dst,
21076                decoder,
21077                offset + 24,
21078                _depth
21079            )?;
21080            Ok(())
21081        }
21082    }
21083
21084    impl fidl::encoding::ResourceTypeMarker for DirectoryOpenRequest {
21085        type Borrowed<'a> = &'a mut Self;
21086        fn take_or_borrow<'a>(
21087            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21088        ) -> Self::Borrowed<'a> {
21089            value
21090        }
21091    }
21092
21093    unsafe impl fidl::encoding::TypeMarker for DirectoryOpenRequest {
21094        type Owned = Self;
21095
21096        #[inline(always)]
21097        fn inline_align(_context: fidl::encoding::Context) -> usize {
21098            8
21099        }
21100
21101        #[inline(always)]
21102        fn inline_size(_context: fidl::encoding::Context) -> usize {
21103            48
21104        }
21105    }
21106
21107    unsafe impl
21108        fidl::encoding::Encode<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21109        for &mut DirectoryOpenRequest
21110    {
21111        #[inline]
21112        unsafe fn encode(
21113            self,
21114            encoder: &mut fidl::encoding::Encoder<
21115                '_,
21116                fidl::encoding::DefaultFuchsiaResourceDialect,
21117            >,
21118            offset: usize,
21119            _depth: fidl::encoding::Depth,
21120        ) -> fidl::Result<()> {
21121            encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
21122            // Delegate to tuple encoding.
21123            fidl::encoding::Encode::<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21124                (
21125                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
21126                    <Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
21127                    <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
21128                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
21129                ),
21130                encoder, offset, _depth
21131            )
21132        }
21133    }
21134    unsafe impl<
21135        T0: fidl::encoding::Encode<
21136                fidl::encoding::BoundedString<4095>,
21137                fidl::encoding::DefaultFuchsiaResourceDialect,
21138            >,
21139        T1: fidl::encoding::Encode<Flags, fidl::encoding::DefaultFuchsiaResourceDialect>,
21140        T2: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
21141        T3: fidl::encoding::Encode<
21142                fidl::encoding::HandleType<
21143                    fidl::Channel,
21144                    { fidl::ObjectType::CHANNEL.into_raw() },
21145                    2147483648,
21146                >,
21147                fidl::encoding::DefaultFuchsiaResourceDialect,
21148            >,
21149    >
21150        fidl::encoding::Encode<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21151        for (T0, T1, T2, T3)
21152    {
21153        #[inline]
21154        unsafe fn encode(
21155            self,
21156            encoder: &mut fidl::encoding::Encoder<
21157                '_,
21158                fidl::encoding::DefaultFuchsiaResourceDialect,
21159            >,
21160            offset: usize,
21161            depth: fidl::encoding::Depth,
21162        ) -> fidl::Result<()> {
21163            encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
21164            // Zero out padding regions. There's no need to apply masks
21165            // because the unmasked parts will be overwritten by fields.
21166            unsafe {
21167                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
21168                (ptr as *mut u64).write_unaligned(0);
21169            }
21170            // Write the fields.
21171            self.0.encode(encoder, offset + 0, depth)?;
21172            self.1.encode(encoder, offset + 16, depth)?;
21173            self.2.encode(encoder, offset + 24, depth)?;
21174            self.3.encode(encoder, offset + 40, depth)?;
21175            Ok(())
21176        }
21177    }
21178
21179    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21180        for DirectoryOpenRequest
21181    {
21182        #[inline(always)]
21183        fn new_empty() -> Self {
21184            Self {
21185                path: fidl::new_empty!(
21186                    fidl::encoding::BoundedString<4095>,
21187                    fidl::encoding::DefaultFuchsiaResourceDialect
21188                ),
21189                flags: fidl::new_empty!(Flags, fidl::encoding::DefaultFuchsiaResourceDialect),
21190                options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
21191                object: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21192            }
21193        }
21194
21195        #[inline]
21196        unsafe fn decode(
21197            &mut self,
21198            decoder: &mut fidl::encoding::Decoder<
21199                '_,
21200                fidl::encoding::DefaultFuchsiaResourceDialect,
21201            >,
21202            offset: usize,
21203            _depth: fidl::encoding::Depth,
21204        ) -> fidl::Result<()> {
21205            decoder.debug_check_bounds::<Self>(offset);
21206            // Verify that padding bytes are zero.
21207            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
21208            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21209            let mask = 0xffffffff00000000u64;
21210            let maskedval = padval & mask;
21211            if maskedval != 0 {
21212                return Err(fidl::Error::NonZeroPadding {
21213                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
21214                });
21215            }
21216            fidl::decode!(
21217                fidl::encoding::BoundedString<4095>,
21218                fidl::encoding::DefaultFuchsiaResourceDialect,
21219                &mut self.path,
21220                decoder,
21221                offset + 0,
21222                _depth
21223            )?;
21224            fidl::decode!(
21225                Flags,
21226                fidl::encoding::DefaultFuchsiaResourceDialect,
21227                &mut self.flags,
21228                decoder,
21229                offset + 16,
21230                _depth
21231            )?;
21232            fidl::decode!(
21233                Options,
21234                fidl::encoding::DefaultFuchsiaResourceDialect,
21235                &mut self.options,
21236                decoder,
21237                offset + 24,
21238                _depth
21239            )?;
21240            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.object, decoder, offset + 40, _depth)?;
21241            Ok(())
21242        }
21243    }
21244
21245    impl fidl::encoding::ResourceTypeMarker for DirectoryRenameRequest {
21246        type Borrowed<'a> = &'a mut Self;
21247        fn take_or_borrow<'a>(
21248            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21249        ) -> Self::Borrowed<'a> {
21250            value
21251        }
21252    }
21253
21254    unsafe impl fidl::encoding::TypeMarker for DirectoryRenameRequest {
21255        type Owned = Self;
21256
21257        #[inline(always)]
21258        fn inline_align(_context: fidl::encoding::Context) -> usize {
21259            8
21260        }
21261
21262        #[inline(always)]
21263        fn inline_size(_context: fidl::encoding::Context) -> usize {
21264            40
21265        }
21266    }
21267
21268    unsafe impl
21269        fidl::encoding::Encode<
21270            DirectoryRenameRequest,
21271            fidl::encoding::DefaultFuchsiaResourceDialect,
21272        > for &mut DirectoryRenameRequest
21273    {
21274        #[inline]
21275        unsafe fn encode(
21276            self,
21277            encoder: &mut fidl::encoding::Encoder<
21278                '_,
21279                fidl::encoding::DefaultFuchsiaResourceDialect,
21280            >,
21281            offset: usize,
21282            _depth: fidl::encoding::Depth,
21283        ) -> fidl::Result<()> {
21284            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
21285            // Delegate to tuple encoding.
21286            fidl::encoding::Encode::<
21287                DirectoryRenameRequest,
21288                fidl::encoding::DefaultFuchsiaResourceDialect,
21289            >::encode(
21290                (
21291                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21292                        &self.src,
21293                    ),
21294                    <fidl::encoding::HandleType<
21295                        fidl::Event,
21296                        { fidl::ObjectType::EVENT.into_raw() },
21297                        2147483648,
21298                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21299                        &mut self.dst_parent_token,
21300                    ),
21301                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21302                        &self.dst,
21303                    ),
21304                ),
21305                encoder,
21306                offset,
21307                _depth,
21308            )
21309        }
21310    }
21311    unsafe impl<
21312        T0: fidl::encoding::Encode<
21313                fidl::encoding::BoundedString<255>,
21314                fidl::encoding::DefaultFuchsiaResourceDialect,
21315            >,
21316        T1: fidl::encoding::Encode<
21317                fidl::encoding::HandleType<
21318                    fidl::Event,
21319                    { fidl::ObjectType::EVENT.into_raw() },
21320                    2147483648,
21321                >,
21322                fidl::encoding::DefaultFuchsiaResourceDialect,
21323            >,
21324        T2: fidl::encoding::Encode<
21325                fidl::encoding::BoundedString<255>,
21326                fidl::encoding::DefaultFuchsiaResourceDialect,
21327            >,
21328    >
21329        fidl::encoding::Encode<
21330            DirectoryRenameRequest,
21331            fidl::encoding::DefaultFuchsiaResourceDialect,
21332        > for (T0, T1, T2)
21333    {
21334        #[inline]
21335        unsafe fn encode(
21336            self,
21337            encoder: &mut fidl::encoding::Encoder<
21338                '_,
21339                fidl::encoding::DefaultFuchsiaResourceDialect,
21340            >,
21341            offset: usize,
21342            depth: fidl::encoding::Depth,
21343        ) -> fidl::Result<()> {
21344            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
21345            // Zero out padding regions. There's no need to apply masks
21346            // because the unmasked parts will be overwritten by fields.
21347            unsafe {
21348                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21349                (ptr as *mut u64).write_unaligned(0);
21350            }
21351            // Write the fields.
21352            self.0.encode(encoder, offset + 0, depth)?;
21353            self.1.encode(encoder, offset + 16, depth)?;
21354            self.2.encode(encoder, offset + 24, depth)?;
21355            Ok(())
21356        }
21357    }
21358
21359    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21360        for DirectoryRenameRequest
21361    {
21362        #[inline(always)]
21363        fn new_empty() -> Self {
21364            Self {
21365                src: fidl::new_empty!(
21366                    fidl::encoding::BoundedString<255>,
21367                    fidl::encoding::DefaultFuchsiaResourceDialect
21368                ),
21369                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21370                dst: fidl::new_empty!(
21371                    fidl::encoding::BoundedString<255>,
21372                    fidl::encoding::DefaultFuchsiaResourceDialect
21373                ),
21374            }
21375        }
21376
21377        #[inline]
21378        unsafe fn decode(
21379            &mut self,
21380            decoder: &mut fidl::encoding::Decoder<
21381                '_,
21382                fidl::encoding::DefaultFuchsiaResourceDialect,
21383            >,
21384            offset: usize,
21385            _depth: fidl::encoding::Depth,
21386        ) -> fidl::Result<()> {
21387            decoder.debug_check_bounds::<Self>(offset);
21388            // Verify that padding bytes are zero.
21389            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21390            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21391            let mask = 0xffffffff00000000u64;
21392            let maskedval = padval & mask;
21393            if maskedval != 0 {
21394                return Err(fidl::Error::NonZeroPadding {
21395                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21396                });
21397            }
21398            fidl::decode!(
21399                fidl::encoding::BoundedString<255>,
21400                fidl::encoding::DefaultFuchsiaResourceDialect,
21401                &mut self.src,
21402                decoder,
21403                offset + 0,
21404                _depth
21405            )?;
21406            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)?;
21407            fidl::decode!(
21408                fidl::encoding::BoundedString<255>,
21409                fidl::encoding::DefaultFuchsiaResourceDialect,
21410                &mut self.dst,
21411                decoder,
21412                offset + 24,
21413                _depth
21414            )?;
21415            Ok(())
21416        }
21417    }
21418
21419    impl fidl::encoding::ResourceTypeMarker for DirectoryWatchRequest {
21420        type Borrowed<'a> = &'a mut Self;
21421        fn take_or_borrow<'a>(
21422            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21423        ) -> Self::Borrowed<'a> {
21424            value
21425        }
21426    }
21427
21428    unsafe impl fidl::encoding::TypeMarker for DirectoryWatchRequest {
21429        type Owned = Self;
21430
21431        #[inline(always)]
21432        fn inline_align(_context: fidl::encoding::Context) -> usize {
21433            4
21434        }
21435
21436        #[inline(always)]
21437        fn inline_size(_context: fidl::encoding::Context) -> usize {
21438            12
21439        }
21440    }
21441
21442    unsafe impl
21443        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21444        for &mut DirectoryWatchRequest
21445    {
21446        #[inline]
21447        unsafe fn encode(
21448            self,
21449            encoder: &mut fidl::encoding::Encoder<
21450                '_,
21451                fidl::encoding::DefaultFuchsiaResourceDialect,
21452            >,
21453            offset: usize,
21454            _depth: fidl::encoding::Depth,
21455        ) -> fidl::Result<()> {
21456            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
21457            // Delegate to tuple encoding.
21458            fidl::encoding::Encode::<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21459                (
21460                    <WatchMask as fidl::encoding::ValueTypeMarker>::borrow(&self.mask),
21461                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
21462                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
21463                ),
21464                encoder, offset, _depth
21465            )
21466        }
21467    }
21468    unsafe impl<
21469        T0: fidl::encoding::Encode<WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect>,
21470        T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
21471        T2: fidl::encoding::Encode<
21472                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
21473                fidl::encoding::DefaultFuchsiaResourceDialect,
21474            >,
21475    >
21476        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21477        for (T0, T1, T2)
21478    {
21479        #[inline]
21480        unsafe fn encode(
21481            self,
21482            encoder: &mut fidl::encoding::Encoder<
21483                '_,
21484                fidl::encoding::DefaultFuchsiaResourceDialect,
21485            >,
21486            offset: usize,
21487            depth: fidl::encoding::Depth,
21488        ) -> fidl::Result<()> {
21489            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
21490            // Zero out padding regions. There's no need to apply masks
21491            // because the unmasked parts will be overwritten by fields.
21492            // Write the fields.
21493            self.0.encode(encoder, offset + 0, depth)?;
21494            self.1.encode(encoder, offset + 4, depth)?;
21495            self.2.encode(encoder, offset + 8, depth)?;
21496            Ok(())
21497        }
21498    }
21499
21500    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21501        for DirectoryWatchRequest
21502    {
21503        #[inline(always)]
21504        fn new_empty() -> Self {
21505            Self {
21506                mask: fidl::new_empty!(WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect),
21507                options: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
21508                watcher: fidl::new_empty!(
21509                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
21510                    fidl::encoding::DefaultFuchsiaResourceDialect
21511                ),
21512            }
21513        }
21514
21515        #[inline]
21516        unsafe fn decode(
21517            &mut self,
21518            decoder: &mut fidl::encoding::Decoder<
21519                '_,
21520                fidl::encoding::DefaultFuchsiaResourceDialect,
21521            >,
21522            offset: usize,
21523            _depth: fidl::encoding::Depth,
21524        ) -> fidl::Result<()> {
21525            decoder.debug_check_bounds::<Self>(offset);
21526            // Verify that padding bytes are zero.
21527            fidl::decode!(
21528                WatchMask,
21529                fidl::encoding::DefaultFuchsiaResourceDialect,
21530                &mut self.mask,
21531                decoder,
21532                offset + 0,
21533                _depth
21534            )?;
21535            fidl::decode!(
21536                u32,
21537                fidl::encoding::DefaultFuchsiaResourceDialect,
21538                &mut self.options,
21539                decoder,
21540                offset + 4,
21541                _depth
21542            )?;
21543            fidl::decode!(
21544                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
21545                fidl::encoding::DefaultFuchsiaResourceDialect,
21546                &mut self.watcher,
21547                decoder,
21548                offset + 8,
21549                _depth
21550            )?;
21551            Ok(())
21552        }
21553    }
21554
21555    impl fidl::encoding::ResourceTypeMarker for FileAllocateRequest {
21556        type Borrowed<'a> = &'a mut Self;
21557        fn take_or_borrow<'a>(
21558            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21559        ) -> Self::Borrowed<'a> {
21560            value
21561        }
21562    }
21563
21564    unsafe impl fidl::encoding::TypeMarker for FileAllocateRequest {
21565        type Owned = Self;
21566
21567        #[inline(always)]
21568        fn inline_align(_context: fidl::encoding::Context) -> usize {
21569            8
21570        }
21571
21572        #[inline(always)]
21573        fn inline_size(_context: fidl::encoding::Context) -> usize {
21574            24
21575        }
21576    }
21577
21578    unsafe impl
21579        fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21580        for &mut FileAllocateRequest
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            // Delegate to tuple encoding.
21594            fidl::encoding::Encode::<
21595                FileAllocateRequest,
21596                fidl::encoding::DefaultFuchsiaResourceDialect,
21597            >::encode(
21598                (
21599                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
21600                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
21601                    <AllocateMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
21602                ),
21603                encoder,
21604                offset,
21605                _depth,
21606            )
21607        }
21608    }
21609    unsafe impl<
21610        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
21611        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
21612        T2: fidl::encoding::Encode<AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect>,
21613    > fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21614        for (T0, T1, T2)
21615    {
21616        #[inline]
21617        unsafe fn encode(
21618            self,
21619            encoder: &mut fidl::encoding::Encoder<
21620                '_,
21621                fidl::encoding::DefaultFuchsiaResourceDialect,
21622            >,
21623            offset: usize,
21624            depth: fidl::encoding::Depth,
21625        ) -> fidl::Result<()> {
21626            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
21627            // Zero out padding regions. There's no need to apply masks
21628            // because the unmasked parts will be overwritten by fields.
21629            unsafe {
21630                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21631                (ptr as *mut u64).write_unaligned(0);
21632            }
21633            // Write the fields.
21634            self.0.encode(encoder, offset + 0, depth)?;
21635            self.1.encode(encoder, offset + 8, depth)?;
21636            self.2.encode(encoder, offset + 16, depth)?;
21637            Ok(())
21638        }
21639    }
21640
21641    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21642        for FileAllocateRequest
21643    {
21644        #[inline(always)]
21645        fn new_empty() -> Self {
21646            Self {
21647                offset: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
21648                length: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
21649                mode: fidl::new_empty!(AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect),
21650            }
21651        }
21652
21653        #[inline]
21654        unsafe fn decode(
21655            &mut self,
21656            decoder: &mut fidl::encoding::Decoder<
21657                '_,
21658                fidl::encoding::DefaultFuchsiaResourceDialect,
21659            >,
21660            offset: usize,
21661            _depth: fidl::encoding::Depth,
21662        ) -> fidl::Result<()> {
21663            decoder.debug_check_bounds::<Self>(offset);
21664            // Verify that padding bytes are zero.
21665            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21666            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21667            let mask = 0xffffffff00000000u64;
21668            let maskedval = padval & mask;
21669            if maskedval != 0 {
21670                return Err(fidl::Error::NonZeroPadding {
21671                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21672                });
21673            }
21674            fidl::decode!(
21675                u64,
21676                fidl::encoding::DefaultFuchsiaResourceDialect,
21677                &mut self.offset,
21678                decoder,
21679                offset + 0,
21680                _depth
21681            )?;
21682            fidl::decode!(
21683                u64,
21684                fidl::encoding::DefaultFuchsiaResourceDialect,
21685                &mut self.length,
21686                decoder,
21687                offset + 8,
21688                _depth
21689            )?;
21690            fidl::decode!(
21691                AllocateMode,
21692                fidl::encoding::DefaultFuchsiaResourceDialect,
21693                &mut self.mode,
21694                decoder,
21695                offset + 16,
21696                _depth
21697            )?;
21698            Ok(())
21699        }
21700    }
21701
21702    impl fidl::encoding::ResourceTypeMarker for FileEnableVerityRequest {
21703        type Borrowed<'a> = &'a mut Self;
21704        fn take_or_borrow<'a>(
21705            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21706        ) -> Self::Borrowed<'a> {
21707            value
21708        }
21709    }
21710
21711    unsafe impl fidl::encoding::TypeMarker for FileEnableVerityRequest {
21712        type Owned = Self;
21713
21714        #[inline(always)]
21715        fn inline_align(_context: fidl::encoding::Context) -> usize {
21716            8
21717        }
21718
21719        #[inline(always)]
21720        fn inline_size(_context: fidl::encoding::Context) -> usize {
21721            16
21722        }
21723    }
21724
21725    unsafe impl
21726        fidl::encoding::Encode<
21727            FileEnableVerityRequest,
21728            fidl::encoding::DefaultFuchsiaResourceDialect,
21729        > for &mut FileEnableVerityRequest
21730    {
21731        #[inline]
21732        unsafe fn encode(
21733            self,
21734            encoder: &mut fidl::encoding::Encoder<
21735                '_,
21736                fidl::encoding::DefaultFuchsiaResourceDialect,
21737            >,
21738            offset: usize,
21739            _depth: fidl::encoding::Depth,
21740        ) -> fidl::Result<()> {
21741            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
21742            // Delegate to tuple encoding.
21743            fidl::encoding::Encode::<
21744                FileEnableVerityRequest,
21745                fidl::encoding::DefaultFuchsiaResourceDialect,
21746            >::encode(
21747                (<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
21748                encoder,
21749                offset,
21750                _depth,
21751            )
21752        }
21753    }
21754    unsafe impl<
21755        T0: fidl::encoding::Encode<VerificationOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
21756    >
21757        fidl::encoding::Encode<
21758            FileEnableVerityRequest,
21759            fidl::encoding::DefaultFuchsiaResourceDialect,
21760        > for (T0,)
21761    {
21762        #[inline]
21763        unsafe fn encode(
21764            self,
21765            encoder: &mut fidl::encoding::Encoder<
21766                '_,
21767                fidl::encoding::DefaultFuchsiaResourceDialect,
21768            >,
21769            offset: usize,
21770            depth: fidl::encoding::Depth,
21771        ) -> fidl::Result<()> {
21772            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
21773            // Zero out padding regions. There's no need to apply masks
21774            // because the unmasked parts will be overwritten by fields.
21775            // Write the fields.
21776            self.0.encode(encoder, offset + 0, depth)?;
21777            Ok(())
21778        }
21779    }
21780
21781    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21782        for FileEnableVerityRequest
21783    {
21784        #[inline(always)]
21785        fn new_empty() -> Self {
21786            Self {
21787                options: fidl::new_empty!(
21788                    VerificationOptions,
21789                    fidl::encoding::DefaultFuchsiaResourceDialect
21790                ),
21791            }
21792        }
21793
21794        #[inline]
21795        unsafe fn decode(
21796            &mut self,
21797            decoder: &mut fidl::encoding::Decoder<
21798                '_,
21799                fidl::encoding::DefaultFuchsiaResourceDialect,
21800            >,
21801            offset: usize,
21802            _depth: fidl::encoding::Depth,
21803        ) -> fidl::Result<()> {
21804            decoder.debug_check_bounds::<Self>(offset);
21805            // Verify that padding bytes are zero.
21806            fidl::decode!(
21807                VerificationOptions,
21808                fidl::encoding::DefaultFuchsiaResourceDialect,
21809                &mut self.options,
21810                decoder,
21811                offset + 0,
21812                _depth
21813            )?;
21814            Ok(())
21815        }
21816    }
21817
21818    impl fidl::encoding::ResourceTypeMarker for FileObject {
21819        type Borrowed<'a> = &'a mut Self;
21820        fn take_or_borrow<'a>(
21821            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21822        ) -> Self::Borrowed<'a> {
21823            value
21824        }
21825    }
21826
21827    unsafe impl fidl::encoding::TypeMarker for FileObject {
21828        type Owned = Self;
21829
21830        #[inline(always)]
21831        fn inline_align(_context: fidl::encoding::Context) -> usize {
21832            4
21833        }
21834
21835        #[inline(always)]
21836        fn inline_size(_context: fidl::encoding::Context) -> usize {
21837            8
21838        }
21839    }
21840
21841    unsafe impl fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
21842        for &mut FileObject
21843    {
21844        #[inline]
21845        unsafe fn encode(
21846            self,
21847            encoder: &mut fidl::encoding::Encoder<
21848                '_,
21849                fidl::encoding::DefaultFuchsiaResourceDialect,
21850            >,
21851            offset: usize,
21852            _depth: fidl::encoding::Depth,
21853        ) -> fidl::Result<()> {
21854            encoder.debug_check_bounds::<FileObject>(offset);
21855            // Delegate to tuple encoding.
21856            fidl::encoding::Encode::<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21857                (
21858                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.event),
21859                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stream),
21860                ),
21861                encoder, offset, _depth
21862            )
21863        }
21864    }
21865    unsafe impl<
21866        T0: fidl::encoding::Encode<
21867                fidl::encoding::Optional<
21868                    fidl::encoding::HandleType<
21869                        fidl::Event,
21870                        { fidl::ObjectType::EVENT.into_raw() },
21871                        2147483648,
21872                    >,
21873                >,
21874                fidl::encoding::DefaultFuchsiaResourceDialect,
21875            >,
21876        T1: fidl::encoding::Encode<
21877                fidl::encoding::Optional<
21878                    fidl::encoding::HandleType<
21879                        fidl::Stream,
21880                        { fidl::ObjectType::STREAM.into_raw() },
21881                        2147483648,
21882                    >,
21883                >,
21884                fidl::encoding::DefaultFuchsiaResourceDialect,
21885            >,
21886    > fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
21887        for (T0, T1)
21888    {
21889        #[inline]
21890        unsafe fn encode(
21891            self,
21892            encoder: &mut fidl::encoding::Encoder<
21893                '_,
21894                fidl::encoding::DefaultFuchsiaResourceDialect,
21895            >,
21896            offset: usize,
21897            depth: fidl::encoding::Depth,
21898        ) -> fidl::Result<()> {
21899            encoder.debug_check_bounds::<FileObject>(offset);
21900            // Zero out padding regions. There's no need to apply masks
21901            // because the unmasked parts will be overwritten by fields.
21902            // Write the fields.
21903            self.0.encode(encoder, offset + 0, depth)?;
21904            self.1.encode(encoder, offset + 4, depth)?;
21905            Ok(())
21906        }
21907    }
21908
21909    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileObject {
21910        #[inline(always)]
21911        fn new_empty() -> Self {
21912            Self {
21913                event: fidl::new_empty!(
21914                    fidl::encoding::Optional<
21915                        fidl::encoding::HandleType<
21916                            fidl::Event,
21917                            { fidl::ObjectType::EVENT.into_raw() },
21918                            2147483648,
21919                        >,
21920                    >,
21921                    fidl::encoding::DefaultFuchsiaResourceDialect
21922                ),
21923                stream: fidl::new_empty!(
21924                    fidl::encoding::Optional<
21925                        fidl::encoding::HandleType<
21926                            fidl::Stream,
21927                            { fidl::ObjectType::STREAM.into_raw() },
21928                            2147483648,
21929                        >,
21930                    >,
21931                    fidl::encoding::DefaultFuchsiaResourceDialect
21932                ),
21933            }
21934        }
21935
21936        #[inline]
21937        unsafe fn decode(
21938            &mut self,
21939            decoder: &mut fidl::encoding::Decoder<
21940                '_,
21941                fidl::encoding::DefaultFuchsiaResourceDialect,
21942            >,
21943            offset: usize,
21944            _depth: fidl::encoding::Depth,
21945        ) -> fidl::Result<()> {
21946            decoder.debug_check_bounds::<Self>(offset);
21947            // Verify that padding bytes are zero.
21948            fidl::decode!(
21949                fidl::encoding::Optional<
21950                    fidl::encoding::HandleType<
21951                        fidl::Event,
21952                        { fidl::ObjectType::EVENT.into_raw() },
21953                        2147483648,
21954                    >,
21955                >,
21956                fidl::encoding::DefaultFuchsiaResourceDialect,
21957                &mut self.event,
21958                decoder,
21959                offset + 0,
21960                _depth
21961            )?;
21962            fidl::decode!(
21963                fidl::encoding::Optional<
21964                    fidl::encoding::HandleType<
21965                        fidl::Stream,
21966                        { fidl::ObjectType::STREAM.into_raw() },
21967                        2147483648,
21968                    >,
21969                >,
21970                fidl::encoding::DefaultFuchsiaResourceDialect,
21971                &mut self.stream,
21972                decoder,
21973                offset + 4,
21974                _depth
21975            )?;
21976            Ok(())
21977        }
21978    }
21979
21980    impl fidl::encoding::ResourceTypeMarker for FileGetBackingMemoryResponse {
21981        type Borrowed<'a> = &'a mut Self;
21982        fn take_or_borrow<'a>(
21983            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21984        ) -> Self::Borrowed<'a> {
21985            value
21986        }
21987    }
21988
21989    unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryResponse {
21990        type Owned = Self;
21991
21992        #[inline(always)]
21993        fn inline_align(_context: fidl::encoding::Context) -> usize {
21994            4
21995        }
21996
21997        #[inline(always)]
21998        fn inline_size(_context: fidl::encoding::Context) -> usize {
21999            4
22000        }
22001    }
22002
22003    unsafe impl
22004        fidl::encoding::Encode<
22005            FileGetBackingMemoryResponse,
22006            fidl::encoding::DefaultFuchsiaResourceDialect,
22007        > for &mut FileGetBackingMemoryResponse
22008    {
22009        #[inline]
22010        unsafe fn encode(
22011            self,
22012            encoder: &mut fidl::encoding::Encoder<
22013                '_,
22014                fidl::encoding::DefaultFuchsiaResourceDialect,
22015            >,
22016            offset: usize,
22017            _depth: fidl::encoding::Depth,
22018        ) -> fidl::Result<()> {
22019            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
22020            // Delegate to tuple encoding.
22021            fidl::encoding::Encode::<
22022                FileGetBackingMemoryResponse,
22023                fidl::encoding::DefaultFuchsiaResourceDialect,
22024            >::encode(
22025                (<fidl::encoding::HandleType<
22026                    fidl::Vmo,
22027                    { fidl::ObjectType::VMO.into_raw() },
22028                    2147483648,
22029                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22030                    &mut self.vmo
22031                ),),
22032                encoder,
22033                offset,
22034                _depth,
22035            )
22036        }
22037    }
22038    unsafe impl<
22039        T0: fidl::encoding::Encode<
22040                fidl::encoding::HandleType<
22041                    fidl::Vmo,
22042                    { fidl::ObjectType::VMO.into_raw() },
22043                    2147483648,
22044                >,
22045                fidl::encoding::DefaultFuchsiaResourceDialect,
22046            >,
22047    >
22048        fidl::encoding::Encode<
22049            FileGetBackingMemoryResponse,
22050            fidl::encoding::DefaultFuchsiaResourceDialect,
22051        > for (T0,)
22052    {
22053        #[inline]
22054        unsafe fn encode(
22055            self,
22056            encoder: &mut fidl::encoding::Encoder<
22057                '_,
22058                fidl::encoding::DefaultFuchsiaResourceDialect,
22059            >,
22060            offset: usize,
22061            depth: fidl::encoding::Depth,
22062        ) -> fidl::Result<()> {
22063            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
22064            // Zero out padding regions. There's no need to apply masks
22065            // because the unmasked parts will be overwritten by fields.
22066            // Write the fields.
22067            self.0.encode(encoder, offset + 0, depth)?;
22068            Ok(())
22069        }
22070    }
22071
22072    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22073        for FileGetBackingMemoryResponse
22074    {
22075        #[inline(always)]
22076        fn new_empty() -> Self {
22077            Self {
22078                vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22079            }
22080        }
22081
22082        #[inline]
22083        unsafe fn decode(
22084            &mut self,
22085            decoder: &mut fidl::encoding::Decoder<
22086                '_,
22087                fidl::encoding::DefaultFuchsiaResourceDialect,
22088            >,
22089            offset: usize,
22090            _depth: fidl::encoding::Depth,
22091        ) -> fidl::Result<()> {
22092            decoder.debug_check_bounds::<Self>(offset);
22093            // Verify that padding bytes are zero.
22094            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
22095            Ok(())
22096        }
22097    }
22098
22099    impl fidl::encoding::ResourceTypeMarker for LinkableLinkIntoRequest {
22100        type Borrowed<'a> = &'a mut Self;
22101        fn take_or_borrow<'a>(
22102            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22103        ) -> Self::Borrowed<'a> {
22104            value
22105        }
22106    }
22107
22108    unsafe impl fidl::encoding::TypeMarker for LinkableLinkIntoRequest {
22109        type Owned = Self;
22110
22111        #[inline(always)]
22112        fn inline_align(_context: fidl::encoding::Context) -> usize {
22113            8
22114        }
22115
22116        #[inline(always)]
22117        fn inline_size(_context: fidl::encoding::Context) -> usize {
22118            24
22119        }
22120    }
22121
22122    unsafe impl
22123        fidl::encoding::Encode<
22124            LinkableLinkIntoRequest,
22125            fidl::encoding::DefaultFuchsiaResourceDialect,
22126        > for &mut LinkableLinkIntoRequest
22127    {
22128        #[inline]
22129        unsafe fn encode(
22130            self,
22131            encoder: &mut fidl::encoding::Encoder<
22132                '_,
22133                fidl::encoding::DefaultFuchsiaResourceDialect,
22134            >,
22135            offset: usize,
22136            _depth: fidl::encoding::Depth,
22137        ) -> fidl::Result<()> {
22138            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
22139            // Delegate to tuple encoding.
22140            fidl::encoding::Encode::<
22141                LinkableLinkIntoRequest,
22142                fidl::encoding::DefaultFuchsiaResourceDialect,
22143            >::encode(
22144                (
22145                    <fidl::encoding::HandleType<
22146                        fidl::Event,
22147                        { fidl::ObjectType::EVENT.into_raw() },
22148                        2147483648,
22149                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22150                        &mut self.dst_parent_token,
22151                    ),
22152                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
22153                        &self.dst,
22154                    ),
22155                ),
22156                encoder,
22157                offset,
22158                _depth,
22159            )
22160        }
22161    }
22162    unsafe impl<
22163        T0: fidl::encoding::Encode<
22164                fidl::encoding::HandleType<
22165                    fidl::Event,
22166                    { fidl::ObjectType::EVENT.into_raw() },
22167                    2147483648,
22168                >,
22169                fidl::encoding::DefaultFuchsiaResourceDialect,
22170            >,
22171        T1: fidl::encoding::Encode<
22172                fidl::encoding::BoundedString<255>,
22173                fidl::encoding::DefaultFuchsiaResourceDialect,
22174            >,
22175    >
22176        fidl::encoding::Encode<
22177            LinkableLinkIntoRequest,
22178            fidl::encoding::DefaultFuchsiaResourceDialect,
22179        > for (T0, T1)
22180    {
22181        #[inline]
22182        unsafe fn encode(
22183            self,
22184            encoder: &mut fidl::encoding::Encoder<
22185                '_,
22186                fidl::encoding::DefaultFuchsiaResourceDialect,
22187            >,
22188            offset: usize,
22189            depth: fidl::encoding::Depth,
22190        ) -> fidl::Result<()> {
22191            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
22192            // Zero out padding regions. There's no need to apply masks
22193            // because the unmasked parts will be overwritten by fields.
22194            unsafe {
22195                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
22196                (ptr as *mut u64).write_unaligned(0);
22197            }
22198            // Write the fields.
22199            self.0.encode(encoder, offset + 0, depth)?;
22200            self.1.encode(encoder, offset + 8, depth)?;
22201            Ok(())
22202        }
22203    }
22204
22205    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22206        for LinkableLinkIntoRequest
22207    {
22208        #[inline(always)]
22209        fn new_empty() -> Self {
22210            Self {
22211                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22212                dst: fidl::new_empty!(
22213                    fidl::encoding::BoundedString<255>,
22214                    fidl::encoding::DefaultFuchsiaResourceDialect
22215                ),
22216            }
22217        }
22218
22219        #[inline]
22220        unsafe fn decode(
22221            &mut self,
22222            decoder: &mut fidl::encoding::Decoder<
22223                '_,
22224                fidl::encoding::DefaultFuchsiaResourceDialect,
22225            >,
22226            offset: usize,
22227            _depth: fidl::encoding::Depth,
22228        ) -> fidl::Result<()> {
22229            decoder.debug_check_bounds::<Self>(offset);
22230            // Verify that padding bytes are zero.
22231            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
22232            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22233            let mask = 0xffffffff00000000u64;
22234            let maskedval = padval & mask;
22235            if maskedval != 0 {
22236                return Err(fidl::Error::NonZeroPadding {
22237                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
22238                });
22239            }
22240            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)?;
22241            fidl::decode!(
22242                fidl::encoding::BoundedString<255>,
22243                fidl::encoding::DefaultFuchsiaResourceDialect,
22244                &mut self.dst,
22245                decoder,
22246                offset + 8,
22247                _depth
22248            )?;
22249            Ok(())
22250        }
22251    }
22252
22253    impl fidl::encoding::ResourceTypeMarker for NodeDeprecatedCloneRequest {
22254        type Borrowed<'a> = &'a mut Self;
22255        fn take_or_borrow<'a>(
22256            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22257        ) -> Self::Borrowed<'a> {
22258            value
22259        }
22260    }
22261
22262    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedCloneRequest {
22263        type Owned = Self;
22264
22265        #[inline(always)]
22266        fn inline_align(_context: fidl::encoding::Context) -> usize {
22267            4
22268        }
22269
22270        #[inline(always)]
22271        fn inline_size(_context: fidl::encoding::Context) -> usize {
22272            8
22273        }
22274    }
22275
22276    unsafe impl
22277        fidl::encoding::Encode<
22278            NodeDeprecatedCloneRequest,
22279            fidl::encoding::DefaultFuchsiaResourceDialect,
22280        > for &mut NodeDeprecatedCloneRequest
22281    {
22282        #[inline]
22283        unsafe fn encode(
22284            self,
22285            encoder: &mut fidl::encoding::Encoder<
22286                '_,
22287                fidl::encoding::DefaultFuchsiaResourceDialect,
22288            >,
22289            offset: usize,
22290            _depth: fidl::encoding::Depth,
22291        ) -> fidl::Result<()> {
22292            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
22293            // Delegate to tuple encoding.
22294            fidl::encoding::Encode::<NodeDeprecatedCloneRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22295                (
22296                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
22297                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
22298                ),
22299                encoder, offset, _depth
22300            )
22301        }
22302    }
22303    unsafe impl<
22304        T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
22305        T1: fidl::encoding::Encode<
22306                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22307                fidl::encoding::DefaultFuchsiaResourceDialect,
22308            >,
22309    >
22310        fidl::encoding::Encode<
22311            NodeDeprecatedCloneRequest,
22312            fidl::encoding::DefaultFuchsiaResourceDialect,
22313        > for (T0, T1)
22314    {
22315        #[inline]
22316        unsafe fn encode(
22317            self,
22318            encoder: &mut fidl::encoding::Encoder<
22319                '_,
22320                fidl::encoding::DefaultFuchsiaResourceDialect,
22321            >,
22322            offset: usize,
22323            depth: fidl::encoding::Depth,
22324        ) -> fidl::Result<()> {
22325            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
22326            // Zero out padding regions. There's no need to apply masks
22327            // because the unmasked parts will be overwritten by fields.
22328            // Write the fields.
22329            self.0.encode(encoder, offset + 0, depth)?;
22330            self.1.encode(encoder, offset + 4, depth)?;
22331            Ok(())
22332        }
22333    }
22334
22335    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22336        for NodeDeprecatedCloneRequest
22337    {
22338        #[inline(always)]
22339        fn new_empty() -> Self {
22340            Self {
22341                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
22342                object: fidl::new_empty!(
22343                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22344                    fidl::encoding::DefaultFuchsiaResourceDialect
22345                ),
22346            }
22347        }
22348
22349        #[inline]
22350        unsafe fn decode(
22351            &mut self,
22352            decoder: &mut fidl::encoding::Decoder<
22353                '_,
22354                fidl::encoding::DefaultFuchsiaResourceDialect,
22355            >,
22356            offset: usize,
22357            _depth: fidl::encoding::Depth,
22358        ) -> fidl::Result<()> {
22359            decoder.debug_check_bounds::<Self>(offset);
22360            // Verify that padding bytes are zero.
22361            fidl::decode!(
22362                OpenFlags,
22363                fidl::encoding::DefaultFuchsiaResourceDialect,
22364                &mut self.flags,
22365                decoder,
22366                offset + 0,
22367                _depth
22368            )?;
22369            fidl::decode!(
22370                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22371                fidl::encoding::DefaultFuchsiaResourceDialect,
22372                &mut self.object,
22373                decoder,
22374                offset + 4,
22375                _depth
22376            )?;
22377            Ok(())
22378        }
22379    }
22380
22381    impl fidl::encoding::ResourceTypeMarker for NodeListExtendedAttributesRequest {
22382        type Borrowed<'a> = &'a mut Self;
22383        fn take_or_borrow<'a>(
22384            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22385        ) -> Self::Borrowed<'a> {
22386            value
22387        }
22388    }
22389
22390    unsafe impl fidl::encoding::TypeMarker for NodeListExtendedAttributesRequest {
22391        type Owned = Self;
22392
22393        #[inline(always)]
22394        fn inline_align(_context: fidl::encoding::Context) -> usize {
22395            4
22396        }
22397
22398        #[inline(always)]
22399        fn inline_size(_context: fidl::encoding::Context) -> usize {
22400            4
22401        }
22402    }
22403
22404    unsafe impl
22405        fidl::encoding::Encode<
22406            NodeListExtendedAttributesRequest,
22407            fidl::encoding::DefaultFuchsiaResourceDialect,
22408        > for &mut NodeListExtendedAttributesRequest
22409    {
22410        #[inline]
22411        unsafe fn encode(
22412            self,
22413            encoder: &mut fidl::encoding::Encoder<
22414                '_,
22415                fidl::encoding::DefaultFuchsiaResourceDialect,
22416            >,
22417            offset: usize,
22418            _depth: fidl::encoding::Depth,
22419        ) -> fidl::Result<()> {
22420            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
22421            // Delegate to tuple encoding.
22422            fidl::encoding::Encode::<
22423                NodeListExtendedAttributesRequest,
22424                fidl::encoding::DefaultFuchsiaResourceDialect,
22425            >::encode(
22426                (<fidl::encoding::Endpoint<
22427                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22428                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22429                    &mut self.iterator
22430                ),),
22431                encoder,
22432                offset,
22433                _depth,
22434            )
22435        }
22436    }
22437    unsafe impl<
22438        T0: fidl::encoding::Encode<
22439                fidl::encoding::Endpoint<
22440                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22441                >,
22442                fidl::encoding::DefaultFuchsiaResourceDialect,
22443            >,
22444    >
22445        fidl::encoding::Encode<
22446            NodeListExtendedAttributesRequest,
22447            fidl::encoding::DefaultFuchsiaResourceDialect,
22448        > for (T0,)
22449    {
22450        #[inline]
22451        unsafe fn encode(
22452            self,
22453            encoder: &mut fidl::encoding::Encoder<
22454                '_,
22455                fidl::encoding::DefaultFuchsiaResourceDialect,
22456            >,
22457            offset: usize,
22458            depth: fidl::encoding::Depth,
22459        ) -> fidl::Result<()> {
22460            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
22461            // Zero out padding regions. There's no need to apply masks
22462            // because the unmasked parts will be overwritten by fields.
22463            // Write the fields.
22464            self.0.encode(encoder, offset + 0, depth)?;
22465            Ok(())
22466        }
22467    }
22468
22469    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22470        for NodeListExtendedAttributesRequest
22471    {
22472        #[inline(always)]
22473        fn new_empty() -> Self {
22474            Self {
22475                iterator: fidl::new_empty!(
22476                    fidl::encoding::Endpoint<
22477                        fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22478                    >,
22479                    fidl::encoding::DefaultFuchsiaResourceDialect
22480                ),
22481            }
22482        }
22483
22484        #[inline]
22485        unsafe fn decode(
22486            &mut self,
22487            decoder: &mut fidl::encoding::Decoder<
22488                '_,
22489                fidl::encoding::DefaultFuchsiaResourceDialect,
22490            >,
22491            offset: usize,
22492            _depth: fidl::encoding::Depth,
22493        ) -> fidl::Result<()> {
22494            decoder.debug_check_bounds::<Self>(offset);
22495            // Verify that padding bytes are zero.
22496            fidl::decode!(
22497                fidl::encoding::Endpoint<
22498                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22499                >,
22500                fidl::encoding::DefaultFuchsiaResourceDialect,
22501                &mut self.iterator,
22502                decoder,
22503                offset + 0,
22504                _depth
22505            )?;
22506            Ok(())
22507        }
22508    }
22509
22510    impl fidl::encoding::ResourceTypeMarker for NodeOnOpenRequest {
22511        type Borrowed<'a> = &'a mut Self;
22512        fn take_or_borrow<'a>(
22513            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22514        ) -> Self::Borrowed<'a> {
22515            value
22516        }
22517    }
22518
22519    unsafe impl fidl::encoding::TypeMarker for NodeOnOpenRequest {
22520        type Owned = Self;
22521
22522        #[inline(always)]
22523        fn inline_align(_context: fidl::encoding::Context) -> usize {
22524            8
22525        }
22526
22527        #[inline(always)]
22528        fn inline_size(_context: fidl::encoding::Context) -> usize {
22529            24
22530        }
22531    }
22532
22533    unsafe impl
22534        fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22535        for &mut NodeOnOpenRequest
22536    {
22537        #[inline]
22538        unsafe fn encode(
22539            self,
22540            encoder: &mut fidl::encoding::Encoder<
22541                '_,
22542                fidl::encoding::DefaultFuchsiaResourceDialect,
22543            >,
22544            offset: usize,
22545            _depth: fidl::encoding::Depth,
22546        ) -> fidl::Result<()> {
22547            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
22548            // Delegate to tuple encoding.
22549            fidl::encoding::Encode::<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22550                (
22551                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
22552                    <fidl::encoding::OptionalUnion<NodeInfoDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
22553                ),
22554                encoder, offset, _depth
22555            )
22556        }
22557    }
22558    unsafe impl<
22559        T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
22560        T1: fidl::encoding::Encode<
22561                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
22562                fidl::encoding::DefaultFuchsiaResourceDialect,
22563            >,
22564    > fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22565        for (T0, T1)
22566    {
22567        #[inline]
22568        unsafe fn encode(
22569            self,
22570            encoder: &mut fidl::encoding::Encoder<
22571                '_,
22572                fidl::encoding::DefaultFuchsiaResourceDialect,
22573            >,
22574            offset: usize,
22575            depth: fidl::encoding::Depth,
22576        ) -> fidl::Result<()> {
22577            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
22578            // Zero out padding regions. There's no need to apply masks
22579            // because the unmasked parts will be overwritten by fields.
22580            unsafe {
22581                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
22582                (ptr as *mut u64).write_unaligned(0);
22583            }
22584            // Write the fields.
22585            self.0.encode(encoder, offset + 0, depth)?;
22586            self.1.encode(encoder, offset + 8, depth)?;
22587            Ok(())
22588        }
22589    }
22590
22591    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22592        for NodeOnOpenRequest
22593    {
22594        #[inline(always)]
22595        fn new_empty() -> Self {
22596            Self {
22597                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
22598                info: fidl::new_empty!(
22599                    fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
22600                    fidl::encoding::DefaultFuchsiaResourceDialect
22601                ),
22602            }
22603        }
22604
22605        #[inline]
22606        unsafe fn decode(
22607            &mut self,
22608            decoder: &mut fidl::encoding::Decoder<
22609                '_,
22610                fidl::encoding::DefaultFuchsiaResourceDialect,
22611            >,
22612            offset: usize,
22613            _depth: fidl::encoding::Depth,
22614        ) -> fidl::Result<()> {
22615            decoder.debug_check_bounds::<Self>(offset);
22616            // Verify that padding bytes are zero.
22617            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
22618            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22619            let mask = 0xffffffff00000000u64;
22620            let maskedval = padval & mask;
22621            if maskedval != 0 {
22622                return Err(fidl::Error::NonZeroPadding {
22623                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
22624                });
22625            }
22626            fidl::decode!(
22627                i32,
22628                fidl::encoding::DefaultFuchsiaResourceDialect,
22629                &mut self.s,
22630                decoder,
22631                offset + 0,
22632                _depth
22633            )?;
22634            fidl::decode!(
22635                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
22636                fidl::encoding::DefaultFuchsiaResourceDialect,
22637                &mut self.info,
22638                decoder,
22639                offset + 8,
22640                _depth
22641            )?;
22642            Ok(())
22643        }
22644    }
22645
22646    impl fidl::encoding::ResourceTypeMarker for NodeSetExtendedAttributeRequest {
22647        type Borrowed<'a> = &'a mut Self;
22648        fn take_or_borrow<'a>(
22649            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22650        ) -> Self::Borrowed<'a> {
22651            value
22652        }
22653    }
22654
22655    unsafe impl fidl::encoding::TypeMarker for NodeSetExtendedAttributeRequest {
22656        type Owned = Self;
22657
22658        #[inline(always)]
22659        fn inline_align(_context: fidl::encoding::Context) -> usize {
22660            8
22661        }
22662
22663        #[inline(always)]
22664        fn inline_size(_context: fidl::encoding::Context) -> usize {
22665            40
22666        }
22667    }
22668
22669    unsafe impl
22670        fidl::encoding::Encode<
22671            NodeSetExtendedAttributeRequest,
22672            fidl::encoding::DefaultFuchsiaResourceDialect,
22673        > for &mut NodeSetExtendedAttributeRequest
22674    {
22675        #[inline]
22676        unsafe fn encode(
22677            self,
22678            encoder: &mut fidl::encoding::Encoder<
22679                '_,
22680                fidl::encoding::DefaultFuchsiaResourceDialect,
22681            >,
22682            offset: usize,
22683            _depth: fidl::encoding::Depth,
22684        ) -> fidl::Result<()> {
22685            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
22686            // Delegate to tuple encoding.
22687            fidl::encoding::Encode::<
22688                NodeSetExtendedAttributeRequest,
22689                fidl::encoding::DefaultFuchsiaResourceDialect,
22690            >::encode(
22691                (
22692                    <fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
22693                        &self.name,
22694                    ),
22695                    <ExtendedAttributeValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22696                        &mut self.value,
22697                    ),
22698                    <SetExtendedAttributeMode as fidl::encoding::ValueTypeMarker>::borrow(
22699                        &self.mode,
22700                    ),
22701                ),
22702                encoder,
22703                offset,
22704                _depth,
22705            )
22706        }
22707    }
22708    unsafe impl<
22709        T0: fidl::encoding::Encode<
22710                fidl::encoding::Vector<u8, 255>,
22711                fidl::encoding::DefaultFuchsiaResourceDialect,
22712            >,
22713        T1: fidl::encoding::Encode<
22714                ExtendedAttributeValue,
22715                fidl::encoding::DefaultFuchsiaResourceDialect,
22716            >,
22717        T2: fidl::encoding::Encode<
22718                SetExtendedAttributeMode,
22719                fidl::encoding::DefaultFuchsiaResourceDialect,
22720            >,
22721    >
22722        fidl::encoding::Encode<
22723            NodeSetExtendedAttributeRequest,
22724            fidl::encoding::DefaultFuchsiaResourceDialect,
22725        > for (T0, T1, T2)
22726    {
22727        #[inline]
22728        unsafe fn encode(
22729            self,
22730            encoder: &mut fidl::encoding::Encoder<
22731                '_,
22732                fidl::encoding::DefaultFuchsiaResourceDialect,
22733            >,
22734            offset: usize,
22735            depth: fidl::encoding::Depth,
22736        ) -> fidl::Result<()> {
22737            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
22738            // Zero out padding regions. There's no need to apply masks
22739            // because the unmasked parts will be overwritten by fields.
22740            unsafe {
22741                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
22742                (ptr as *mut u64).write_unaligned(0);
22743            }
22744            // Write the fields.
22745            self.0.encode(encoder, offset + 0, depth)?;
22746            self.1.encode(encoder, offset + 16, depth)?;
22747            self.2.encode(encoder, offset + 32, depth)?;
22748            Ok(())
22749        }
22750    }
22751
22752    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22753        for NodeSetExtendedAttributeRequest
22754    {
22755        #[inline(always)]
22756        fn new_empty() -> Self {
22757            Self {
22758                name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect),
22759                value: fidl::new_empty!(
22760                    ExtendedAttributeValue,
22761                    fidl::encoding::DefaultFuchsiaResourceDialect
22762                ),
22763                mode: fidl::new_empty!(
22764                    SetExtendedAttributeMode,
22765                    fidl::encoding::DefaultFuchsiaResourceDialect
22766                ),
22767            }
22768        }
22769
22770        #[inline]
22771        unsafe fn decode(
22772            &mut self,
22773            decoder: &mut fidl::encoding::Decoder<
22774                '_,
22775                fidl::encoding::DefaultFuchsiaResourceDialect,
22776            >,
22777            offset: usize,
22778            _depth: fidl::encoding::Depth,
22779        ) -> fidl::Result<()> {
22780            decoder.debug_check_bounds::<Self>(offset);
22781            // Verify that padding bytes are zero.
22782            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
22783            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22784            let mask = 0xffffffff00000000u64;
22785            let maskedval = padval & mask;
22786            if maskedval != 0 {
22787                return Err(fidl::Error::NonZeroPadding {
22788                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
22789                });
22790            }
22791            fidl::decode!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.name, decoder, offset + 0, _depth)?;
22792            fidl::decode!(
22793                ExtendedAttributeValue,
22794                fidl::encoding::DefaultFuchsiaResourceDialect,
22795                &mut self.value,
22796                decoder,
22797                offset + 16,
22798                _depth
22799            )?;
22800            fidl::decode!(
22801                SetExtendedAttributeMode,
22802                fidl::encoding::DefaultFuchsiaResourceDialect,
22803                &mut self.mode,
22804                decoder,
22805                offset + 32,
22806                _depth
22807            )?;
22808            Ok(())
22809        }
22810    }
22811
22812    impl ConnectionInfo {
22813        #[inline(always)]
22814        fn max_ordinal_present(&self) -> u64 {
22815            if let Some(_) = self.rights {
22816                return 1;
22817            }
22818            0
22819        }
22820    }
22821
22822    impl fidl::encoding::ResourceTypeMarker for ConnectionInfo {
22823        type Borrowed<'a> = &'a mut Self;
22824        fn take_or_borrow<'a>(
22825            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22826        ) -> Self::Borrowed<'a> {
22827            value
22828        }
22829    }
22830
22831    unsafe impl fidl::encoding::TypeMarker for ConnectionInfo {
22832        type Owned = Self;
22833
22834        #[inline(always)]
22835        fn inline_align(_context: fidl::encoding::Context) -> usize {
22836            8
22837        }
22838
22839        #[inline(always)]
22840        fn inline_size(_context: fidl::encoding::Context) -> usize {
22841            16
22842        }
22843    }
22844
22845    unsafe impl
22846        fidl::encoding::Encode<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
22847        for &mut ConnectionInfo
22848    {
22849        unsafe fn encode(
22850            self,
22851            encoder: &mut fidl::encoding::Encoder<
22852                '_,
22853                fidl::encoding::DefaultFuchsiaResourceDialect,
22854            >,
22855            offset: usize,
22856            mut depth: fidl::encoding::Depth,
22857        ) -> fidl::Result<()> {
22858            encoder.debug_check_bounds::<ConnectionInfo>(offset);
22859            // Vector header
22860            let max_ordinal: u64 = self.max_ordinal_present();
22861            encoder.write_num(max_ordinal, offset);
22862            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
22863            // Calling encoder.out_of_line_offset(0) is not allowed.
22864            if max_ordinal == 0 {
22865                return Ok(());
22866            }
22867            depth.increment()?;
22868            let envelope_size = 8;
22869            let bytes_len = max_ordinal as usize * envelope_size;
22870            #[allow(unused_variables)]
22871            let offset = encoder.out_of_line_offset(bytes_len);
22872            let mut _prev_end_offset: usize = 0;
22873            if 1 > max_ordinal {
22874                return Ok(());
22875            }
22876
22877            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
22878            // are envelope_size bytes.
22879            let cur_offset: usize = (1 - 1) * envelope_size;
22880
22881            // Zero reserved fields.
22882            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22883
22884            // Safety:
22885            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
22886            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
22887            //   envelope_size bytes, there is always sufficient room.
22888            fidl::encoding::encode_in_envelope_optional::<
22889                Operations,
22890                fidl::encoding::DefaultFuchsiaResourceDialect,
22891            >(
22892                self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
22893                encoder,
22894                offset + cur_offset,
22895                depth,
22896            )?;
22897
22898            _prev_end_offset = cur_offset + envelope_size;
22899
22900            Ok(())
22901        }
22902    }
22903
22904    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22905        for ConnectionInfo
22906    {
22907        #[inline(always)]
22908        fn new_empty() -> Self {
22909            Self::default()
22910        }
22911
22912        unsafe fn decode(
22913            &mut self,
22914            decoder: &mut fidl::encoding::Decoder<
22915                '_,
22916                fidl::encoding::DefaultFuchsiaResourceDialect,
22917            >,
22918            offset: usize,
22919            mut depth: fidl::encoding::Depth,
22920        ) -> fidl::Result<()> {
22921            decoder.debug_check_bounds::<Self>(offset);
22922            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22923                None => return Err(fidl::Error::NotNullable),
22924                Some(len) => len,
22925            };
22926            // Calling decoder.out_of_line_offset(0) is not allowed.
22927            if len == 0 {
22928                return Ok(());
22929            };
22930            depth.increment()?;
22931            let envelope_size = 8;
22932            let bytes_len = len * envelope_size;
22933            let offset = decoder.out_of_line_offset(bytes_len)?;
22934            // Decode the envelope for each type.
22935            let mut _next_ordinal_to_read = 0;
22936            let mut next_offset = offset;
22937            let end_offset = offset + bytes_len;
22938            _next_ordinal_to_read += 1;
22939            if next_offset >= end_offset {
22940                return Ok(());
22941            }
22942
22943            // Decode unknown envelopes for gaps in ordinals.
22944            while _next_ordinal_to_read < 1 {
22945                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22946                _next_ordinal_to_read += 1;
22947                next_offset += envelope_size;
22948            }
22949
22950            let next_out_of_line = decoder.next_out_of_line();
22951            let handles_before = decoder.remaining_handles();
22952            if let Some((inlined, num_bytes, num_handles)) =
22953                fidl::encoding::decode_envelope_header(decoder, next_offset)?
22954            {
22955                let member_inline_size =
22956                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22957                if inlined != (member_inline_size <= 4) {
22958                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
22959                }
22960                let inner_offset;
22961                let mut inner_depth = depth.clone();
22962                if inlined {
22963                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22964                    inner_offset = next_offset;
22965                } else {
22966                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22967                    inner_depth.increment()?;
22968                }
22969                let val_ref = self.rights.get_or_insert_with(|| {
22970                    fidl::new_empty!(Operations, fidl::encoding::DefaultFuchsiaResourceDialect)
22971                });
22972                fidl::decode!(
22973                    Operations,
22974                    fidl::encoding::DefaultFuchsiaResourceDialect,
22975                    val_ref,
22976                    decoder,
22977                    inner_offset,
22978                    inner_depth
22979                )?;
22980                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22981                {
22982                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
22983                }
22984                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22985                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22986                }
22987            }
22988
22989            next_offset += envelope_size;
22990
22991            // Decode the remaining unknown envelopes.
22992            while next_offset < end_offset {
22993                _next_ordinal_to_read += 1;
22994                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22995                next_offset += envelope_size;
22996            }
22997
22998            Ok(())
22999        }
23000    }
23001
23002    impl FileInfo {
23003        #[inline(always)]
23004        fn max_ordinal_present(&self) -> u64 {
23005            if let Some(_) = self.attributes {
23006                return 4;
23007            }
23008            if let Some(_) = self.stream {
23009                return 3;
23010            }
23011            if let Some(_) = self.observer {
23012                return 2;
23013            }
23014            if let Some(_) = self.is_append {
23015                return 1;
23016            }
23017            0
23018        }
23019    }
23020
23021    impl fidl::encoding::ResourceTypeMarker for FileInfo {
23022        type Borrowed<'a> = &'a mut Self;
23023        fn take_or_borrow<'a>(
23024            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23025        ) -> Self::Borrowed<'a> {
23026            value
23027        }
23028    }
23029
23030    unsafe impl fidl::encoding::TypeMarker for FileInfo {
23031        type Owned = Self;
23032
23033        #[inline(always)]
23034        fn inline_align(_context: fidl::encoding::Context) -> usize {
23035            8
23036        }
23037
23038        #[inline(always)]
23039        fn inline_size(_context: fidl::encoding::Context) -> usize {
23040            16
23041        }
23042    }
23043
23044    unsafe impl fidl::encoding::Encode<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
23045        for &mut FileInfo
23046    {
23047        unsafe fn encode(
23048            self,
23049            encoder: &mut fidl::encoding::Encoder<
23050                '_,
23051                fidl::encoding::DefaultFuchsiaResourceDialect,
23052            >,
23053            offset: usize,
23054            mut depth: fidl::encoding::Depth,
23055        ) -> fidl::Result<()> {
23056            encoder.debug_check_bounds::<FileInfo>(offset);
23057            // Vector header
23058            let max_ordinal: u64 = self.max_ordinal_present();
23059            encoder.write_num(max_ordinal, offset);
23060            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23061            // Calling encoder.out_of_line_offset(0) is not allowed.
23062            if max_ordinal == 0 {
23063                return Ok(());
23064            }
23065            depth.increment()?;
23066            let envelope_size = 8;
23067            let bytes_len = max_ordinal as usize * envelope_size;
23068            #[allow(unused_variables)]
23069            let offset = encoder.out_of_line_offset(bytes_len);
23070            let mut _prev_end_offset: usize = 0;
23071            if 1 > max_ordinal {
23072                return Ok(());
23073            }
23074
23075            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23076            // are envelope_size bytes.
23077            let cur_offset: usize = (1 - 1) * envelope_size;
23078
23079            // Zero reserved fields.
23080            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23081
23082            // Safety:
23083            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23084            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23085            //   envelope_size bytes, there is always sufficient room.
23086            fidl::encoding::encode_in_envelope_optional::<
23087                bool,
23088                fidl::encoding::DefaultFuchsiaResourceDialect,
23089            >(
23090                self.is_append.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
23091                encoder,
23092                offset + cur_offset,
23093                depth,
23094            )?;
23095
23096            _prev_end_offset = cur_offset + envelope_size;
23097            if 2 > max_ordinal {
23098                return Ok(());
23099            }
23100
23101            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23102            // are envelope_size bytes.
23103            let cur_offset: usize = (2 - 1) * envelope_size;
23104
23105            // Zero reserved fields.
23106            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23107
23108            // Safety:
23109            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23110            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23111            //   envelope_size bytes, there is always sufficient room.
23112            fidl::encoding::encode_in_envelope_optional::<
23113                fidl::encoding::HandleType<
23114                    fidl::Event,
23115                    { fidl::ObjectType::EVENT.into_raw() },
23116                    2147483648,
23117                >,
23118                fidl::encoding::DefaultFuchsiaResourceDialect,
23119            >(
23120                self.observer.as_mut().map(
23121                    <fidl::encoding::HandleType<
23122                        fidl::Event,
23123                        { fidl::ObjectType::EVENT.into_raw() },
23124                        2147483648,
23125                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
23126                ),
23127                encoder,
23128                offset + cur_offset,
23129                depth,
23130            )?;
23131
23132            _prev_end_offset = cur_offset + envelope_size;
23133            if 3 > max_ordinal {
23134                return Ok(());
23135            }
23136
23137            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23138            // are envelope_size bytes.
23139            let cur_offset: usize = (3 - 1) * envelope_size;
23140
23141            // Zero reserved fields.
23142            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23143
23144            // Safety:
23145            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23146            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23147            //   envelope_size bytes, there is always sufficient room.
23148            fidl::encoding::encode_in_envelope_optional::<
23149                fidl::encoding::HandleType<
23150                    fidl::Stream,
23151                    { fidl::ObjectType::STREAM.into_raw() },
23152                    2147483648,
23153                >,
23154                fidl::encoding::DefaultFuchsiaResourceDialect,
23155            >(
23156                self.stream.as_mut().map(
23157                    <fidl::encoding::HandleType<
23158                        fidl::Stream,
23159                        { fidl::ObjectType::STREAM.into_raw() },
23160                        2147483648,
23161                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
23162                ),
23163                encoder,
23164                offset + cur_offset,
23165                depth,
23166            )?;
23167
23168            _prev_end_offset = cur_offset + envelope_size;
23169            if 4 > max_ordinal {
23170                return Ok(());
23171            }
23172
23173            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23174            // are envelope_size bytes.
23175            let cur_offset: usize = (4 - 1) * envelope_size;
23176
23177            // Zero reserved fields.
23178            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23179
23180            // Safety:
23181            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23182            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23183            //   envelope_size bytes, there is always sufficient room.
23184            fidl::encoding::encode_in_envelope_optional::<
23185                NodeAttributes2,
23186                fidl::encoding::DefaultFuchsiaResourceDialect,
23187            >(
23188                self.attributes
23189                    .as_ref()
23190                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
23191                encoder,
23192                offset + cur_offset,
23193                depth,
23194            )?;
23195
23196            _prev_end_offset = cur_offset + envelope_size;
23197
23198            Ok(())
23199        }
23200    }
23201
23202    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileInfo {
23203        #[inline(always)]
23204        fn new_empty() -> Self {
23205            Self::default()
23206        }
23207
23208        unsafe fn decode(
23209            &mut self,
23210            decoder: &mut fidl::encoding::Decoder<
23211                '_,
23212                fidl::encoding::DefaultFuchsiaResourceDialect,
23213            >,
23214            offset: usize,
23215            mut depth: fidl::encoding::Depth,
23216        ) -> fidl::Result<()> {
23217            decoder.debug_check_bounds::<Self>(offset);
23218            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23219                None => return Err(fidl::Error::NotNullable),
23220                Some(len) => len,
23221            };
23222            // Calling decoder.out_of_line_offset(0) is not allowed.
23223            if len == 0 {
23224                return Ok(());
23225            };
23226            depth.increment()?;
23227            let envelope_size = 8;
23228            let bytes_len = len * envelope_size;
23229            let offset = decoder.out_of_line_offset(bytes_len)?;
23230            // Decode the envelope for each type.
23231            let mut _next_ordinal_to_read = 0;
23232            let mut next_offset = offset;
23233            let end_offset = offset + bytes_len;
23234            _next_ordinal_to_read += 1;
23235            if next_offset >= end_offset {
23236                return Ok(());
23237            }
23238
23239            // Decode unknown envelopes for gaps in ordinals.
23240            while _next_ordinal_to_read < 1 {
23241                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23242                _next_ordinal_to_read += 1;
23243                next_offset += envelope_size;
23244            }
23245
23246            let next_out_of_line = decoder.next_out_of_line();
23247            let handles_before = decoder.remaining_handles();
23248            if let Some((inlined, num_bytes, num_handles)) =
23249                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23250            {
23251                let member_inline_size =
23252                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23253                if inlined != (member_inline_size <= 4) {
23254                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23255                }
23256                let inner_offset;
23257                let mut inner_depth = depth.clone();
23258                if inlined {
23259                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23260                    inner_offset = next_offset;
23261                } else {
23262                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23263                    inner_depth.increment()?;
23264                }
23265                let val_ref = self.is_append.get_or_insert_with(|| {
23266                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
23267                });
23268                fidl::decode!(
23269                    bool,
23270                    fidl::encoding::DefaultFuchsiaResourceDialect,
23271                    val_ref,
23272                    decoder,
23273                    inner_offset,
23274                    inner_depth
23275                )?;
23276                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23277                {
23278                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23279                }
23280                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23281                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23282                }
23283            }
23284
23285            next_offset += envelope_size;
23286            _next_ordinal_to_read += 1;
23287            if next_offset >= end_offset {
23288                return Ok(());
23289            }
23290
23291            // Decode unknown envelopes for gaps in ordinals.
23292            while _next_ordinal_to_read < 2 {
23293                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23294                _next_ordinal_to_read += 1;
23295                next_offset += envelope_size;
23296            }
23297
23298            let next_out_of_line = decoder.next_out_of_line();
23299            let handles_before = decoder.remaining_handles();
23300            if let Some((inlined, num_bytes, num_handles)) =
23301                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23302            {
23303                let member_inline_size = <fidl::encoding::HandleType<
23304                    fidl::Event,
23305                    { fidl::ObjectType::EVENT.into_raw() },
23306                    2147483648,
23307                > as fidl::encoding::TypeMarker>::inline_size(
23308                    decoder.context
23309                );
23310                if inlined != (member_inline_size <= 4) {
23311                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23312                }
23313                let inner_offset;
23314                let mut inner_depth = depth.clone();
23315                if inlined {
23316                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23317                    inner_offset = next_offset;
23318                } else {
23319                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23320                    inner_depth.increment()?;
23321                }
23322                let val_ref =
23323                self.observer.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
23324                fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
23325                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23326                {
23327                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23328                }
23329                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23330                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23331                }
23332            }
23333
23334            next_offset += envelope_size;
23335            _next_ordinal_to_read += 1;
23336            if next_offset >= end_offset {
23337                return Ok(());
23338            }
23339
23340            // Decode unknown envelopes for gaps in ordinals.
23341            while _next_ordinal_to_read < 3 {
23342                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23343                _next_ordinal_to_read += 1;
23344                next_offset += envelope_size;
23345            }
23346
23347            let next_out_of_line = decoder.next_out_of_line();
23348            let handles_before = decoder.remaining_handles();
23349            if let Some((inlined, num_bytes, num_handles)) =
23350                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23351            {
23352                let member_inline_size = <fidl::encoding::HandleType<
23353                    fidl::Stream,
23354                    { fidl::ObjectType::STREAM.into_raw() },
23355                    2147483648,
23356                > as fidl::encoding::TypeMarker>::inline_size(
23357                    decoder.context
23358                );
23359                if inlined != (member_inline_size <= 4) {
23360                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23361                }
23362                let inner_offset;
23363                let mut inner_depth = depth.clone();
23364                if inlined {
23365                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23366                    inner_offset = next_offset;
23367                } else {
23368                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23369                    inner_depth.increment()?;
23370                }
23371                let val_ref =
23372                self.stream.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
23373                fidl::decode!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
23374                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23375                {
23376                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23377                }
23378                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23379                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23380                }
23381            }
23382
23383            next_offset += envelope_size;
23384            _next_ordinal_to_read += 1;
23385            if next_offset >= end_offset {
23386                return Ok(());
23387            }
23388
23389            // Decode unknown envelopes for gaps in ordinals.
23390            while _next_ordinal_to_read < 4 {
23391                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23392                _next_ordinal_to_read += 1;
23393                next_offset += envelope_size;
23394            }
23395
23396            let next_out_of_line = decoder.next_out_of_line();
23397            let handles_before = decoder.remaining_handles();
23398            if let Some((inlined, num_bytes, num_handles)) =
23399                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23400            {
23401                let member_inline_size =
23402                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23403                if inlined != (member_inline_size <= 4) {
23404                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23405                }
23406                let inner_offset;
23407                let mut inner_depth = depth.clone();
23408                if inlined {
23409                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23410                    inner_offset = next_offset;
23411                } else {
23412                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23413                    inner_depth.increment()?;
23414                }
23415                let val_ref = self.attributes.get_or_insert_with(|| {
23416                    fidl::new_empty!(NodeAttributes2, fidl::encoding::DefaultFuchsiaResourceDialect)
23417                });
23418                fidl::decode!(
23419                    NodeAttributes2,
23420                    fidl::encoding::DefaultFuchsiaResourceDialect,
23421                    val_ref,
23422                    decoder,
23423                    inner_offset,
23424                    inner_depth
23425                )?;
23426                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23427                {
23428                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23429                }
23430                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23431                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23432                }
23433            }
23434
23435            next_offset += envelope_size;
23436
23437            // Decode the remaining unknown envelopes.
23438            while next_offset < end_offset {
23439                _next_ordinal_to_read += 1;
23440                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23441                next_offset += envelope_size;
23442            }
23443
23444            Ok(())
23445        }
23446    }
23447
23448    impl fidl::encoding::ResourceTypeMarker for ExtendedAttributeValue {
23449        type Borrowed<'a> = &'a mut Self;
23450        fn take_or_borrow<'a>(
23451            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23452        ) -> Self::Borrowed<'a> {
23453            value
23454        }
23455    }
23456
23457    unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeValue {
23458        type Owned = Self;
23459
23460        #[inline(always)]
23461        fn inline_align(_context: fidl::encoding::Context) -> usize {
23462            8
23463        }
23464
23465        #[inline(always)]
23466        fn inline_size(_context: fidl::encoding::Context) -> usize {
23467            16
23468        }
23469    }
23470
23471    unsafe impl
23472        fidl::encoding::Encode<
23473            ExtendedAttributeValue,
23474            fidl::encoding::DefaultFuchsiaResourceDialect,
23475        > for &mut ExtendedAttributeValue
23476    {
23477        #[inline]
23478        unsafe fn encode(
23479            self,
23480            encoder: &mut fidl::encoding::Encoder<
23481                '_,
23482                fidl::encoding::DefaultFuchsiaResourceDialect,
23483            >,
23484            offset: usize,
23485            _depth: fidl::encoding::Depth,
23486        ) -> fidl::Result<()> {
23487            encoder.debug_check_bounds::<ExtendedAttributeValue>(offset);
23488            encoder.write_num::<u64>(self.ordinal(), offset);
23489            match self {
23490                ExtendedAttributeValue::Bytes(ref val) => fidl::encoding::encode_in_envelope::<
23491                    fidl::encoding::Vector<u8, 32768>,
23492                    fidl::encoding::DefaultFuchsiaResourceDialect,
23493                >(
23494                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::ValueTypeMarker>::borrow(
23495                        val,
23496                    ),
23497                    encoder,
23498                    offset + 8,
23499                    _depth,
23500                ),
23501                ExtendedAttributeValue::Buffer(ref mut val) => {
23502                    fidl::encoding::encode_in_envelope::<
23503                        fidl::encoding::HandleType<
23504                            fidl::Vmo,
23505                            { fidl::ObjectType::VMO.into_raw() },
23506                            2147483648,
23507                        >,
23508                        fidl::encoding::DefaultFuchsiaResourceDialect,
23509                    >(
23510                        <fidl::encoding::HandleType<
23511                            fidl::Vmo,
23512                            { fidl::ObjectType::VMO.into_raw() },
23513                            2147483648,
23514                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
23515                            val
23516                        ),
23517                        encoder,
23518                        offset + 8,
23519                        _depth,
23520                    )
23521                }
23522                ExtendedAttributeValue::__SourceBreaking { .. } => {
23523                    Err(fidl::Error::UnknownUnionTag)
23524                }
23525            }
23526        }
23527    }
23528
23529    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23530        for ExtendedAttributeValue
23531    {
23532        #[inline(always)]
23533        fn new_empty() -> Self {
23534            Self::__SourceBreaking { unknown_ordinal: 0 }
23535        }
23536
23537        #[inline]
23538        unsafe fn decode(
23539            &mut self,
23540            decoder: &mut fidl::encoding::Decoder<
23541                '_,
23542                fidl::encoding::DefaultFuchsiaResourceDialect,
23543            >,
23544            offset: usize,
23545            mut depth: fidl::encoding::Depth,
23546        ) -> fidl::Result<()> {
23547            decoder.debug_check_bounds::<Self>(offset);
23548            #[allow(unused_variables)]
23549            let next_out_of_line = decoder.next_out_of_line();
23550            let handles_before = decoder.remaining_handles();
23551            let (ordinal, inlined, num_bytes, num_handles) =
23552                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23553
23554            let member_inline_size = match ordinal {
23555                1 => {
23556                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::TypeMarker>::inline_size(
23557                        decoder.context,
23558                    )
23559                }
23560                2 => <fidl::encoding::HandleType<
23561                    fidl::Vmo,
23562                    { fidl::ObjectType::VMO.into_raw() },
23563                    2147483648,
23564                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23565                0 => return Err(fidl::Error::UnknownUnionTag),
23566                _ => num_bytes as usize,
23567            };
23568
23569            if inlined != (member_inline_size <= 4) {
23570                return Err(fidl::Error::InvalidInlineBitInEnvelope);
23571            }
23572            let _inner_offset;
23573            if inlined {
23574                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23575                _inner_offset = offset + 8;
23576            } else {
23577                depth.increment()?;
23578                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23579            }
23580            match ordinal {
23581                1 => {
23582                    #[allow(irrefutable_let_patterns)]
23583                    if let ExtendedAttributeValue::Bytes(_) = self {
23584                        // Do nothing, read the value into the object
23585                    } else {
23586                        // Initialize `self` to the right variant
23587                        *self = ExtendedAttributeValue::Bytes(
23588                            fidl::new_empty!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect),
23589                        );
23590                    }
23591                    #[allow(irrefutable_let_patterns)]
23592                    if let ExtendedAttributeValue::Bytes(ref mut val) = self {
23593                        fidl::decode!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
23594                    } else {
23595                        unreachable!()
23596                    }
23597                }
23598                2 => {
23599                    #[allow(irrefutable_let_patterns)]
23600                    if let ExtendedAttributeValue::Buffer(_) = self {
23601                        // Do nothing, read the value into the object
23602                    } else {
23603                        // Initialize `self` to the right variant
23604                        *self = ExtendedAttributeValue::Buffer(
23605                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
23606                        );
23607                    }
23608                    #[allow(irrefutable_let_patterns)]
23609                    if let ExtendedAttributeValue::Buffer(ref mut val) = self {
23610                        fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
23611                    } else {
23612                        unreachable!()
23613                    }
23614                }
23615                #[allow(deprecated)]
23616                ordinal => {
23617                    for _ in 0..num_handles {
23618                        decoder.drop_next_handle()?;
23619                    }
23620                    *self = ExtendedAttributeValue::__SourceBreaking { unknown_ordinal: ordinal };
23621                }
23622            }
23623            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23624                return Err(fidl::Error::InvalidNumBytesInEnvelope);
23625            }
23626            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23627                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23628            }
23629            Ok(())
23630        }
23631    }
23632
23633    impl fidl::encoding::ResourceTypeMarker for NodeInfoDeprecated {
23634        type Borrowed<'a> = &'a mut Self;
23635        fn take_or_borrow<'a>(
23636            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23637        ) -> Self::Borrowed<'a> {
23638            value
23639        }
23640    }
23641
23642    unsafe impl fidl::encoding::TypeMarker for NodeInfoDeprecated {
23643        type Owned = Self;
23644
23645        #[inline(always)]
23646        fn inline_align(_context: fidl::encoding::Context) -> usize {
23647            8
23648        }
23649
23650        #[inline(always)]
23651        fn inline_size(_context: fidl::encoding::Context) -> usize {
23652            16
23653        }
23654    }
23655
23656    unsafe impl
23657        fidl::encoding::Encode<NodeInfoDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>
23658        for &mut NodeInfoDeprecated
23659    {
23660        #[inline]
23661        unsafe fn encode(
23662            self,
23663            encoder: &mut fidl::encoding::Encoder<
23664                '_,
23665                fidl::encoding::DefaultFuchsiaResourceDialect,
23666            >,
23667            offset: usize,
23668            _depth: fidl::encoding::Depth,
23669        ) -> fidl::Result<()> {
23670            encoder.debug_check_bounds::<NodeInfoDeprecated>(offset);
23671            encoder.write_num::<u64>(self.ordinal(), offset);
23672            match self {
23673                NodeInfoDeprecated::Service(ref val) => fidl::encoding::encode_in_envelope::<
23674                    Service,
23675                    fidl::encoding::DefaultFuchsiaResourceDialect,
23676                >(
23677                    <Service as fidl::encoding::ValueTypeMarker>::borrow(val),
23678                    encoder,
23679                    offset + 8,
23680                    _depth,
23681                ),
23682                NodeInfoDeprecated::File(ref mut val) => fidl::encoding::encode_in_envelope::<
23683                    FileObject,
23684                    fidl::encoding::DefaultFuchsiaResourceDialect,
23685                >(
23686                    <FileObject as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
23687                    encoder,
23688                    offset + 8,
23689                    _depth,
23690                ),
23691                NodeInfoDeprecated::Directory(ref val) => fidl::encoding::encode_in_envelope::<
23692                    DirectoryObject,
23693                    fidl::encoding::DefaultFuchsiaResourceDialect,
23694                >(
23695                    <DirectoryObject as fidl::encoding::ValueTypeMarker>::borrow(val),
23696                    encoder,
23697                    offset + 8,
23698                    _depth,
23699                ),
23700                NodeInfoDeprecated::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
23701                    SymlinkObject,
23702                    fidl::encoding::DefaultFuchsiaResourceDialect,
23703                >(
23704                    <SymlinkObject as fidl::encoding::ValueTypeMarker>::borrow(val),
23705                    encoder,
23706                    offset + 8,
23707                    _depth,
23708                ),
23709            }
23710        }
23711    }
23712
23713    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23714        for NodeInfoDeprecated
23715    {
23716        #[inline(always)]
23717        fn new_empty() -> Self {
23718            Self::Service(fidl::new_empty!(Service, fidl::encoding::DefaultFuchsiaResourceDialect))
23719        }
23720
23721        #[inline]
23722        unsafe fn decode(
23723            &mut self,
23724            decoder: &mut fidl::encoding::Decoder<
23725                '_,
23726                fidl::encoding::DefaultFuchsiaResourceDialect,
23727            >,
23728            offset: usize,
23729            mut depth: fidl::encoding::Depth,
23730        ) -> fidl::Result<()> {
23731            decoder.debug_check_bounds::<Self>(offset);
23732            #[allow(unused_variables)]
23733            let next_out_of_line = decoder.next_out_of_line();
23734            let handles_before = decoder.remaining_handles();
23735            let (ordinal, inlined, num_bytes, num_handles) =
23736                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23737
23738            let member_inline_size = match ordinal {
23739                1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23740                2 => <FileObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23741                3 => <DirectoryObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23742                4 => <SymlinkObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23743                _ => return Err(fidl::Error::UnknownUnionTag),
23744            };
23745
23746            if inlined != (member_inline_size <= 4) {
23747                return Err(fidl::Error::InvalidInlineBitInEnvelope);
23748            }
23749            let _inner_offset;
23750            if inlined {
23751                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23752                _inner_offset = offset + 8;
23753            } else {
23754                depth.increment()?;
23755                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23756            }
23757            match ordinal {
23758                1 => {
23759                    #[allow(irrefutable_let_patterns)]
23760                    if let NodeInfoDeprecated::Service(_) = self {
23761                        // Do nothing, read the value into the object
23762                    } else {
23763                        // Initialize `self` to the right variant
23764                        *self = NodeInfoDeprecated::Service(fidl::new_empty!(
23765                            Service,
23766                            fidl::encoding::DefaultFuchsiaResourceDialect
23767                        ));
23768                    }
23769                    #[allow(irrefutable_let_patterns)]
23770                    if let NodeInfoDeprecated::Service(ref mut val) = self {
23771                        fidl::decode!(
23772                            Service,
23773                            fidl::encoding::DefaultFuchsiaResourceDialect,
23774                            val,
23775                            decoder,
23776                            _inner_offset,
23777                            depth
23778                        )?;
23779                    } else {
23780                        unreachable!()
23781                    }
23782                }
23783                2 => {
23784                    #[allow(irrefutable_let_patterns)]
23785                    if let NodeInfoDeprecated::File(_) = self {
23786                        // Do nothing, read the value into the object
23787                    } else {
23788                        // Initialize `self` to the right variant
23789                        *self = NodeInfoDeprecated::File(fidl::new_empty!(
23790                            FileObject,
23791                            fidl::encoding::DefaultFuchsiaResourceDialect
23792                        ));
23793                    }
23794                    #[allow(irrefutable_let_patterns)]
23795                    if let NodeInfoDeprecated::File(ref mut val) = self {
23796                        fidl::decode!(
23797                            FileObject,
23798                            fidl::encoding::DefaultFuchsiaResourceDialect,
23799                            val,
23800                            decoder,
23801                            _inner_offset,
23802                            depth
23803                        )?;
23804                    } else {
23805                        unreachable!()
23806                    }
23807                }
23808                3 => {
23809                    #[allow(irrefutable_let_patterns)]
23810                    if let NodeInfoDeprecated::Directory(_) = self {
23811                        // Do nothing, read the value into the object
23812                    } else {
23813                        // Initialize `self` to the right variant
23814                        *self = NodeInfoDeprecated::Directory(fidl::new_empty!(
23815                            DirectoryObject,
23816                            fidl::encoding::DefaultFuchsiaResourceDialect
23817                        ));
23818                    }
23819                    #[allow(irrefutable_let_patterns)]
23820                    if let NodeInfoDeprecated::Directory(ref mut val) = self {
23821                        fidl::decode!(
23822                            DirectoryObject,
23823                            fidl::encoding::DefaultFuchsiaResourceDialect,
23824                            val,
23825                            decoder,
23826                            _inner_offset,
23827                            depth
23828                        )?;
23829                    } else {
23830                        unreachable!()
23831                    }
23832                }
23833                4 => {
23834                    #[allow(irrefutable_let_patterns)]
23835                    if let NodeInfoDeprecated::Symlink(_) = self {
23836                        // Do nothing, read the value into the object
23837                    } else {
23838                        // Initialize `self` to the right variant
23839                        *self = NodeInfoDeprecated::Symlink(fidl::new_empty!(
23840                            SymlinkObject,
23841                            fidl::encoding::DefaultFuchsiaResourceDialect
23842                        ));
23843                    }
23844                    #[allow(irrefutable_let_patterns)]
23845                    if let NodeInfoDeprecated::Symlink(ref mut val) = self {
23846                        fidl::decode!(
23847                            SymlinkObject,
23848                            fidl::encoding::DefaultFuchsiaResourceDialect,
23849                            val,
23850                            decoder,
23851                            _inner_offset,
23852                            depth
23853                        )?;
23854                    } else {
23855                        unreachable!()
23856                    }
23857                }
23858                ordinal => panic!("unexpected ordinal {:?}", ordinal),
23859            }
23860            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23861                return Err(fidl::Error::InvalidNumBytesInEnvelope);
23862            }
23863            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23864                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23865            }
23866            Ok(())
23867        }
23868    }
23869
23870    impl fidl::encoding::ResourceTypeMarker for Representation {
23871        type Borrowed<'a> = &'a mut Self;
23872        fn take_or_borrow<'a>(
23873            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23874        ) -> Self::Borrowed<'a> {
23875            value
23876        }
23877    }
23878
23879    unsafe impl fidl::encoding::TypeMarker for Representation {
23880        type Owned = Self;
23881
23882        #[inline(always)]
23883        fn inline_align(_context: fidl::encoding::Context) -> usize {
23884            8
23885        }
23886
23887        #[inline(always)]
23888        fn inline_size(_context: fidl::encoding::Context) -> usize {
23889            16
23890        }
23891    }
23892
23893    unsafe impl
23894        fidl::encoding::Encode<Representation, fidl::encoding::DefaultFuchsiaResourceDialect>
23895        for &mut Representation
23896    {
23897        #[inline]
23898        unsafe fn encode(
23899            self,
23900            encoder: &mut fidl::encoding::Encoder<
23901                '_,
23902                fidl::encoding::DefaultFuchsiaResourceDialect,
23903            >,
23904            offset: usize,
23905            _depth: fidl::encoding::Depth,
23906        ) -> fidl::Result<()> {
23907            encoder.debug_check_bounds::<Representation>(offset);
23908            encoder.write_num::<u64>(self.ordinal(), offset);
23909            match self {
23910                Representation::Node(ref val) => fidl::encoding::encode_in_envelope::<
23911                    NodeInfo,
23912                    fidl::encoding::DefaultFuchsiaResourceDialect,
23913                >(
23914                    <NodeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
23915                    encoder,
23916                    offset + 8,
23917                    _depth,
23918                ),
23919                Representation::Directory(ref val) => fidl::encoding::encode_in_envelope::<
23920                    DirectoryInfo,
23921                    fidl::encoding::DefaultFuchsiaResourceDialect,
23922                >(
23923                    <DirectoryInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
23924                    encoder,
23925                    offset + 8,
23926                    _depth,
23927                ),
23928                Representation::File(ref mut val) => fidl::encoding::encode_in_envelope::<
23929                    FileInfo,
23930                    fidl::encoding::DefaultFuchsiaResourceDialect,
23931                >(
23932                    <FileInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
23933                    encoder,
23934                    offset + 8,
23935                    _depth,
23936                ),
23937                Representation::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
23938                    SymlinkInfo,
23939                    fidl::encoding::DefaultFuchsiaResourceDialect,
23940                >(
23941                    <SymlinkInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
23942                    encoder,
23943                    offset + 8,
23944                    _depth,
23945                ),
23946                Representation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
23947            }
23948        }
23949    }
23950
23951    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23952        for Representation
23953    {
23954        #[inline(always)]
23955        fn new_empty() -> Self {
23956            Self::__SourceBreaking { unknown_ordinal: 0 }
23957        }
23958
23959        #[inline]
23960        unsafe fn decode(
23961            &mut self,
23962            decoder: &mut fidl::encoding::Decoder<
23963                '_,
23964                fidl::encoding::DefaultFuchsiaResourceDialect,
23965            >,
23966            offset: usize,
23967            mut depth: fidl::encoding::Depth,
23968        ) -> fidl::Result<()> {
23969            decoder.debug_check_bounds::<Self>(offset);
23970            #[allow(unused_variables)]
23971            let next_out_of_line = decoder.next_out_of_line();
23972            let handles_before = decoder.remaining_handles();
23973            let (ordinal, inlined, num_bytes, num_handles) =
23974                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23975
23976            let member_inline_size = match ordinal {
23977                1 => <NodeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23978                2 => <DirectoryInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23979                3 => <FileInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23980                4 => <SymlinkInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23981                0 => return Err(fidl::Error::UnknownUnionTag),
23982                _ => num_bytes as usize,
23983            };
23984
23985            if inlined != (member_inline_size <= 4) {
23986                return Err(fidl::Error::InvalidInlineBitInEnvelope);
23987            }
23988            let _inner_offset;
23989            if inlined {
23990                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23991                _inner_offset = offset + 8;
23992            } else {
23993                depth.increment()?;
23994                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23995            }
23996            match ordinal {
23997                1 => {
23998                    #[allow(irrefutable_let_patterns)]
23999                    if let Representation::Node(_) = self {
24000                        // Do nothing, read the value into the object
24001                    } else {
24002                        // Initialize `self` to the right variant
24003                        *self = Representation::Node(fidl::new_empty!(
24004                            NodeInfo,
24005                            fidl::encoding::DefaultFuchsiaResourceDialect
24006                        ));
24007                    }
24008                    #[allow(irrefutable_let_patterns)]
24009                    if let Representation::Node(ref mut val) = self {
24010                        fidl::decode!(
24011                            NodeInfo,
24012                            fidl::encoding::DefaultFuchsiaResourceDialect,
24013                            val,
24014                            decoder,
24015                            _inner_offset,
24016                            depth
24017                        )?;
24018                    } else {
24019                        unreachable!()
24020                    }
24021                }
24022                2 => {
24023                    #[allow(irrefutable_let_patterns)]
24024                    if let Representation::Directory(_) = self {
24025                        // Do nothing, read the value into the object
24026                    } else {
24027                        // Initialize `self` to the right variant
24028                        *self = Representation::Directory(fidl::new_empty!(
24029                            DirectoryInfo,
24030                            fidl::encoding::DefaultFuchsiaResourceDialect
24031                        ));
24032                    }
24033                    #[allow(irrefutable_let_patterns)]
24034                    if let Representation::Directory(ref mut val) = self {
24035                        fidl::decode!(
24036                            DirectoryInfo,
24037                            fidl::encoding::DefaultFuchsiaResourceDialect,
24038                            val,
24039                            decoder,
24040                            _inner_offset,
24041                            depth
24042                        )?;
24043                    } else {
24044                        unreachable!()
24045                    }
24046                }
24047                3 => {
24048                    #[allow(irrefutable_let_patterns)]
24049                    if let Representation::File(_) = self {
24050                        // Do nothing, read the value into the object
24051                    } else {
24052                        // Initialize `self` to the right variant
24053                        *self = Representation::File(fidl::new_empty!(
24054                            FileInfo,
24055                            fidl::encoding::DefaultFuchsiaResourceDialect
24056                        ));
24057                    }
24058                    #[allow(irrefutable_let_patterns)]
24059                    if let Representation::File(ref mut val) = self {
24060                        fidl::decode!(
24061                            FileInfo,
24062                            fidl::encoding::DefaultFuchsiaResourceDialect,
24063                            val,
24064                            decoder,
24065                            _inner_offset,
24066                            depth
24067                        )?;
24068                    } else {
24069                        unreachable!()
24070                    }
24071                }
24072                4 => {
24073                    #[allow(irrefutable_let_patterns)]
24074                    if let Representation::Symlink(_) = self {
24075                        // Do nothing, read the value into the object
24076                    } else {
24077                        // Initialize `self` to the right variant
24078                        *self = Representation::Symlink(fidl::new_empty!(
24079                            SymlinkInfo,
24080                            fidl::encoding::DefaultFuchsiaResourceDialect
24081                        ));
24082                    }
24083                    #[allow(irrefutable_let_patterns)]
24084                    if let Representation::Symlink(ref mut val) = self {
24085                        fidl::decode!(
24086                            SymlinkInfo,
24087                            fidl::encoding::DefaultFuchsiaResourceDialect,
24088                            val,
24089                            decoder,
24090                            _inner_offset,
24091                            depth
24092                        )?;
24093                    } else {
24094                        unreachable!()
24095                    }
24096                }
24097                #[allow(deprecated)]
24098                ordinal => {
24099                    for _ in 0..num_handles {
24100                        decoder.drop_next_handle()?;
24101                    }
24102                    *self = Representation::__SourceBreaking { unknown_ordinal: ordinal };
24103                }
24104            }
24105            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24106                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24107            }
24108            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24109                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24110            }
24111            Ok(())
24112        }
24113    }
24114}