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::Handle>,
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::Handle,
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::Handle {
487    fn from(value: AdvisoryLockingSynchronousProxy) -> Self {
488        value.into_channel().into()
489    }
490}
491
492#[cfg(target_os = "fuchsia")]
493impl From<fidl::Channel> for AdvisoryLockingSynchronousProxy {
494    fn from(value: fidl::Channel) -> Self {
495        Self::new(value)
496    }
497}
498
499#[cfg(target_os = "fuchsia")]
500impl fidl::endpoints::FromClient for AdvisoryLockingSynchronousProxy {
501    type Protocol = AdvisoryLockingMarker;
502
503    fn from_client(value: fidl::endpoints::ClientEnd<AdvisoryLockingMarker>) -> Self {
504        Self::new(value.into_channel())
505    }
506}
507
508#[derive(Debug, Clone)]
509pub struct AdvisoryLockingProxy {
510    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
511}
512
513impl fidl::endpoints::Proxy for AdvisoryLockingProxy {
514    type Protocol = AdvisoryLockingMarker;
515
516    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
517        Self::new(inner)
518    }
519
520    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
521        self.client.into_channel().map_err(|client| Self { client })
522    }
523
524    fn as_channel(&self) -> &::fidl::AsyncChannel {
525        self.client.as_channel()
526    }
527}
528
529impl AdvisoryLockingProxy {
530    /// Create a new Proxy for fuchsia.io/AdvisoryLocking.
531    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
532        let protocol_name = <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
533        Self { client: fidl::client::Client::new(channel, protocol_name) }
534    }
535
536    /// Get a Stream of events from the remote end of the protocol.
537    ///
538    /// # Panics
539    ///
540    /// Panics if the event stream was already taken.
541    pub fn take_event_stream(&self) -> AdvisoryLockingEventStream {
542        AdvisoryLockingEventStream { event_receiver: self.client.take_event_receiver() }
543    }
544
545    /// Acquires an advisory lock on the underlying file.
546    ///
547    /// The lock lasts until either this connection is closed or
548    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
549    /// explicitly.
550    ///
551    /// Advisory locks are purely advisory. They do not prevent actual read or
552    /// write operations from occurring on the file, either through this
553    /// connection or through other connections.
554    ///
555    /// This method requires the following rights:
556    ///
557    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
558    /// * [`Rights.WRITE_BYTES`] if `request.type` is
559    ///   [`AdvisoryLockType.WRITE`].
560    ///
561    /// # Errors
562    ///
563    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
564    ///   example, another connection might hold a conflicting lock type.
565    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
566    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
567    ///   to acquire the given type of lock.
568    pub fn r#advisory_lock(
569        &self,
570        mut request: &AdvisoryLockRequest,
571    ) -> fidl::client::QueryResponseFut<
572        AdvisoryLockingAdvisoryLockResult,
573        fidl::encoding::DefaultFuchsiaResourceDialect,
574    > {
575        AdvisoryLockingProxyInterface::r#advisory_lock(self, request)
576    }
577}
578
579impl AdvisoryLockingProxyInterface for AdvisoryLockingProxy {
580    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
581        AdvisoryLockingAdvisoryLockResult,
582        fidl::encoding::DefaultFuchsiaResourceDialect,
583    >;
584    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
585        fn _decode(
586            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
587        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
588            let _response = fidl::client::decode_transaction_body::<
589                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
590                fidl::encoding::DefaultFuchsiaResourceDialect,
591                0x6ee9c0ad53ec87aa,
592            >(_buf?)?;
593            Ok(_response.map(|x| x))
594        }
595        self.client.send_query_and_decode::<
596            AdvisoryLockingAdvisoryLockRequest,
597            AdvisoryLockingAdvisoryLockResult,
598        >(
599            (request,),
600            0x6ee9c0ad53ec87aa,
601            fidl::encoding::DynamicFlags::empty(),
602            _decode,
603        )
604    }
605}
606
607pub struct AdvisoryLockingEventStream {
608    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
609}
610
611impl std::marker::Unpin for AdvisoryLockingEventStream {}
612
613impl futures::stream::FusedStream for AdvisoryLockingEventStream {
614    fn is_terminated(&self) -> bool {
615        self.event_receiver.is_terminated()
616    }
617}
618
619impl futures::Stream for AdvisoryLockingEventStream {
620    type Item = Result<AdvisoryLockingEvent, fidl::Error>;
621
622    fn poll_next(
623        mut self: std::pin::Pin<&mut Self>,
624        cx: &mut std::task::Context<'_>,
625    ) -> std::task::Poll<Option<Self::Item>> {
626        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
627            &mut self.event_receiver,
628            cx
629        )?) {
630            Some(buf) => std::task::Poll::Ready(Some(AdvisoryLockingEvent::decode(buf))),
631            None => std::task::Poll::Ready(None),
632        }
633    }
634}
635
636#[derive(Debug)]
637pub enum AdvisoryLockingEvent {}
638
639impl AdvisoryLockingEvent {
640    /// Decodes a message buffer as a [`AdvisoryLockingEvent`].
641    fn decode(
642        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
643    ) -> Result<AdvisoryLockingEvent, fidl::Error> {
644        let (bytes, _handles) = buf.split_mut();
645        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
646        debug_assert_eq!(tx_header.tx_id, 0);
647        match tx_header.ordinal {
648            _ => Err(fidl::Error::UnknownOrdinal {
649                ordinal: tx_header.ordinal,
650                protocol_name:
651                    <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
652            }),
653        }
654    }
655}
656
657/// A Stream of incoming requests for fuchsia.io/AdvisoryLocking.
658pub struct AdvisoryLockingRequestStream {
659    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
660    is_terminated: bool,
661}
662
663impl std::marker::Unpin for AdvisoryLockingRequestStream {}
664
665impl futures::stream::FusedStream for AdvisoryLockingRequestStream {
666    fn is_terminated(&self) -> bool {
667        self.is_terminated
668    }
669}
670
671impl fidl::endpoints::RequestStream for AdvisoryLockingRequestStream {
672    type Protocol = AdvisoryLockingMarker;
673    type ControlHandle = AdvisoryLockingControlHandle;
674
675    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
676        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
677    }
678
679    fn control_handle(&self) -> Self::ControlHandle {
680        AdvisoryLockingControlHandle { inner: self.inner.clone() }
681    }
682
683    fn into_inner(
684        self,
685    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
686    {
687        (self.inner, self.is_terminated)
688    }
689
690    fn from_inner(
691        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
692        is_terminated: bool,
693    ) -> Self {
694        Self { inner, is_terminated }
695    }
696}
697
698impl futures::Stream for AdvisoryLockingRequestStream {
699    type Item = Result<AdvisoryLockingRequest, fidl::Error>;
700
701    fn poll_next(
702        mut self: std::pin::Pin<&mut Self>,
703        cx: &mut std::task::Context<'_>,
704    ) -> std::task::Poll<Option<Self::Item>> {
705        let this = &mut *self;
706        if this.inner.check_shutdown(cx) {
707            this.is_terminated = true;
708            return std::task::Poll::Ready(None);
709        }
710        if this.is_terminated {
711            panic!("polled AdvisoryLockingRequestStream after completion");
712        }
713        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
714            |bytes, handles| {
715                match this.inner.channel().read_etc(cx, bytes, handles) {
716                    std::task::Poll::Ready(Ok(())) => {}
717                    std::task::Poll::Pending => return std::task::Poll::Pending,
718                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
719                        this.is_terminated = true;
720                        return std::task::Poll::Ready(None);
721                    }
722                    std::task::Poll::Ready(Err(e)) => {
723                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
724                            e.into(),
725                        ))));
726                    }
727                }
728
729                // A message has been received from the channel
730                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
731
732                std::task::Poll::Ready(Some(match header.ordinal {
733                    0x6ee9c0ad53ec87aa => {
734                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
735                        let mut req = fidl::new_empty!(
736                            AdvisoryLockingAdvisoryLockRequest,
737                            fidl::encoding::DefaultFuchsiaResourceDialect
738                        );
739                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
740                        let control_handle =
741                            AdvisoryLockingControlHandle { inner: this.inner.clone() };
742                        Ok(AdvisoryLockingRequest::AdvisoryLock {
743                            request: req.request,
744
745                            responder: AdvisoryLockingAdvisoryLockResponder {
746                                control_handle: std::mem::ManuallyDrop::new(control_handle),
747                                tx_id: header.tx_id,
748                            },
749                        })
750                    }
751                    _ => Err(fidl::Error::UnknownOrdinal {
752                        ordinal: header.ordinal,
753                        protocol_name:
754                            <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
755                    }),
756                }))
757            },
758        )
759    }
760}
761
762/// Advisory locking protocol.
763///
764/// This protocol is intended to be composed into the |File| protocol to
765/// provide support for advisory locking.
766///
767/// Advisory locks are purely advisory. They do not prevent actual read or
768/// write operations from occurring on the file, either through this
769/// connection or through other connections.
770///
771/// These primitives are designed to support the flock() and fcntl(),
772/// specifically F_SETLK, F_SETLKW, and F_GETLK, functionality that code
773/// running on Fuchsia expects from other operating systems.
774#[derive(Debug)]
775pub enum AdvisoryLockingRequest {
776    /// Acquires an advisory lock on the underlying file.
777    ///
778    /// The lock lasts until either this connection is closed or
779    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
780    /// explicitly.
781    ///
782    /// Advisory locks are purely advisory. They do not prevent actual read or
783    /// write operations from occurring on the file, either through this
784    /// connection or through other connections.
785    ///
786    /// This method requires the following rights:
787    ///
788    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
789    /// * [`Rights.WRITE_BYTES`] if `request.type` is
790    ///   [`AdvisoryLockType.WRITE`].
791    ///
792    /// # Errors
793    ///
794    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
795    ///   example, another connection might hold a conflicting lock type.
796    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
797    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
798    ///   to acquire the given type of lock.
799    AdvisoryLock { request: AdvisoryLockRequest, responder: AdvisoryLockingAdvisoryLockResponder },
800}
801
802impl AdvisoryLockingRequest {
803    #[allow(irrefutable_let_patterns)]
804    pub fn into_advisory_lock(
805        self,
806    ) -> Option<(AdvisoryLockRequest, AdvisoryLockingAdvisoryLockResponder)> {
807        if let AdvisoryLockingRequest::AdvisoryLock { request, responder } = self {
808            Some((request, responder))
809        } else {
810            None
811        }
812    }
813
814    /// Name of the method defined in FIDL
815    pub fn method_name(&self) -> &'static str {
816        match *self {
817            AdvisoryLockingRequest::AdvisoryLock { .. } => "advisory_lock",
818        }
819    }
820}
821
822#[derive(Debug, Clone)]
823pub struct AdvisoryLockingControlHandle {
824    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
825}
826
827impl fidl::endpoints::ControlHandle for AdvisoryLockingControlHandle {
828    fn shutdown(&self) {
829        self.inner.shutdown()
830    }
831    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
832        self.inner.shutdown_with_epitaph(status)
833    }
834
835    fn is_closed(&self) -> bool {
836        self.inner.channel().is_closed()
837    }
838    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
839        self.inner.channel().on_closed()
840    }
841
842    #[cfg(target_os = "fuchsia")]
843    fn signal_peer(
844        &self,
845        clear_mask: zx::Signals,
846        set_mask: zx::Signals,
847    ) -> Result<(), zx_status::Status> {
848        use fidl::Peered;
849        self.inner.channel().signal_peer(clear_mask, set_mask)
850    }
851}
852
853impl AdvisoryLockingControlHandle {}
854
855#[must_use = "FIDL methods require a response to be sent"]
856#[derive(Debug)]
857pub struct AdvisoryLockingAdvisoryLockResponder {
858    control_handle: std::mem::ManuallyDrop<AdvisoryLockingControlHandle>,
859    tx_id: u32,
860}
861
862/// Set the the channel to be shutdown (see [`AdvisoryLockingControlHandle::shutdown`])
863/// if the responder is dropped without sending a response, so that the client
864/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
865impl std::ops::Drop for AdvisoryLockingAdvisoryLockResponder {
866    fn drop(&mut self) {
867        self.control_handle.shutdown();
868        // Safety: drops once, never accessed again
869        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
870    }
871}
872
873impl fidl::endpoints::Responder for AdvisoryLockingAdvisoryLockResponder {
874    type ControlHandle = AdvisoryLockingControlHandle;
875
876    fn control_handle(&self) -> &AdvisoryLockingControlHandle {
877        &self.control_handle
878    }
879
880    fn drop_without_shutdown(mut self) {
881        // Safety: drops once, never accessed again due to mem::forget
882        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
883        // Prevent Drop from running (which would shut down the channel)
884        std::mem::forget(self);
885    }
886}
887
888impl AdvisoryLockingAdvisoryLockResponder {
889    /// Sends a response to the FIDL transaction.
890    ///
891    /// Sets the channel to shutdown if an error occurs.
892    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
893        let _result = self.send_raw(result);
894        if _result.is_err() {
895            self.control_handle.shutdown();
896        }
897        self.drop_without_shutdown();
898        _result
899    }
900
901    /// Similar to "send" but does not shutdown the channel if an error occurs.
902    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
903        let _result = self.send_raw(result);
904        self.drop_without_shutdown();
905        _result
906    }
907
908    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
909        self.control_handle
910            .inner
911            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
912                result,
913                self.tx_id,
914                0x6ee9c0ad53ec87aa,
915                fidl::encoding::DynamicFlags::empty(),
916            )
917    }
918}
919
920#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
921pub struct DirectoryMarker;
922
923impl fidl::endpoints::ProtocolMarker for DirectoryMarker {
924    type Proxy = DirectoryProxy;
925    type RequestStream = DirectoryRequestStream;
926    #[cfg(target_os = "fuchsia")]
927    type SynchronousProxy = DirectorySynchronousProxy;
928
929    const DEBUG_NAME: &'static str = "fuchsia.io.Directory";
930}
931impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryMarker {}
932pub type DirectoryUnlinkResult = Result<(), i32>;
933pub type DirectoryRenameResult = Result<(), i32>;
934pub type DirectoryCreateSymlinkResult = Result<(), i32>;
935
936pub trait DirectoryProxyInterface: Send + Sync {
937    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
938        + Send;
939    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
940    fn r#clone(
941        &self,
942        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
943    ) -> Result<(), fidl::Error>;
944    type CloseResponseFut: std::future::Future<
945            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
946        > + Send;
947    fn r#close(&self) -> Self::CloseResponseFut;
948    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
949    fn r#query(&self) -> Self::QueryResponseFut;
950    fn r#deprecated_clone(
951        &self,
952        flags: OpenFlags,
953        object: fidl::endpoints::ServerEnd<NodeMarker>,
954    ) -> Result<(), fidl::Error>;
955    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
956        + Send;
957    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
958    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
959    fn r#deprecated_set_attr(
960        &self,
961        flags: NodeAttributeFlags,
962        attributes: &NodeAttributes,
963    ) -> Self::DeprecatedSetAttrResponseFut;
964    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
965        + Send;
966    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
967    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
968        + Send;
969    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
970    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
971        + Send;
972    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
973    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
974        + Send;
975    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
976    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
977        + Send;
978    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
979    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
980        + Send;
981    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
982    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
983        + Send;
984    fn r#update_attributes(
985        &self,
986        payload: &MutableNodeAttributes,
987    ) -> Self::UpdateAttributesResponseFut;
988    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
989    fn r#sync(&self) -> Self::SyncResponseFut;
990    fn r#list_extended_attributes(
991        &self,
992        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
993    ) -> Result<(), fidl::Error>;
994    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
995        + Send;
996    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
997    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
998        + Send;
999    fn r#set_extended_attribute(
1000        &self,
1001        name: &[u8],
1002        value: ExtendedAttributeValue,
1003        mode: SetExtendedAttributeMode,
1004    ) -> Self::SetExtendedAttributeResponseFut;
1005    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
1006        + Send;
1007    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
1008    fn r#deprecated_open(
1009        &self,
1010        flags: OpenFlags,
1011        mode: ModeType,
1012        path: &str,
1013        object: fidl::endpoints::ServerEnd<NodeMarker>,
1014    ) -> Result<(), fidl::Error>;
1015    fn r#open(
1016        &self,
1017        path: &str,
1018        flags: Flags,
1019        options: &Options,
1020        object: fidl::Channel,
1021    ) -> Result<(), fidl::Error>;
1022    type ReadDirentsResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>), fidl::Error>>
1023        + Send;
1024    fn r#read_dirents(&self, max_bytes: u64) -> Self::ReadDirentsResponseFut;
1025    type RewindResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1026    fn r#rewind(&self) -> Self::RewindResponseFut;
1027    type GetTokenResponseFut: std::future::Future<Output = Result<(i32, Option<fidl::Handle>), fidl::Error>>
1028        + Send;
1029    fn r#get_token(&self) -> Self::GetTokenResponseFut;
1030    type LinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1031    fn r#link(&self, src: &str, dst_parent_token: fidl::Handle, dst: &str)
1032    -> Self::LinkResponseFut;
1033    type UnlinkResponseFut: std::future::Future<Output = Result<DirectoryUnlinkResult, fidl::Error>>
1034        + Send;
1035    fn r#unlink(&self, name: &str, options: &UnlinkOptions) -> Self::UnlinkResponseFut;
1036    type RenameResponseFut: std::future::Future<Output = Result<DirectoryRenameResult, fidl::Error>>
1037        + Send;
1038    fn r#rename(
1039        &self,
1040        src: &str,
1041        dst_parent_token: fidl::Event,
1042        dst: &str,
1043    ) -> Self::RenameResponseFut;
1044    type CreateSymlinkResponseFut: std::future::Future<Output = Result<DirectoryCreateSymlinkResult, fidl::Error>>
1045        + Send;
1046    fn r#create_symlink(
1047        &self,
1048        name: &str,
1049        target: &[u8],
1050        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1051    ) -> Self::CreateSymlinkResponseFut;
1052    type WatchResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1053    fn r#watch(
1054        &self,
1055        mask: WatchMask,
1056        options: u32,
1057        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1058    ) -> Self::WatchResponseFut;
1059}
1060#[derive(Debug)]
1061#[cfg(target_os = "fuchsia")]
1062pub struct DirectorySynchronousProxy {
1063    client: fidl::client::sync::Client,
1064}
1065
1066#[cfg(target_os = "fuchsia")]
1067impl fidl::endpoints::SynchronousProxy for DirectorySynchronousProxy {
1068    type Proxy = DirectoryProxy;
1069    type Protocol = DirectoryMarker;
1070
1071    fn from_channel(inner: fidl::Channel) -> Self {
1072        Self::new(inner)
1073    }
1074
1075    fn into_channel(self) -> fidl::Channel {
1076        self.client.into_channel()
1077    }
1078
1079    fn as_channel(&self) -> &fidl::Channel {
1080        self.client.as_channel()
1081    }
1082}
1083
1084#[cfg(target_os = "fuchsia")]
1085impl DirectorySynchronousProxy {
1086    pub fn new(channel: fidl::Channel) -> Self {
1087        let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1088        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1089    }
1090
1091    pub fn into_channel(self) -> fidl::Channel {
1092        self.client.into_channel()
1093    }
1094
1095    /// Waits until an event arrives and returns it. It is safe for other
1096    /// threads to make concurrent requests while waiting for an event.
1097    pub fn wait_for_event(
1098        &self,
1099        deadline: zx::MonotonicInstant,
1100    ) -> Result<DirectoryEvent, fidl::Error> {
1101        DirectoryEvent::decode(self.client.wait_for_event(deadline)?)
1102    }
1103
1104    /// Acquires an advisory lock on the underlying file.
1105    ///
1106    /// The lock lasts until either this connection is closed or
1107    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1108    /// explicitly.
1109    ///
1110    /// Advisory locks are purely advisory. They do not prevent actual read or
1111    /// write operations from occurring on the file, either through this
1112    /// connection or through other connections.
1113    ///
1114    /// This method requires the following rights:
1115    ///
1116    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1117    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1118    ///   [`AdvisoryLockType.WRITE`].
1119    ///
1120    /// # Errors
1121    ///
1122    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1123    ///   example, another connection might hold a conflicting lock type.
1124    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1125    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1126    ///   to acquire the given type of lock.
1127    pub fn r#advisory_lock(
1128        &self,
1129        mut request: &AdvisoryLockRequest,
1130        ___deadline: zx::MonotonicInstant,
1131    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
1132        let _response = self.client.send_query::<
1133            AdvisoryLockingAdvisoryLockRequest,
1134            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1135        >(
1136            (request,),
1137            0x6ee9c0ad53ec87aa,
1138            fidl::encoding::DynamicFlags::empty(),
1139            ___deadline,
1140        )?;
1141        Ok(_response.map(|x| x))
1142    }
1143
1144    pub fn r#clone(
1145        &self,
1146        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1147    ) -> Result<(), fidl::Error> {
1148        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
1149            (request,),
1150            0x20d8a7aba2168a79,
1151            fidl::encoding::DynamicFlags::empty(),
1152        )
1153    }
1154
1155    /// Terminates the connection.
1156    ///
1157    /// After calling `Close`, the client must not send any other requests.
1158    ///
1159    /// Servers, after sending the status response, should close the connection
1160    /// regardless of status and without sending an epitaph.
1161    ///
1162    /// Closing the client end of the channel should be semantically equivalent
1163    /// to calling `Close` without knowing when the close has completed or its
1164    /// status.
1165    pub fn r#close(
1166        &self,
1167        ___deadline: zx::MonotonicInstant,
1168    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
1169        let _response = self.client.send_query::<
1170            fidl::encoding::EmptyPayload,
1171            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1172        >(
1173            (),
1174            0x5ac5d459ad7f657e,
1175            fidl::encoding::DynamicFlags::empty(),
1176            ___deadline,
1177        )?;
1178        Ok(_response.map(|x| x))
1179    }
1180
1181    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
1182        let _response = self.client.send_query::<
1183            fidl::encoding::EmptyPayload,
1184            fidl_fuchsia_unknown::QueryableQueryResponse,
1185        >(
1186            (),
1187            0x2658edee9decfc06,
1188            fidl::encoding::DynamicFlags::empty(),
1189            ___deadline,
1190        )?;
1191        Ok(_response.protocol)
1192    }
1193
1194    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1195    pub fn r#deprecated_clone(
1196        &self,
1197        mut flags: OpenFlags,
1198        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1199    ) -> Result<(), fidl::Error> {
1200        self.client.send::<NodeDeprecatedCloneRequest>(
1201            (flags, object),
1202            0x5a61678f293ce16f,
1203            fidl::encoding::DynamicFlags::FLEXIBLE,
1204        )
1205    }
1206
1207    /// DEPRECATED - Use `Node.GetAttributes` instead.
1208    pub fn r#deprecated_get_attr(
1209        &self,
1210        ___deadline: zx::MonotonicInstant,
1211    ) -> Result<(i32, NodeAttributes), fidl::Error> {
1212        let _response =
1213            self.client.send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse>(
1214                (),
1215                0x78985e216314dafd,
1216                fidl::encoding::DynamicFlags::empty(),
1217                ___deadline,
1218            )?;
1219        Ok((_response.s, _response.attributes))
1220    }
1221
1222    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1223    pub fn r#deprecated_set_attr(
1224        &self,
1225        mut flags: NodeAttributeFlags,
1226        mut attributes: &NodeAttributes,
1227        ___deadline: zx::MonotonicInstant,
1228    ) -> Result<i32, fidl::Error> {
1229        let _response =
1230            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
1231                (flags, attributes),
1232                0x4186c0f40d938f46,
1233                fidl::encoding::DynamicFlags::empty(),
1234                ___deadline,
1235            )?;
1236        Ok(_response.s)
1237    }
1238
1239    /// [DEPRECATED - Use new GetFlags method instead.]
1240    pub fn r#deprecated_get_flags(
1241        &self,
1242        ___deadline: zx::MonotonicInstant,
1243    ) -> Result<(i32, OpenFlags), fidl::Error> {
1244        let _response = self
1245            .client
1246            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
1247                (),
1248                0x5b88fffb8eda3aa1,
1249                fidl::encoding::DynamicFlags::empty(),
1250                ___deadline,
1251            )?;
1252        Ok((_response.s, _response.flags))
1253    }
1254
1255    /// [DEPRECATED - Use new SetFlags method instead.]
1256    pub fn r#deprecated_set_flags(
1257        &self,
1258        mut flags: OpenFlags,
1259        ___deadline: zx::MonotonicInstant,
1260    ) -> Result<i32, fidl::Error> {
1261        let _response = self
1262            .client
1263            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
1264                (flags,),
1265                0x5295b76c71fde733,
1266                fidl::encoding::DynamicFlags::empty(),
1267                ___deadline,
1268            )?;
1269        Ok(_response.s)
1270    }
1271
1272    /// Queries the flags that apply to this node after it has been opened/created. This method does
1273    /// not require any rights.
1274    ///
1275    /// Note that the final set of flags that apply to the connection may differ from those
1276    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1277    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1278    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1279    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1280    pub fn r#get_flags(
1281        &self,
1282        ___deadline: zx::MonotonicInstant,
1283    ) -> Result<NodeGetFlagsResult, fidl::Error> {
1284        let _response = self.client.send_query::<
1285            fidl::encoding::EmptyPayload,
1286            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
1287        >(
1288            (),
1289            0x176eb318f64ec23,
1290            fidl::encoding::DynamicFlags::FLEXIBLE,
1291            ___deadline,
1292        )?
1293        .into_result::<DirectoryMarker>("get_flags")?;
1294        Ok(_response.map(|x| x.flags))
1295    }
1296
1297    /// Sets the flags that apply to this node after it has been opened. This method does not
1298    /// require any rights.
1299    ///
1300    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1301    /// clear append mode.
1302    ///
1303    /// Errors:
1304    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1305    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1306    pub fn r#set_flags(
1307        &self,
1308        mut flags: Flags,
1309        ___deadline: zx::MonotonicInstant,
1310    ) -> Result<NodeSetFlagsResult, fidl::Error> {
1311        let _response = self.client.send_query::<
1312            NodeSetFlagsRequest,
1313            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1314        >(
1315            (flags,),
1316            0x55a8028685791ea8,
1317            fidl::encoding::DynamicFlags::FLEXIBLE,
1318            ___deadline,
1319        )?
1320        .into_result::<DirectoryMarker>("set_flags")?;
1321        Ok(_response.map(|x| x))
1322    }
1323
1324    /// Query the filesystem for filesystem-specific information.
1325    pub fn r#query_filesystem(
1326        &self,
1327        ___deadline: zx::MonotonicInstant,
1328    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
1329        let _response =
1330            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
1331                (),
1332                0x6f344a1c6b0a0610,
1333                fidl::encoding::DynamicFlags::empty(),
1334                ___deadline,
1335            )?;
1336        Ok((_response.s, _response.info))
1337    }
1338
1339    /// Acquires information about the node.
1340    ///
1341    /// The attributes of a node should be stable, independent of the
1342    /// specific protocol used to access it.
1343    ///
1344    /// If a particular attribute is not applicable or not supported,
1345    /// filesystems should leave the corresponding field absent.
1346    ///
1347    /// + `query` a bit-mask specifying which attributes to fetch. The server
1348    ///   should not return more than necessary.
1349    /// - `attributes` the returned attributes.
1350    ///
1351    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1352    pub fn r#get_attributes(
1353        &self,
1354        mut query: NodeAttributesQuery,
1355        ___deadline: zx::MonotonicInstant,
1356    ) -> Result<NodeGetAttributesResult, fidl::Error> {
1357        let _response = self.client.send_query::<
1358            NodeGetAttributesRequest,
1359            fidl::encoding::ResultType<NodeAttributes2, i32>,
1360        >(
1361            (query,),
1362            0x3d4396a638ea053b,
1363            fidl::encoding::DynamicFlags::empty(),
1364            ___deadline,
1365        )?;
1366        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
1367    }
1368
1369    /// Updates information about the node.
1370    ///
1371    /// + `attributes` the presence of a table field in `attributes` indicates
1372    /// the intent to update the corresponding attribute.
1373    ///
1374    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
1375    ///
1376    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1377    pub fn r#update_attributes(
1378        &self,
1379        mut payload: &MutableNodeAttributes,
1380        ___deadline: zx::MonotonicInstant,
1381    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
1382        let _response = self.client.send_query::<
1383            MutableNodeAttributes,
1384            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1385        >(
1386            payload,
1387            0x3308c1da5a89bf08,
1388            fidl::encoding::DynamicFlags::empty(),
1389            ___deadline,
1390        )?;
1391        Ok(_response.map(|x| x))
1392    }
1393
1394    /// Synchronizes updates to the node to the underlying media, if it exists.
1395    ///
1396    /// This method will return when the filesystem server has flushed the
1397    /// relevant updates to the underlying media, but does not guarantee the
1398    /// underlying media has persisted the information, nor that any information
1399    /// is committed to hardware. Clients may use `Sync` to ensure ordering
1400    /// between operations.
1401    ///
1402    /// This method does not require any rights.
1403    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
1404        let _response = self.client.send_query::<
1405            fidl::encoding::EmptyPayload,
1406            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1407        >(
1408            (),
1409            0x2c5c27ca0ab5dc49,
1410            fidl::encoding::DynamicFlags::empty(),
1411            ___deadline,
1412        )?;
1413        Ok(_response.map(|x| x))
1414    }
1415
1416    /// Creates an iterator over all the extended attribute names associated
1417    /// with this node. If an error occurs it is returned as an epitaph on the
1418    /// iterator request channel, and then the channel is closed.
1419    ///
1420    /// GetExtendedAttributes can be used with any of these names to retrieve
1421    /// the associated value.
1422    ///
1423    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1424    pub fn r#list_extended_attributes(
1425        &self,
1426        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
1427    ) -> Result<(), fidl::Error> {
1428        self.client.send::<NodeListExtendedAttributesRequest>(
1429            (iterator,),
1430            0x4b61033de007fcd0,
1431            fidl::encoding::DynamicFlags::empty(),
1432        )
1433    }
1434
1435    /// Get the value associated with the given attribute `name` for this node.
1436    ///
1437    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
1438    /// particular structure is imposed on them.
1439    ///
1440    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1441    pub fn r#get_extended_attribute(
1442        &self,
1443        mut name: &[u8],
1444        ___deadline: zx::MonotonicInstant,
1445    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
1446        let _response = self.client.send_query::<
1447            NodeGetExtendedAttributeRequest,
1448            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
1449        >(
1450            (name,),
1451            0x45ffa3ccfdeb76db,
1452            fidl::encoding::DynamicFlags::empty(),
1453            ___deadline,
1454        )?;
1455        Ok(_response.map(|x| x))
1456    }
1457
1458    /// Set the value for the given attribute `name` to `value` for this node.
1459    ///
1460    /// The attribute name may exist, in which case the attribute is updated.
1461    /// If the attribute doesn't exist, it is created. The name should have no
1462    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
1463    ///
1464    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1465    pub fn r#set_extended_attribute(
1466        &self,
1467        mut name: &[u8],
1468        mut value: ExtendedAttributeValue,
1469        mut mode: SetExtendedAttributeMode,
1470        ___deadline: zx::MonotonicInstant,
1471    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
1472        let _response = self.client.send_query::<
1473            NodeSetExtendedAttributeRequest,
1474            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1475        >(
1476            (name, &mut value, mode,),
1477            0x4a951362f681f23c,
1478            fidl::encoding::DynamicFlags::empty(),
1479            ___deadline,
1480        )?;
1481        Ok(_response.map(|x| x))
1482    }
1483
1484    /// Remove the specified extended attribute.
1485    ///
1486    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
1487    ///
1488    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1489    pub fn r#remove_extended_attribute(
1490        &self,
1491        mut name: &[u8],
1492        ___deadline: zx::MonotonicInstant,
1493    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
1494        let _response = self.client.send_query::<
1495            NodeRemoveExtendedAttributeRequest,
1496            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1497        >(
1498            (name,),
1499            0x7a0b9f3a9bf9032d,
1500            fidl::encoding::DynamicFlags::empty(),
1501            ___deadline,
1502        )?;
1503        Ok(_response.map(|x| x))
1504    }
1505
1506    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
1507    pub fn r#deprecated_open(
1508        &self,
1509        mut flags: OpenFlags,
1510        mut mode: ModeType,
1511        mut path: &str,
1512        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1513    ) -> Result<(), fidl::Error> {
1514        self.client.send::<DirectoryDeprecatedOpenRequest>(
1515            (flags, mode, path, object),
1516            0x2c5044561d685ec0,
1517            fidl::encoding::DynamicFlags::FLEXIBLE,
1518        )
1519    }
1520
1521    /// Open (or create) a node relative to this directory. Any errors are communicated via an
1522    /// epitaph sent on the `object` channel.
1523    ///
1524    /// Errors:
1525    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
1526    /// * See [`Flags`] for other errors which may be communicated based on `flags`
1527    pub fn r#open(
1528        &self,
1529        mut path: &str,
1530        mut flags: Flags,
1531        mut options: &Options,
1532        mut object: fidl::Channel,
1533    ) -> Result<(), fidl::Error> {
1534        self.client.send::<DirectoryOpenRequest>(
1535            (path, flags, options, object),
1536            0x568ddcb9a9cbb6d9,
1537            fidl::encoding::DynamicFlags::empty(),
1538        )
1539    }
1540
1541    /// Reads a collection of variably sized dirents into a buffer.
1542    /// The number of dirents in a directory may be very large: akin to
1543    /// calling read multiple times on a file, directories have a seek
1544    /// offset which is updated on subsequent calls to ReadDirents.
1545    /// Each call to ReadDirents will only return whole dirent structures,
1546    /// they will not get split across ReadDirent calls. When the seek
1547    /// offset reaches the end, `dirents` will be empty.
1548    ///
1549    /// These dirents are of the form:
1550    /// ```
1551    /// struct dirent {
1552    ///   // Describes the inode of the entry.
1553    ///   uint64 ino;
1554    ///   // Describes the length of the dirent name in bytes.
1555    ///   uint8 size;
1556    ///   // Describes the type of the entry. Aligned with the
1557    ///   // POSIX d_type values. Use `DirentType` constants.
1558    ///   uint8 type;
1559    ///   // Unterminated name of entry.
1560    ///   char name[0];
1561    /// }
1562    /// ```
1563    ///
1564    /// This method does not require any rights, since one could always probe for
1565    /// directory contents by triggering name conflicts during file creation.
1566    pub fn r#read_dirents(
1567        &self,
1568        mut max_bytes: u64,
1569        ___deadline: zx::MonotonicInstant,
1570    ) -> Result<(i32, Vec<u8>), fidl::Error> {
1571        let _response =
1572            self.client.send_query::<DirectoryReadDirentsRequest, DirectoryReadDirentsResponse>(
1573                (max_bytes,),
1574                0x3582806bf27faa0a,
1575                fidl::encoding::DynamicFlags::empty(),
1576                ___deadline,
1577            )?;
1578        Ok((_response.s, _response.dirents))
1579    }
1580
1581    /// Resets the directory seek offset.
1582    ///
1583    /// This method does not require any rights, similar to ReadDirents.
1584    pub fn r#rewind(&self, ___deadline: zx::MonotonicInstant) -> Result<i32, fidl::Error> {
1585        let _response =
1586            self.client.send_query::<fidl::encoding::EmptyPayload, DirectoryRewindResponse>(
1587                (),
1588                0x16b1202af0f34c71,
1589                fidl::encoding::DynamicFlags::empty(),
1590                ___deadline,
1591            )?;
1592        Ok(_response.s)
1593    }
1594
1595    /// Acquires a token to a Directory which can be used to identify access to it at a later point
1596    /// in time. The token will remain valid for as long as the connection requesting the token
1597    /// remains open.
1598    ///
1599    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1600    /// `ZX_ERR_BAD_HANDLE`.
1601    pub fn r#get_token(
1602        &self,
1603        ___deadline: zx::MonotonicInstant,
1604    ) -> Result<(i32, Option<fidl::Handle>), fidl::Error> {
1605        let _response =
1606            self.client.send_query::<fidl::encoding::EmptyPayload, DirectoryGetTokenResponse>(
1607                (),
1608                0x26ae9d18763c8655,
1609                fidl::encoding::DynamicFlags::empty(),
1610                ___deadline,
1611            )?;
1612        Ok((_response.s, _response.token))
1613    }
1614
1615    /// Creates a link to an object named src by the name dst, within a directory represented by
1616    /// token.
1617    ///
1618    /// `src` must be a resolved object name. Including "/" in the string will
1619    /// return `ZX_ERR_INVALID_ARGS`.
1620    ///
1621    /// `dst` must be a resolved object name. Including "/" in the string will
1622    /// return `ZX_ERR_INVALID_ARGS`.
1623    ///
1624    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
1625    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
1626    ///
1627    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
1628    /// there are two actors operating concurrently, and one actor performs a rename that affects
1629    /// the source within this directory, and the other does a link, each will appear to occur
1630    /// atomically in an unspecified order.
1631    pub fn r#link(
1632        &self,
1633        mut src: &str,
1634        mut dst_parent_token: fidl::Handle,
1635        mut dst: &str,
1636        ___deadline: zx::MonotonicInstant,
1637    ) -> Result<i32, fidl::Error> {
1638        let _response = self.client.send_query::<DirectoryLinkRequest, DirectoryLinkResponse>(
1639            (src, dst_parent_token, dst),
1640            0x740604c0c7c930e7,
1641            fidl::encoding::DynamicFlags::empty(),
1642            ___deadline,
1643        )?;
1644        Ok(_response.s)
1645    }
1646
1647    /// Removes a child node from the this directory's list of entries.
1648    ///
1649    /// Note: this does not guarantee that the underlying object is destroyed.
1650    /// Although the link will be removed from the containing directory,
1651    /// objects with multiple references (such as files which are still open)
1652    /// will not actually be destroyed until all references are closed.
1653    ///
1654    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
1655    ///   [`Rights.WRITE_BYTES`].
1656    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
1657    ///   support writing.
1658    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
1659    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
1660    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
1661    ///   containing a remote channel.
1662    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
1663    ///     something other than a directory was found.
1664    ///
1665    /// Other errors may be returned for filesystem-specific reasons.
1666    ///
1667    /// This method requires the following rights:
1668    ///
1669    /// * [`Rights.ENUMERATE`]
1670    /// * [`Rights.MODIFY_DIRECTORY`]
1671    pub fn r#unlink(
1672        &self,
1673        mut name: &str,
1674        mut options: &UnlinkOptions,
1675        ___deadline: zx::MonotonicInstant,
1676    ) -> Result<DirectoryUnlinkResult, fidl::Error> {
1677        let _response = self.client.send_query::<
1678            DirectoryUnlinkRequest,
1679            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1680        >(
1681            (name, options,),
1682            0x750a0326a78d7bed,
1683            fidl::encoding::DynamicFlags::empty(),
1684            ___deadline,
1685        )?;
1686        Ok(_response.map(|x| x))
1687    }
1688
1689    /// Renames a node named `src` to the name `dst`, in a directory represented
1690    /// by `dst_parent_token`.
1691    ///
1692    /// `src` and `dst` must be valid node names.
1693    /// See [`Name`] for what constitutes a valid name.
1694    ///
1695    /// This method requires the following rights on both the current connection, and the connection
1696    /// identified by `dst_parent_token`:
1697    ///
1698    /// * [`Rights.ENUMERATE`]
1699    /// * [`Rights.MODIFY_DIRECTORY`]
1700    ///
1701    /// The following requirements are necessary to avoid rights escalations.
1702    ///
1703    /// If the source and destination directory differ, the source directory must also have the
1704    /// maximal set of abilities supported for files, which would typically be
1705    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
1706    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
1707    /// right.
1708    ///
1709    /// If `src` refers to a directory, and differs from the destination directory, then the source
1710    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
1711    ///
1712    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
1713    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
1714    pub fn r#rename(
1715        &self,
1716        mut src: &str,
1717        mut dst_parent_token: fidl::Event,
1718        mut dst: &str,
1719        ___deadline: zx::MonotonicInstant,
1720    ) -> Result<DirectoryRenameResult, fidl::Error> {
1721        let _response = self.client.send_query::<
1722            DirectoryRenameRequest,
1723            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1724        >(
1725            (src, dst_parent_token, dst,),
1726            0x7060e7723b9928de,
1727            fidl::encoding::DynamicFlags::empty(),
1728            ___deadline,
1729        )?;
1730        Ok(_response.map(|x| x))
1731    }
1732
1733    /// Creates a symbolic link.
1734    ///
1735    /// `name` is the name to be given to the created symbolic link.
1736    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
1737    /// will perform no validation of `target` except for a server chosen maximum length.
1738    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
1739    /// on the successfully created node.
1740    ///
1741    /// * [`Rights.MODIFY_DIRECTORY`]
1742    ///
1743    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
1744    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
1745    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
1746    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
1747    pub fn r#create_symlink(
1748        &self,
1749        mut name: &str,
1750        mut target: &[u8],
1751        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1752        ___deadline: zx::MonotonicInstant,
1753    ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
1754        let _response = self.client.send_query::<
1755            DirectoryCreateSymlinkRequest,
1756            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1757        >(
1758            (name, target, connection,),
1759            0x21ce0f19ec043889,
1760            fidl::encoding::DynamicFlags::empty(),
1761            ___deadline,
1762        )?;
1763        Ok(_response.map(|x| x))
1764    }
1765
1766    /// Watches a directory, receiving events of added messages on the
1767    /// watcher request channel.
1768    ///
1769    /// Options must be zero; it is reserved.
1770    ///
1771    /// This method does not require any rights, similar to ReadDirents.
1772    pub fn r#watch(
1773        &self,
1774        mut mask: WatchMask,
1775        mut options: u32,
1776        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1777        ___deadline: zx::MonotonicInstant,
1778    ) -> Result<i32, fidl::Error> {
1779        let _response = self.client.send_query::<DirectoryWatchRequest, DirectoryWatchResponse>(
1780            (mask, options, watcher),
1781            0x5717193a59d66d91,
1782            fidl::encoding::DynamicFlags::empty(),
1783            ___deadline,
1784        )?;
1785        Ok(_response.s)
1786    }
1787}
1788
1789#[cfg(target_os = "fuchsia")]
1790impl From<DirectorySynchronousProxy> for zx::Handle {
1791    fn from(value: DirectorySynchronousProxy) -> Self {
1792        value.into_channel().into()
1793    }
1794}
1795
1796#[cfg(target_os = "fuchsia")]
1797impl From<fidl::Channel> for DirectorySynchronousProxy {
1798    fn from(value: fidl::Channel) -> Self {
1799        Self::new(value)
1800    }
1801}
1802
1803#[cfg(target_os = "fuchsia")]
1804impl fidl::endpoints::FromClient for DirectorySynchronousProxy {
1805    type Protocol = DirectoryMarker;
1806
1807    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryMarker>) -> Self {
1808        Self::new(value.into_channel())
1809    }
1810}
1811
1812#[derive(Debug, Clone)]
1813pub struct DirectoryProxy {
1814    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1815}
1816
1817impl fidl::endpoints::Proxy for DirectoryProxy {
1818    type Protocol = DirectoryMarker;
1819
1820    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1821        Self::new(inner)
1822    }
1823
1824    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1825        self.client.into_channel().map_err(|client| Self { client })
1826    }
1827
1828    fn as_channel(&self) -> &::fidl::AsyncChannel {
1829        self.client.as_channel()
1830    }
1831}
1832
1833impl DirectoryProxy {
1834    /// Create a new Proxy for fuchsia.io/Directory.
1835    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1836        let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1837        Self { client: fidl::client::Client::new(channel, protocol_name) }
1838    }
1839
1840    /// Get a Stream of events from the remote end of the protocol.
1841    ///
1842    /// # Panics
1843    ///
1844    /// Panics if the event stream was already taken.
1845    pub fn take_event_stream(&self) -> DirectoryEventStream {
1846        DirectoryEventStream { event_receiver: self.client.take_event_receiver() }
1847    }
1848
1849    /// Acquires an advisory lock on the underlying file.
1850    ///
1851    /// The lock lasts until either this connection is closed or
1852    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1853    /// explicitly.
1854    ///
1855    /// Advisory locks are purely advisory. They do not prevent actual read or
1856    /// write operations from occurring on the file, either through this
1857    /// connection or through other connections.
1858    ///
1859    /// This method requires the following rights:
1860    ///
1861    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1862    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1863    ///   [`AdvisoryLockType.WRITE`].
1864    ///
1865    /// # Errors
1866    ///
1867    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1868    ///   example, another connection might hold a conflicting lock type.
1869    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1870    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1871    ///   to acquire the given type of lock.
1872    pub fn r#advisory_lock(
1873        &self,
1874        mut request: &AdvisoryLockRequest,
1875    ) -> fidl::client::QueryResponseFut<
1876        AdvisoryLockingAdvisoryLockResult,
1877        fidl::encoding::DefaultFuchsiaResourceDialect,
1878    > {
1879        DirectoryProxyInterface::r#advisory_lock(self, request)
1880    }
1881
1882    pub fn r#clone(
1883        &self,
1884        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1885    ) -> Result<(), fidl::Error> {
1886        DirectoryProxyInterface::r#clone(self, request)
1887    }
1888
1889    /// Terminates the connection.
1890    ///
1891    /// After calling `Close`, the client must not send any other requests.
1892    ///
1893    /// Servers, after sending the status response, should close the connection
1894    /// regardless of status and without sending an epitaph.
1895    ///
1896    /// Closing the client end of the channel should be semantically equivalent
1897    /// to calling `Close` without knowing when the close has completed or its
1898    /// status.
1899    pub fn r#close(
1900        &self,
1901    ) -> fidl::client::QueryResponseFut<
1902        fidl_fuchsia_unknown::CloseableCloseResult,
1903        fidl::encoding::DefaultFuchsiaResourceDialect,
1904    > {
1905        DirectoryProxyInterface::r#close(self)
1906    }
1907
1908    pub fn r#query(
1909        &self,
1910    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
1911    {
1912        DirectoryProxyInterface::r#query(self)
1913    }
1914
1915    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1916    pub fn r#deprecated_clone(
1917        &self,
1918        mut flags: OpenFlags,
1919        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1920    ) -> Result<(), fidl::Error> {
1921        DirectoryProxyInterface::r#deprecated_clone(self, flags, object)
1922    }
1923
1924    /// DEPRECATED - Use `Node.GetAttributes` instead.
1925    pub fn r#deprecated_get_attr(
1926        &self,
1927    ) -> fidl::client::QueryResponseFut<
1928        (i32, NodeAttributes),
1929        fidl::encoding::DefaultFuchsiaResourceDialect,
1930    > {
1931        DirectoryProxyInterface::r#deprecated_get_attr(self)
1932    }
1933
1934    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1935    pub fn r#deprecated_set_attr(
1936        &self,
1937        mut flags: NodeAttributeFlags,
1938        mut attributes: &NodeAttributes,
1939    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
1940        DirectoryProxyInterface::r#deprecated_set_attr(self, flags, attributes)
1941    }
1942
1943    /// [DEPRECATED - Use new GetFlags method instead.]
1944    pub fn r#deprecated_get_flags(
1945        &self,
1946    ) -> fidl::client::QueryResponseFut<
1947        (i32, OpenFlags),
1948        fidl::encoding::DefaultFuchsiaResourceDialect,
1949    > {
1950        DirectoryProxyInterface::r#deprecated_get_flags(self)
1951    }
1952
1953    /// [DEPRECATED - Use new SetFlags method instead.]
1954    pub fn r#deprecated_set_flags(
1955        &self,
1956        mut flags: OpenFlags,
1957    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
1958        DirectoryProxyInterface::r#deprecated_set_flags(self, flags)
1959    }
1960
1961    /// Queries the flags that apply to this node after it has been opened/created. This method does
1962    /// not require any rights.
1963    ///
1964    /// Note that the final set of flags that apply to the connection may differ from those
1965    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1966    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1967    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1968    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1969    pub fn r#get_flags(
1970        &self,
1971    ) -> fidl::client::QueryResponseFut<
1972        NodeGetFlagsResult,
1973        fidl::encoding::DefaultFuchsiaResourceDialect,
1974    > {
1975        DirectoryProxyInterface::r#get_flags(self)
1976    }
1977
1978    /// Sets the flags that apply to this node after it has been opened. This method does not
1979    /// require any rights.
1980    ///
1981    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1982    /// clear append mode.
1983    ///
1984    /// Errors:
1985    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1986    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1987    pub fn r#set_flags(
1988        &self,
1989        mut flags: Flags,
1990    ) -> fidl::client::QueryResponseFut<
1991        NodeSetFlagsResult,
1992        fidl::encoding::DefaultFuchsiaResourceDialect,
1993    > {
1994        DirectoryProxyInterface::r#set_flags(self, flags)
1995    }
1996
1997    /// Query the filesystem for filesystem-specific information.
1998    pub fn r#query_filesystem(
1999        &self,
2000    ) -> fidl::client::QueryResponseFut<
2001        (i32, Option<Box<FilesystemInfo>>),
2002        fidl::encoding::DefaultFuchsiaResourceDialect,
2003    > {
2004        DirectoryProxyInterface::r#query_filesystem(self)
2005    }
2006
2007    /// Acquires information about the node.
2008    ///
2009    /// The attributes of a node should be stable, independent of the
2010    /// specific protocol used to access it.
2011    ///
2012    /// If a particular attribute is not applicable or not supported,
2013    /// filesystems should leave the corresponding field absent.
2014    ///
2015    /// + `query` a bit-mask specifying which attributes to fetch. The server
2016    ///   should not return more than necessary.
2017    /// - `attributes` the returned attributes.
2018    ///
2019    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2020    pub fn r#get_attributes(
2021        &self,
2022        mut query: NodeAttributesQuery,
2023    ) -> fidl::client::QueryResponseFut<
2024        NodeGetAttributesResult,
2025        fidl::encoding::DefaultFuchsiaResourceDialect,
2026    > {
2027        DirectoryProxyInterface::r#get_attributes(self, query)
2028    }
2029
2030    /// Updates information about the node.
2031    ///
2032    /// + `attributes` the presence of a table field in `attributes` indicates
2033    /// the intent to update the corresponding attribute.
2034    ///
2035    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
2036    ///
2037    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2038    pub fn r#update_attributes(
2039        &self,
2040        mut payload: &MutableNodeAttributes,
2041    ) -> fidl::client::QueryResponseFut<
2042        NodeUpdateAttributesResult,
2043        fidl::encoding::DefaultFuchsiaResourceDialect,
2044    > {
2045        DirectoryProxyInterface::r#update_attributes(self, payload)
2046    }
2047
2048    /// Synchronizes updates to the node to the underlying media, if it exists.
2049    ///
2050    /// This method will return when the filesystem server has flushed the
2051    /// relevant updates to the underlying media, but does not guarantee the
2052    /// underlying media has persisted the information, nor that any information
2053    /// is committed to hardware. Clients may use `Sync` to ensure ordering
2054    /// between operations.
2055    ///
2056    /// This method does not require any rights.
2057    pub fn r#sync(
2058        &self,
2059    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
2060    {
2061        DirectoryProxyInterface::r#sync(self)
2062    }
2063
2064    /// Creates an iterator over all the extended attribute names associated
2065    /// with this node. If an error occurs it is returned as an epitaph on the
2066    /// iterator request channel, and then the channel is closed.
2067    ///
2068    /// GetExtendedAttributes can be used with any of these names to retrieve
2069    /// the associated value.
2070    ///
2071    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2072    pub fn r#list_extended_attributes(
2073        &self,
2074        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2075    ) -> Result<(), fidl::Error> {
2076        DirectoryProxyInterface::r#list_extended_attributes(self, iterator)
2077    }
2078
2079    /// Get the value associated with the given attribute `name` for this node.
2080    ///
2081    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
2082    /// particular structure is imposed on them.
2083    ///
2084    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2085    pub fn r#get_extended_attribute(
2086        &self,
2087        mut name: &[u8],
2088    ) -> fidl::client::QueryResponseFut<
2089        NodeGetExtendedAttributeResult,
2090        fidl::encoding::DefaultFuchsiaResourceDialect,
2091    > {
2092        DirectoryProxyInterface::r#get_extended_attribute(self, name)
2093    }
2094
2095    /// Set the value for the given attribute `name` to `value` for this node.
2096    ///
2097    /// The attribute name may exist, in which case the attribute is updated.
2098    /// If the attribute doesn't exist, it is created. The name should have no
2099    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
2100    ///
2101    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2102    pub fn r#set_extended_attribute(
2103        &self,
2104        mut name: &[u8],
2105        mut value: ExtendedAttributeValue,
2106        mut mode: SetExtendedAttributeMode,
2107    ) -> fidl::client::QueryResponseFut<
2108        NodeSetExtendedAttributeResult,
2109        fidl::encoding::DefaultFuchsiaResourceDialect,
2110    > {
2111        DirectoryProxyInterface::r#set_extended_attribute(self, name, value, mode)
2112    }
2113
2114    /// Remove the specified extended attribute.
2115    ///
2116    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
2117    ///
2118    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2119    pub fn r#remove_extended_attribute(
2120        &self,
2121        mut name: &[u8],
2122    ) -> fidl::client::QueryResponseFut<
2123        NodeRemoveExtendedAttributeResult,
2124        fidl::encoding::DefaultFuchsiaResourceDialect,
2125    > {
2126        DirectoryProxyInterface::r#remove_extended_attribute(self, name)
2127    }
2128
2129    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
2130    pub fn r#deprecated_open(
2131        &self,
2132        mut flags: OpenFlags,
2133        mut mode: ModeType,
2134        mut path: &str,
2135        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2136    ) -> Result<(), fidl::Error> {
2137        DirectoryProxyInterface::r#deprecated_open(self, flags, mode, path, object)
2138    }
2139
2140    /// Open (or create) a node relative to this directory. Any errors are communicated via an
2141    /// epitaph sent on the `object` channel.
2142    ///
2143    /// Errors:
2144    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
2145    /// * See [`Flags`] for other errors which may be communicated based on `flags`
2146    pub fn r#open(
2147        &self,
2148        mut path: &str,
2149        mut flags: Flags,
2150        mut options: &Options,
2151        mut object: fidl::Channel,
2152    ) -> Result<(), fidl::Error> {
2153        DirectoryProxyInterface::r#open(self, path, flags, options, object)
2154    }
2155
2156    /// Reads a collection of variably sized dirents into a buffer.
2157    /// The number of dirents in a directory may be very large: akin to
2158    /// calling read multiple times on a file, directories have a seek
2159    /// offset which is updated on subsequent calls to ReadDirents.
2160    /// Each call to ReadDirents will only return whole dirent structures,
2161    /// they will not get split across ReadDirent calls. When the seek
2162    /// offset reaches the end, `dirents` will be empty.
2163    ///
2164    /// These dirents are of the form:
2165    /// ```
2166    /// struct dirent {
2167    ///   // Describes the inode of the entry.
2168    ///   uint64 ino;
2169    ///   // Describes the length of the dirent name in bytes.
2170    ///   uint8 size;
2171    ///   // Describes the type of the entry. Aligned with the
2172    ///   // POSIX d_type values. Use `DirentType` constants.
2173    ///   uint8 type;
2174    ///   // Unterminated name of entry.
2175    ///   char name[0];
2176    /// }
2177    /// ```
2178    ///
2179    /// This method does not require any rights, since one could always probe for
2180    /// directory contents by triggering name conflicts during file creation.
2181    pub fn r#read_dirents(
2182        &self,
2183        mut max_bytes: u64,
2184    ) -> fidl::client::QueryResponseFut<(i32, Vec<u8>), fidl::encoding::DefaultFuchsiaResourceDialect>
2185    {
2186        DirectoryProxyInterface::r#read_dirents(self, max_bytes)
2187    }
2188
2189    /// Resets the directory seek offset.
2190    ///
2191    /// This method does not require any rights, similar to ReadDirents.
2192    pub fn r#rewind(
2193        &self,
2194    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2195        DirectoryProxyInterface::r#rewind(self)
2196    }
2197
2198    /// Acquires a token to a Directory which can be used to identify access to it at a later point
2199    /// in time. The token will remain valid for as long as the connection requesting the token
2200    /// remains open.
2201    ///
2202    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
2203    /// `ZX_ERR_BAD_HANDLE`.
2204    pub fn r#get_token(
2205        &self,
2206    ) -> fidl::client::QueryResponseFut<
2207        (i32, Option<fidl::Handle>),
2208        fidl::encoding::DefaultFuchsiaResourceDialect,
2209    > {
2210        DirectoryProxyInterface::r#get_token(self)
2211    }
2212
2213    /// Creates a link to an object named src by the name dst, within a directory represented by
2214    /// token.
2215    ///
2216    /// `src` must be a resolved object name. Including "/" in the string will
2217    /// return `ZX_ERR_INVALID_ARGS`.
2218    ///
2219    /// `dst` must be a resolved object name. Including "/" in the string will
2220    /// return `ZX_ERR_INVALID_ARGS`.
2221    ///
2222    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
2223    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
2224    ///
2225    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
2226    /// there are two actors operating concurrently, and one actor performs a rename that affects
2227    /// the source within this directory, and the other does a link, each will appear to occur
2228    /// atomically in an unspecified order.
2229    pub fn r#link(
2230        &self,
2231        mut src: &str,
2232        mut dst_parent_token: fidl::Handle,
2233        mut dst: &str,
2234    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2235        DirectoryProxyInterface::r#link(self, src, dst_parent_token, dst)
2236    }
2237
2238    /// Removes a child node from the this directory's list of entries.
2239    ///
2240    /// Note: this does not guarantee that the underlying object is destroyed.
2241    /// Although the link will be removed from the containing directory,
2242    /// objects with multiple references (such as files which are still open)
2243    /// will not actually be destroyed until all references are closed.
2244    ///
2245    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
2246    ///   [`Rights.WRITE_BYTES`].
2247    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
2248    ///   support writing.
2249    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
2250    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
2251    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
2252    ///   containing a remote channel.
2253    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
2254    ///     something other than a directory was found.
2255    ///
2256    /// Other errors may be returned for filesystem-specific reasons.
2257    ///
2258    /// This method requires the following rights:
2259    ///
2260    /// * [`Rights.ENUMERATE`]
2261    /// * [`Rights.MODIFY_DIRECTORY`]
2262    pub fn r#unlink(
2263        &self,
2264        mut name: &str,
2265        mut options: &UnlinkOptions,
2266    ) -> fidl::client::QueryResponseFut<
2267        DirectoryUnlinkResult,
2268        fidl::encoding::DefaultFuchsiaResourceDialect,
2269    > {
2270        DirectoryProxyInterface::r#unlink(self, name, options)
2271    }
2272
2273    /// Renames a node named `src` to the name `dst`, in a directory represented
2274    /// by `dst_parent_token`.
2275    ///
2276    /// `src` and `dst` must be valid node names.
2277    /// See [`Name`] for what constitutes a valid name.
2278    ///
2279    /// This method requires the following rights on both the current connection, and the connection
2280    /// identified by `dst_parent_token`:
2281    ///
2282    /// * [`Rights.ENUMERATE`]
2283    /// * [`Rights.MODIFY_DIRECTORY`]
2284    ///
2285    /// The following requirements are necessary to avoid rights escalations.
2286    ///
2287    /// If the source and destination directory differ, the source directory must also have the
2288    /// maximal set of abilities supported for files, which would typically be
2289    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
2290    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
2291    /// right.
2292    ///
2293    /// If `src` refers to a directory, and differs from the destination directory, then the source
2294    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
2295    ///
2296    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
2297    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
2298    pub fn r#rename(
2299        &self,
2300        mut src: &str,
2301        mut dst_parent_token: fidl::Event,
2302        mut dst: &str,
2303    ) -> fidl::client::QueryResponseFut<
2304        DirectoryRenameResult,
2305        fidl::encoding::DefaultFuchsiaResourceDialect,
2306    > {
2307        DirectoryProxyInterface::r#rename(self, src, dst_parent_token, dst)
2308    }
2309
2310    /// Creates a symbolic link.
2311    ///
2312    /// `name` is the name to be given to the created symbolic link.
2313    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
2314    /// will perform no validation of `target` except for a server chosen maximum length.
2315    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
2316    /// on the successfully created node.
2317    ///
2318    /// * [`Rights.MODIFY_DIRECTORY`]
2319    ///
2320    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
2321    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
2322    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
2323    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
2324    pub fn r#create_symlink(
2325        &self,
2326        mut name: &str,
2327        mut target: &[u8],
2328        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
2329    ) -> fidl::client::QueryResponseFut<
2330        DirectoryCreateSymlinkResult,
2331        fidl::encoding::DefaultFuchsiaResourceDialect,
2332    > {
2333        DirectoryProxyInterface::r#create_symlink(self, name, target, connection)
2334    }
2335
2336    /// Watches a directory, receiving events of added messages on the
2337    /// watcher request channel.
2338    ///
2339    /// Options must be zero; it is reserved.
2340    ///
2341    /// This method does not require any rights, similar to ReadDirents.
2342    pub fn r#watch(
2343        &self,
2344        mut mask: WatchMask,
2345        mut options: u32,
2346        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
2347    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2348        DirectoryProxyInterface::r#watch(self, mask, options, watcher)
2349    }
2350}
2351
2352impl DirectoryProxyInterface for DirectoryProxy {
2353    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
2354        AdvisoryLockingAdvisoryLockResult,
2355        fidl::encoding::DefaultFuchsiaResourceDialect,
2356    >;
2357    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
2358        fn _decode(
2359            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2360        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
2361            let _response = fidl::client::decode_transaction_body::<
2362                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2363                fidl::encoding::DefaultFuchsiaResourceDialect,
2364                0x6ee9c0ad53ec87aa,
2365            >(_buf?)?;
2366            Ok(_response.map(|x| x))
2367        }
2368        self.client.send_query_and_decode::<
2369            AdvisoryLockingAdvisoryLockRequest,
2370            AdvisoryLockingAdvisoryLockResult,
2371        >(
2372            (request,),
2373            0x6ee9c0ad53ec87aa,
2374            fidl::encoding::DynamicFlags::empty(),
2375            _decode,
2376        )
2377    }
2378
2379    fn r#clone(
2380        &self,
2381        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
2382    ) -> Result<(), fidl::Error> {
2383        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
2384            (request,),
2385            0x20d8a7aba2168a79,
2386            fidl::encoding::DynamicFlags::empty(),
2387        )
2388    }
2389
2390    type CloseResponseFut = fidl::client::QueryResponseFut<
2391        fidl_fuchsia_unknown::CloseableCloseResult,
2392        fidl::encoding::DefaultFuchsiaResourceDialect,
2393    >;
2394    fn r#close(&self) -> Self::CloseResponseFut {
2395        fn _decode(
2396            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2397        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
2398            let _response = fidl::client::decode_transaction_body::<
2399                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2400                fidl::encoding::DefaultFuchsiaResourceDialect,
2401                0x5ac5d459ad7f657e,
2402            >(_buf?)?;
2403            Ok(_response.map(|x| x))
2404        }
2405        self.client.send_query_and_decode::<
2406            fidl::encoding::EmptyPayload,
2407            fidl_fuchsia_unknown::CloseableCloseResult,
2408        >(
2409            (),
2410            0x5ac5d459ad7f657e,
2411            fidl::encoding::DynamicFlags::empty(),
2412            _decode,
2413        )
2414    }
2415
2416    type QueryResponseFut =
2417        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2418    fn r#query(&self) -> Self::QueryResponseFut {
2419        fn _decode(
2420            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2421        ) -> Result<Vec<u8>, fidl::Error> {
2422            let _response = fidl::client::decode_transaction_body::<
2423                fidl_fuchsia_unknown::QueryableQueryResponse,
2424                fidl::encoding::DefaultFuchsiaResourceDialect,
2425                0x2658edee9decfc06,
2426            >(_buf?)?;
2427            Ok(_response.protocol)
2428        }
2429        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
2430            (),
2431            0x2658edee9decfc06,
2432            fidl::encoding::DynamicFlags::empty(),
2433            _decode,
2434        )
2435    }
2436
2437    fn r#deprecated_clone(
2438        &self,
2439        mut flags: OpenFlags,
2440        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2441    ) -> Result<(), fidl::Error> {
2442        self.client.send::<NodeDeprecatedCloneRequest>(
2443            (flags, object),
2444            0x5a61678f293ce16f,
2445            fidl::encoding::DynamicFlags::FLEXIBLE,
2446        )
2447    }
2448
2449    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
2450        (i32, NodeAttributes),
2451        fidl::encoding::DefaultFuchsiaResourceDialect,
2452    >;
2453    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
2454        fn _decode(
2455            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2456        ) -> Result<(i32, NodeAttributes), fidl::Error> {
2457            let _response = fidl::client::decode_transaction_body::<
2458                NodeDeprecatedGetAttrResponse,
2459                fidl::encoding::DefaultFuchsiaResourceDialect,
2460                0x78985e216314dafd,
2461            >(_buf?)?;
2462            Ok((_response.s, _response.attributes))
2463        }
2464        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
2465            (),
2466            0x78985e216314dafd,
2467            fidl::encoding::DynamicFlags::empty(),
2468            _decode,
2469        )
2470    }
2471
2472    type DeprecatedSetAttrResponseFut =
2473        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2474    fn r#deprecated_set_attr(
2475        &self,
2476        mut flags: NodeAttributeFlags,
2477        mut attributes: &NodeAttributes,
2478    ) -> Self::DeprecatedSetAttrResponseFut {
2479        fn _decode(
2480            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2481        ) -> Result<i32, fidl::Error> {
2482            let _response = fidl::client::decode_transaction_body::<
2483                NodeDeprecatedSetAttrResponse,
2484                fidl::encoding::DefaultFuchsiaResourceDialect,
2485                0x4186c0f40d938f46,
2486            >(_buf?)?;
2487            Ok(_response.s)
2488        }
2489        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
2490            (flags, attributes),
2491            0x4186c0f40d938f46,
2492            fidl::encoding::DynamicFlags::empty(),
2493            _decode,
2494        )
2495    }
2496
2497    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
2498        (i32, OpenFlags),
2499        fidl::encoding::DefaultFuchsiaResourceDialect,
2500    >;
2501    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
2502        fn _decode(
2503            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2504        ) -> Result<(i32, OpenFlags), fidl::Error> {
2505            let _response = fidl::client::decode_transaction_body::<
2506                NodeDeprecatedGetFlagsResponse,
2507                fidl::encoding::DefaultFuchsiaResourceDialect,
2508                0x5b88fffb8eda3aa1,
2509            >(_buf?)?;
2510            Ok((_response.s, _response.flags))
2511        }
2512        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
2513            (),
2514            0x5b88fffb8eda3aa1,
2515            fidl::encoding::DynamicFlags::empty(),
2516            _decode,
2517        )
2518    }
2519
2520    type DeprecatedSetFlagsResponseFut =
2521        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2522    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
2523        fn _decode(
2524            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2525        ) -> Result<i32, fidl::Error> {
2526            let _response = fidl::client::decode_transaction_body::<
2527                NodeDeprecatedSetFlagsResponse,
2528                fidl::encoding::DefaultFuchsiaResourceDialect,
2529                0x5295b76c71fde733,
2530            >(_buf?)?;
2531            Ok(_response.s)
2532        }
2533        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
2534            (flags,),
2535            0x5295b76c71fde733,
2536            fidl::encoding::DynamicFlags::empty(),
2537            _decode,
2538        )
2539    }
2540
2541    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
2542        NodeGetFlagsResult,
2543        fidl::encoding::DefaultFuchsiaResourceDialect,
2544    >;
2545    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
2546        fn _decode(
2547            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2548        ) -> Result<NodeGetFlagsResult, fidl::Error> {
2549            let _response = fidl::client::decode_transaction_body::<
2550                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
2551                fidl::encoding::DefaultFuchsiaResourceDialect,
2552                0x176eb318f64ec23,
2553            >(_buf?)?
2554            .into_result::<DirectoryMarker>("get_flags")?;
2555            Ok(_response.map(|x| x.flags))
2556        }
2557        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
2558            (),
2559            0x176eb318f64ec23,
2560            fidl::encoding::DynamicFlags::FLEXIBLE,
2561            _decode,
2562        )
2563    }
2564
2565    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
2566        NodeSetFlagsResult,
2567        fidl::encoding::DefaultFuchsiaResourceDialect,
2568    >;
2569    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
2570        fn _decode(
2571            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2572        ) -> Result<NodeSetFlagsResult, fidl::Error> {
2573            let _response = fidl::client::decode_transaction_body::<
2574                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2575                fidl::encoding::DefaultFuchsiaResourceDialect,
2576                0x55a8028685791ea8,
2577            >(_buf?)?
2578            .into_result::<DirectoryMarker>("set_flags")?;
2579            Ok(_response.map(|x| x))
2580        }
2581        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
2582            (flags,),
2583            0x55a8028685791ea8,
2584            fidl::encoding::DynamicFlags::FLEXIBLE,
2585            _decode,
2586        )
2587    }
2588
2589    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
2590        (i32, Option<Box<FilesystemInfo>>),
2591        fidl::encoding::DefaultFuchsiaResourceDialect,
2592    >;
2593    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
2594        fn _decode(
2595            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2596        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
2597            let _response = fidl::client::decode_transaction_body::<
2598                NodeQueryFilesystemResponse,
2599                fidl::encoding::DefaultFuchsiaResourceDialect,
2600                0x6f344a1c6b0a0610,
2601            >(_buf?)?;
2602            Ok((_response.s, _response.info))
2603        }
2604        self.client.send_query_and_decode::<
2605            fidl::encoding::EmptyPayload,
2606            (i32, Option<Box<FilesystemInfo>>),
2607        >(
2608            (),
2609            0x6f344a1c6b0a0610,
2610            fidl::encoding::DynamicFlags::empty(),
2611            _decode,
2612        )
2613    }
2614
2615    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
2616        NodeGetAttributesResult,
2617        fidl::encoding::DefaultFuchsiaResourceDialect,
2618    >;
2619    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
2620        fn _decode(
2621            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2622        ) -> Result<NodeGetAttributesResult, fidl::Error> {
2623            let _response = fidl::client::decode_transaction_body::<
2624                fidl::encoding::ResultType<NodeAttributes2, i32>,
2625                fidl::encoding::DefaultFuchsiaResourceDialect,
2626                0x3d4396a638ea053b,
2627            >(_buf?)?;
2628            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
2629        }
2630        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
2631            (query,),
2632            0x3d4396a638ea053b,
2633            fidl::encoding::DynamicFlags::empty(),
2634            _decode,
2635        )
2636    }
2637
2638    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
2639        NodeUpdateAttributesResult,
2640        fidl::encoding::DefaultFuchsiaResourceDialect,
2641    >;
2642    fn r#update_attributes(
2643        &self,
2644        mut payload: &MutableNodeAttributes,
2645    ) -> Self::UpdateAttributesResponseFut {
2646        fn _decode(
2647            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2648        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
2649            let _response = fidl::client::decode_transaction_body::<
2650                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2651                fidl::encoding::DefaultFuchsiaResourceDialect,
2652                0x3308c1da5a89bf08,
2653            >(_buf?)?;
2654            Ok(_response.map(|x| x))
2655        }
2656        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
2657            payload,
2658            0x3308c1da5a89bf08,
2659            fidl::encoding::DynamicFlags::empty(),
2660            _decode,
2661        )
2662    }
2663
2664    type SyncResponseFut = fidl::client::QueryResponseFut<
2665        NodeSyncResult,
2666        fidl::encoding::DefaultFuchsiaResourceDialect,
2667    >;
2668    fn r#sync(&self) -> Self::SyncResponseFut {
2669        fn _decode(
2670            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2671        ) -> Result<NodeSyncResult, fidl::Error> {
2672            let _response = fidl::client::decode_transaction_body::<
2673                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2674                fidl::encoding::DefaultFuchsiaResourceDialect,
2675                0x2c5c27ca0ab5dc49,
2676            >(_buf?)?;
2677            Ok(_response.map(|x| x))
2678        }
2679        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
2680            (),
2681            0x2c5c27ca0ab5dc49,
2682            fidl::encoding::DynamicFlags::empty(),
2683            _decode,
2684        )
2685    }
2686
2687    fn r#list_extended_attributes(
2688        &self,
2689        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2690    ) -> Result<(), fidl::Error> {
2691        self.client.send::<NodeListExtendedAttributesRequest>(
2692            (iterator,),
2693            0x4b61033de007fcd0,
2694            fidl::encoding::DynamicFlags::empty(),
2695        )
2696    }
2697
2698    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2699        NodeGetExtendedAttributeResult,
2700        fidl::encoding::DefaultFuchsiaResourceDialect,
2701    >;
2702    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
2703        fn _decode(
2704            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2705        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
2706            let _response = fidl::client::decode_transaction_body::<
2707                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
2708                fidl::encoding::DefaultFuchsiaResourceDialect,
2709                0x45ffa3ccfdeb76db,
2710            >(_buf?)?;
2711            Ok(_response.map(|x| x))
2712        }
2713        self.client.send_query_and_decode::<
2714            NodeGetExtendedAttributeRequest,
2715            NodeGetExtendedAttributeResult,
2716        >(
2717            (name,),
2718            0x45ffa3ccfdeb76db,
2719            fidl::encoding::DynamicFlags::empty(),
2720            _decode,
2721        )
2722    }
2723
2724    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2725        NodeSetExtendedAttributeResult,
2726        fidl::encoding::DefaultFuchsiaResourceDialect,
2727    >;
2728    fn r#set_extended_attribute(
2729        &self,
2730        mut name: &[u8],
2731        mut value: ExtendedAttributeValue,
2732        mut mode: SetExtendedAttributeMode,
2733    ) -> Self::SetExtendedAttributeResponseFut {
2734        fn _decode(
2735            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2736        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
2737            let _response = fidl::client::decode_transaction_body::<
2738                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2739                fidl::encoding::DefaultFuchsiaResourceDialect,
2740                0x4a951362f681f23c,
2741            >(_buf?)?;
2742            Ok(_response.map(|x| x))
2743        }
2744        self.client.send_query_and_decode::<
2745            NodeSetExtendedAttributeRequest,
2746            NodeSetExtendedAttributeResult,
2747        >(
2748            (name, &mut value, mode,),
2749            0x4a951362f681f23c,
2750            fidl::encoding::DynamicFlags::empty(),
2751            _decode,
2752        )
2753    }
2754
2755    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2756        NodeRemoveExtendedAttributeResult,
2757        fidl::encoding::DefaultFuchsiaResourceDialect,
2758    >;
2759    fn r#remove_extended_attribute(
2760        &self,
2761        mut name: &[u8],
2762    ) -> Self::RemoveExtendedAttributeResponseFut {
2763        fn _decode(
2764            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2765        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
2766            let _response = fidl::client::decode_transaction_body::<
2767                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2768                fidl::encoding::DefaultFuchsiaResourceDialect,
2769                0x7a0b9f3a9bf9032d,
2770            >(_buf?)?;
2771            Ok(_response.map(|x| x))
2772        }
2773        self.client.send_query_and_decode::<
2774            NodeRemoveExtendedAttributeRequest,
2775            NodeRemoveExtendedAttributeResult,
2776        >(
2777            (name,),
2778            0x7a0b9f3a9bf9032d,
2779            fidl::encoding::DynamicFlags::empty(),
2780            _decode,
2781        )
2782    }
2783
2784    fn r#deprecated_open(
2785        &self,
2786        mut flags: OpenFlags,
2787        mut mode: ModeType,
2788        mut path: &str,
2789        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2790    ) -> Result<(), fidl::Error> {
2791        self.client.send::<DirectoryDeprecatedOpenRequest>(
2792            (flags, mode, path, object),
2793            0x2c5044561d685ec0,
2794            fidl::encoding::DynamicFlags::FLEXIBLE,
2795        )
2796    }
2797
2798    fn r#open(
2799        &self,
2800        mut path: &str,
2801        mut flags: Flags,
2802        mut options: &Options,
2803        mut object: fidl::Channel,
2804    ) -> Result<(), fidl::Error> {
2805        self.client.send::<DirectoryOpenRequest>(
2806            (path, flags, options, object),
2807            0x568ddcb9a9cbb6d9,
2808            fidl::encoding::DynamicFlags::empty(),
2809        )
2810    }
2811
2812    type ReadDirentsResponseFut = fidl::client::QueryResponseFut<
2813        (i32, Vec<u8>),
2814        fidl::encoding::DefaultFuchsiaResourceDialect,
2815    >;
2816    fn r#read_dirents(&self, mut max_bytes: u64) -> Self::ReadDirentsResponseFut {
2817        fn _decode(
2818            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2819        ) -> Result<(i32, Vec<u8>), fidl::Error> {
2820            let _response = fidl::client::decode_transaction_body::<
2821                DirectoryReadDirentsResponse,
2822                fidl::encoding::DefaultFuchsiaResourceDialect,
2823                0x3582806bf27faa0a,
2824            >(_buf?)?;
2825            Ok((_response.s, _response.dirents))
2826        }
2827        self.client.send_query_and_decode::<DirectoryReadDirentsRequest, (i32, Vec<u8>)>(
2828            (max_bytes,),
2829            0x3582806bf27faa0a,
2830            fidl::encoding::DynamicFlags::empty(),
2831            _decode,
2832        )
2833    }
2834
2835    type RewindResponseFut =
2836        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2837    fn r#rewind(&self) -> Self::RewindResponseFut {
2838        fn _decode(
2839            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2840        ) -> Result<i32, fidl::Error> {
2841            let _response = fidl::client::decode_transaction_body::<
2842                DirectoryRewindResponse,
2843                fidl::encoding::DefaultFuchsiaResourceDialect,
2844                0x16b1202af0f34c71,
2845            >(_buf?)?;
2846            Ok(_response.s)
2847        }
2848        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
2849            (),
2850            0x16b1202af0f34c71,
2851            fidl::encoding::DynamicFlags::empty(),
2852            _decode,
2853        )
2854    }
2855
2856    type GetTokenResponseFut = fidl::client::QueryResponseFut<
2857        (i32, Option<fidl::Handle>),
2858        fidl::encoding::DefaultFuchsiaResourceDialect,
2859    >;
2860    fn r#get_token(&self) -> Self::GetTokenResponseFut {
2861        fn _decode(
2862            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2863        ) -> Result<(i32, Option<fidl::Handle>), fidl::Error> {
2864            let _response = fidl::client::decode_transaction_body::<
2865                DirectoryGetTokenResponse,
2866                fidl::encoding::DefaultFuchsiaResourceDialect,
2867                0x26ae9d18763c8655,
2868            >(_buf?)?;
2869            Ok((_response.s, _response.token))
2870        }
2871        self.client
2872            .send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, Option<fidl::Handle>)>(
2873                (),
2874                0x26ae9d18763c8655,
2875                fidl::encoding::DynamicFlags::empty(),
2876                _decode,
2877            )
2878    }
2879
2880    type LinkResponseFut =
2881        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2882    fn r#link(
2883        &self,
2884        mut src: &str,
2885        mut dst_parent_token: fidl::Handle,
2886        mut dst: &str,
2887    ) -> Self::LinkResponseFut {
2888        fn _decode(
2889            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2890        ) -> Result<i32, fidl::Error> {
2891            let _response = fidl::client::decode_transaction_body::<
2892                DirectoryLinkResponse,
2893                fidl::encoding::DefaultFuchsiaResourceDialect,
2894                0x740604c0c7c930e7,
2895            >(_buf?)?;
2896            Ok(_response.s)
2897        }
2898        self.client.send_query_and_decode::<DirectoryLinkRequest, i32>(
2899            (src, dst_parent_token, dst),
2900            0x740604c0c7c930e7,
2901            fidl::encoding::DynamicFlags::empty(),
2902            _decode,
2903        )
2904    }
2905
2906    type UnlinkResponseFut = fidl::client::QueryResponseFut<
2907        DirectoryUnlinkResult,
2908        fidl::encoding::DefaultFuchsiaResourceDialect,
2909    >;
2910    fn r#unlink(&self, mut name: &str, mut options: &UnlinkOptions) -> Self::UnlinkResponseFut {
2911        fn _decode(
2912            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2913        ) -> Result<DirectoryUnlinkResult, fidl::Error> {
2914            let _response = fidl::client::decode_transaction_body::<
2915                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2916                fidl::encoding::DefaultFuchsiaResourceDialect,
2917                0x750a0326a78d7bed,
2918            >(_buf?)?;
2919            Ok(_response.map(|x| x))
2920        }
2921        self.client.send_query_and_decode::<DirectoryUnlinkRequest, DirectoryUnlinkResult>(
2922            (name, options),
2923            0x750a0326a78d7bed,
2924            fidl::encoding::DynamicFlags::empty(),
2925            _decode,
2926        )
2927    }
2928
2929    type RenameResponseFut = fidl::client::QueryResponseFut<
2930        DirectoryRenameResult,
2931        fidl::encoding::DefaultFuchsiaResourceDialect,
2932    >;
2933    fn r#rename(
2934        &self,
2935        mut src: &str,
2936        mut dst_parent_token: fidl::Event,
2937        mut dst: &str,
2938    ) -> Self::RenameResponseFut {
2939        fn _decode(
2940            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2941        ) -> Result<DirectoryRenameResult, fidl::Error> {
2942            let _response = fidl::client::decode_transaction_body::<
2943                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2944                fidl::encoding::DefaultFuchsiaResourceDialect,
2945                0x7060e7723b9928de,
2946            >(_buf?)?;
2947            Ok(_response.map(|x| x))
2948        }
2949        self.client.send_query_and_decode::<DirectoryRenameRequest, DirectoryRenameResult>(
2950            (src, dst_parent_token, dst),
2951            0x7060e7723b9928de,
2952            fidl::encoding::DynamicFlags::empty(),
2953            _decode,
2954        )
2955    }
2956
2957    type CreateSymlinkResponseFut = fidl::client::QueryResponseFut<
2958        DirectoryCreateSymlinkResult,
2959        fidl::encoding::DefaultFuchsiaResourceDialect,
2960    >;
2961    fn r#create_symlink(
2962        &self,
2963        mut name: &str,
2964        mut target: &[u8],
2965        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
2966    ) -> Self::CreateSymlinkResponseFut {
2967        fn _decode(
2968            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2969        ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
2970            let _response = fidl::client::decode_transaction_body::<
2971                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2972                fidl::encoding::DefaultFuchsiaResourceDialect,
2973                0x21ce0f19ec043889,
2974            >(_buf?)?;
2975            Ok(_response.map(|x| x))
2976        }
2977        self.client
2978            .send_query_and_decode::<DirectoryCreateSymlinkRequest, DirectoryCreateSymlinkResult>(
2979                (name, target, connection),
2980                0x21ce0f19ec043889,
2981                fidl::encoding::DynamicFlags::empty(),
2982                _decode,
2983            )
2984    }
2985
2986    type WatchResponseFut =
2987        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2988    fn r#watch(
2989        &self,
2990        mut mask: WatchMask,
2991        mut options: u32,
2992        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
2993    ) -> Self::WatchResponseFut {
2994        fn _decode(
2995            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2996        ) -> Result<i32, fidl::Error> {
2997            let _response = fidl::client::decode_transaction_body::<
2998                DirectoryWatchResponse,
2999                fidl::encoding::DefaultFuchsiaResourceDialect,
3000                0x5717193a59d66d91,
3001            >(_buf?)?;
3002            Ok(_response.s)
3003        }
3004        self.client.send_query_and_decode::<DirectoryWatchRequest, i32>(
3005            (mask, options, watcher),
3006            0x5717193a59d66d91,
3007            fidl::encoding::DynamicFlags::empty(),
3008            _decode,
3009        )
3010    }
3011}
3012
3013pub struct DirectoryEventStream {
3014    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3015}
3016
3017impl std::marker::Unpin for DirectoryEventStream {}
3018
3019impl futures::stream::FusedStream for DirectoryEventStream {
3020    fn is_terminated(&self) -> bool {
3021        self.event_receiver.is_terminated()
3022    }
3023}
3024
3025impl futures::Stream for DirectoryEventStream {
3026    type Item = Result<DirectoryEvent, fidl::Error>;
3027
3028    fn poll_next(
3029        mut self: std::pin::Pin<&mut Self>,
3030        cx: &mut std::task::Context<'_>,
3031    ) -> std::task::Poll<Option<Self::Item>> {
3032        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3033            &mut self.event_receiver,
3034            cx
3035        )?) {
3036            Some(buf) => std::task::Poll::Ready(Some(DirectoryEvent::decode(buf))),
3037            None => std::task::Poll::Ready(None),
3038        }
3039    }
3040}
3041
3042#[derive(Debug)]
3043pub enum DirectoryEvent {
3044    OnOpen_ {
3045        s: i32,
3046        info: Option<Box<NodeInfoDeprecated>>,
3047    },
3048    OnRepresentation {
3049        payload: Representation,
3050    },
3051    #[non_exhaustive]
3052    _UnknownEvent {
3053        /// Ordinal of the event that was sent.
3054        ordinal: u64,
3055    },
3056}
3057
3058impl DirectoryEvent {
3059    #[allow(irrefutable_let_patterns)]
3060    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
3061        if let DirectoryEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
3062    }
3063    #[allow(irrefutable_let_patterns)]
3064    pub fn into_on_representation(self) -> Option<Representation> {
3065        if let DirectoryEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
3066    }
3067
3068    /// Decodes a message buffer as a [`DirectoryEvent`].
3069    fn decode(
3070        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3071    ) -> Result<DirectoryEvent, fidl::Error> {
3072        let (bytes, _handles) = buf.split_mut();
3073        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3074        debug_assert_eq!(tx_header.tx_id, 0);
3075        match tx_header.ordinal {
3076            0x7fc7bbb1dbfd1972 => {
3077                let mut out = fidl::new_empty!(
3078                    NodeOnOpenRequest,
3079                    fidl::encoding::DefaultFuchsiaResourceDialect
3080                );
3081                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3082                Ok((DirectoryEvent::OnOpen_ { s: out.s, info: out.info }))
3083            }
3084            0x5cb40567d80a510c => {
3085                let mut out =
3086                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
3087                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
3088                Ok((DirectoryEvent::OnRepresentation { payload: out }))
3089            }
3090            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3091                Ok(DirectoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3092            }
3093            _ => Err(fidl::Error::UnknownOrdinal {
3094                ordinal: tx_header.ordinal,
3095                protocol_name: <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3096            }),
3097        }
3098    }
3099}
3100
3101/// A Stream of incoming requests for fuchsia.io/Directory.
3102pub struct DirectoryRequestStream {
3103    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3104    is_terminated: bool,
3105}
3106
3107impl std::marker::Unpin for DirectoryRequestStream {}
3108
3109impl futures::stream::FusedStream for DirectoryRequestStream {
3110    fn is_terminated(&self) -> bool {
3111        self.is_terminated
3112    }
3113}
3114
3115impl fidl::endpoints::RequestStream for DirectoryRequestStream {
3116    type Protocol = DirectoryMarker;
3117    type ControlHandle = DirectoryControlHandle;
3118
3119    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3120        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3121    }
3122
3123    fn control_handle(&self) -> Self::ControlHandle {
3124        DirectoryControlHandle { inner: self.inner.clone() }
3125    }
3126
3127    fn into_inner(
3128        self,
3129    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3130    {
3131        (self.inner, self.is_terminated)
3132    }
3133
3134    fn from_inner(
3135        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3136        is_terminated: bool,
3137    ) -> Self {
3138        Self { inner, is_terminated }
3139    }
3140}
3141
3142impl futures::Stream for DirectoryRequestStream {
3143    type Item = Result<DirectoryRequest, fidl::Error>;
3144
3145    fn poll_next(
3146        mut self: std::pin::Pin<&mut Self>,
3147        cx: &mut std::task::Context<'_>,
3148    ) -> std::task::Poll<Option<Self::Item>> {
3149        let this = &mut *self;
3150        if this.inner.check_shutdown(cx) {
3151            this.is_terminated = true;
3152            return std::task::Poll::Ready(None);
3153        }
3154        if this.is_terminated {
3155            panic!("polled DirectoryRequestStream after completion");
3156        }
3157        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3158            |bytes, handles| {
3159                match this.inner.channel().read_etc(cx, bytes, handles) {
3160                    std::task::Poll::Ready(Ok(())) => {}
3161                    std::task::Poll::Pending => return std::task::Poll::Pending,
3162                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3163                        this.is_terminated = true;
3164                        return std::task::Poll::Ready(None);
3165                    }
3166                    std::task::Poll::Ready(Err(e)) => {
3167                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3168                            e.into(),
3169                        ))));
3170                    }
3171                }
3172
3173                // A message has been received from the channel
3174                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3175
3176                std::task::Poll::Ready(Some(match header.ordinal {
3177                    0x6ee9c0ad53ec87aa => {
3178                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3179                        let mut req = fidl::new_empty!(
3180                            AdvisoryLockingAdvisoryLockRequest,
3181                            fidl::encoding::DefaultFuchsiaResourceDialect
3182                        );
3183                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
3184                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3185                        Ok(DirectoryRequest::AdvisoryLock {
3186                            request: req.request,
3187
3188                            responder: DirectoryAdvisoryLockResponder {
3189                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3190                                tx_id: header.tx_id,
3191                            },
3192                        })
3193                    }
3194                    0x20d8a7aba2168a79 => {
3195                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3196                        let mut req = fidl::new_empty!(
3197                            fidl_fuchsia_unknown::CloneableCloneRequest,
3198                            fidl::encoding::DefaultFuchsiaResourceDialect
3199                        );
3200                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3201                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3202                        Ok(DirectoryRequest::Clone { request: req.request, control_handle })
3203                    }
3204                    0x5ac5d459ad7f657e => {
3205                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3206                        let mut req = fidl::new_empty!(
3207                            fidl::encoding::EmptyPayload,
3208                            fidl::encoding::DefaultFuchsiaResourceDialect
3209                        );
3210                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3211                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3212                        Ok(DirectoryRequest::Close {
3213                            responder: DirectoryCloseResponder {
3214                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3215                                tx_id: header.tx_id,
3216                            },
3217                        })
3218                    }
3219                    0x2658edee9decfc06 => {
3220                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3221                        let mut req = fidl::new_empty!(
3222                            fidl::encoding::EmptyPayload,
3223                            fidl::encoding::DefaultFuchsiaResourceDialect
3224                        );
3225                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3226                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3227                        Ok(DirectoryRequest::Query {
3228                            responder: DirectoryQueryResponder {
3229                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3230                                tx_id: header.tx_id,
3231                            },
3232                        })
3233                    }
3234                    0x5a61678f293ce16f => {
3235                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3236                        let mut req = fidl::new_empty!(
3237                            NodeDeprecatedCloneRequest,
3238                            fidl::encoding::DefaultFuchsiaResourceDialect
3239                        );
3240                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3241                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3242                        Ok(DirectoryRequest::DeprecatedClone {
3243                            flags: req.flags,
3244                            object: req.object,
3245
3246                            control_handle,
3247                        })
3248                    }
3249                    0x78985e216314dafd => {
3250                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3251                        let mut req = fidl::new_empty!(
3252                            fidl::encoding::EmptyPayload,
3253                            fidl::encoding::DefaultFuchsiaResourceDialect
3254                        );
3255                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3256                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3257                        Ok(DirectoryRequest::DeprecatedGetAttr {
3258                            responder: DirectoryDeprecatedGetAttrResponder {
3259                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3260                                tx_id: header.tx_id,
3261                            },
3262                        })
3263                    }
3264                    0x4186c0f40d938f46 => {
3265                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3266                        let mut req = fidl::new_empty!(
3267                            NodeDeprecatedSetAttrRequest,
3268                            fidl::encoding::DefaultFuchsiaResourceDialect
3269                        );
3270                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
3271                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3272                        Ok(DirectoryRequest::DeprecatedSetAttr {
3273                            flags: req.flags,
3274                            attributes: req.attributes,
3275
3276                            responder: DirectoryDeprecatedSetAttrResponder {
3277                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3278                                tx_id: header.tx_id,
3279                            },
3280                        })
3281                    }
3282                    0x5b88fffb8eda3aa1 => {
3283                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3284                        let mut req = fidl::new_empty!(
3285                            fidl::encoding::EmptyPayload,
3286                            fidl::encoding::DefaultFuchsiaResourceDialect
3287                        );
3288                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3289                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3290                        Ok(DirectoryRequest::DeprecatedGetFlags {
3291                            responder: DirectoryDeprecatedGetFlagsResponder {
3292                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3293                                tx_id: header.tx_id,
3294                            },
3295                        })
3296                    }
3297                    0x5295b76c71fde733 => {
3298                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3299                        let mut req = fidl::new_empty!(
3300                            NodeDeprecatedSetFlagsRequest,
3301                            fidl::encoding::DefaultFuchsiaResourceDialect
3302                        );
3303                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3304                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3305                        Ok(DirectoryRequest::DeprecatedSetFlags {
3306                            flags: req.flags,
3307
3308                            responder: DirectoryDeprecatedSetFlagsResponder {
3309                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3310                                tx_id: header.tx_id,
3311                            },
3312                        })
3313                    }
3314                    0x176eb318f64ec23 => {
3315                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3316                        let mut req = fidl::new_empty!(
3317                            fidl::encoding::EmptyPayload,
3318                            fidl::encoding::DefaultFuchsiaResourceDialect
3319                        );
3320                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3321                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3322                        Ok(DirectoryRequest::GetFlags {
3323                            responder: DirectoryGetFlagsResponder {
3324                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3325                                tx_id: header.tx_id,
3326                            },
3327                        })
3328                    }
3329                    0x55a8028685791ea8 => {
3330                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3331                        let mut req = fidl::new_empty!(
3332                            NodeSetFlagsRequest,
3333                            fidl::encoding::DefaultFuchsiaResourceDialect
3334                        );
3335                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3336                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3337                        Ok(DirectoryRequest::SetFlags {
3338                            flags: req.flags,
3339
3340                            responder: DirectorySetFlagsResponder {
3341                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3342                                tx_id: header.tx_id,
3343                            },
3344                        })
3345                    }
3346                    0x6f344a1c6b0a0610 => {
3347                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3348                        let mut req = fidl::new_empty!(
3349                            fidl::encoding::EmptyPayload,
3350                            fidl::encoding::DefaultFuchsiaResourceDialect
3351                        );
3352                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3353                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3354                        Ok(DirectoryRequest::QueryFilesystem {
3355                            responder: DirectoryQueryFilesystemResponder {
3356                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3357                                tx_id: header.tx_id,
3358                            },
3359                        })
3360                    }
3361                    0x3d4396a638ea053b => {
3362                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3363                        let mut req = fidl::new_empty!(
3364                            NodeGetAttributesRequest,
3365                            fidl::encoding::DefaultFuchsiaResourceDialect
3366                        );
3367                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3368                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3369                        Ok(DirectoryRequest::GetAttributes {
3370                            query: req.query,
3371
3372                            responder: DirectoryGetAttributesResponder {
3373                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3374                                tx_id: header.tx_id,
3375                            },
3376                        })
3377                    }
3378                    0x3308c1da5a89bf08 => {
3379                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3380                        let mut req = fidl::new_empty!(
3381                            MutableNodeAttributes,
3382                            fidl::encoding::DefaultFuchsiaResourceDialect
3383                        );
3384                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
3385                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3386                        Ok(DirectoryRequest::UpdateAttributes {
3387                            payload: req,
3388                            responder: DirectoryUpdateAttributesResponder {
3389                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3390                                tx_id: header.tx_id,
3391                            },
3392                        })
3393                    }
3394                    0x2c5c27ca0ab5dc49 => {
3395                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3396                        let mut req = fidl::new_empty!(
3397                            fidl::encoding::EmptyPayload,
3398                            fidl::encoding::DefaultFuchsiaResourceDialect
3399                        );
3400                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3401                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3402                        Ok(DirectoryRequest::Sync {
3403                            responder: DirectorySyncResponder {
3404                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3405                                tx_id: header.tx_id,
3406                            },
3407                        })
3408                    }
3409                    0x4b61033de007fcd0 => {
3410                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3411                        let mut req = fidl::new_empty!(
3412                            NodeListExtendedAttributesRequest,
3413                            fidl::encoding::DefaultFuchsiaResourceDialect
3414                        );
3415                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3416                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3417                        Ok(DirectoryRequest::ListExtendedAttributes {
3418                            iterator: req.iterator,
3419
3420                            control_handle,
3421                        })
3422                    }
3423                    0x45ffa3ccfdeb76db => {
3424                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3425                        let mut req = fidl::new_empty!(
3426                            NodeGetExtendedAttributeRequest,
3427                            fidl::encoding::DefaultFuchsiaResourceDialect
3428                        );
3429                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3430                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3431                        Ok(DirectoryRequest::GetExtendedAttribute {
3432                            name: req.name,
3433
3434                            responder: DirectoryGetExtendedAttributeResponder {
3435                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3436                                tx_id: header.tx_id,
3437                            },
3438                        })
3439                    }
3440                    0x4a951362f681f23c => {
3441                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3442                        let mut req = fidl::new_empty!(
3443                            NodeSetExtendedAttributeRequest,
3444                            fidl::encoding::DefaultFuchsiaResourceDialect
3445                        );
3446                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3447                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3448                        Ok(DirectoryRequest::SetExtendedAttribute {
3449                            name: req.name,
3450                            value: req.value,
3451                            mode: req.mode,
3452
3453                            responder: DirectorySetExtendedAttributeResponder {
3454                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3455                                tx_id: header.tx_id,
3456                            },
3457                        })
3458                    }
3459                    0x7a0b9f3a9bf9032d => {
3460                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3461                        let mut req = fidl::new_empty!(
3462                            NodeRemoveExtendedAttributeRequest,
3463                            fidl::encoding::DefaultFuchsiaResourceDialect
3464                        );
3465                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3466                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3467                        Ok(DirectoryRequest::RemoveExtendedAttribute {
3468                            name: req.name,
3469
3470                            responder: DirectoryRemoveExtendedAttributeResponder {
3471                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3472                                tx_id: header.tx_id,
3473                            },
3474                        })
3475                    }
3476                    0x2c5044561d685ec0 => {
3477                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3478                        let mut req = fidl::new_empty!(
3479                            DirectoryDeprecatedOpenRequest,
3480                            fidl::encoding::DefaultFuchsiaResourceDialect
3481                        );
3482                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryDeprecatedOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3483                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3484                        Ok(DirectoryRequest::DeprecatedOpen {
3485                            flags: req.flags,
3486                            mode: req.mode,
3487                            path: req.path,
3488                            object: req.object,
3489
3490                            control_handle,
3491                        })
3492                    }
3493                    0x568ddcb9a9cbb6d9 => {
3494                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3495                        let mut req = fidl::new_empty!(
3496                            DirectoryOpenRequest,
3497                            fidl::encoding::DefaultFuchsiaResourceDialect
3498                        );
3499                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3500                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3501                        Ok(DirectoryRequest::Open {
3502                            path: req.path,
3503                            flags: req.flags,
3504                            options: req.options,
3505                            object: req.object,
3506
3507                            control_handle,
3508                        })
3509                    }
3510                    0x3582806bf27faa0a => {
3511                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3512                        let mut req = fidl::new_empty!(
3513                            DirectoryReadDirentsRequest,
3514                            fidl::encoding::DefaultFuchsiaResourceDialect
3515                        );
3516                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryReadDirentsRequest>(&header, _body_bytes, handles, &mut req)?;
3517                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3518                        Ok(DirectoryRequest::ReadDirents {
3519                            max_bytes: req.max_bytes,
3520
3521                            responder: DirectoryReadDirentsResponder {
3522                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3523                                tx_id: header.tx_id,
3524                            },
3525                        })
3526                    }
3527                    0x16b1202af0f34c71 => {
3528                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3529                        let mut req = fidl::new_empty!(
3530                            fidl::encoding::EmptyPayload,
3531                            fidl::encoding::DefaultFuchsiaResourceDialect
3532                        );
3533                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3534                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3535                        Ok(DirectoryRequest::Rewind {
3536                            responder: DirectoryRewindResponder {
3537                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3538                                tx_id: header.tx_id,
3539                            },
3540                        })
3541                    }
3542                    0x26ae9d18763c8655 => {
3543                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3544                        let mut req = fidl::new_empty!(
3545                            fidl::encoding::EmptyPayload,
3546                            fidl::encoding::DefaultFuchsiaResourceDialect
3547                        );
3548                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3549                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3550                        Ok(DirectoryRequest::GetToken {
3551                            responder: DirectoryGetTokenResponder {
3552                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3553                                tx_id: header.tx_id,
3554                            },
3555                        })
3556                    }
3557                    0x740604c0c7c930e7 => {
3558                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3559                        let mut req = fidl::new_empty!(
3560                            DirectoryLinkRequest,
3561                            fidl::encoding::DefaultFuchsiaResourceDialect
3562                        );
3563                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryLinkRequest>(&header, _body_bytes, handles, &mut req)?;
3564                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3565                        Ok(DirectoryRequest::Link {
3566                            src: req.src,
3567                            dst_parent_token: req.dst_parent_token,
3568                            dst: req.dst,
3569
3570                            responder: DirectoryLinkResponder {
3571                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3572                                tx_id: header.tx_id,
3573                            },
3574                        })
3575                    }
3576                    0x750a0326a78d7bed => {
3577                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3578                        let mut req = fidl::new_empty!(
3579                            DirectoryUnlinkRequest,
3580                            fidl::encoding::DefaultFuchsiaResourceDialect
3581                        );
3582                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryUnlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3583                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3584                        Ok(DirectoryRequest::Unlink {
3585                            name: req.name,
3586                            options: req.options,
3587
3588                            responder: DirectoryUnlinkResponder {
3589                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3590                                tx_id: header.tx_id,
3591                            },
3592                        })
3593                    }
3594                    0x7060e7723b9928de => {
3595                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3596                        let mut req = fidl::new_empty!(
3597                            DirectoryRenameRequest,
3598                            fidl::encoding::DefaultFuchsiaResourceDialect
3599                        );
3600                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryRenameRequest>(&header, _body_bytes, handles, &mut req)?;
3601                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3602                        Ok(DirectoryRequest::Rename {
3603                            src: req.src,
3604                            dst_parent_token: req.dst_parent_token,
3605                            dst: req.dst,
3606
3607                            responder: DirectoryRenameResponder {
3608                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3609                                tx_id: header.tx_id,
3610                            },
3611                        })
3612                    }
3613                    0x21ce0f19ec043889 => {
3614                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3615                        let mut req = fidl::new_empty!(
3616                            DirectoryCreateSymlinkRequest,
3617                            fidl::encoding::DefaultFuchsiaResourceDialect
3618                        );
3619                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryCreateSymlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3620                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3621                        Ok(DirectoryRequest::CreateSymlink {
3622                            name: req.name,
3623                            target: req.target,
3624                            connection: req.connection,
3625
3626                            responder: DirectoryCreateSymlinkResponder {
3627                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3628                                tx_id: header.tx_id,
3629                            },
3630                        })
3631                    }
3632                    0x5717193a59d66d91 => {
3633                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3634                        let mut req = fidl::new_empty!(
3635                            DirectoryWatchRequest,
3636                            fidl::encoding::DefaultFuchsiaResourceDialect
3637                        );
3638                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryWatchRequest>(&header, _body_bytes, handles, &mut req)?;
3639                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3640                        Ok(DirectoryRequest::Watch {
3641                            mask: req.mask,
3642                            options: req.options,
3643                            watcher: req.watcher,
3644
3645                            responder: DirectoryWatchResponder {
3646                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3647                                tx_id: header.tx_id,
3648                            },
3649                        })
3650                    }
3651                    _ if header.tx_id == 0
3652                        && header
3653                            .dynamic_flags()
3654                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3655                    {
3656                        Ok(DirectoryRequest::_UnknownMethod {
3657                            ordinal: header.ordinal,
3658                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3659                            method_type: fidl::MethodType::OneWay,
3660                        })
3661                    }
3662                    _ if header
3663                        .dynamic_flags()
3664                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3665                    {
3666                        this.inner.send_framework_err(
3667                            fidl::encoding::FrameworkErr::UnknownMethod,
3668                            header.tx_id,
3669                            header.ordinal,
3670                            header.dynamic_flags(),
3671                            (bytes, handles),
3672                        )?;
3673                        Ok(DirectoryRequest::_UnknownMethod {
3674                            ordinal: header.ordinal,
3675                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3676                            method_type: fidl::MethodType::TwoWay,
3677                        })
3678                    }
3679                    _ => Err(fidl::Error::UnknownOrdinal {
3680                        ordinal: header.ordinal,
3681                        protocol_name:
3682                            <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3683                    }),
3684                }))
3685            },
3686        )
3687    }
3688}
3689
3690/// Directory defines a node which is capable of containing other Objects.
3691#[derive(Debug)]
3692pub enum DirectoryRequest {
3693    /// Acquires an advisory lock on the underlying file.
3694    ///
3695    /// The lock lasts until either this connection is closed or
3696    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
3697    /// explicitly.
3698    ///
3699    /// Advisory locks are purely advisory. They do not prevent actual read or
3700    /// write operations from occurring on the file, either through this
3701    /// connection or through other connections.
3702    ///
3703    /// This method requires the following rights:
3704    ///
3705    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
3706    /// * [`Rights.WRITE_BYTES`] if `request.type` is
3707    ///   [`AdvisoryLockType.WRITE`].
3708    ///
3709    /// # Errors
3710    ///
3711    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
3712    ///   example, another connection might hold a conflicting lock type.
3713    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
3714    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
3715    ///   to acquire the given type of lock.
3716    AdvisoryLock {
3717        request: AdvisoryLockRequest,
3718        responder: DirectoryAdvisoryLockResponder,
3719    },
3720    Clone {
3721        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
3722        control_handle: DirectoryControlHandle,
3723    },
3724    /// Terminates the connection.
3725    ///
3726    /// After calling `Close`, the client must not send any other requests.
3727    ///
3728    /// Servers, after sending the status response, should close the connection
3729    /// regardless of status and without sending an epitaph.
3730    ///
3731    /// Closing the client end of the channel should be semantically equivalent
3732    /// to calling `Close` without knowing when the close has completed or its
3733    /// status.
3734    Close {
3735        responder: DirectoryCloseResponder,
3736    },
3737    Query {
3738        responder: DirectoryQueryResponder,
3739    },
3740    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
3741    DeprecatedClone {
3742        flags: OpenFlags,
3743        object: fidl::endpoints::ServerEnd<NodeMarker>,
3744        control_handle: DirectoryControlHandle,
3745    },
3746    /// DEPRECATED - Use `Node.GetAttributes` instead.
3747    DeprecatedGetAttr {
3748        responder: DirectoryDeprecatedGetAttrResponder,
3749    },
3750    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
3751    DeprecatedSetAttr {
3752        flags: NodeAttributeFlags,
3753        attributes: NodeAttributes,
3754        responder: DirectoryDeprecatedSetAttrResponder,
3755    },
3756    /// [DEPRECATED - Use new GetFlags method instead.]
3757    DeprecatedGetFlags {
3758        responder: DirectoryDeprecatedGetFlagsResponder,
3759    },
3760    /// [DEPRECATED - Use new SetFlags method instead.]
3761    DeprecatedSetFlags {
3762        flags: OpenFlags,
3763        responder: DirectoryDeprecatedSetFlagsResponder,
3764    },
3765    /// Queries the flags that apply to this node after it has been opened/created. This method does
3766    /// not require any rights.
3767    ///
3768    /// Note that the final set of flags that apply to the connection may differ from those
3769    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
3770    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
3771    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
3772    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
3773    GetFlags {
3774        responder: DirectoryGetFlagsResponder,
3775    },
3776    /// Sets the flags that apply to this node after it has been opened. This method does not
3777    /// require any rights.
3778    ///
3779    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
3780    /// clear append mode.
3781    ///
3782    /// Errors:
3783    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
3784    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
3785    SetFlags {
3786        flags: Flags,
3787        responder: DirectorySetFlagsResponder,
3788    },
3789    /// Query the filesystem for filesystem-specific information.
3790    QueryFilesystem {
3791        responder: DirectoryQueryFilesystemResponder,
3792    },
3793    /// Acquires information about the node.
3794    ///
3795    /// The attributes of a node should be stable, independent of the
3796    /// specific protocol used to access it.
3797    ///
3798    /// If a particular attribute is not applicable or not supported,
3799    /// filesystems should leave the corresponding field absent.
3800    ///
3801    /// + `query` a bit-mask specifying which attributes to fetch. The server
3802    ///   should not return more than necessary.
3803    /// - `attributes` the returned attributes.
3804    ///
3805    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3806    GetAttributes {
3807        query: NodeAttributesQuery,
3808        responder: DirectoryGetAttributesResponder,
3809    },
3810    /// Updates information about the node.
3811    ///
3812    /// + `attributes` the presence of a table field in `attributes` indicates
3813    /// the intent to update the corresponding attribute.
3814    ///
3815    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
3816    ///
3817    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3818    UpdateAttributes {
3819        payload: MutableNodeAttributes,
3820        responder: DirectoryUpdateAttributesResponder,
3821    },
3822    /// Synchronizes updates to the node to the underlying media, if it exists.
3823    ///
3824    /// This method will return when the filesystem server has flushed the
3825    /// relevant updates to the underlying media, but does not guarantee the
3826    /// underlying media has persisted the information, nor that any information
3827    /// is committed to hardware. Clients may use `Sync` to ensure ordering
3828    /// between operations.
3829    ///
3830    /// This method does not require any rights.
3831    Sync {
3832        responder: DirectorySyncResponder,
3833    },
3834    /// Creates an iterator over all the extended attribute names associated
3835    /// with this node. If an error occurs it is returned as an epitaph on the
3836    /// iterator request channel, and then the channel is closed.
3837    ///
3838    /// GetExtendedAttributes can be used with any of these names to retrieve
3839    /// the associated value.
3840    ///
3841    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3842    ListExtendedAttributes {
3843        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
3844        control_handle: DirectoryControlHandle,
3845    },
3846    /// Get the value associated with the given attribute `name` for this node.
3847    ///
3848    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
3849    /// particular structure is imposed on them.
3850    ///
3851    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3852    GetExtendedAttribute {
3853        name: Vec<u8>,
3854        responder: DirectoryGetExtendedAttributeResponder,
3855    },
3856    /// Set the value for the given attribute `name` to `value` for this node.
3857    ///
3858    /// The attribute name may exist, in which case the attribute is updated.
3859    /// If the attribute doesn't exist, it is created. The name should have no
3860    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
3861    ///
3862    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3863    SetExtendedAttribute {
3864        name: Vec<u8>,
3865        value: ExtendedAttributeValue,
3866        mode: SetExtendedAttributeMode,
3867        responder: DirectorySetExtendedAttributeResponder,
3868    },
3869    /// Remove the specified extended attribute.
3870    ///
3871    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
3872    ///
3873    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3874    RemoveExtendedAttribute {
3875        name: Vec<u8>,
3876        responder: DirectoryRemoveExtendedAttributeResponder,
3877    },
3878    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
3879    DeprecatedOpen {
3880        flags: OpenFlags,
3881        mode: ModeType,
3882        path: String,
3883        object: fidl::endpoints::ServerEnd<NodeMarker>,
3884        control_handle: DirectoryControlHandle,
3885    },
3886    /// Open (or create) a node relative to this directory. Any errors are communicated via an
3887    /// epitaph sent on the `object` channel.
3888    ///
3889    /// Errors:
3890    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
3891    /// * See [`Flags`] for other errors which may be communicated based on `flags`
3892    Open {
3893        path: String,
3894        flags: Flags,
3895        options: Options,
3896        object: fidl::Channel,
3897        control_handle: DirectoryControlHandle,
3898    },
3899    /// Reads a collection of variably sized dirents into a buffer.
3900    /// The number of dirents in a directory may be very large: akin to
3901    /// calling read multiple times on a file, directories have a seek
3902    /// offset which is updated on subsequent calls to ReadDirents.
3903    /// Each call to ReadDirents will only return whole dirent structures,
3904    /// they will not get split across ReadDirent calls. When the seek
3905    /// offset reaches the end, `dirents` will be empty.
3906    ///
3907    /// These dirents are of the form:
3908    /// ```
3909    /// struct dirent {
3910    ///   // Describes the inode of the entry.
3911    ///   uint64 ino;
3912    ///   // Describes the length of the dirent name in bytes.
3913    ///   uint8 size;
3914    ///   // Describes the type of the entry. Aligned with the
3915    ///   // POSIX d_type values. Use `DirentType` constants.
3916    ///   uint8 type;
3917    ///   // Unterminated name of entry.
3918    ///   char name[0];
3919    /// }
3920    /// ```
3921    ///
3922    /// This method does not require any rights, since one could always probe for
3923    /// directory contents by triggering name conflicts during file creation.
3924    ReadDirents {
3925        max_bytes: u64,
3926        responder: DirectoryReadDirentsResponder,
3927    },
3928    /// Resets the directory seek offset.
3929    ///
3930    /// This method does not require any rights, similar to ReadDirents.
3931    Rewind {
3932        responder: DirectoryRewindResponder,
3933    },
3934    /// Acquires a token to a Directory which can be used to identify access to it at a later point
3935    /// in time. The token will remain valid for as long as the connection requesting the token
3936    /// remains open.
3937    ///
3938    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
3939    /// `ZX_ERR_BAD_HANDLE`.
3940    GetToken {
3941        responder: DirectoryGetTokenResponder,
3942    },
3943    /// Creates a link to an object named src by the name dst, within a directory represented by
3944    /// token.
3945    ///
3946    /// `src` must be a resolved object name. Including "/" in the string will
3947    /// return `ZX_ERR_INVALID_ARGS`.
3948    ///
3949    /// `dst` must be a resolved object name. Including "/" in the string will
3950    /// return `ZX_ERR_INVALID_ARGS`.
3951    ///
3952    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
3953    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
3954    ///
3955    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
3956    /// there are two actors operating concurrently, and one actor performs a rename that affects
3957    /// the source within this directory, and the other does a link, each will appear to occur
3958    /// atomically in an unspecified order.
3959    Link {
3960        src: String,
3961        dst_parent_token: fidl::Handle,
3962        dst: String,
3963        responder: DirectoryLinkResponder,
3964    },
3965    /// Removes a child node from the this directory's list of entries.
3966    ///
3967    /// Note: this does not guarantee that the underlying object is destroyed.
3968    /// Although the link will be removed from the containing directory,
3969    /// objects with multiple references (such as files which are still open)
3970    /// will not actually be destroyed until all references are closed.
3971    ///
3972    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
3973    ///   [`Rights.WRITE_BYTES`].
3974    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
3975    ///   support writing.
3976    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
3977    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
3978    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
3979    ///   containing a remote channel.
3980    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
3981    ///     something other than a directory was found.
3982    ///
3983    /// Other errors may be returned for filesystem-specific reasons.
3984    ///
3985    /// This method requires the following rights:
3986    ///
3987    /// * [`Rights.ENUMERATE`]
3988    /// * [`Rights.MODIFY_DIRECTORY`]
3989    Unlink {
3990        name: String,
3991        options: UnlinkOptions,
3992        responder: DirectoryUnlinkResponder,
3993    },
3994    /// Renames a node named `src` to the name `dst`, in a directory represented
3995    /// by `dst_parent_token`.
3996    ///
3997    /// `src` and `dst` must be valid node names.
3998    /// See [`Name`] for what constitutes a valid name.
3999    ///
4000    /// This method requires the following rights on both the current connection, and the connection
4001    /// identified by `dst_parent_token`:
4002    ///
4003    /// * [`Rights.ENUMERATE`]
4004    /// * [`Rights.MODIFY_DIRECTORY`]
4005    ///
4006    /// The following requirements are necessary to avoid rights escalations.
4007    ///
4008    /// If the source and destination directory differ, the source directory must also have the
4009    /// maximal set of abilities supported for files, which would typically be
4010    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
4011    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
4012    /// right.
4013    ///
4014    /// If `src` refers to a directory, and differs from the destination directory, then the source
4015    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
4016    ///
4017    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
4018    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
4019    Rename {
4020        src: String,
4021        dst_parent_token: fidl::Event,
4022        dst: String,
4023        responder: DirectoryRenameResponder,
4024    },
4025    /// Creates a symbolic link.
4026    ///
4027    /// `name` is the name to be given to the created symbolic link.
4028    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
4029    /// will perform no validation of `target` except for a server chosen maximum length.
4030    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
4031    /// on the successfully created node.
4032    ///
4033    /// * [`Rights.MODIFY_DIRECTORY`]
4034    ///
4035    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
4036    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
4037    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
4038    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
4039    CreateSymlink {
4040        name: String,
4041        target: Vec<u8>,
4042        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4043        responder: DirectoryCreateSymlinkResponder,
4044    },
4045    /// Watches a directory, receiving events of added messages on the
4046    /// watcher request channel.
4047    ///
4048    /// Options must be zero; it is reserved.
4049    ///
4050    /// This method does not require any rights, similar to ReadDirents.
4051    Watch {
4052        mask: WatchMask,
4053        options: u32,
4054        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4055        responder: DirectoryWatchResponder,
4056    },
4057    /// An interaction was received which does not match any known method.
4058    #[non_exhaustive]
4059    _UnknownMethod {
4060        /// Ordinal of the method that was called.
4061        ordinal: u64,
4062        control_handle: DirectoryControlHandle,
4063        method_type: fidl::MethodType,
4064    },
4065}
4066
4067impl DirectoryRequest {
4068    #[allow(irrefutable_let_patterns)]
4069    pub fn into_advisory_lock(
4070        self,
4071    ) -> Option<(AdvisoryLockRequest, DirectoryAdvisoryLockResponder)> {
4072        if let DirectoryRequest::AdvisoryLock { request, responder } = self {
4073            Some((request, responder))
4074        } else {
4075            None
4076        }
4077    }
4078
4079    #[allow(irrefutable_let_patterns)]
4080    pub fn into_clone(
4081        self,
4082    ) -> Option<(
4083        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
4084        DirectoryControlHandle,
4085    )> {
4086        if let DirectoryRequest::Clone { request, control_handle } = self {
4087            Some((request, control_handle))
4088        } else {
4089            None
4090        }
4091    }
4092
4093    #[allow(irrefutable_let_patterns)]
4094    pub fn into_close(self) -> Option<(DirectoryCloseResponder)> {
4095        if let DirectoryRequest::Close { responder } = self { Some((responder)) } else { None }
4096    }
4097
4098    #[allow(irrefutable_let_patterns)]
4099    pub fn into_query(self) -> Option<(DirectoryQueryResponder)> {
4100        if let DirectoryRequest::Query { responder } = self { Some((responder)) } else { None }
4101    }
4102
4103    #[allow(irrefutable_let_patterns)]
4104    pub fn into_deprecated_clone(
4105        self,
4106    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, DirectoryControlHandle)> {
4107        if let DirectoryRequest::DeprecatedClone { flags, object, control_handle } = self {
4108            Some((flags, object, control_handle))
4109        } else {
4110            None
4111        }
4112    }
4113
4114    #[allow(irrefutable_let_patterns)]
4115    pub fn into_deprecated_get_attr(self) -> Option<(DirectoryDeprecatedGetAttrResponder)> {
4116        if let DirectoryRequest::DeprecatedGetAttr { responder } = self {
4117            Some((responder))
4118        } else {
4119            None
4120        }
4121    }
4122
4123    #[allow(irrefutable_let_patterns)]
4124    pub fn into_deprecated_set_attr(
4125        self,
4126    ) -> Option<(NodeAttributeFlags, NodeAttributes, DirectoryDeprecatedSetAttrResponder)> {
4127        if let DirectoryRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
4128            Some((flags, attributes, responder))
4129        } else {
4130            None
4131        }
4132    }
4133
4134    #[allow(irrefutable_let_patterns)]
4135    pub fn into_deprecated_get_flags(self) -> Option<(DirectoryDeprecatedGetFlagsResponder)> {
4136        if let DirectoryRequest::DeprecatedGetFlags { responder } = self {
4137            Some((responder))
4138        } else {
4139            None
4140        }
4141    }
4142
4143    #[allow(irrefutable_let_patterns)]
4144    pub fn into_deprecated_set_flags(
4145        self,
4146    ) -> Option<(OpenFlags, DirectoryDeprecatedSetFlagsResponder)> {
4147        if let DirectoryRequest::DeprecatedSetFlags { flags, responder } = self {
4148            Some((flags, responder))
4149        } else {
4150            None
4151        }
4152    }
4153
4154    #[allow(irrefutable_let_patterns)]
4155    pub fn into_get_flags(self) -> Option<(DirectoryGetFlagsResponder)> {
4156        if let DirectoryRequest::GetFlags { responder } = self { Some((responder)) } else { None }
4157    }
4158
4159    #[allow(irrefutable_let_patterns)]
4160    pub fn into_set_flags(self) -> Option<(Flags, DirectorySetFlagsResponder)> {
4161        if let DirectoryRequest::SetFlags { flags, responder } = self {
4162            Some((flags, responder))
4163        } else {
4164            None
4165        }
4166    }
4167
4168    #[allow(irrefutable_let_patterns)]
4169    pub fn into_query_filesystem(self) -> Option<(DirectoryQueryFilesystemResponder)> {
4170        if let DirectoryRequest::QueryFilesystem { responder } = self {
4171            Some((responder))
4172        } else {
4173            None
4174        }
4175    }
4176
4177    #[allow(irrefutable_let_patterns)]
4178    pub fn into_get_attributes(
4179        self,
4180    ) -> Option<(NodeAttributesQuery, DirectoryGetAttributesResponder)> {
4181        if let DirectoryRequest::GetAttributes { query, responder } = self {
4182            Some((query, responder))
4183        } else {
4184            None
4185        }
4186    }
4187
4188    #[allow(irrefutable_let_patterns)]
4189    pub fn into_update_attributes(
4190        self,
4191    ) -> Option<(MutableNodeAttributes, DirectoryUpdateAttributesResponder)> {
4192        if let DirectoryRequest::UpdateAttributes { payload, responder } = self {
4193            Some((payload, responder))
4194        } else {
4195            None
4196        }
4197    }
4198
4199    #[allow(irrefutable_let_patterns)]
4200    pub fn into_sync(self) -> Option<(DirectorySyncResponder)> {
4201        if let DirectoryRequest::Sync { responder } = self { Some((responder)) } else { None }
4202    }
4203
4204    #[allow(irrefutable_let_patterns)]
4205    pub fn into_list_extended_attributes(
4206        self,
4207    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, DirectoryControlHandle)>
4208    {
4209        if let DirectoryRequest::ListExtendedAttributes { iterator, control_handle } = self {
4210            Some((iterator, control_handle))
4211        } else {
4212            None
4213        }
4214    }
4215
4216    #[allow(irrefutable_let_patterns)]
4217    pub fn into_get_extended_attribute(
4218        self,
4219    ) -> Option<(Vec<u8>, DirectoryGetExtendedAttributeResponder)> {
4220        if let DirectoryRequest::GetExtendedAttribute { name, responder } = self {
4221            Some((name, responder))
4222        } else {
4223            None
4224        }
4225    }
4226
4227    #[allow(irrefutable_let_patterns)]
4228    pub fn into_set_extended_attribute(
4229        self,
4230    ) -> Option<(
4231        Vec<u8>,
4232        ExtendedAttributeValue,
4233        SetExtendedAttributeMode,
4234        DirectorySetExtendedAttributeResponder,
4235    )> {
4236        if let DirectoryRequest::SetExtendedAttribute { name, value, mode, responder } = self {
4237            Some((name, value, mode, responder))
4238        } else {
4239            None
4240        }
4241    }
4242
4243    #[allow(irrefutable_let_patterns)]
4244    pub fn into_remove_extended_attribute(
4245        self,
4246    ) -> Option<(Vec<u8>, DirectoryRemoveExtendedAttributeResponder)> {
4247        if let DirectoryRequest::RemoveExtendedAttribute { name, responder } = self {
4248            Some((name, responder))
4249        } else {
4250            None
4251        }
4252    }
4253
4254    #[allow(irrefutable_let_patterns)]
4255    pub fn into_deprecated_open(
4256        self,
4257    ) -> Option<(
4258        OpenFlags,
4259        ModeType,
4260        String,
4261        fidl::endpoints::ServerEnd<NodeMarker>,
4262        DirectoryControlHandle,
4263    )> {
4264        if let DirectoryRequest::DeprecatedOpen { flags, mode, path, object, control_handle } = self
4265        {
4266            Some((flags, mode, path, object, control_handle))
4267        } else {
4268            None
4269        }
4270    }
4271
4272    #[allow(irrefutable_let_patterns)]
4273    pub fn into_open(
4274        self,
4275    ) -> Option<(String, Flags, Options, fidl::Channel, DirectoryControlHandle)> {
4276        if let DirectoryRequest::Open { path, flags, options, object, control_handle } = self {
4277            Some((path, flags, options, object, control_handle))
4278        } else {
4279            None
4280        }
4281    }
4282
4283    #[allow(irrefutable_let_patterns)]
4284    pub fn into_read_dirents(self) -> Option<(u64, DirectoryReadDirentsResponder)> {
4285        if let DirectoryRequest::ReadDirents { max_bytes, responder } = self {
4286            Some((max_bytes, responder))
4287        } else {
4288            None
4289        }
4290    }
4291
4292    #[allow(irrefutable_let_patterns)]
4293    pub fn into_rewind(self) -> Option<(DirectoryRewindResponder)> {
4294        if let DirectoryRequest::Rewind { responder } = self { Some((responder)) } else { None }
4295    }
4296
4297    #[allow(irrefutable_let_patterns)]
4298    pub fn into_get_token(self) -> Option<(DirectoryGetTokenResponder)> {
4299        if let DirectoryRequest::GetToken { responder } = self { Some((responder)) } else { None }
4300    }
4301
4302    #[allow(irrefutable_let_patterns)]
4303    pub fn into_link(self) -> Option<(String, fidl::Handle, String, DirectoryLinkResponder)> {
4304        if let DirectoryRequest::Link { src, dst_parent_token, dst, responder } = self {
4305            Some((src, dst_parent_token, dst, responder))
4306        } else {
4307            None
4308        }
4309    }
4310
4311    #[allow(irrefutable_let_patterns)]
4312    pub fn into_unlink(self) -> Option<(String, UnlinkOptions, DirectoryUnlinkResponder)> {
4313        if let DirectoryRequest::Unlink { name, options, responder } = self {
4314            Some((name, options, responder))
4315        } else {
4316            None
4317        }
4318    }
4319
4320    #[allow(irrefutable_let_patterns)]
4321    pub fn into_rename(self) -> Option<(String, fidl::Event, String, DirectoryRenameResponder)> {
4322        if let DirectoryRequest::Rename { src, dst_parent_token, dst, responder } = self {
4323            Some((src, dst_parent_token, dst, responder))
4324        } else {
4325            None
4326        }
4327    }
4328
4329    #[allow(irrefutable_let_patterns)]
4330    pub fn into_create_symlink(
4331        self,
4332    ) -> Option<(
4333        String,
4334        Vec<u8>,
4335        Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4336        DirectoryCreateSymlinkResponder,
4337    )> {
4338        if let DirectoryRequest::CreateSymlink { name, target, connection, responder } = self {
4339            Some((name, target, connection, responder))
4340        } else {
4341            None
4342        }
4343    }
4344
4345    #[allow(irrefutable_let_patterns)]
4346    pub fn into_watch(
4347        self,
4348    ) -> Option<(
4349        WatchMask,
4350        u32,
4351        fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4352        DirectoryWatchResponder,
4353    )> {
4354        if let DirectoryRequest::Watch { mask, options, watcher, responder } = self {
4355            Some((mask, options, watcher, responder))
4356        } else {
4357            None
4358        }
4359    }
4360
4361    /// Name of the method defined in FIDL
4362    pub fn method_name(&self) -> &'static str {
4363        match *self {
4364            DirectoryRequest::AdvisoryLock { .. } => "advisory_lock",
4365            DirectoryRequest::Clone { .. } => "clone",
4366            DirectoryRequest::Close { .. } => "close",
4367            DirectoryRequest::Query { .. } => "query",
4368            DirectoryRequest::DeprecatedClone { .. } => "deprecated_clone",
4369            DirectoryRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
4370            DirectoryRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
4371            DirectoryRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
4372            DirectoryRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
4373            DirectoryRequest::GetFlags { .. } => "get_flags",
4374            DirectoryRequest::SetFlags { .. } => "set_flags",
4375            DirectoryRequest::QueryFilesystem { .. } => "query_filesystem",
4376            DirectoryRequest::GetAttributes { .. } => "get_attributes",
4377            DirectoryRequest::UpdateAttributes { .. } => "update_attributes",
4378            DirectoryRequest::Sync { .. } => "sync",
4379            DirectoryRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
4380            DirectoryRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
4381            DirectoryRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
4382            DirectoryRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
4383            DirectoryRequest::DeprecatedOpen { .. } => "deprecated_open",
4384            DirectoryRequest::Open { .. } => "open",
4385            DirectoryRequest::ReadDirents { .. } => "read_dirents",
4386            DirectoryRequest::Rewind { .. } => "rewind",
4387            DirectoryRequest::GetToken { .. } => "get_token",
4388            DirectoryRequest::Link { .. } => "link",
4389            DirectoryRequest::Unlink { .. } => "unlink",
4390            DirectoryRequest::Rename { .. } => "rename",
4391            DirectoryRequest::CreateSymlink { .. } => "create_symlink",
4392            DirectoryRequest::Watch { .. } => "watch",
4393            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4394                "unknown one-way method"
4395            }
4396            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4397                "unknown two-way method"
4398            }
4399        }
4400    }
4401}
4402
4403#[derive(Debug, Clone)]
4404pub struct DirectoryControlHandle {
4405    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4406}
4407
4408impl fidl::endpoints::ControlHandle for DirectoryControlHandle {
4409    fn shutdown(&self) {
4410        self.inner.shutdown()
4411    }
4412    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4413        self.inner.shutdown_with_epitaph(status)
4414    }
4415
4416    fn is_closed(&self) -> bool {
4417        self.inner.channel().is_closed()
4418    }
4419    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4420        self.inner.channel().on_closed()
4421    }
4422
4423    #[cfg(target_os = "fuchsia")]
4424    fn signal_peer(
4425        &self,
4426        clear_mask: zx::Signals,
4427        set_mask: zx::Signals,
4428    ) -> Result<(), zx_status::Status> {
4429        use fidl::Peered;
4430        self.inner.channel().signal_peer(clear_mask, set_mask)
4431    }
4432}
4433
4434impl DirectoryControlHandle {
4435    pub fn send_on_open_(
4436        &self,
4437        mut s: i32,
4438        mut info: Option<NodeInfoDeprecated>,
4439    ) -> Result<(), fidl::Error> {
4440        self.inner.send::<NodeOnOpenRequest>(
4441            (s, info.as_mut()),
4442            0,
4443            0x7fc7bbb1dbfd1972,
4444            fidl::encoding::DynamicFlags::FLEXIBLE,
4445        )
4446    }
4447
4448    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
4449        self.inner.send::<Representation>(
4450            &mut payload,
4451            0,
4452            0x5cb40567d80a510c,
4453            fidl::encoding::DynamicFlags::empty(),
4454        )
4455    }
4456}
4457
4458#[must_use = "FIDL methods require a response to be sent"]
4459#[derive(Debug)]
4460pub struct DirectoryAdvisoryLockResponder {
4461    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4462    tx_id: u32,
4463}
4464
4465/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4466/// if the responder is dropped without sending a response, so that the client
4467/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4468impl std::ops::Drop for DirectoryAdvisoryLockResponder {
4469    fn drop(&mut self) {
4470        self.control_handle.shutdown();
4471        // Safety: drops once, never accessed again
4472        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4473    }
4474}
4475
4476impl fidl::endpoints::Responder for DirectoryAdvisoryLockResponder {
4477    type ControlHandle = DirectoryControlHandle;
4478
4479    fn control_handle(&self) -> &DirectoryControlHandle {
4480        &self.control_handle
4481    }
4482
4483    fn drop_without_shutdown(mut self) {
4484        // Safety: drops once, never accessed again due to mem::forget
4485        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4486        // Prevent Drop from running (which would shut down the channel)
4487        std::mem::forget(self);
4488    }
4489}
4490
4491impl DirectoryAdvisoryLockResponder {
4492    /// Sends a response to the FIDL transaction.
4493    ///
4494    /// Sets the channel to shutdown if an error occurs.
4495    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4496        let _result = self.send_raw(result);
4497        if _result.is_err() {
4498            self.control_handle.shutdown();
4499        }
4500        self.drop_without_shutdown();
4501        _result
4502    }
4503
4504    /// Similar to "send" but does not shutdown the channel if an error occurs.
4505    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4506        let _result = self.send_raw(result);
4507        self.drop_without_shutdown();
4508        _result
4509    }
4510
4511    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4512        self.control_handle
4513            .inner
4514            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4515                result,
4516                self.tx_id,
4517                0x6ee9c0ad53ec87aa,
4518                fidl::encoding::DynamicFlags::empty(),
4519            )
4520    }
4521}
4522
4523#[must_use = "FIDL methods require a response to be sent"]
4524#[derive(Debug)]
4525pub struct DirectoryCloseResponder {
4526    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4527    tx_id: u32,
4528}
4529
4530/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4531/// if the responder is dropped without sending a response, so that the client
4532/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4533impl std::ops::Drop for DirectoryCloseResponder {
4534    fn drop(&mut self) {
4535        self.control_handle.shutdown();
4536        // Safety: drops once, never accessed again
4537        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4538    }
4539}
4540
4541impl fidl::endpoints::Responder for DirectoryCloseResponder {
4542    type ControlHandle = DirectoryControlHandle;
4543
4544    fn control_handle(&self) -> &DirectoryControlHandle {
4545        &self.control_handle
4546    }
4547
4548    fn drop_without_shutdown(mut self) {
4549        // Safety: drops once, never accessed again due to mem::forget
4550        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4551        // Prevent Drop from running (which would shut down the channel)
4552        std::mem::forget(self);
4553    }
4554}
4555
4556impl DirectoryCloseResponder {
4557    /// Sends a response to the FIDL transaction.
4558    ///
4559    /// Sets the channel to shutdown if an error occurs.
4560    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4561        let _result = self.send_raw(result);
4562        if _result.is_err() {
4563            self.control_handle.shutdown();
4564        }
4565        self.drop_without_shutdown();
4566        _result
4567    }
4568
4569    /// Similar to "send" but does not shutdown the channel if an error occurs.
4570    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4571        let _result = self.send_raw(result);
4572        self.drop_without_shutdown();
4573        _result
4574    }
4575
4576    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4577        self.control_handle
4578            .inner
4579            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4580                result,
4581                self.tx_id,
4582                0x5ac5d459ad7f657e,
4583                fidl::encoding::DynamicFlags::empty(),
4584            )
4585    }
4586}
4587
4588#[must_use = "FIDL methods require a response to be sent"]
4589#[derive(Debug)]
4590pub struct DirectoryQueryResponder {
4591    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4592    tx_id: u32,
4593}
4594
4595/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4596/// if the responder is dropped without sending a response, so that the client
4597/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4598impl std::ops::Drop for DirectoryQueryResponder {
4599    fn drop(&mut self) {
4600        self.control_handle.shutdown();
4601        // Safety: drops once, never accessed again
4602        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4603    }
4604}
4605
4606impl fidl::endpoints::Responder for DirectoryQueryResponder {
4607    type ControlHandle = DirectoryControlHandle;
4608
4609    fn control_handle(&self) -> &DirectoryControlHandle {
4610        &self.control_handle
4611    }
4612
4613    fn drop_without_shutdown(mut self) {
4614        // Safety: drops once, never accessed again due to mem::forget
4615        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4616        // Prevent Drop from running (which would shut down the channel)
4617        std::mem::forget(self);
4618    }
4619}
4620
4621impl DirectoryQueryResponder {
4622    /// Sends a response to the FIDL transaction.
4623    ///
4624    /// Sets the channel to shutdown if an error occurs.
4625    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4626        let _result = self.send_raw(protocol);
4627        if _result.is_err() {
4628            self.control_handle.shutdown();
4629        }
4630        self.drop_without_shutdown();
4631        _result
4632    }
4633
4634    /// Similar to "send" but does not shutdown the channel if an error occurs.
4635    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4636        let _result = self.send_raw(protocol);
4637        self.drop_without_shutdown();
4638        _result
4639    }
4640
4641    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4642        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
4643            (protocol,),
4644            self.tx_id,
4645            0x2658edee9decfc06,
4646            fidl::encoding::DynamicFlags::empty(),
4647        )
4648    }
4649}
4650
4651#[must_use = "FIDL methods require a response to be sent"]
4652#[derive(Debug)]
4653pub struct DirectoryDeprecatedGetAttrResponder {
4654    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4655    tx_id: u32,
4656}
4657
4658/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4659/// if the responder is dropped without sending a response, so that the client
4660/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4661impl std::ops::Drop for DirectoryDeprecatedGetAttrResponder {
4662    fn drop(&mut self) {
4663        self.control_handle.shutdown();
4664        // Safety: drops once, never accessed again
4665        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4666    }
4667}
4668
4669impl fidl::endpoints::Responder for DirectoryDeprecatedGetAttrResponder {
4670    type ControlHandle = DirectoryControlHandle;
4671
4672    fn control_handle(&self) -> &DirectoryControlHandle {
4673        &self.control_handle
4674    }
4675
4676    fn drop_without_shutdown(mut self) {
4677        // Safety: drops once, never accessed again due to mem::forget
4678        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4679        // Prevent Drop from running (which would shut down the channel)
4680        std::mem::forget(self);
4681    }
4682}
4683
4684impl DirectoryDeprecatedGetAttrResponder {
4685    /// Sends a response to the FIDL transaction.
4686    ///
4687    /// Sets the channel to shutdown if an error occurs.
4688    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4689        let _result = self.send_raw(s, attributes);
4690        if _result.is_err() {
4691            self.control_handle.shutdown();
4692        }
4693        self.drop_without_shutdown();
4694        _result
4695    }
4696
4697    /// Similar to "send" but does not shutdown the channel if an error occurs.
4698    pub fn send_no_shutdown_on_err(
4699        self,
4700        mut s: i32,
4701        mut attributes: &NodeAttributes,
4702    ) -> Result<(), fidl::Error> {
4703        let _result = self.send_raw(s, attributes);
4704        self.drop_without_shutdown();
4705        _result
4706    }
4707
4708    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4709        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
4710            (s, attributes),
4711            self.tx_id,
4712            0x78985e216314dafd,
4713            fidl::encoding::DynamicFlags::empty(),
4714        )
4715    }
4716}
4717
4718#[must_use = "FIDL methods require a response to be sent"]
4719#[derive(Debug)]
4720pub struct DirectoryDeprecatedSetAttrResponder {
4721    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4722    tx_id: u32,
4723}
4724
4725/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4726/// if the responder is dropped without sending a response, so that the client
4727/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4728impl std::ops::Drop for DirectoryDeprecatedSetAttrResponder {
4729    fn drop(&mut self) {
4730        self.control_handle.shutdown();
4731        // Safety: drops once, never accessed again
4732        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4733    }
4734}
4735
4736impl fidl::endpoints::Responder for DirectoryDeprecatedSetAttrResponder {
4737    type ControlHandle = DirectoryControlHandle;
4738
4739    fn control_handle(&self) -> &DirectoryControlHandle {
4740        &self.control_handle
4741    }
4742
4743    fn drop_without_shutdown(mut self) {
4744        // Safety: drops once, never accessed again due to mem::forget
4745        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4746        // Prevent Drop from running (which would shut down the channel)
4747        std::mem::forget(self);
4748    }
4749}
4750
4751impl DirectoryDeprecatedSetAttrResponder {
4752    /// Sends a response to the FIDL transaction.
4753    ///
4754    /// Sets the channel to shutdown if an error occurs.
4755    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4756        let _result = self.send_raw(s);
4757        if _result.is_err() {
4758            self.control_handle.shutdown();
4759        }
4760        self.drop_without_shutdown();
4761        _result
4762    }
4763
4764    /// Similar to "send" but does not shutdown the channel if an error occurs.
4765    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4766        let _result = self.send_raw(s);
4767        self.drop_without_shutdown();
4768        _result
4769    }
4770
4771    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4772        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
4773            (s,),
4774            self.tx_id,
4775            0x4186c0f40d938f46,
4776            fidl::encoding::DynamicFlags::empty(),
4777        )
4778    }
4779}
4780
4781#[must_use = "FIDL methods require a response to be sent"]
4782#[derive(Debug)]
4783pub struct DirectoryDeprecatedGetFlagsResponder {
4784    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4785    tx_id: u32,
4786}
4787
4788/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4789/// if the responder is dropped without sending a response, so that the client
4790/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4791impl std::ops::Drop for DirectoryDeprecatedGetFlagsResponder {
4792    fn drop(&mut self) {
4793        self.control_handle.shutdown();
4794        // Safety: drops once, never accessed again
4795        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4796    }
4797}
4798
4799impl fidl::endpoints::Responder for DirectoryDeprecatedGetFlagsResponder {
4800    type ControlHandle = DirectoryControlHandle;
4801
4802    fn control_handle(&self) -> &DirectoryControlHandle {
4803        &self.control_handle
4804    }
4805
4806    fn drop_without_shutdown(mut self) {
4807        // Safety: drops once, never accessed again due to mem::forget
4808        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4809        // Prevent Drop from running (which would shut down the channel)
4810        std::mem::forget(self);
4811    }
4812}
4813
4814impl DirectoryDeprecatedGetFlagsResponder {
4815    /// Sends a response to the FIDL transaction.
4816    ///
4817    /// Sets the channel to shutdown if an error occurs.
4818    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4819        let _result = self.send_raw(s, flags);
4820        if _result.is_err() {
4821            self.control_handle.shutdown();
4822        }
4823        self.drop_without_shutdown();
4824        _result
4825    }
4826
4827    /// Similar to "send" but does not shutdown the channel if an error occurs.
4828    pub fn send_no_shutdown_on_err(
4829        self,
4830        mut s: i32,
4831        mut flags: OpenFlags,
4832    ) -> Result<(), fidl::Error> {
4833        let _result = self.send_raw(s, flags);
4834        self.drop_without_shutdown();
4835        _result
4836    }
4837
4838    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4839        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
4840            (s, flags),
4841            self.tx_id,
4842            0x5b88fffb8eda3aa1,
4843            fidl::encoding::DynamicFlags::empty(),
4844        )
4845    }
4846}
4847
4848#[must_use = "FIDL methods require a response to be sent"]
4849#[derive(Debug)]
4850pub struct DirectoryDeprecatedSetFlagsResponder {
4851    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4852    tx_id: u32,
4853}
4854
4855/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4856/// if the responder is dropped without sending a response, so that the client
4857/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4858impl std::ops::Drop for DirectoryDeprecatedSetFlagsResponder {
4859    fn drop(&mut self) {
4860        self.control_handle.shutdown();
4861        // Safety: drops once, never accessed again
4862        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4863    }
4864}
4865
4866impl fidl::endpoints::Responder for DirectoryDeprecatedSetFlagsResponder {
4867    type ControlHandle = DirectoryControlHandle;
4868
4869    fn control_handle(&self) -> &DirectoryControlHandle {
4870        &self.control_handle
4871    }
4872
4873    fn drop_without_shutdown(mut self) {
4874        // Safety: drops once, never accessed again due to mem::forget
4875        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4876        // Prevent Drop from running (which would shut down the channel)
4877        std::mem::forget(self);
4878    }
4879}
4880
4881impl DirectoryDeprecatedSetFlagsResponder {
4882    /// Sends a response to the FIDL transaction.
4883    ///
4884    /// Sets the channel to shutdown if an error occurs.
4885    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4886        let _result = self.send_raw(s);
4887        if _result.is_err() {
4888            self.control_handle.shutdown();
4889        }
4890        self.drop_without_shutdown();
4891        _result
4892    }
4893
4894    /// Similar to "send" but does not shutdown the channel if an error occurs.
4895    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4896        let _result = self.send_raw(s);
4897        self.drop_without_shutdown();
4898        _result
4899    }
4900
4901    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4902        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
4903            (s,),
4904            self.tx_id,
4905            0x5295b76c71fde733,
4906            fidl::encoding::DynamicFlags::empty(),
4907        )
4908    }
4909}
4910
4911#[must_use = "FIDL methods require a response to be sent"]
4912#[derive(Debug)]
4913pub struct DirectoryGetFlagsResponder {
4914    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4915    tx_id: u32,
4916}
4917
4918/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4919/// if the responder is dropped without sending a response, so that the client
4920/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4921impl std::ops::Drop for DirectoryGetFlagsResponder {
4922    fn drop(&mut self) {
4923        self.control_handle.shutdown();
4924        // Safety: drops once, never accessed again
4925        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4926    }
4927}
4928
4929impl fidl::endpoints::Responder for DirectoryGetFlagsResponder {
4930    type ControlHandle = DirectoryControlHandle;
4931
4932    fn control_handle(&self) -> &DirectoryControlHandle {
4933        &self.control_handle
4934    }
4935
4936    fn drop_without_shutdown(mut self) {
4937        // Safety: drops once, never accessed again due to mem::forget
4938        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4939        // Prevent Drop from running (which would shut down the channel)
4940        std::mem::forget(self);
4941    }
4942}
4943
4944impl DirectoryGetFlagsResponder {
4945    /// Sends a response to the FIDL transaction.
4946    ///
4947    /// Sets the channel to shutdown if an error occurs.
4948    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4949        let _result = self.send_raw(result);
4950        if _result.is_err() {
4951            self.control_handle.shutdown();
4952        }
4953        self.drop_without_shutdown();
4954        _result
4955    }
4956
4957    /// Similar to "send" but does not shutdown the channel if an error occurs.
4958    pub fn send_no_shutdown_on_err(
4959        self,
4960        mut result: Result<Flags, i32>,
4961    ) -> Result<(), fidl::Error> {
4962        let _result = self.send_raw(result);
4963        self.drop_without_shutdown();
4964        _result
4965    }
4966
4967    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4968        self.control_handle
4969            .inner
4970            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
4971                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
4972                self.tx_id,
4973                0x176eb318f64ec23,
4974                fidl::encoding::DynamicFlags::FLEXIBLE,
4975            )
4976    }
4977}
4978
4979#[must_use = "FIDL methods require a response to be sent"]
4980#[derive(Debug)]
4981pub struct DirectorySetFlagsResponder {
4982    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4983    tx_id: u32,
4984}
4985
4986/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4987/// if the responder is dropped without sending a response, so that the client
4988/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4989impl std::ops::Drop for DirectorySetFlagsResponder {
4990    fn drop(&mut self) {
4991        self.control_handle.shutdown();
4992        // Safety: drops once, never accessed again
4993        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4994    }
4995}
4996
4997impl fidl::endpoints::Responder for DirectorySetFlagsResponder {
4998    type ControlHandle = DirectoryControlHandle;
4999
5000    fn control_handle(&self) -> &DirectoryControlHandle {
5001        &self.control_handle
5002    }
5003
5004    fn drop_without_shutdown(mut self) {
5005        // Safety: drops once, never accessed again due to mem::forget
5006        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5007        // Prevent Drop from running (which would shut down the channel)
5008        std::mem::forget(self);
5009    }
5010}
5011
5012impl DirectorySetFlagsResponder {
5013    /// Sends a response to the FIDL transaction.
5014    ///
5015    /// Sets the channel to shutdown if an error occurs.
5016    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5017        let _result = self.send_raw(result);
5018        if _result.is_err() {
5019            self.control_handle.shutdown();
5020        }
5021        self.drop_without_shutdown();
5022        _result
5023    }
5024
5025    /// Similar to "send" but does not shutdown the channel if an error occurs.
5026    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5027        let _result = self.send_raw(result);
5028        self.drop_without_shutdown();
5029        _result
5030    }
5031
5032    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5033        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5034            fidl::encoding::EmptyStruct,
5035            i32,
5036        >>(
5037            fidl::encoding::FlexibleResult::new(result),
5038            self.tx_id,
5039            0x55a8028685791ea8,
5040            fidl::encoding::DynamicFlags::FLEXIBLE,
5041        )
5042    }
5043}
5044
5045#[must_use = "FIDL methods require a response to be sent"]
5046#[derive(Debug)]
5047pub struct DirectoryQueryFilesystemResponder {
5048    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5049    tx_id: u32,
5050}
5051
5052/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5053/// if the responder is dropped without sending a response, so that the client
5054/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5055impl std::ops::Drop for DirectoryQueryFilesystemResponder {
5056    fn drop(&mut self) {
5057        self.control_handle.shutdown();
5058        // Safety: drops once, never accessed again
5059        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5060    }
5061}
5062
5063impl fidl::endpoints::Responder for DirectoryQueryFilesystemResponder {
5064    type ControlHandle = DirectoryControlHandle;
5065
5066    fn control_handle(&self) -> &DirectoryControlHandle {
5067        &self.control_handle
5068    }
5069
5070    fn drop_without_shutdown(mut self) {
5071        // Safety: drops once, never accessed again due to mem::forget
5072        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5073        // Prevent Drop from running (which would shut down the channel)
5074        std::mem::forget(self);
5075    }
5076}
5077
5078impl DirectoryQueryFilesystemResponder {
5079    /// Sends a response to the FIDL transaction.
5080    ///
5081    /// Sets the channel to shutdown if an error occurs.
5082    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5083        let _result = self.send_raw(s, info);
5084        if _result.is_err() {
5085            self.control_handle.shutdown();
5086        }
5087        self.drop_without_shutdown();
5088        _result
5089    }
5090
5091    /// Similar to "send" but does not shutdown the channel if an error occurs.
5092    pub fn send_no_shutdown_on_err(
5093        self,
5094        mut s: i32,
5095        mut info: Option<&FilesystemInfo>,
5096    ) -> Result<(), fidl::Error> {
5097        let _result = self.send_raw(s, info);
5098        self.drop_without_shutdown();
5099        _result
5100    }
5101
5102    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5103        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
5104            (s, info),
5105            self.tx_id,
5106            0x6f344a1c6b0a0610,
5107            fidl::encoding::DynamicFlags::empty(),
5108        )
5109    }
5110}
5111
5112#[must_use = "FIDL methods require a response to be sent"]
5113#[derive(Debug)]
5114pub struct DirectoryGetAttributesResponder {
5115    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5116    tx_id: u32,
5117}
5118
5119/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5120/// if the responder is dropped without sending a response, so that the client
5121/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5122impl std::ops::Drop for DirectoryGetAttributesResponder {
5123    fn drop(&mut self) {
5124        self.control_handle.shutdown();
5125        // Safety: drops once, never accessed again
5126        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5127    }
5128}
5129
5130impl fidl::endpoints::Responder for DirectoryGetAttributesResponder {
5131    type ControlHandle = DirectoryControlHandle;
5132
5133    fn control_handle(&self) -> &DirectoryControlHandle {
5134        &self.control_handle
5135    }
5136
5137    fn drop_without_shutdown(mut self) {
5138        // Safety: drops once, never accessed again due to mem::forget
5139        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5140        // Prevent Drop from running (which would shut down the channel)
5141        std::mem::forget(self);
5142    }
5143}
5144
5145impl DirectoryGetAttributesResponder {
5146    /// Sends a response to the FIDL transaction.
5147    ///
5148    /// Sets the channel to shutdown if an error occurs.
5149    pub fn send(
5150        self,
5151        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5152    ) -> Result<(), fidl::Error> {
5153        let _result = self.send_raw(result);
5154        if _result.is_err() {
5155            self.control_handle.shutdown();
5156        }
5157        self.drop_without_shutdown();
5158        _result
5159    }
5160
5161    /// Similar to "send" but does not shutdown the channel if an error occurs.
5162    pub fn send_no_shutdown_on_err(
5163        self,
5164        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5165    ) -> Result<(), fidl::Error> {
5166        let _result = self.send_raw(result);
5167        self.drop_without_shutdown();
5168        _result
5169    }
5170
5171    fn send_raw(
5172        &self,
5173        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5174    ) -> Result<(), fidl::Error> {
5175        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
5176            result,
5177            self.tx_id,
5178            0x3d4396a638ea053b,
5179            fidl::encoding::DynamicFlags::empty(),
5180        )
5181    }
5182}
5183
5184#[must_use = "FIDL methods require a response to be sent"]
5185#[derive(Debug)]
5186pub struct DirectoryUpdateAttributesResponder {
5187    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5188    tx_id: u32,
5189}
5190
5191/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5192/// if the responder is dropped without sending a response, so that the client
5193/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5194impl std::ops::Drop for DirectoryUpdateAttributesResponder {
5195    fn drop(&mut self) {
5196        self.control_handle.shutdown();
5197        // Safety: drops once, never accessed again
5198        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5199    }
5200}
5201
5202impl fidl::endpoints::Responder for DirectoryUpdateAttributesResponder {
5203    type ControlHandle = DirectoryControlHandle;
5204
5205    fn control_handle(&self) -> &DirectoryControlHandle {
5206        &self.control_handle
5207    }
5208
5209    fn drop_without_shutdown(mut self) {
5210        // Safety: drops once, never accessed again due to mem::forget
5211        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5212        // Prevent Drop from running (which would shut down the channel)
5213        std::mem::forget(self);
5214    }
5215}
5216
5217impl DirectoryUpdateAttributesResponder {
5218    /// Sends a response to the FIDL transaction.
5219    ///
5220    /// Sets the channel to shutdown if an error occurs.
5221    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5222        let _result = self.send_raw(result);
5223        if _result.is_err() {
5224            self.control_handle.shutdown();
5225        }
5226        self.drop_without_shutdown();
5227        _result
5228    }
5229
5230    /// Similar to "send" but does not shutdown the channel if an error occurs.
5231    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5232        let _result = self.send_raw(result);
5233        self.drop_without_shutdown();
5234        _result
5235    }
5236
5237    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5238        self.control_handle
5239            .inner
5240            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5241                result,
5242                self.tx_id,
5243                0x3308c1da5a89bf08,
5244                fidl::encoding::DynamicFlags::empty(),
5245            )
5246    }
5247}
5248
5249#[must_use = "FIDL methods require a response to be sent"]
5250#[derive(Debug)]
5251pub struct DirectorySyncResponder {
5252    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5253    tx_id: u32,
5254}
5255
5256/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5257/// if the responder is dropped without sending a response, so that the client
5258/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5259impl std::ops::Drop for DirectorySyncResponder {
5260    fn drop(&mut self) {
5261        self.control_handle.shutdown();
5262        // Safety: drops once, never accessed again
5263        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5264    }
5265}
5266
5267impl fidl::endpoints::Responder for DirectorySyncResponder {
5268    type ControlHandle = DirectoryControlHandle;
5269
5270    fn control_handle(&self) -> &DirectoryControlHandle {
5271        &self.control_handle
5272    }
5273
5274    fn drop_without_shutdown(mut self) {
5275        // Safety: drops once, never accessed again due to mem::forget
5276        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5277        // Prevent Drop from running (which would shut down the channel)
5278        std::mem::forget(self);
5279    }
5280}
5281
5282impl DirectorySyncResponder {
5283    /// Sends a response to the FIDL transaction.
5284    ///
5285    /// Sets the channel to shutdown if an error occurs.
5286    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5287        let _result = self.send_raw(result);
5288        if _result.is_err() {
5289            self.control_handle.shutdown();
5290        }
5291        self.drop_without_shutdown();
5292        _result
5293    }
5294
5295    /// Similar to "send" but does not shutdown the channel if an error occurs.
5296    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5297        let _result = self.send_raw(result);
5298        self.drop_without_shutdown();
5299        _result
5300    }
5301
5302    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5303        self.control_handle
5304            .inner
5305            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5306                result,
5307                self.tx_id,
5308                0x2c5c27ca0ab5dc49,
5309                fidl::encoding::DynamicFlags::empty(),
5310            )
5311    }
5312}
5313
5314#[must_use = "FIDL methods require a response to be sent"]
5315#[derive(Debug)]
5316pub struct DirectoryGetExtendedAttributeResponder {
5317    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5318    tx_id: u32,
5319}
5320
5321/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5322/// if the responder is dropped without sending a response, so that the client
5323/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5324impl std::ops::Drop for DirectoryGetExtendedAttributeResponder {
5325    fn drop(&mut self) {
5326        self.control_handle.shutdown();
5327        // Safety: drops once, never accessed again
5328        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5329    }
5330}
5331
5332impl fidl::endpoints::Responder for DirectoryGetExtendedAttributeResponder {
5333    type ControlHandle = DirectoryControlHandle;
5334
5335    fn control_handle(&self) -> &DirectoryControlHandle {
5336        &self.control_handle
5337    }
5338
5339    fn drop_without_shutdown(mut self) {
5340        // Safety: drops once, never accessed again due to mem::forget
5341        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5342        // Prevent Drop from running (which would shut down the channel)
5343        std::mem::forget(self);
5344    }
5345}
5346
5347impl DirectoryGetExtendedAttributeResponder {
5348    /// Sends a response to the FIDL transaction.
5349    ///
5350    /// Sets the channel to shutdown if an error occurs.
5351    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5352        let _result = self.send_raw(result);
5353        if _result.is_err() {
5354            self.control_handle.shutdown();
5355        }
5356        self.drop_without_shutdown();
5357        _result
5358    }
5359
5360    /// Similar to "send" but does not shutdown the channel if an error occurs.
5361    pub fn send_no_shutdown_on_err(
5362        self,
5363        mut result: Result<ExtendedAttributeValue, i32>,
5364    ) -> Result<(), fidl::Error> {
5365        let _result = self.send_raw(result);
5366        self.drop_without_shutdown();
5367        _result
5368    }
5369
5370    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5371        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
5372            result.as_mut().map_err(|e| *e),
5373            self.tx_id,
5374            0x45ffa3ccfdeb76db,
5375            fidl::encoding::DynamicFlags::empty(),
5376        )
5377    }
5378}
5379
5380#[must_use = "FIDL methods require a response to be sent"]
5381#[derive(Debug)]
5382pub struct DirectorySetExtendedAttributeResponder {
5383    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5384    tx_id: u32,
5385}
5386
5387/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5388/// if the responder is dropped without sending a response, so that the client
5389/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5390impl std::ops::Drop for DirectorySetExtendedAttributeResponder {
5391    fn drop(&mut self) {
5392        self.control_handle.shutdown();
5393        // Safety: drops once, never accessed again
5394        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5395    }
5396}
5397
5398impl fidl::endpoints::Responder for DirectorySetExtendedAttributeResponder {
5399    type ControlHandle = DirectoryControlHandle;
5400
5401    fn control_handle(&self) -> &DirectoryControlHandle {
5402        &self.control_handle
5403    }
5404
5405    fn drop_without_shutdown(mut self) {
5406        // Safety: drops once, never accessed again due to mem::forget
5407        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5408        // Prevent Drop from running (which would shut down the channel)
5409        std::mem::forget(self);
5410    }
5411}
5412
5413impl DirectorySetExtendedAttributeResponder {
5414    /// Sends a response to the FIDL transaction.
5415    ///
5416    /// Sets the channel to shutdown if an error occurs.
5417    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5418        let _result = self.send_raw(result);
5419        if _result.is_err() {
5420            self.control_handle.shutdown();
5421        }
5422        self.drop_without_shutdown();
5423        _result
5424    }
5425
5426    /// Similar to "send" but does not shutdown the channel if an error occurs.
5427    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5428        let _result = self.send_raw(result);
5429        self.drop_without_shutdown();
5430        _result
5431    }
5432
5433    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5434        self.control_handle
5435            .inner
5436            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5437                result,
5438                self.tx_id,
5439                0x4a951362f681f23c,
5440                fidl::encoding::DynamicFlags::empty(),
5441            )
5442    }
5443}
5444
5445#[must_use = "FIDL methods require a response to be sent"]
5446#[derive(Debug)]
5447pub struct DirectoryRemoveExtendedAttributeResponder {
5448    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5449    tx_id: u32,
5450}
5451
5452/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5453/// if the responder is dropped without sending a response, so that the client
5454/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5455impl std::ops::Drop for DirectoryRemoveExtendedAttributeResponder {
5456    fn drop(&mut self) {
5457        self.control_handle.shutdown();
5458        // Safety: drops once, never accessed again
5459        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5460    }
5461}
5462
5463impl fidl::endpoints::Responder for DirectoryRemoveExtendedAttributeResponder {
5464    type ControlHandle = DirectoryControlHandle;
5465
5466    fn control_handle(&self) -> &DirectoryControlHandle {
5467        &self.control_handle
5468    }
5469
5470    fn drop_without_shutdown(mut self) {
5471        // Safety: drops once, never accessed again due to mem::forget
5472        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5473        // Prevent Drop from running (which would shut down the channel)
5474        std::mem::forget(self);
5475    }
5476}
5477
5478impl DirectoryRemoveExtendedAttributeResponder {
5479    /// Sends a response to the FIDL transaction.
5480    ///
5481    /// Sets the channel to shutdown if an error occurs.
5482    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5483        let _result = self.send_raw(result);
5484        if _result.is_err() {
5485            self.control_handle.shutdown();
5486        }
5487        self.drop_without_shutdown();
5488        _result
5489    }
5490
5491    /// Similar to "send" but does not shutdown the channel if an error occurs.
5492    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5493        let _result = self.send_raw(result);
5494        self.drop_without_shutdown();
5495        _result
5496    }
5497
5498    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5499        self.control_handle
5500            .inner
5501            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5502                result,
5503                self.tx_id,
5504                0x7a0b9f3a9bf9032d,
5505                fidl::encoding::DynamicFlags::empty(),
5506            )
5507    }
5508}
5509
5510#[must_use = "FIDL methods require a response to be sent"]
5511#[derive(Debug)]
5512pub struct DirectoryReadDirentsResponder {
5513    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5514    tx_id: u32,
5515}
5516
5517/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5518/// if the responder is dropped without sending a response, so that the client
5519/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5520impl std::ops::Drop for DirectoryReadDirentsResponder {
5521    fn drop(&mut self) {
5522        self.control_handle.shutdown();
5523        // Safety: drops once, never accessed again
5524        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5525    }
5526}
5527
5528impl fidl::endpoints::Responder for DirectoryReadDirentsResponder {
5529    type ControlHandle = DirectoryControlHandle;
5530
5531    fn control_handle(&self) -> &DirectoryControlHandle {
5532        &self.control_handle
5533    }
5534
5535    fn drop_without_shutdown(mut self) {
5536        // Safety: drops once, never accessed again due to mem::forget
5537        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5538        // Prevent Drop from running (which would shut down the channel)
5539        std::mem::forget(self);
5540    }
5541}
5542
5543impl DirectoryReadDirentsResponder {
5544    /// Sends a response to the FIDL transaction.
5545    ///
5546    /// Sets the channel to shutdown if an error occurs.
5547    pub fn send(self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5548        let _result = self.send_raw(s, dirents);
5549        if _result.is_err() {
5550            self.control_handle.shutdown();
5551        }
5552        self.drop_without_shutdown();
5553        _result
5554    }
5555
5556    /// Similar to "send" but does not shutdown the channel if an error occurs.
5557    pub fn send_no_shutdown_on_err(
5558        self,
5559        mut s: i32,
5560        mut dirents: &[u8],
5561    ) -> Result<(), fidl::Error> {
5562        let _result = self.send_raw(s, dirents);
5563        self.drop_without_shutdown();
5564        _result
5565    }
5566
5567    fn send_raw(&self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5568        self.control_handle.inner.send::<DirectoryReadDirentsResponse>(
5569            (s, dirents),
5570            self.tx_id,
5571            0x3582806bf27faa0a,
5572            fidl::encoding::DynamicFlags::empty(),
5573        )
5574    }
5575}
5576
5577#[must_use = "FIDL methods require a response to be sent"]
5578#[derive(Debug)]
5579pub struct DirectoryRewindResponder {
5580    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5581    tx_id: u32,
5582}
5583
5584/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5585/// if the responder is dropped without sending a response, so that the client
5586/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5587impl std::ops::Drop for DirectoryRewindResponder {
5588    fn drop(&mut self) {
5589        self.control_handle.shutdown();
5590        // Safety: drops once, never accessed again
5591        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5592    }
5593}
5594
5595impl fidl::endpoints::Responder for DirectoryRewindResponder {
5596    type ControlHandle = DirectoryControlHandle;
5597
5598    fn control_handle(&self) -> &DirectoryControlHandle {
5599        &self.control_handle
5600    }
5601
5602    fn drop_without_shutdown(mut self) {
5603        // Safety: drops once, never accessed again due to mem::forget
5604        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5605        // Prevent Drop from running (which would shut down the channel)
5606        std::mem::forget(self);
5607    }
5608}
5609
5610impl DirectoryRewindResponder {
5611    /// Sends a response to the FIDL transaction.
5612    ///
5613    /// Sets the channel to shutdown if an error occurs.
5614    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5615        let _result = self.send_raw(s);
5616        if _result.is_err() {
5617            self.control_handle.shutdown();
5618        }
5619        self.drop_without_shutdown();
5620        _result
5621    }
5622
5623    /// Similar to "send" but does not shutdown the channel if an error occurs.
5624    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5625        let _result = self.send_raw(s);
5626        self.drop_without_shutdown();
5627        _result
5628    }
5629
5630    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5631        self.control_handle.inner.send::<DirectoryRewindResponse>(
5632            (s,),
5633            self.tx_id,
5634            0x16b1202af0f34c71,
5635            fidl::encoding::DynamicFlags::empty(),
5636        )
5637    }
5638}
5639
5640#[must_use = "FIDL methods require a response to be sent"]
5641#[derive(Debug)]
5642pub struct DirectoryGetTokenResponder {
5643    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5644    tx_id: u32,
5645}
5646
5647/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5648/// if the responder is dropped without sending a response, so that the client
5649/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5650impl std::ops::Drop for DirectoryGetTokenResponder {
5651    fn drop(&mut self) {
5652        self.control_handle.shutdown();
5653        // Safety: drops once, never accessed again
5654        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5655    }
5656}
5657
5658impl fidl::endpoints::Responder for DirectoryGetTokenResponder {
5659    type ControlHandle = DirectoryControlHandle;
5660
5661    fn control_handle(&self) -> &DirectoryControlHandle {
5662        &self.control_handle
5663    }
5664
5665    fn drop_without_shutdown(mut self) {
5666        // Safety: drops once, never accessed again due to mem::forget
5667        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5668        // Prevent Drop from running (which would shut down the channel)
5669        std::mem::forget(self);
5670    }
5671}
5672
5673impl DirectoryGetTokenResponder {
5674    /// Sends a response to the FIDL transaction.
5675    ///
5676    /// Sets the channel to shutdown if an error occurs.
5677    pub fn send(self, mut s: i32, mut token: Option<fidl::Handle>) -> Result<(), fidl::Error> {
5678        let _result = self.send_raw(s, token);
5679        if _result.is_err() {
5680            self.control_handle.shutdown();
5681        }
5682        self.drop_without_shutdown();
5683        _result
5684    }
5685
5686    /// Similar to "send" but does not shutdown the channel if an error occurs.
5687    pub fn send_no_shutdown_on_err(
5688        self,
5689        mut s: i32,
5690        mut token: Option<fidl::Handle>,
5691    ) -> Result<(), fidl::Error> {
5692        let _result = self.send_raw(s, token);
5693        self.drop_without_shutdown();
5694        _result
5695    }
5696
5697    fn send_raw(&self, mut s: i32, mut token: Option<fidl::Handle>) -> Result<(), fidl::Error> {
5698        self.control_handle.inner.send::<DirectoryGetTokenResponse>(
5699            (s, token),
5700            self.tx_id,
5701            0x26ae9d18763c8655,
5702            fidl::encoding::DynamicFlags::empty(),
5703        )
5704    }
5705}
5706
5707#[must_use = "FIDL methods require a response to be sent"]
5708#[derive(Debug)]
5709pub struct DirectoryLinkResponder {
5710    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5711    tx_id: u32,
5712}
5713
5714/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5715/// if the responder is dropped without sending a response, so that the client
5716/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5717impl std::ops::Drop for DirectoryLinkResponder {
5718    fn drop(&mut self) {
5719        self.control_handle.shutdown();
5720        // Safety: drops once, never accessed again
5721        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5722    }
5723}
5724
5725impl fidl::endpoints::Responder for DirectoryLinkResponder {
5726    type ControlHandle = DirectoryControlHandle;
5727
5728    fn control_handle(&self) -> &DirectoryControlHandle {
5729        &self.control_handle
5730    }
5731
5732    fn drop_without_shutdown(mut self) {
5733        // Safety: drops once, never accessed again due to mem::forget
5734        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5735        // Prevent Drop from running (which would shut down the channel)
5736        std::mem::forget(self);
5737    }
5738}
5739
5740impl DirectoryLinkResponder {
5741    /// Sends a response to the FIDL transaction.
5742    ///
5743    /// Sets the channel to shutdown if an error occurs.
5744    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5745        let _result = self.send_raw(s);
5746        if _result.is_err() {
5747            self.control_handle.shutdown();
5748        }
5749        self.drop_without_shutdown();
5750        _result
5751    }
5752
5753    /// Similar to "send" but does not shutdown the channel if an error occurs.
5754    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5755        let _result = self.send_raw(s);
5756        self.drop_without_shutdown();
5757        _result
5758    }
5759
5760    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5761        self.control_handle.inner.send::<DirectoryLinkResponse>(
5762            (s,),
5763            self.tx_id,
5764            0x740604c0c7c930e7,
5765            fidl::encoding::DynamicFlags::empty(),
5766        )
5767    }
5768}
5769
5770#[must_use = "FIDL methods require a response to be sent"]
5771#[derive(Debug)]
5772pub struct DirectoryUnlinkResponder {
5773    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5774    tx_id: u32,
5775}
5776
5777/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5778/// if the responder is dropped without sending a response, so that the client
5779/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5780impl std::ops::Drop for DirectoryUnlinkResponder {
5781    fn drop(&mut self) {
5782        self.control_handle.shutdown();
5783        // Safety: drops once, never accessed again
5784        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5785    }
5786}
5787
5788impl fidl::endpoints::Responder for DirectoryUnlinkResponder {
5789    type ControlHandle = DirectoryControlHandle;
5790
5791    fn control_handle(&self) -> &DirectoryControlHandle {
5792        &self.control_handle
5793    }
5794
5795    fn drop_without_shutdown(mut self) {
5796        // Safety: drops once, never accessed again due to mem::forget
5797        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5798        // Prevent Drop from running (which would shut down the channel)
5799        std::mem::forget(self);
5800    }
5801}
5802
5803impl DirectoryUnlinkResponder {
5804    /// Sends a response to the FIDL transaction.
5805    ///
5806    /// Sets the channel to shutdown if an error occurs.
5807    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5808        let _result = self.send_raw(result);
5809        if _result.is_err() {
5810            self.control_handle.shutdown();
5811        }
5812        self.drop_without_shutdown();
5813        _result
5814    }
5815
5816    /// Similar to "send" but does not shutdown the channel if an error occurs.
5817    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5818        let _result = self.send_raw(result);
5819        self.drop_without_shutdown();
5820        _result
5821    }
5822
5823    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5824        self.control_handle
5825            .inner
5826            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5827                result,
5828                self.tx_id,
5829                0x750a0326a78d7bed,
5830                fidl::encoding::DynamicFlags::empty(),
5831            )
5832    }
5833}
5834
5835#[must_use = "FIDL methods require a response to be sent"]
5836#[derive(Debug)]
5837pub struct DirectoryRenameResponder {
5838    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5839    tx_id: u32,
5840}
5841
5842/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5843/// if the responder is dropped without sending a response, so that the client
5844/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5845impl std::ops::Drop for DirectoryRenameResponder {
5846    fn drop(&mut self) {
5847        self.control_handle.shutdown();
5848        // Safety: drops once, never accessed again
5849        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5850    }
5851}
5852
5853impl fidl::endpoints::Responder for DirectoryRenameResponder {
5854    type ControlHandle = DirectoryControlHandle;
5855
5856    fn control_handle(&self) -> &DirectoryControlHandle {
5857        &self.control_handle
5858    }
5859
5860    fn drop_without_shutdown(mut self) {
5861        // Safety: drops once, never accessed again due to mem::forget
5862        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5863        // Prevent Drop from running (which would shut down the channel)
5864        std::mem::forget(self);
5865    }
5866}
5867
5868impl DirectoryRenameResponder {
5869    /// Sends a response to the FIDL transaction.
5870    ///
5871    /// Sets the channel to shutdown if an error occurs.
5872    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5873        let _result = self.send_raw(result);
5874        if _result.is_err() {
5875            self.control_handle.shutdown();
5876        }
5877        self.drop_without_shutdown();
5878        _result
5879    }
5880
5881    /// Similar to "send" but does not shutdown the channel if an error occurs.
5882    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5883        let _result = self.send_raw(result);
5884        self.drop_without_shutdown();
5885        _result
5886    }
5887
5888    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5889        self.control_handle
5890            .inner
5891            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5892                result,
5893                self.tx_id,
5894                0x7060e7723b9928de,
5895                fidl::encoding::DynamicFlags::empty(),
5896            )
5897    }
5898}
5899
5900#[must_use = "FIDL methods require a response to be sent"]
5901#[derive(Debug)]
5902pub struct DirectoryCreateSymlinkResponder {
5903    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5904    tx_id: u32,
5905}
5906
5907/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5908/// if the responder is dropped without sending a response, so that the client
5909/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5910impl std::ops::Drop for DirectoryCreateSymlinkResponder {
5911    fn drop(&mut self) {
5912        self.control_handle.shutdown();
5913        // Safety: drops once, never accessed again
5914        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5915    }
5916}
5917
5918impl fidl::endpoints::Responder for DirectoryCreateSymlinkResponder {
5919    type ControlHandle = DirectoryControlHandle;
5920
5921    fn control_handle(&self) -> &DirectoryControlHandle {
5922        &self.control_handle
5923    }
5924
5925    fn drop_without_shutdown(mut self) {
5926        // Safety: drops once, never accessed again due to mem::forget
5927        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5928        // Prevent Drop from running (which would shut down the channel)
5929        std::mem::forget(self);
5930    }
5931}
5932
5933impl DirectoryCreateSymlinkResponder {
5934    /// Sends a response to the FIDL transaction.
5935    ///
5936    /// Sets the channel to shutdown if an error occurs.
5937    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5938        let _result = self.send_raw(result);
5939        if _result.is_err() {
5940            self.control_handle.shutdown();
5941        }
5942        self.drop_without_shutdown();
5943        _result
5944    }
5945
5946    /// Similar to "send" but does not shutdown the channel if an error occurs.
5947    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5948        let _result = self.send_raw(result);
5949        self.drop_without_shutdown();
5950        _result
5951    }
5952
5953    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5954        self.control_handle
5955            .inner
5956            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5957                result,
5958                self.tx_id,
5959                0x21ce0f19ec043889,
5960                fidl::encoding::DynamicFlags::empty(),
5961            )
5962    }
5963}
5964
5965#[must_use = "FIDL methods require a response to be sent"]
5966#[derive(Debug)]
5967pub struct DirectoryWatchResponder {
5968    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5969    tx_id: u32,
5970}
5971
5972/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5973/// if the responder is dropped without sending a response, so that the client
5974/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5975impl std::ops::Drop for DirectoryWatchResponder {
5976    fn drop(&mut self) {
5977        self.control_handle.shutdown();
5978        // Safety: drops once, never accessed again
5979        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5980    }
5981}
5982
5983impl fidl::endpoints::Responder for DirectoryWatchResponder {
5984    type ControlHandle = DirectoryControlHandle;
5985
5986    fn control_handle(&self) -> &DirectoryControlHandle {
5987        &self.control_handle
5988    }
5989
5990    fn drop_without_shutdown(mut self) {
5991        // Safety: drops once, never accessed again due to mem::forget
5992        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5993        // Prevent Drop from running (which would shut down the channel)
5994        std::mem::forget(self);
5995    }
5996}
5997
5998impl DirectoryWatchResponder {
5999    /// Sends a response to the FIDL transaction.
6000    ///
6001    /// Sets the channel to shutdown if an error occurs.
6002    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
6003        let _result = self.send_raw(s);
6004        if _result.is_err() {
6005            self.control_handle.shutdown();
6006        }
6007        self.drop_without_shutdown();
6008        _result
6009    }
6010
6011    /// Similar to "send" but does not shutdown the channel if an error occurs.
6012    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
6013        let _result = self.send_raw(s);
6014        self.drop_without_shutdown();
6015        _result
6016    }
6017
6018    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
6019        self.control_handle.inner.send::<DirectoryWatchResponse>(
6020            (s,),
6021            self.tx_id,
6022            0x5717193a59d66d91,
6023            fidl::encoding::DynamicFlags::empty(),
6024        )
6025    }
6026}
6027
6028#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6029pub struct DirectoryWatcherMarker;
6030
6031impl fidl::endpoints::ProtocolMarker for DirectoryWatcherMarker {
6032    type Proxy = DirectoryWatcherProxy;
6033    type RequestStream = DirectoryWatcherRequestStream;
6034    #[cfg(target_os = "fuchsia")]
6035    type SynchronousProxy = DirectoryWatcherSynchronousProxy;
6036
6037    const DEBUG_NAME: &'static str = "(anonymous) DirectoryWatcher";
6038}
6039
6040pub trait DirectoryWatcherProxyInterface: Send + Sync {}
6041#[derive(Debug)]
6042#[cfg(target_os = "fuchsia")]
6043pub struct DirectoryWatcherSynchronousProxy {
6044    client: fidl::client::sync::Client,
6045}
6046
6047#[cfg(target_os = "fuchsia")]
6048impl fidl::endpoints::SynchronousProxy for DirectoryWatcherSynchronousProxy {
6049    type Proxy = DirectoryWatcherProxy;
6050    type Protocol = DirectoryWatcherMarker;
6051
6052    fn from_channel(inner: fidl::Channel) -> Self {
6053        Self::new(inner)
6054    }
6055
6056    fn into_channel(self) -> fidl::Channel {
6057        self.client.into_channel()
6058    }
6059
6060    fn as_channel(&self) -> &fidl::Channel {
6061        self.client.as_channel()
6062    }
6063}
6064
6065#[cfg(target_os = "fuchsia")]
6066impl DirectoryWatcherSynchronousProxy {
6067    pub fn new(channel: fidl::Channel) -> Self {
6068        let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6069        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6070    }
6071
6072    pub fn into_channel(self) -> fidl::Channel {
6073        self.client.into_channel()
6074    }
6075
6076    /// Waits until an event arrives and returns it. It is safe for other
6077    /// threads to make concurrent requests while waiting for an event.
6078    pub fn wait_for_event(
6079        &self,
6080        deadline: zx::MonotonicInstant,
6081    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6082        DirectoryWatcherEvent::decode(self.client.wait_for_event(deadline)?)
6083    }
6084}
6085
6086#[cfg(target_os = "fuchsia")]
6087impl From<DirectoryWatcherSynchronousProxy> for zx::Handle {
6088    fn from(value: DirectoryWatcherSynchronousProxy) -> Self {
6089        value.into_channel().into()
6090    }
6091}
6092
6093#[cfg(target_os = "fuchsia")]
6094impl From<fidl::Channel> for DirectoryWatcherSynchronousProxy {
6095    fn from(value: fidl::Channel) -> Self {
6096        Self::new(value)
6097    }
6098}
6099
6100#[cfg(target_os = "fuchsia")]
6101impl fidl::endpoints::FromClient for DirectoryWatcherSynchronousProxy {
6102    type Protocol = DirectoryWatcherMarker;
6103
6104    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryWatcherMarker>) -> Self {
6105        Self::new(value.into_channel())
6106    }
6107}
6108
6109#[derive(Debug, Clone)]
6110pub struct DirectoryWatcherProxy {
6111    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6112}
6113
6114impl fidl::endpoints::Proxy for DirectoryWatcherProxy {
6115    type Protocol = DirectoryWatcherMarker;
6116
6117    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6118        Self::new(inner)
6119    }
6120
6121    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6122        self.client.into_channel().map_err(|client| Self { client })
6123    }
6124
6125    fn as_channel(&self) -> &::fidl::AsyncChannel {
6126        self.client.as_channel()
6127    }
6128}
6129
6130impl DirectoryWatcherProxy {
6131    /// Create a new Proxy for fuchsia.io/DirectoryWatcher.
6132    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6133        let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6134        Self { client: fidl::client::Client::new(channel, protocol_name) }
6135    }
6136
6137    /// Get a Stream of events from the remote end of the protocol.
6138    ///
6139    /// # Panics
6140    ///
6141    /// Panics if the event stream was already taken.
6142    pub fn take_event_stream(&self) -> DirectoryWatcherEventStream {
6143        DirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
6144    }
6145}
6146
6147impl DirectoryWatcherProxyInterface for DirectoryWatcherProxy {}
6148
6149pub struct DirectoryWatcherEventStream {
6150    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6151}
6152
6153impl std::marker::Unpin for DirectoryWatcherEventStream {}
6154
6155impl futures::stream::FusedStream for DirectoryWatcherEventStream {
6156    fn is_terminated(&self) -> bool {
6157        self.event_receiver.is_terminated()
6158    }
6159}
6160
6161impl futures::Stream for DirectoryWatcherEventStream {
6162    type Item = Result<DirectoryWatcherEvent, fidl::Error>;
6163
6164    fn poll_next(
6165        mut self: std::pin::Pin<&mut Self>,
6166        cx: &mut std::task::Context<'_>,
6167    ) -> std::task::Poll<Option<Self::Item>> {
6168        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6169            &mut self.event_receiver,
6170            cx
6171        )?) {
6172            Some(buf) => std::task::Poll::Ready(Some(DirectoryWatcherEvent::decode(buf))),
6173            None => std::task::Poll::Ready(None),
6174        }
6175    }
6176}
6177
6178#[derive(Debug)]
6179pub enum DirectoryWatcherEvent {}
6180
6181impl DirectoryWatcherEvent {
6182    /// Decodes a message buffer as a [`DirectoryWatcherEvent`].
6183    fn decode(
6184        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6185    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6186        let (bytes, _handles) = buf.split_mut();
6187        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6188        debug_assert_eq!(tx_header.tx_id, 0);
6189        match tx_header.ordinal {
6190            _ => Err(fidl::Error::UnknownOrdinal {
6191                ordinal: tx_header.ordinal,
6192                protocol_name:
6193                    <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6194            }),
6195        }
6196    }
6197}
6198
6199/// A Stream of incoming requests for fuchsia.io/DirectoryWatcher.
6200pub struct DirectoryWatcherRequestStream {
6201    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6202    is_terminated: bool,
6203}
6204
6205impl std::marker::Unpin for DirectoryWatcherRequestStream {}
6206
6207impl futures::stream::FusedStream for DirectoryWatcherRequestStream {
6208    fn is_terminated(&self) -> bool {
6209        self.is_terminated
6210    }
6211}
6212
6213impl fidl::endpoints::RequestStream for DirectoryWatcherRequestStream {
6214    type Protocol = DirectoryWatcherMarker;
6215    type ControlHandle = DirectoryWatcherControlHandle;
6216
6217    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6218        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6219    }
6220
6221    fn control_handle(&self) -> Self::ControlHandle {
6222        DirectoryWatcherControlHandle { inner: self.inner.clone() }
6223    }
6224
6225    fn into_inner(
6226        self,
6227    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6228    {
6229        (self.inner, self.is_terminated)
6230    }
6231
6232    fn from_inner(
6233        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6234        is_terminated: bool,
6235    ) -> Self {
6236        Self { inner, is_terminated }
6237    }
6238}
6239
6240impl futures::Stream for DirectoryWatcherRequestStream {
6241    type Item = Result<DirectoryWatcherRequest, fidl::Error>;
6242
6243    fn poll_next(
6244        mut self: std::pin::Pin<&mut Self>,
6245        cx: &mut std::task::Context<'_>,
6246    ) -> std::task::Poll<Option<Self::Item>> {
6247        let this = &mut *self;
6248        if this.inner.check_shutdown(cx) {
6249            this.is_terminated = true;
6250            return std::task::Poll::Ready(None);
6251        }
6252        if this.is_terminated {
6253            panic!("polled DirectoryWatcherRequestStream after completion");
6254        }
6255        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6256            |bytes, handles| {
6257                match this.inner.channel().read_etc(cx, bytes, handles) {
6258                    std::task::Poll::Ready(Ok(())) => {}
6259                    std::task::Poll::Pending => return std::task::Poll::Pending,
6260                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6261                        this.is_terminated = true;
6262                        return std::task::Poll::Ready(None);
6263                    }
6264                    std::task::Poll::Ready(Err(e)) => {
6265                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6266                            e.into(),
6267                        ))));
6268                    }
6269                }
6270
6271                // A message has been received from the channel
6272                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6273
6274                std::task::Poll::Ready(Some(match header.ordinal {
6275                    _ => Err(fidl::Error::UnknownOrdinal {
6276                        ordinal: header.ordinal,
6277                        protocol_name:
6278                            <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6279                    }),
6280                }))
6281            },
6282        )
6283    }
6284}
6285
6286/// DirectoryWatcher transmits messages from a filesystem server
6287/// about events happening in the filesystem. Clients can register
6288/// new watchers using the `Directory.Watch` method, where they can
6289/// filter which events they want to receive notifications for.
6290///
6291/// The DirectoryWatcher will send messages of the form:
6292/// ```
6293/// struct {
6294///   uint8 event;
6295///   uint8 len;
6296///   char name[];
6297/// };
6298/// ```
6299/// Where names are NOT null-terminated. The name is the relative
6300/// path to the entry the event is refering to. It will be empty if
6301/// the event isn't referencing a particular entry (e.g. for the
6302/// `IDLE` event).
6303#[derive(Debug)]
6304pub enum DirectoryWatcherRequest {}
6305
6306impl DirectoryWatcherRequest {
6307    /// Name of the method defined in FIDL
6308    pub fn method_name(&self) -> &'static str {
6309        match *self {}
6310    }
6311}
6312
6313#[derive(Debug, Clone)]
6314pub struct DirectoryWatcherControlHandle {
6315    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6316}
6317
6318impl fidl::endpoints::ControlHandle for DirectoryWatcherControlHandle {
6319    fn shutdown(&self) {
6320        self.inner.shutdown()
6321    }
6322    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6323        self.inner.shutdown_with_epitaph(status)
6324    }
6325
6326    fn is_closed(&self) -> bool {
6327        self.inner.channel().is_closed()
6328    }
6329    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6330        self.inner.channel().on_closed()
6331    }
6332
6333    #[cfg(target_os = "fuchsia")]
6334    fn signal_peer(
6335        &self,
6336        clear_mask: zx::Signals,
6337        set_mask: zx::Signals,
6338    ) -> Result<(), zx_status::Status> {
6339        use fidl::Peered;
6340        self.inner.channel().signal_peer(clear_mask, set_mask)
6341    }
6342}
6343
6344impl DirectoryWatcherControlHandle {}
6345
6346#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6347pub struct ExtendedAttributeIteratorMarker;
6348
6349impl fidl::endpoints::ProtocolMarker for ExtendedAttributeIteratorMarker {
6350    type Proxy = ExtendedAttributeIteratorProxy;
6351    type RequestStream = ExtendedAttributeIteratorRequestStream;
6352    #[cfg(target_os = "fuchsia")]
6353    type SynchronousProxy = ExtendedAttributeIteratorSynchronousProxy;
6354
6355    const DEBUG_NAME: &'static str = "(anonymous) ExtendedAttributeIterator";
6356}
6357pub type ExtendedAttributeIteratorGetNextResult = Result<(Vec<Vec<u8>>, bool), i32>;
6358
6359pub trait ExtendedAttributeIteratorProxyInterface: Send + Sync {
6360    type GetNextResponseFut: std::future::Future<Output = Result<ExtendedAttributeIteratorGetNextResult, fidl::Error>>
6361        + Send;
6362    fn r#get_next(&self) -> Self::GetNextResponseFut;
6363}
6364#[derive(Debug)]
6365#[cfg(target_os = "fuchsia")]
6366pub struct ExtendedAttributeIteratorSynchronousProxy {
6367    client: fidl::client::sync::Client,
6368}
6369
6370#[cfg(target_os = "fuchsia")]
6371impl fidl::endpoints::SynchronousProxy for ExtendedAttributeIteratorSynchronousProxy {
6372    type Proxy = ExtendedAttributeIteratorProxy;
6373    type Protocol = ExtendedAttributeIteratorMarker;
6374
6375    fn from_channel(inner: fidl::Channel) -> Self {
6376        Self::new(inner)
6377    }
6378
6379    fn into_channel(self) -> fidl::Channel {
6380        self.client.into_channel()
6381    }
6382
6383    fn as_channel(&self) -> &fidl::Channel {
6384        self.client.as_channel()
6385    }
6386}
6387
6388#[cfg(target_os = "fuchsia")]
6389impl ExtendedAttributeIteratorSynchronousProxy {
6390    pub fn new(channel: fidl::Channel) -> Self {
6391        let protocol_name =
6392            <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6393        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6394    }
6395
6396    pub fn into_channel(self) -> fidl::Channel {
6397        self.client.into_channel()
6398    }
6399
6400    /// Waits until an event arrives and returns it. It is safe for other
6401    /// threads to make concurrent requests while waiting for an event.
6402    pub fn wait_for_event(
6403        &self,
6404        deadline: zx::MonotonicInstant,
6405    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6406        ExtendedAttributeIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6407    }
6408
6409    /// Get the next chunk of extended attribute names. If this is the last
6410    /// chunk, last will be true, and the channel will be closed after the
6411    /// call.
6412    pub fn r#get_next(
6413        &self,
6414        ___deadline: zx::MonotonicInstant,
6415    ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6416        let _response = self.client.send_query::<
6417            fidl::encoding::EmptyPayload,
6418            fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6419        >(
6420            (),
6421            0x3ba664a1c2e45a7,
6422            fidl::encoding::DynamicFlags::empty(),
6423            ___deadline,
6424        )?;
6425        Ok(_response.map(|x| (x.attributes, x.last)))
6426    }
6427}
6428
6429#[cfg(target_os = "fuchsia")]
6430impl From<ExtendedAttributeIteratorSynchronousProxy> for zx::Handle {
6431    fn from(value: ExtendedAttributeIteratorSynchronousProxy) -> Self {
6432        value.into_channel().into()
6433    }
6434}
6435
6436#[cfg(target_os = "fuchsia")]
6437impl From<fidl::Channel> for ExtendedAttributeIteratorSynchronousProxy {
6438    fn from(value: fidl::Channel) -> Self {
6439        Self::new(value)
6440    }
6441}
6442
6443#[cfg(target_os = "fuchsia")]
6444impl fidl::endpoints::FromClient for ExtendedAttributeIteratorSynchronousProxy {
6445    type Protocol = ExtendedAttributeIteratorMarker;
6446
6447    fn from_client(value: fidl::endpoints::ClientEnd<ExtendedAttributeIteratorMarker>) -> Self {
6448        Self::new(value.into_channel())
6449    }
6450}
6451
6452#[derive(Debug, Clone)]
6453pub struct ExtendedAttributeIteratorProxy {
6454    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6455}
6456
6457impl fidl::endpoints::Proxy for ExtendedAttributeIteratorProxy {
6458    type Protocol = ExtendedAttributeIteratorMarker;
6459
6460    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6461        Self::new(inner)
6462    }
6463
6464    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6465        self.client.into_channel().map_err(|client| Self { client })
6466    }
6467
6468    fn as_channel(&self) -> &::fidl::AsyncChannel {
6469        self.client.as_channel()
6470    }
6471}
6472
6473impl ExtendedAttributeIteratorProxy {
6474    /// Create a new Proxy for fuchsia.io/ExtendedAttributeIterator.
6475    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6476        let protocol_name =
6477            <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6478        Self { client: fidl::client::Client::new(channel, protocol_name) }
6479    }
6480
6481    /// Get a Stream of events from the remote end of the protocol.
6482    ///
6483    /// # Panics
6484    ///
6485    /// Panics if the event stream was already taken.
6486    pub fn take_event_stream(&self) -> ExtendedAttributeIteratorEventStream {
6487        ExtendedAttributeIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6488    }
6489
6490    /// Get the next chunk of extended attribute names. If this is the last
6491    /// chunk, last will be true, and the channel will be closed after the
6492    /// call.
6493    pub fn r#get_next(
6494        &self,
6495    ) -> fidl::client::QueryResponseFut<
6496        ExtendedAttributeIteratorGetNextResult,
6497        fidl::encoding::DefaultFuchsiaResourceDialect,
6498    > {
6499        ExtendedAttributeIteratorProxyInterface::r#get_next(self)
6500    }
6501}
6502
6503impl ExtendedAttributeIteratorProxyInterface for ExtendedAttributeIteratorProxy {
6504    type GetNextResponseFut = fidl::client::QueryResponseFut<
6505        ExtendedAttributeIteratorGetNextResult,
6506        fidl::encoding::DefaultFuchsiaResourceDialect,
6507    >;
6508    fn r#get_next(&self) -> Self::GetNextResponseFut {
6509        fn _decode(
6510            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6511        ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6512            let _response = fidl::client::decode_transaction_body::<
6513                fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6514                fidl::encoding::DefaultFuchsiaResourceDialect,
6515                0x3ba664a1c2e45a7,
6516            >(_buf?)?;
6517            Ok(_response.map(|x| (x.attributes, x.last)))
6518        }
6519        self.client.send_query_and_decode::<
6520            fidl::encoding::EmptyPayload,
6521            ExtendedAttributeIteratorGetNextResult,
6522        >(
6523            (),
6524            0x3ba664a1c2e45a7,
6525            fidl::encoding::DynamicFlags::empty(),
6526            _decode,
6527        )
6528    }
6529}
6530
6531pub struct ExtendedAttributeIteratorEventStream {
6532    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6533}
6534
6535impl std::marker::Unpin for ExtendedAttributeIteratorEventStream {}
6536
6537impl futures::stream::FusedStream for ExtendedAttributeIteratorEventStream {
6538    fn is_terminated(&self) -> bool {
6539        self.event_receiver.is_terminated()
6540    }
6541}
6542
6543impl futures::Stream for ExtendedAttributeIteratorEventStream {
6544    type Item = Result<ExtendedAttributeIteratorEvent, fidl::Error>;
6545
6546    fn poll_next(
6547        mut self: std::pin::Pin<&mut Self>,
6548        cx: &mut std::task::Context<'_>,
6549    ) -> std::task::Poll<Option<Self::Item>> {
6550        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6551            &mut self.event_receiver,
6552            cx
6553        )?) {
6554            Some(buf) => std::task::Poll::Ready(Some(ExtendedAttributeIteratorEvent::decode(buf))),
6555            None => std::task::Poll::Ready(None),
6556        }
6557    }
6558}
6559
6560#[derive(Debug)]
6561pub enum ExtendedAttributeIteratorEvent {}
6562
6563impl ExtendedAttributeIteratorEvent {
6564    /// Decodes a message buffer as a [`ExtendedAttributeIteratorEvent`].
6565    fn decode(
6566        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6567    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6568        let (bytes, _handles) = buf.split_mut();
6569        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6570        debug_assert_eq!(tx_header.tx_id, 0);
6571        match tx_header.ordinal {
6572            _ => Err(fidl::Error::UnknownOrdinal {
6573                ordinal: tx_header.ordinal,
6574                protocol_name:
6575                    <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6576            }),
6577        }
6578    }
6579}
6580
6581/// A Stream of incoming requests for fuchsia.io/ExtendedAttributeIterator.
6582pub struct ExtendedAttributeIteratorRequestStream {
6583    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6584    is_terminated: bool,
6585}
6586
6587impl std::marker::Unpin for ExtendedAttributeIteratorRequestStream {}
6588
6589impl futures::stream::FusedStream for ExtendedAttributeIteratorRequestStream {
6590    fn is_terminated(&self) -> bool {
6591        self.is_terminated
6592    }
6593}
6594
6595impl fidl::endpoints::RequestStream for ExtendedAttributeIteratorRequestStream {
6596    type Protocol = ExtendedAttributeIteratorMarker;
6597    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6598
6599    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6600        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6601    }
6602
6603    fn control_handle(&self) -> Self::ControlHandle {
6604        ExtendedAttributeIteratorControlHandle { inner: self.inner.clone() }
6605    }
6606
6607    fn into_inner(
6608        self,
6609    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6610    {
6611        (self.inner, self.is_terminated)
6612    }
6613
6614    fn from_inner(
6615        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6616        is_terminated: bool,
6617    ) -> Self {
6618        Self { inner, is_terminated }
6619    }
6620}
6621
6622impl futures::Stream for ExtendedAttributeIteratorRequestStream {
6623    type Item = Result<ExtendedAttributeIteratorRequest, fidl::Error>;
6624
6625    fn poll_next(
6626        mut self: std::pin::Pin<&mut Self>,
6627        cx: &mut std::task::Context<'_>,
6628    ) -> std::task::Poll<Option<Self::Item>> {
6629        let this = &mut *self;
6630        if this.inner.check_shutdown(cx) {
6631            this.is_terminated = true;
6632            return std::task::Poll::Ready(None);
6633        }
6634        if this.is_terminated {
6635            panic!("polled ExtendedAttributeIteratorRequestStream after completion");
6636        }
6637        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6638            |bytes, handles| {
6639                match this.inner.channel().read_etc(cx, bytes, handles) {
6640                    std::task::Poll::Ready(Ok(())) => {}
6641                    std::task::Poll::Pending => return std::task::Poll::Pending,
6642                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6643                        this.is_terminated = true;
6644                        return std::task::Poll::Ready(None);
6645                    }
6646                    std::task::Poll::Ready(Err(e)) => {
6647                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6648                            e.into(),
6649                        ))));
6650                    }
6651                }
6652
6653                // A message has been received from the channel
6654                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6655
6656                std::task::Poll::Ready(Some(match header.ordinal {
6657                0x3ba664a1c2e45a7 => {
6658                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6659                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6660                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6661                    let control_handle = ExtendedAttributeIteratorControlHandle {
6662                        inner: this.inner.clone(),
6663                    };
6664                    Ok(ExtendedAttributeIteratorRequest::GetNext {
6665                        responder: ExtendedAttributeIteratorGetNextResponder {
6666                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6667                            tx_id: header.tx_id,
6668                        },
6669                    })
6670                }
6671                _ => Err(fidl::Error::UnknownOrdinal {
6672                    ordinal: header.ordinal,
6673                    protocol_name: <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6674                }),
6675            }))
6676            },
6677        )
6678    }
6679}
6680
6681#[derive(Debug)]
6682pub enum ExtendedAttributeIteratorRequest {
6683    /// Get the next chunk of extended attribute names. If this is the last
6684    /// chunk, last will be true, and the channel will be closed after the
6685    /// call.
6686    GetNext { responder: ExtendedAttributeIteratorGetNextResponder },
6687}
6688
6689impl ExtendedAttributeIteratorRequest {
6690    #[allow(irrefutable_let_patterns)]
6691    pub fn into_get_next(self) -> Option<(ExtendedAttributeIteratorGetNextResponder)> {
6692        if let ExtendedAttributeIteratorRequest::GetNext { responder } = self {
6693            Some((responder))
6694        } else {
6695            None
6696        }
6697    }
6698
6699    /// Name of the method defined in FIDL
6700    pub fn method_name(&self) -> &'static str {
6701        match *self {
6702            ExtendedAttributeIteratorRequest::GetNext { .. } => "get_next",
6703        }
6704    }
6705}
6706
6707#[derive(Debug, Clone)]
6708pub struct ExtendedAttributeIteratorControlHandle {
6709    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6710}
6711
6712impl fidl::endpoints::ControlHandle for ExtendedAttributeIteratorControlHandle {
6713    fn shutdown(&self) {
6714        self.inner.shutdown()
6715    }
6716    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6717        self.inner.shutdown_with_epitaph(status)
6718    }
6719
6720    fn is_closed(&self) -> bool {
6721        self.inner.channel().is_closed()
6722    }
6723    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6724        self.inner.channel().on_closed()
6725    }
6726
6727    #[cfg(target_os = "fuchsia")]
6728    fn signal_peer(
6729        &self,
6730        clear_mask: zx::Signals,
6731        set_mask: zx::Signals,
6732    ) -> Result<(), zx_status::Status> {
6733        use fidl::Peered;
6734        self.inner.channel().signal_peer(clear_mask, set_mask)
6735    }
6736}
6737
6738impl ExtendedAttributeIteratorControlHandle {}
6739
6740#[must_use = "FIDL methods require a response to be sent"]
6741#[derive(Debug)]
6742pub struct ExtendedAttributeIteratorGetNextResponder {
6743    control_handle: std::mem::ManuallyDrop<ExtendedAttributeIteratorControlHandle>,
6744    tx_id: u32,
6745}
6746
6747/// Set the the channel to be shutdown (see [`ExtendedAttributeIteratorControlHandle::shutdown`])
6748/// if the responder is dropped without sending a response, so that the client
6749/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6750impl std::ops::Drop for ExtendedAttributeIteratorGetNextResponder {
6751    fn drop(&mut self) {
6752        self.control_handle.shutdown();
6753        // Safety: drops once, never accessed again
6754        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6755    }
6756}
6757
6758impl fidl::endpoints::Responder for ExtendedAttributeIteratorGetNextResponder {
6759    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6760
6761    fn control_handle(&self) -> &ExtendedAttributeIteratorControlHandle {
6762        &self.control_handle
6763    }
6764
6765    fn drop_without_shutdown(mut self) {
6766        // Safety: drops once, never accessed again due to mem::forget
6767        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6768        // Prevent Drop from running (which would shut down the channel)
6769        std::mem::forget(self);
6770    }
6771}
6772
6773impl ExtendedAttributeIteratorGetNextResponder {
6774    /// Sends a response to the FIDL transaction.
6775    ///
6776    /// Sets the channel to shutdown if an error occurs.
6777    pub fn send(self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6778        let _result = self.send_raw(result);
6779        if _result.is_err() {
6780            self.control_handle.shutdown();
6781        }
6782        self.drop_without_shutdown();
6783        _result
6784    }
6785
6786    /// Similar to "send" but does not shutdown the channel if an error occurs.
6787    pub fn send_no_shutdown_on_err(
6788        self,
6789        mut result: Result<(&[Vec<u8>], bool), i32>,
6790    ) -> Result<(), fidl::Error> {
6791        let _result = self.send_raw(result);
6792        self.drop_without_shutdown();
6793        _result
6794    }
6795
6796    fn send_raw(&self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6797        self.control_handle.inner.send::<fidl::encoding::ResultType<
6798            ExtendedAttributeIteratorGetNextResponse,
6799            i32,
6800        >>(
6801            result,
6802            self.tx_id,
6803            0x3ba664a1c2e45a7,
6804            fidl::encoding::DynamicFlags::empty(),
6805        )
6806    }
6807}
6808
6809#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6810pub struct FileMarker;
6811
6812impl fidl::endpoints::ProtocolMarker for FileMarker {
6813    type Proxy = FileProxy;
6814    type RequestStream = FileRequestStream;
6815    #[cfg(target_os = "fuchsia")]
6816    type SynchronousProxy = FileSynchronousProxy;
6817
6818    const DEBUG_NAME: &'static str = "fuchsia.io.File";
6819}
6820impl fidl::endpoints::DiscoverableProtocolMarker for FileMarker {}
6821pub type FileSeekResult = Result<u64, i32>;
6822pub type FileReadAtResult = Result<Vec<u8>, i32>;
6823pub type FileWriteAtResult = Result<u64, i32>;
6824pub type FileResizeResult = Result<(), i32>;
6825pub type FileGetBackingMemoryResult = Result<fidl::Vmo, i32>;
6826pub type FileAllocateResult = Result<(), i32>;
6827pub type FileEnableVerityResult = Result<(), i32>;
6828
6829pub trait FileProxyInterface: Send + Sync {
6830    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
6831        + Send;
6832    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
6833    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
6834        + Send;
6835    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
6836    fn r#clone(
6837        &self,
6838        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
6839    ) -> Result<(), fidl::Error>;
6840    type CloseResponseFut: std::future::Future<
6841            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
6842        > + Send;
6843    fn r#close(&self) -> Self::CloseResponseFut;
6844    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
6845    fn r#query(&self) -> Self::QueryResponseFut;
6846    fn r#deprecated_clone(
6847        &self,
6848        flags: OpenFlags,
6849        object: fidl::endpoints::ServerEnd<NodeMarker>,
6850    ) -> Result<(), fidl::Error>;
6851    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
6852        + Send;
6853    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
6854    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
6855    fn r#deprecated_set_attr(
6856        &self,
6857        flags: NodeAttributeFlags,
6858        attributes: &NodeAttributes,
6859    ) -> Self::DeprecatedSetAttrResponseFut;
6860    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
6861        + Send;
6862    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
6863    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
6864        + Send;
6865    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
6866    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
6867        + Send;
6868    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
6869    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
6870        + Send;
6871    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
6872    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
6873        + Send;
6874    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
6875    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
6876        + Send;
6877    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
6878    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
6879        + Send;
6880    fn r#update_attributes(
6881        &self,
6882        payload: &MutableNodeAttributes,
6883    ) -> Self::UpdateAttributesResponseFut;
6884    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
6885    fn r#sync(&self) -> Self::SyncResponseFut;
6886    fn r#list_extended_attributes(
6887        &self,
6888        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
6889    ) -> Result<(), fidl::Error>;
6890    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
6891        + Send;
6892    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
6893    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
6894        + Send;
6895    fn r#set_extended_attribute(
6896        &self,
6897        name: &[u8],
6898        value: ExtendedAttributeValue,
6899        mode: SetExtendedAttributeMode,
6900    ) -> Self::SetExtendedAttributeResponseFut;
6901    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
6902        + Send;
6903    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
6904    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
6905        + Send;
6906    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
6907    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
6908        + Send;
6909    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
6910    type DescribeResponseFut: std::future::Future<Output = Result<FileInfo, fidl::Error>> + Send;
6911    fn r#describe(&self) -> Self::DescribeResponseFut;
6912    type SeekResponseFut: std::future::Future<Output = Result<FileSeekResult, fidl::Error>> + Send;
6913    fn r#seek(&self, origin: SeekOrigin, offset: i64) -> Self::SeekResponseFut;
6914    type ReadAtResponseFut: std::future::Future<Output = Result<FileReadAtResult, fidl::Error>>
6915        + Send;
6916    fn r#read_at(&self, count: u64, offset: u64) -> Self::ReadAtResponseFut;
6917    type WriteAtResponseFut: std::future::Future<Output = Result<FileWriteAtResult, fidl::Error>>
6918        + Send;
6919    fn r#write_at(&self, data: &[u8], offset: u64) -> Self::WriteAtResponseFut;
6920    type ResizeResponseFut: std::future::Future<Output = Result<FileResizeResult, fidl::Error>>
6921        + Send;
6922    fn r#resize(&self, length: u64) -> Self::ResizeResponseFut;
6923    type GetBackingMemoryResponseFut: std::future::Future<Output = Result<FileGetBackingMemoryResult, fidl::Error>>
6924        + Send;
6925    fn r#get_backing_memory(&self, flags: VmoFlags) -> Self::GetBackingMemoryResponseFut;
6926    type AllocateResponseFut: std::future::Future<Output = Result<FileAllocateResult, fidl::Error>>
6927        + Send;
6928    fn r#allocate(&self, offset: u64, length: u64, mode: AllocateMode)
6929    -> Self::AllocateResponseFut;
6930    type EnableVerityResponseFut: std::future::Future<Output = Result<FileEnableVerityResult, fidl::Error>>
6931        + Send;
6932    fn r#enable_verity(&self, options: &VerificationOptions) -> Self::EnableVerityResponseFut;
6933}
6934#[derive(Debug)]
6935#[cfg(target_os = "fuchsia")]
6936pub struct FileSynchronousProxy {
6937    client: fidl::client::sync::Client,
6938}
6939
6940#[cfg(target_os = "fuchsia")]
6941impl fidl::endpoints::SynchronousProxy for FileSynchronousProxy {
6942    type Proxy = FileProxy;
6943    type Protocol = FileMarker;
6944
6945    fn from_channel(inner: fidl::Channel) -> Self {
6946        Self::new(inner)
6947    }
6948
6949    fn into_channel(self) -> fidl::Channel {
6950        self.client.into_channel()
6951    }
6952
6953    fn as_channel(&self) -> &fidl::Channel {
6954        self.client.as_channel()
6955    }
6956}
6957
6958#[cfg(target_os = "fuchsia")]
6959impl FileSynchronousProxy {
6960    pub fn new(channel: fidl::Channel) -> Self {
6961        let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6962        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6963    }
6964
6965    pub fn into_channel(self) -> fidl::Channel {
6966        self.client.into_channel()
6967    }
6968
6969    /// Waits until an event arrives and returns it. It is safe for other
6970    /// threads to make concurrent requests while waiting for an event.
6971    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<FileEvent, fidl::Error> {
6972        FileEvent::decode(self.client.wait_for_event(deadline)?)
6973    }
6974
6975    /// Acquires an advisory lock on the underlying file.
6976    ///
6977    /// The lock lasts until either this connection is closed or
6978    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
6979    /// explicitly.
6980    ///
6981    /// Advisory locks are purely advisory. They do not prevent actual read or
6982    /// write operations from occurring on the file, either through this
6983    /// connection or through other connections.
6984    ///
6985    /// This method requires the following rights:
6986    ///
6987    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
6988    /// * [`Rights.WRITE_BYTES`] if `request.type` is
6989    ///   [`AdvisoryLockType.WRITE`].
6990    ///
6991    /// # Errors
6992    ///
6993    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
6994    ///   example, another connection might hold a conflicting lock type.
6995    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
6996    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
6997    ///   to acquire the given type of lock.
6998    pub fn r#advisory_lock(
6999        &self,
7000        mut request: &AdvisoryLockRequest,
7001        ___deadline: zx::MonotonicInstant,
7002    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
7003        let _response = self.client.send_query::<
7004            AdvisoryLockingAdvisoryLockRequest,
7005            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7006        >(
7007            (request,),
7008            0x6ee9c0ad53ec87aa,
7009            fidl::encoding::DynamicFlags::empty(),
7010            ___deadline,
7011        )?;
7012        Ok(_response.map(|x| x))
7013    }
7014
7015    /// Creates a link to this this object with name `dst` in the directory represented by
7016    /// `dst_parent_token`.
7017    ///
7018    /// `dst` must be a resolved object name. Including "/" in the string will return
7019    /// `ZX_ERR_INVALID_ARGS`.
7020    ///
7021    /// This method requires the maximal set of rights supported by the filesystem for this object.
7022    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7023    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7024    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7025    /// `ZX_ERR_ACCESS_DENIED`.
7026    ///
7027    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7028    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7029    ///
7030    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7031    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7032    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7033    ///
7034    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7035    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7036    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7037    pub fn r#link_into(
7038        &self,
7039        mut dst_parent_token: fidl::Event,
7040        mut dst: &str,
7041        ___deadline: zx::MonotonicInstant,
7042    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
7043        let _response = self.client.send_query::<
7044            LinkableLinkIntoRequest,
7045            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7046        >(
7047            (dst_parent_token, dst,),
7048            0x54f3949246a03e74,
7049            fidl::encoding::DynamicFlags::empty(),
7050            ___deadline,
7051        )?;
7052        Ok(_response.map(|x| x))
7053    }
7054
7055    pub fn r#clone(
7056        &self,
7057        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7058    ) -> Result<(), fidl::Error> {
7059        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
7060            (request,),
7061            0x20d8a7aba2168a79,
7062            fidl::encoding::DynamicFlags::empty(),
7063        )
7064    }
7065
7066    /// Terminates the connection.
7067    ///
7068    /// After calling `Close`, the client must not send any other requests.
7069    ///
7070    /// Servers, after sending the status response, should close the connection
7071    /// regardless of status and without sending an epitaph.
7072    ///
7073    /// Closing the client end of the channel should be semantically equivalent
7074    /// to calling `Close` without knowing when the close has completed or its
7075    /// status.
7076    pub fn r#close(
7077        &self,
7078        ___deadline: zx::MonotonicInstant,
7079    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
7080        let _response = self.client.send_query::<
7081            fidl::encoding::EmptyPayload,
7082            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7083        >(
7084            (),
7085            0x5ac5d459ad7f657e,
7086            fidl::encoding::DynamicFlags::empty(),
7087            ___deadline,
7088        )?;
7089        Ok(_response.map(|x| x))
7090    }
7091
7092    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
7093        let _response = self.client.send_query::<
7094            fidl::encoding::EmptyPayload,
7095            fidl_fuchsia_unknown::QueryableQueryResponse,
7096        >(
7097            (),
7098            0x2658edee9decfc06,
7099            fidl::encoding::DynamicFlags::empty(),
7100            ___deadline,
7101        )?;
7102        Ok(_response.protocol)
7103    }
7104
7105    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7106    pub fn r#deprecated_clone(
7107        &self,
7108        mut flags: OpenFlags,
7109        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
7110    ) -> Result<(), fidl::Error> {
7111        self.client.send::<NodeDeprecatedCloneRequest>(
7112            (flags, object),
7113            0x5a61678f293ce16f,
7114            fidl::encoding::DynamicFlags::FLEXIBLE,
7115        )
7116    }
7117
7118    /// DEPRECATED - Use `Node.GetAttributes` instead.
7119    pub fn r#deprecated_get_attr(
7120        &self,
7121        ___deadline: zx::MonotonicInstant,
7122    ) -> Result<(i32, NodeAttributes), fidl::Error> {
7123        let _response =
7124            self.client.send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse>(
7125                (),
7126                0x78985e216314dafd,
7127                fidl::encoding::DynamicFlags::empty(),
7128                ___deadline,
7129            )?;
7130        Ok((_response.s, _response.attributes))
7131    }
7132
7133    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7134    pub fn r#deprecated_set_attr(
7135        &self,
7136        mut flags: NodeAttributeFlags,
7137        mut attributes: &NodeAttributes,
7138        ___deadline: zx::MonotonicInstant,
7139    ) -> Result<i32, fidl::Error> {
7140        let _response =
7141            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
7142                (flags, attributes),
7143                0x4186c0f40d938f46,
7144                fidl::encoding::DynamicFlags::empty(),
7145                ___deadline,
7146            )?;
7147        Ok(_response.s)
7148    }
7149
7150    /// [DEPRECATED - Use new GetFlags method instead.]
7151    pub fn r#deprecated_get_flags(
7152        &self,
7153        ___deadline: zx::MonotonicInstant,
7154    ) -> Result<(i32, OpenFlags), fidl::Error> {
7155        let _response = self
7156            .client
7157            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
7158                (),
7159                0x5b88fffb8eda3aa1,
7160                fidl::encoding::DynamicFlags::empty(),
7161                ___deadline,
7162            )?;
7163        Ok((_response.s, _response.flags))
7164    }
7165
7166    /// [DEPRECATED - Use new SetFlags method instead.]
7167    pub fn r#deprecated_set_flags(
7168        &self,
7169        mut flags: OpenFlags,
7170        ___deadline: zx::MonotonicInstant,
7171    ) -> Result<i32, fidl::Error> {
7172        let _response = self
7173            .client
7174            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
7175                (flags,),
7176                0x5295b76c71fde733,
7177                fidl::encoding::DynamicFlags::empty(),
7178                ___deadline,
7179            )?;
7180        Ok(_response.s)
7181    }
7182
7183    /// Queries the flags that apply to this node after it has been opened/created. This method does
7184    /// not require any rights.
7185    ///
7186    /// Note that the final set of flags that apply to the connection may differ from those
7187    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
7188    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
7189    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
7190    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
7191    pub fn r#get_flags(
7192        &self,
7193        ___deadline: zx::MonotonicInstant,
7194    ) -> Result<NodeGetFlagsResult, fidl::Error> {
7195        let _response = self.client.send_query::<
7196            fidl::encoding::EmptyPayload,
7197            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
7198        >(
7199            (),
7200            0x176eb318f64ec23,
7201            fidl::encoding::DynamicFlags::FLEXIBLE,
7202            ___deadline,
7203        )?
7204        .into_result::<FileMarker>("get_flags")?;
7205        Ok(_response.map(|x| x.flags))
7206    }
7207
7208    /// Sets the flags that apply to this node after it has been opened. This method does not
7209    /// require any rights.
7210    ///
7211    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
7212    /// clear append mode.
7213    ///
7214    /// Errors:
7215    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
7216    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
7217    pub fn r#set_flags(
7218        &self,
7219        mut flags: Flags,
7220        ___deadline: zx::MonotonicInstant,
7221    ) -> Result<NodeSetFlagsResult, fidl::Error> {
7222        let _response = self.client.send_query::<
7223            NodeSetFlagsRequest,
7224            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7225        >(
7226            (flags,),
7227            0x55a8028685791ea8,
7228            fidl::encoding::DynamicFlags::FLEXIBLE,
7229            ___deadline,
7230        )?
7231        .into_result::<FileMarker>("set_flags")?;
7232        Ok(_response.map(|x| x))
7233    }
7234
7235    /// Query the filesystem for filesystem-specific information.
7236    pub fn r#query_filesystem(
7237        &self,
7238        ___deadline: zx::MonotonicInstant,
7239    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
7240        let _response =
7241            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
7242                (),
7243                0x6f344a1c6b0a0610,
7244                fidl::encoding::DynamicFlags::empty(),
7245                ___deadline,
7246            )?;
7247        Ok((_response.s, _response.info))
7248    }
7249
7250    /// Acquires information about the node.
7251    ///
7252    /// The attributes of a node should be stable, independent of the
7253    /// specific protocol used to access it.
7254    ///
7255    /// If a particular attribute is not applicable or not supported,
7256    /// filesystems should leave the corresponding field absent.
7257    ///
7258    /// + `query` a bit-mask specifying which attributes to fetch. The server
7259    ///   should not return more than necessary.
7260    /// - `attributes` the returned attributes.
7261    ///
7262    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7263    pub fn r#get_attributes(
7264        &self,
7265        mut query: NodeAttributesQuery,
7266        ___deadline: zx::MonotonicInstant,
7267    ) -> Result<NodeGetAttributesResult, fidl::Error> {
7268        let _response = self.client.send_query::<
7269            NodeGetAttributesRequest,
7270            fidl::encoding::ResultType<NodeAttributes2, i32>,
7271        >(
7272            (query,),
7273            0x3d4396a638ea053b,
7274            fidl::encoding::DynamicFlags::empty(),
7275            ___deadline,
7276        )?;
7277        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
7278    }
7279
7280    /// Updates information about the node.
7281    ///
7282    /// + `attributes` the presence of a table field in `attributes` indicates
7283    /// the intent to update the corresponding attribute.
7284    ///
7285    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
7286    ///
7287    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7288    pub fn r#update_attributes(
7289        &self,
7290        mut payload: &MutableNodeAttributes,
7291        ___deadline: zx::MonotonicInstant,
7292    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
7293        let _response = self.client.send_query::<
7294            MutableNodeAttributes,
7295            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7296        >(
7297            payload,
7298            0x3308c1da5a89bf08,
7299            fidl::encoding::DynamicFlags::empty(),
7300            ___deadline,
7301        )?;
7302        Ok(_response.map(|x| x))
7303    }
7304
7305    /// Synchronizes updates to the node to the underlying media, if it exists.
7306    ///
7307    /// This method will return when the filesystem server has flushed the
7308    /// relevant updates to the underlying media, but does not guarantee the
7309    /// underlying media has persisted the information, nor that any information
7310    /// is committed to hardware. Clients may use `Sync` to ensure ordering
7311    /// between operations.
7312    ///
7313    /// This method does not require any rights.
7314    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
7315        let _response = self.client.send_query::<
7316            fidl::encoding::EmptyPayload,
7317            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7318        >(
7319            (),
7320            0x2c5c27ca0ab5dc49,
7321            fidl::encoding::DynamicFlags::empty(),
7322            ___deadline,
7323        )?;
7324        Ok(_response.map(|x| x))
7325    }
7326
7327    /// Creates an iterator over all the extended attribute names associated
7328    /// with this node. If an error occurs it is returned as an epitaph on the
7329    /// iterator request channel, and then the channel is closed.
7330    ///
7331    /// GetExtendedAttributes can be used with any of these names to retrieve
7332    /// the associated value.
7333    ///
7334    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7335    pub fn r#list_extended_attributes(
7336        &self,
7337        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
7338    ) -> Result<(), fidl::Error> {
7339        self.client.send::<NodeListExtendedAttributesRequest>(
7340            (iterator,),
7341            0x4b61033de007fcd0,
7342            fidl::encoding::DynamicFlags::empty(),
7343        )
7344    }
7345
7346    /// Get the value associated with the given attribute `name` for this node.
7347    ///
7348    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
7349    /// particular structure is imposed on them.
7350    ///
7351    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7352    pub fn r#get_extended_attribute(
7353        &self,
7354        mut name: &[u8],
7355        ___deadline: zx::MonotonicInstant,
7356    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
7357        let _response = self.client.send_query::<
7358            NodeGetExtendedAttributeRequest,
7359            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
7360        >(
7361            (name,),
7362            0x45ffa3ccfdeb76db,
7363            fidl::encoding::DynamicFlags::empty(),
7364            ___deadline,
7365        )?;
7366        Ok(_response.map(|x| x))
7367    }
7368
7369    /// Set the value for the given attribute `name` to `value` for this node.
7370    ///
7371    /// The attribute name may exist, in which case the attribute is updated.
7372    /// If the attribute doesn't exist, it is created. The name should have no
7373    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
7374    ///
7375    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7376    pub fn r#set_extended_attribute(
7377        &self,
7378        mut name: &[u8],
7379        mut value: ExtendedAttributeValue,
7380        mut mode: SetExtendedAttributeMode,
7381        ___deadline: zx::MonotonicInstant,
7382    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
7383        let _response = self.client.send_query::<
7384            NodeSetExtendedAttributeRequest,
7385            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7386        >(
7387            (name, &mut value, mode,),
7388            0x4a951362f681f23c,
7389            fidl::encoding::DynamicFlags::empty(),
7390            ___deadline,
7391        )?;
7392        Ok(_response.map(|x| x))
7393    }
7394
7395    /// Remove the specified extended attribute.
7396    ///
7397    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
7398    ///
7399    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7400    pub fn r#remove_extended_attribute(
7401        &self,
7402        mut name: &[u8],
7403        ___deadline: zx::MonotonicInstant,
7404    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
7405        let _response = self.client.send_query::<
7406            NodeRemoveExtendedAttributeRequest,
7407            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7408        >(
7409            (name,),
7410            0x7a0b9f3a9bf9032d,
7411            fidl::encoding::DynamicFlags::empty(),
7412            ___deadline,
7413        )?;
7414        Ok(_response.map(|x| x))
7415    }
7416
7417    /// Reads up to 'count' bytes at the seek offset.
7418    /// The seek offset is moved forward by the number of bytes read.
7419    ///
7420    /// ## Invariants
7421    ///
7422    /// * The returned `data.length` will never be greater than `count`.
7423    /// * If `data.length` is less than `count`, it means that the seek offset
7424    ///   has reached the end of file as part of this operation.
7425    /// * If `data.length` is zero while `count` is not, it means that the
7426    ///   seek offset is already at or beyond the end of file, and no data could
7427    ///   be read.
7428    /// * If `count` is zero, the server should perform all the checks ensuring
7429    ///   read access without actually read anything, and return an empty
7430    ///   `data` vector.
7431    ///
7432    /// This method requires the [`Rights.READ_BYTES`] right.
7433    ///
7434    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7435    pub fn r#read(
7436        &self,
7437        mut count: u64,
7438        ___deadline: zx::MonotonicInstant,
7439    ) -> Result<ReadableReadResult, fidl::Error> {
7440        let _response = self.client.send_query::<
7441            ReadableReadRequest,
7442            fidl::encoding::ResultType<ReadableReadResponse, i32>,
7443        >(
7444            (count,),
7445            0x57e419a298c8ede,
7446            fidl::encoding::DynamicFlags::empty(),
7447            ___deadline,
7448        )?;
7449        Ok(_response.map(|x| x.data))
7450    }
7451
7452    /// Writes data at the seek offset.
7453    /// The seek offset is moved forward by the number of bytes written.
7454    /// If the file is in append mode, the seek offset is first set to the end
7455    /// of the file, followed by the write, in one atomic step.
7456    ///
7457    /// The file size may grow if the seek offset plus `data.length` is beyond
7458    /// the current end of file.
7459    ///
7460    /// + request `data` the byte buffer to write to the file.
7461    /// - response `actual_count` the number of bytes written.
7462    ///
7463    /// ## Invariants
7464    ///
7465    /// * The returned `actual_count` will never be greater than `data.length`.
7466    /// * If the server is unable to write all the data due to e.g. not enough
7467    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7468    ///   could be written, an error is returned.
7469    /// * If `data.length` is zero, the server should perform all the checks
7470    ///   ensuring write access without mutating the file and return a
7471    ///   successful write of zero bytes.  The seek offset is still updated if
7472    ///   in append mode.
7473    ///
7474    /// This method requires the [`Rights.WRITE_BYTES`] right.
7475    pub fn r#write(
7476        &self,
7477        mut data: &[u8],
7478        ___deadline: zx::MonotonicInstant,
7479    ) -> Result<WritableWriteResult, fidl::Error> {
7480        let _response = self.client.send_query::<
7481            WritableWriteRequest,
7482            fidl::encoding::ResultType<WritableWriteResponse, i32>,
7483        >(
7484            (data,),
7485            0x6a31437832469f82,
7486            fidl::encoding::DynamicFlags::empty(),
7487            ___deadline,
7488        )?;
7489        Ok(_response.map(|x| x.actual_count))
7490    }
7491
7492    pub fn r#describe(&self, ___deadline: zx::MonotonicInstant) -> Result<FileInfo, fidl::Error> {
7493        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, FileInfo>(
7494            (),
7495            0x68b5ac00c62906bc,
7496            fidl::encoding::DynamicFlags::empty(),
7497            ___deadline,
7498        )?;
7499        Ok(_response)
7500    }
7501
7502    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
7503    /// will occur. The seek offset is specific to each file connection.
7504    ///
7505    /// + request `origin` the reference point where `offset` will be based on.
7506    /// + request `offset` the number of bytes to seek.
7507    /// - response `offset_from_start` the adjusted seek offset, from the start
7508    ///   of the file.
7509    ///
7510    /// This method does not require any rights.
7511    pub fn r#seek(
7512        &self,
7513        mut origin: SeekOrigin,
7514        mut offset: i64,
7515        ___deadline: zx::MonotonicInstant,
7516    ) -> Result<FileSeekResult, fidl::Error> {
7517        let _response = self
7518            .client
7519            .send_query::<FileSeekRequest, fidl::encoding::ResultType<FileSeekResponse, i32>>(
7520                (origin, offset),
7521                0x78079168162c5207,
7522                fidl::encoding::DynamicFlags::empty(),
7523                ___deadline,
7524            )?;
7525        Ok(_response.map(|x| x.offset_from_start))
7526    }
7527
7528    /// Reads up to 'count' bytes at the provided offset.
7529    /// Does not affect the seek offset.
7530    ///
7531    /// ## Invariants
7532    ///
7533    /// * The returned `data.length` will never be greater than `count`.
7534    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
7535    ///   the end of file as part of this operation.
7536    /// * If `data.length` is zero while `count` is not, it means that `offset`
7537    ///   is at or past the end of file, and no data can be read.
7538    /// * If `count` is zero, the server should perform all the checks ensuring
7539    ///   read access without actually reading anything, and return an empty
7540    ///   `data` vector.
7541    ///
7542    /// This method requires the [`Rights.READ_BYTES`] right.
7543    ///
7544    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7545    pub fn r#read_at(
7546        &self,
7547        mut count: u64,
7548        mut offset: u64,
7549        ___deadline: zx::MonotonicInstant,
7550    ) -> Result<FileReadAtResult, fidl::Error> {
7551        let _response = self
7552            .client
7553            .send_query::<FileReadAtRequest, fidl::encoding::ResultType<FileReadAtResponse, i32>>(
7554                (count, offset),
7555                0x1607a293a60d723e,
7556                fidl::encoding::DynamicFlags::empty(),
7557                ___deadline,
7558            )?;
7559        Ok(_response.map(|x| x.data))
7560    }
7561
7562    /// Writes data at the provided offset.
7563    /// Does not affect the seek offset.
7564    ///
7565    /// The file size may grow if `offset` plus `data.length` is past the
7566    /// current end of file.
7567    ///
7568    /// + request `data` the byte buffer to write to the file.
7569    /// + request `offset` the offset from start of the file to begin writing.
7570    /// - response `actual_count` the number of bytes written.
7571    ///
7572    /// ## Invariants
7573    ///
7574    /// * The returned `actual_count` will never be greater than `data.length`.
7575    /// * If the server is unable to write all the data due to e.g. not enough
7576    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7577    ///   could be written, an error is returned.
7578    /// * If `data.length` is zero, the server should perform all the checks
7579    ///   ensuring write access without mutating the file, and will return a
7580    ///   successful write of zero bytes.
7581    ///
7582    /// This method requires the [`Rights.WRITE_BYTES`] right.
7583    pub fn r#write_at(
7584        &self,
7585        mut data: &[u8],
7586        mut offset: u64,
7587        ___deadline: zx::MonotonicInstant,
7588    ) -> Result<FileWriteAtResult, fidl::Error> {
7589        let _response = self
7590            .client
7591            .send_query::<FileWriteAtRequest, fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
7592                (data, offset),
7593                0x793eefc0045e792b,
7594                fidl::encoding::DynamicFlags::empty(),
7595                ___deadline,
7596            )?;
7597        Ok(_response.map(|x| x.actual_count))
7598    }
7599
7600    /// Shrinks or grows the file size to 'length' bytes.
7601    ///
7602    /// If file size is reduced by this operation, the extra trailing data'
7603    /// is discarded.
7604    /// If file size is increased by this operation, the extended area appears
7605    /// as if it was zeroed.
7606    ///
7607    /// This method requires the [`Rights.WRITE_BYTES`] right.
7608    pub fn r#resize(
7609        &self,
7610        mut length: u64,
7611        ___deadline: zx::MonotonicInstant,
7612    ) -> Result<FileResizeResult, fidl::Error> {
7613        let _response = self.client.send_query::<
7614            FileResizeRequest,
7615            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7616        >(
7617            (length,),
7618            0x2b80825f0535743a,
7619            fidl::encoding::DynamicFlags::empty(),
7620            ___deadline,
7621        )?;
7622        Ok(_response.map(|x| x))
7623    }
7624
7625    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
7626    /// with the requested access rights.
7627    ///
7628    /// Implementations are not required to implement files backed by VMOs so
7629    /// this request may fail. Additionally, implementations may only support
7630    /// a certain subset of the flags. Clients should be prepared with fallback
7631    /// behavior if this request fails.
7632    ///
7633    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
7634    /// implementation is free to choose the semantics of the returned VMO.
7635    ///
7636    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
7637    /// - response `vmo` the requested [`zx.Handle:VMO`].
7638    /// * error a [`zx.Status`] value indicating the failure.
7639    ///
7640    /// This method requires the following rights:
7641    ///
7642    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
7643    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
7644    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
7645    pub fn r#get_backing_memory(
7646        &self,
7647        mut flags: VmoFlags,
7648        ___deadline: zx::MonotonicInstant,
7649    ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
7650        let _response = self.client.send_query::<
7651            FileGetBackingMemoryRequest,
7652            fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
7653        >(
7654            (flags,),
7655            0xa6a9e654cbf62b,
7656            fidl::encoding::DynamicFlags::empty(),
7657            ___deadline,
7658        )?;
7659        Ok(_response.map(|x| x.vmo))
7660    }
7661
7662    /// Pre-allocate on-disk space for this file.
7663    pub fn r#allocate(
7664        &self,
7665        mut offset: u64,
7666        mut length: u64,
7667        mut mode: AllocateMode,
7668        ___deadline: zx::MonotonicInstant,
7669    ) -> Result<FileAllocateResult, fidl::Error> {
7670        let _response = self.client.send_query::<
7671            FileAllocateRequest,
7672            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7673        >(
7674            (offset, length, mode,),
7675            0x77fa0c330b57fd2e,
7676            fidl::encoding::DynamicFlags::FLEXIBLE,
7677            ___deadline,
7678        )?
7679        .into_result::<FileMarker>("allocate")?;
7680        Ok(_response.map(|x| x))
7681    }
7682
7683    /// Enables verification for the file (permanently) which involves computing a merkle tree for
7684    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
7685    /// captured. Future reads will be verified against the computed merkle tree and writes will be
7686    /// rejected. This method can take some time to complete as it depends on the size of the file.
7687    /// This method can be aborted by closing the connection that this method was issued on.
7688    ///
7689    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7690    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
7691    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
7692    /// Also returns any error that might arise from reading the file, or from flushing the file,
7693    /// such as `ZX_ERR_IO`.
7694    pub fn r#enable_verity(
7695        &self,
7696        mut options: &VerificationOptions,
7697        ___deadline: zx::MonotonicInstant,
7698    ) -> Result<FileEnableVerityResult, fidl::Error> {
7699        let _response = self.client.send_query::<
7700            FileEnableVerityRequest,
7701            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7702        >(
7703            (options,),
7704            0x2c421ec3faaeb8bb,
7705            fidl::encoding::DynamicFlags::FLEXIBLE,
7706            ___deadline,
7707        )?
7708        .into_result::<FileMarker>("enable_verity")?;
7709        Ok(_response.map(|x| x))
7710    }
7711}
7712
7713#[cfg(target_os = "fuchsia")]
7714impl From<FileSynchronousProxy> for zx::Handle {
7715    fn from(value: FileSynchronousProxy) -> Self {
7716        value.into_channel().into()
7717    }
7718}
7719
7720#[cfg(target_os = "fuchsia")]
7721impl From<fidl::Channel> for FileSynchronousProxy {
7722    fn from(value: fidl::Channel) -> Self {
7723        Self::new(value)
7724    }
7725}
7726
7727#[cfg(target_os = "fuchsia")]
7728impl fidl::endpoints::FromClient for FileSynchronousProxy {
7729    type Protocol = FileMarker;
7730
7731    fn from_client(value: fidl::endpoints::ClientEnd<FileMarker>) -> Self {
7732        Self::new(value.into_channel())
7733    }
7734}
7735
7736#[derive(Debug, Clone)]
7737pub struct FileProxy {
7738    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7739}
7740
7741impl fidl::endpoints::Proxy for FileProxy {
7742    type Protocol = FileMarker;
7743
7744    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7745        Self::new(inner)
7746    }
7747
7748    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7749        self.client.into_channel().map_err(|client| Self { client })
7750    }
7751
7752    fn as_channel(&self) -> &::fidl::AsyncChannel {
7753        self.client.as_channel()
7754    }
7755}
7756
7757impl FileProxy {
7758    /// Create a new Proxy for fuchsia.io/File.
7759    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7760        let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7761        Self { client: fidl::client::Client::new(channel, protocol_name) }
7762    }
7763
7764    /// Get a Stream of events from the remote end of the protocol.
7765    ///
7766    /// # Panics
7767    ///
7768    /// Panics if the event stream was already taken.
7769    pub fn take_event_stream(&self) -> FileEventStream {
7770        FileEventStream { event_receiver: self.client.take_event_receiver() }
7771    }
7772
7773    /// Acquires an advisory lock on the underlying file.
7774    ///
7775    /// The lock lasts until either this connection is closed or
7776    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7777    /// explicitly.
7778    ///
7779    /// Advisory locks are purely advisory. They do not prevent actual read or
7780    /// write operations from occurring on the file, either through this
7781    /// connection or through other connections.
7782    ///
7783    /// This method requires the following rights:
7784    ///
7785    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7786    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7787    ///   [`AdvisoryLockType.WRITE`].
7788    ///
7789    /// # Errors
7790    ///
7791    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7792    ///   example, another connection might hold a conflicting lock type.
7793    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7794    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7795    ///   to acquire the given type of lock.
7796    pub fn r#advisory_lock(
7797        &self,
7798        mut request: &AdvisoryLockRequest,
7799    ) -> fidl::client::QueryResponseFut<
7800        AdvisoryLockingAdvisoryLockResult,
7801        fidl::encoding::DefaultFuchsiaResourceDialect,
7802    > {
7803        FileProxyInterface::r#advisory_lock(self, request)
7804    }
7805
7806    /// Creates a link to this this object with name `dst` in the directory represented by
7807    /// `dst_parent_token`.
7808    ///
7809    /// `dst` must be a resolved object name. Including "/" in the string will return
7810    /// `ZX_ERR_INVALID_ARGS`.
7811    ///
7812    /// This method requires the maximal set of rights supported by the filesystem for this object.
7813    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7814    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7815    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7816    /// `ZX_ERR_ACCESS_DENIED`.
7817    ///
7818    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7819    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7820    ///
7821    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7822    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7823    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7824    ///
7825    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7826    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7827    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7828    pub fn r#link_into(
7829        &self,
7830        mut dst_parent_token: fidl::Event,
7831        mut dst: &str,
7832    ) -> fidl::client::QueryResponseFut<
7833        LinkableLinkIntoResult,
7834        fidl::encoding::DefaultFuchsiaResourceDialect,
7835    > {
7836        FileProxyInterface::r#link_into(self, dst_parent_token, dst)
7837    }
7838
7839    pub fn r#clone(
7840        &self,
7841        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7842    ) -> Result<(), fidl::Error> {
7843        FileProxyInterface::r#clone(self, request)
7844    }
7845
7846    /// Terminates the connection.
7847    ///
7848    /// After calling `Close`, the client must not send any other requests.
7849    ///
7850    /// Servers, after sending the status response, should close the connection
7851    /// regardless of status and without sending an epitaph.
7852    ///
7853    /// Closing the client end of the channel should be semantically equivalent
7854    /// to calling `Close` without knowing when the close has completed or its
7855    /// status.
7856    pub fn r#close(
7857        &self,
7858    ) -> fidl::client::QueryResponseFut<
7859        fidl_fuchsia_unknown::CloseableCloseResult,
7860        fidl::encoding::DefaultFuchsiaResourceDialect,
7861    > {
7862        FileProxyInterface::r#close(self)
7863    }
7864
7865    pub fn r#query(
7866        &self,
7867    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
7868    {
7869        FileProxyInterface::r#query(self)
7870    }
7871
7872    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7873    pub fn r#deprecated_clone(
7874        &self,
7875        mut flags: OpenFlags,
7876        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
7877    ) -> Result<(), fidl::Error> {
7878        FileProxyInterface::r#deprecated_clone(self, flags, object)
7879    }
7880
7881    /// DEPRECATED - Use `Node.GetAttributes` instead.
7882    pub fn r#deprecated_get_attr(
7883        &self,
7884    ) -> fidl::client::QueryResponseFut<
7885        (i32, NodeAttributes),
7886        fidl::encoding::DefaultFuchsiaResourceDialect,
7887    > {
7888        FileProxyInterface::r#deprecated_get_attr(self)
7889    }
7890
7891    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7892    pub fn r#deprecated_set_attr(
7893        &self,
7894        mut flags: NodeAttributeFlags,
7895        mut attributes: &NodeAttributes,
7896    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
7897        FileProxyInterface::r#deprecated_set_attr(self, flags, attributes)
7898    }
7899
7900    /// [DEPRECATED - Use new GetFlags method instead.]
7901    pub fn r#deprecated_get_flags(
7902        &self,
7903    ) -> fidl::client::QueryResponseFut<
7904        (i32, OpenFlags),
7905        fidl::encoding::DefaultFuchsiaResourceDialect,
7906    > {
7907        FileProxyInterface::r#deprecated_get_flags(self)
7908    }
7909
7910    /// [DEPRECATED - Use new SetFlags method instead.]
7911    pub fn r#deprecated_set_flags(
7912        &self,
7913        mut flags: OpenFlags,
7914    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
7915        FileProxyInterface::r#deprecated_set_flags(self, flags)
7916    }
7917
7918    /// Queries the flags that apply to this node after it has been opened/created. This method does
7919    /// not require any rights.
7920    ///
7921    /// Note that the final set of flags that apply to the connection may differ from those
7922    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
7923    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
7924    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
7925    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
7926    pub fn r#get_flags(
7927        &self,
7928    ) -> fidl::client::QueryResponseFut<
7929        NodeGetFlagsResult,
7930        fidl::encoding::DefaultFuchsiaResourceDialect,
7931    > {
7932        FileProxyInterface::r#get_flags(self)
7933    }
7934
7935    /// Sets the flags that apply to this node after it has been opened. This method does not
7936    /// require any rights.
7937    ///
7938    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
7939    /// clear append mode.
7940    ///
7941    /// Errors:
7942    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
7943    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
7944    pub fn r#set_flags(
7945        &self,
7946        mut flags: Flags,
7947    ) -> fidl::client::QueryResponseFut<
7948        NodeSetFlagsResult,
7949        fidl::encoding::DefaultFuchsiaResourceDialect,
7950    > {
7951        FileProxyInterface::r#set_flags(self, flags)
7952    }
7953
7954    /// Query the filesystem for filesystem-specific information.
7955    pub fn r#query_filesystem(
7956        &self,
7957    ) -> fidl::client::QueryResponseFut<
7958        (i32, Option<Box<FilesystemInfo>>),
7959        fidl::encoding::DefaultFuchsiaResourceDialect,
7960    > {
7961        FileProxyInterface::r#query_filesystem(self)
7962    }
7963
7964    /// Acquires information about the node.
7965    ///
7966    /// The attributes of a node should be stable, independent of the
7967    /// specific protocol used to access it.
7968    ///
7969    /// If a particular attribute is not applicable or not supported,
7970    /// filesystems should leave the corresponding field absent.
7971    ///
7972    /// + `query` a bit-mask specifying which attributes to fetch. The server
7973    ///   should not return more than necessary.
7974    /// - `attributes` the returned attributes.
7975    ///
7976    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7977    pub fn r#get_attributes(
7978        &self,
7979        mut query: NodeAttributesQuery,
7980    ) -> fidl::client::QueryResponseFut<
7981        NodeGetAttributesResult,
7982        fidl::encoding::DefaultFuchsiaResourceDialect,
7983    > {
7984        FileProxyInterface::r#get_attributes(self, query)
7985    }
7986
7987    /// Updates information about the node.
7988    ///
7989    /// + `attributes` the presence of a table field in `attributes` indicates
7990    /// the intent to update the corresponding attribute.
7991    ///
7992    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
7993    ///
7994    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7995    pub fn r#update_attributes(
7996        &self,
7997        mut payload: &MutableNodeAttributes,
7998    ) -> fidl::client::QueryResponseFut<
7999        NodeUpdateAttributesResult,
8000        fidl::encoding::DefaultFuchsiaResourceDialect,
8001    > {
8002        FileProxyInterface::r#update_attributes(self, payload)
8003    }
8004
8005    /// Synchronizes updates to the node to the underlying media, if it exists.
8006    ///
8007    /// This method will return when the filesystem server has flushed the
8008    /// relevant updates to the underlying media, but does not guarantee the
8009    /// underlying media has persisted the information, nor that any information
8010    /// is committed to hardware. Clients may use `Sync` to ensure ordering
8011    /// between operations.
8012    ///
8013    /// This method does not require any rights.
8014    pub fn r#sync(
8015        &self,
8016    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8017    {
8018        FileProxyInterface::r#sync(self)
8019    }
8020
8021    /// Creates an iterator over all the extended attribute names associated
8022    /// with this node. If an error occurs it is returned as an epitaph on the
8023    /// iterator request channel, and then the channel is closed.
8024    ///
8025    /// GetExtendedAttributes can be used with any of these names to retrieve
8026    /// the associated value.
8027    ///
8028    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8029    pub fn r#list_extended_attributes(
8030        &self,
8031        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8032    ) -> Result<(), fidl::Error> {
8033        FileProxyInterface::r#list_extended_attributes(self, iterator)
8034    }
8035
8036    /// Get the value associated with the given attribute `name` for this node.
8037    ///
8038    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
8039    /// particular structure is imposed on them.
8040    ///
8041    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8042    pub fn r#get_extended_attribute(
8043        &self,
8044        mut name: &[u8],
8045    ) -> fidl::client::QueryResponseFut<
8046        NodeGetExtendedAttributeResult,
8047        fidl::encoding::DefaultFuchsiaResourceDialect,
8048    > {
8049        FileProxyInterface::r#get_extended_attribute(self, name)
8050    }
8051
8052    /// Set the value for the given attribute `name` to `value` for this node.
8053    ///
8054    /// The attribute name may exist, in which case the attribute is updated.
8055    /// If the attribute doesn't exist, it is created. The name should have no
8056    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
8057    ///
8058    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8059    pub fn r#set_extended_attribute(
8060        &self,
8061        mut name: &[u8],
8062        mut value: ExtendedAttributeValue,
8063        mut mode: SetExtendedAttributeMode,
8064    ) -> fidl::client::QueryResponseFut<
8065        NodeSetExtendedAttributeResult,
8066        fidl::encoding::DefaultFuchsiaResourceDialect,
8067    > {
8068        FileProxyInterface::r#set_extended_attribute(self, name, value, mode)
8069    }
8070
8071    /// Remove the specified extended attribute.
8072    ///
8073    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
8074    ///
8075    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8076    pub fn r#remove_extended_attribute(
8077        &self,
8078        mut name: &[u8],
8079    ) -> fidl::client::QueryResponseFut<
8080        NodeRemoveExtendedAttributeResult,
8081        fidl::encoding::DefaultFuchsiaResourceDialect,
8082    > {
8083        FileProxyInterface::r#remove_extended_attribute(self, name)
8084    }
8085
8086    /// Reads up to 'count' bytes at the seek offset.
8087    /// The seek offset is moved forward by the number of bytes read.
8088    ///
8089    /// ## Invariants
8090    ///
8091    /// * The returned `data.length` will never be greater than `count`.
8092    /// * If `data.length` is less than `count`, it means that the seek offset
8093    ///   has reached the end of file as part of this operation.
8094    /// * If `data.length` is zero while `count` is not, it means that the
8095    ///   seek offset is already at or beyond the end of file, and no data could
8096    ///   be read.
8097    /// * If `count` is zero, the server should perform all the checks ensuring
8098    ///   read access without actually read anything, and return an empty
8099    ///   `data` vector.
8100    ///
8101    /// This method requires the [`Rights.READ_BYTES`] right.
8102    ///
8103    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8104    pub fn r#read(
8105        &self,
8106        mut count: u64,
8107    ) -> fidl::client::QueryResponseFut<
8108        ReadableReadResult,
8109        fidl::encoding::DefaultFuchsiaResourceDialect,
8110    > {
8111        FileProxyInterface::r#read(self, count)
8112    }
8113
8114    /// Writes data at the seek offset.
8115    /// The seek offset is moved forward by the number of bytes written.
8116    /// If the file is in append mode, the seek offset is first set to the end
8117    /// of the file, followed by the write, in one atomic step.
8118    ///
8119    /// The file size may grow if the seek offset plus `data.length` is beyond
8120    /// the current end of file.
8121    ///
8122    /// + request `data` the byte buffer to write to the file.
8123    /// - response `actual_count` the number of bytes written.
8124    ///
8125    /// ## Invariants
8126    ///
8127    /// * The returned `actual_count` will never be greater than `data.length`.
8128    /// * If the server is unable to write all the data due to e.g. not enough
8129    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8130    ///   could be written, an error is returned.
8131    /// * If `data.length` is zero, the server should perform all the checks
8132    ///   ensuring write access without mutating the file and return a
8133    ///   successful write of zero bytes.  The seek offset is still updated if
8134    ///   in append mode.
8135    ///
8136    /// This method requires the [`Rights.WRITE_BYTES`] right.
8137    pub fn r#write(
8138        &self,
8139        mut data: &[u8],
8140    ) -> fidl::client::QueryResponseFut<
8141        WritableWriteResult,
8142        fidl::encoding::DefaultFuchsiaResourceDialect,
8143    > {
8144        FileProxyInterface::r#write(self, data)
8145    }
8146
8147    pub fn r#describe(
8148        &self,
8149    ) -> fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
8150    {
8151        FileProxyInterface::r#describe(self)
8152    }
8153
8154    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
8155    /// will occur. The seek offset is specific to each file connection.
8156    ///
8157    /// + request `origin` the reference point where `offset` will be based on.
8158    /// + request `offset` the number of bytes to seek.
8159    /// - response `offset_from_start` the adjusted seek offset, from the start
8160    ///   of the file.
8161    ///
8162    /// This method does not require any rights.
8163    pub fn r#seek(
8164        &self,
8165        mut origin: SeekOrigin,
8166        mut offset: i64,
8167    ) -> fidl::client::QueryResponseFut<FileSeekResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8168    {
8169        FileProxyInterface::r#seek(self, origin, offset)
8170    }
8171
8172    /// Reads up to 'count' bytes at the provided offset.
8173    /// Does not affect the seek offset.
8174    ///
8175    /// ## Invariants
8176    ///
8177    /// * The returned `data.length` will never be greater than `count`.
8178    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
8179    ///   the end of file as part of this operation.
8180    /// * If `data.length` is zero while `count` is not, it means that `offset`
8181    ///   is at or past the end of file, and no data can be read.
8182    /// * If `count` is zero, the server should perform all the checks ensuring
8183    ///   read access without actually reading anything, and return an empty
8184    ///   `data` vector.
8185    ///
8186    /// This method requires the [`Rights.READ_BYTES`] right.
8187    ///
8188    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8189    pub fn r#read_at(
8190        &self,
8191        mut count: u64,
8192        mut offset: u64,
8193    ) -> fidl::client::QueryResponseFut<
8194        FileReadAtResult,
8195        fidl::encoding::DefaultFuchsiaResourceDialect,
8196    > {
8197        FileProxyInterface::r#read_at(self, count, offset)
8198    }
8199
8200    /// Writes data at the provided offset.
8201    /// Does not affect the seek offset.
8202    ///
8203    /// The file size may grow if `offset` plus `data.length` is past the
8204    /// current end of file.
8205    ///
8206    /// + request `data` the byte buffer to write to the file.
8207    /// + request `offset` the offset from start of the file to begin writing.
8208    /// - response `actual_count` the number of bytes written.
8209    ///
8210    /// ## Invariants
8211    ///
8212    /// * The returned `actual_count` will never be greater than `data.length`.
8213    /// * If the server is unable to write all the data due to e.g. not enough
8214    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8215    ///   could be written, an error is returned.
8216    /// * If `data.length` is zero, the server should perform all the checks
8217    ///   ensuring write access without mutating the file, and will return a
8218    ///   successful write of zero bytes.
8219    ///
8220    /// This method requires the [`Rights.WRITE_BYTES`] right.
8221    pub fn r#write_at(
8222        &self,
8223        mut data: &[u8],
8224        mut offset: u64,
8225    ) -> fidl::client::QueryResponseFut<
8226        FileWriteAtResult,
8227        fidl::encoding::DefaultFuchsiaResourceDialect,
8228    > {
8229        FileProxyInterface::r#write_at(self, data, offset)
8230    }
8231
8232    /// Shrinks or grows the file size to 'length' bytes.
8233    ///
8234    /// If file size is reduced by this operation, the extra trailing data'
8235    /// is discarded.
8236    /// If file size is increased by this operation, the extended area appears
8237    /// as if it was zeroed.
8238    ///
8239    /// This method requires the [`Rights.WRITE_BYTES`] right.
8240    pub fn r#resize(
8241        &self,
8242        mut length: u64,
8243    ) -> fidl::client::QueryResponseFut<
8244        FileResizeResult,
8245        fidl::encoding::DefaultFuchsiaResourceDialect,
8246    > {
8247        FileProxyInterface::r#resize(self, length)
8248    }
8249
8250    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
8251    /// with the requested access rights.
8252    ///
8253    /// Implementations are not required to implement files backed by VMOs so
8254    /// this request may fail. Additionally, implementations may only support
8255    /// a certain subset of the flags. Clients should be prepared with fallback
8256    /// behavior if this request fails.
8257    ///
8258    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
8259    /// implementation is free to choose the semantics of the returned VMO.
8260    ///
8261    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
8262    /// - response `vmo` the requested [`zx.Handle:VMO`].
8263    /// * error a [`zx.Status`] value indicating the failure.
8264    ///
8265    /// This method requires the following rights:
8266    ///
8267    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
8268    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
8269    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
8270    pub fn r#get_backing_memory(
8271        &self,
8272        mut flags: VmoFlags,
8273    ) -> fidl::client::QueryResponseFut<
8274        FileGetBackingMemoryResult,
8275        fidl::encoding::DefaultFuchsiaResourceDialect,
8276    > {
8277        FileProxyInterface::r#get_backing_memory(self, flags)
8278    }
8279
8280    /// Pre-allocate on-disk space for this file.
8281    pub fn r#allocate(
8282        &self,
8283        mut offset: u64,
8284        mut length: u64,
8285        mut mode: AllocateMode,
8286    ) -> fidl::client::QueryResponseFut<
8287        FileAllocateResult,
8288        fidl::encoding::DefaultFuchsiaResourceDialect,
8289    > {
8290        FileProxyInterface::r#allocate(self, offset, length, mode)
8291    }
8292
8293    /// Enables verification for the file (permanently) which involves computing a merkle tree for
8294    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
8295    /// captured. Future reads will be verified against the computed merkle tree and writes will be
8296    /// rejected. This method can take some time to complete as it depends on the size of the file.
8297    /// This method can be aborted by closing the connection that this method was issued on.
8298    ///
8299    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8300    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
8301    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
8302    /// Also returns any error that might arise from reading the file, or from flushing the file,
8303    /// such as `ZX_ERR_IO`.
8304    pub fn r#enable_verity(
8305        &self,
8306        mut options: &VerificationOptions,
8307    ) -> fidl::client::QueryResponseFut<
8308        FileEnableVerityResult,
8309        fidl::encoding::DefaultFuchsiaResourceDialect,
8310    > {
8311        FileProxyInterface::r#enable_verity(self, options)
8312    }
8313}
8314
8315impl FileProxyInterface for FileProxy {
8316    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
8317        AdvisoryLockingAdvisoryLockResult,
8318        fidl::encoding::DefaultFuchsiaResourceDialect,
8319    >;
8320    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
8321        fn _decode(
8322            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8323        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
8324            let _response = fidl::client::decode_transaction_body::<
8325                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8326                fidl::encoding::DefaultFuchsiaResourceDialect,
8327                0x6ee9c0ad53ec87aa,
8328            >(_buf?)?;
8329            Ok(_response.map(|x| x))
8330        }
8331        self.client.send_query_and_decode::<
8332            AdvisoryLockingAdvisoryLockRequest,
8333            AdvisoryLockingAdvisoryLockResult,
8334        >(
8335            (request,),
8336            0x6ee9c0ad53ec87aa,
8337            fidl::encoding::DynamicFlags::empty(),
8338            _decode,
8339        )
8340    }
8341
8342    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
8343        LinkableLinkIntoResult,
8344        fidl::encoding::DefaultFuchsiaResourceDialect,
8345    >;
8346    fn r#link_into(
8347        &self,
8348        mut dst_parent_token: fidl::Event,
8349        mut dst: &str,
8350    ) -> Self::LinkIntoResponseFut {
8351        fn _decode(
8352            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8353        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
8354            let _response = fidl::client::decode_transaction_body::<
8355                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8356                fidl::encoding::DefaultFuchsiaResourceDialect,
8357                0x54f3949246a03e74,
8358            >(_buf?)?;
8359            Ok(_response.map(|x| x))
8360        }
8361        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
8362            (dst_parent_token, dst),
8363            0x54f3949246a03e74,
8364            fidl::encoding::DynamicFlags::empty(),
8365            _decode,
8366        )
8367    }
8368
8369    fn r#clone(
8370        &self,
8371        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8372    ) -> Result<(), fidl::Error> {
8373        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
8374            (request,),
8375            0x20d8a7aba2168a79,
8376            fidl::encoding::DynamicFlags::empty(),
8377        )
8378    }
8379
8380    type CloseResponseFut = fidl::client::QueryResponseFut<
8381        fidl_fuchsia_unknown::CloseableCloseResult,
8382        fidl::encoding::DefaultFuchsiaResourceDialect,
8383    >;
8384    fn r#close(&self) -> Self::CloseResponseFut {
8385        fn _decode(
8386            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8387        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
8388            let _response = fidl::client::decode_transaction_body::<
8389                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8390                fidl::encoding::DefaultFuchsiaResourceDialect,
8391                0x5ac5d459ad7f657e,
8392            >(_buf?)?;
8393            Ok(_response.map(|x| x))
8394        }
8395        self.client.send_query_and_decode::<
8396            fidl::encoding::EmptyPayload,
8397            fidl_fuchsia_unknown::CloseableCloseResult,
8398        >(
8399            (),
8400            0x5ac5d459ad7f657e,
8401            fidl::encoding::DynamicFlags::empty(),
8402            _decode,
8403        )
8404    }
8405
8406    type QueryResponseFut =
8407        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
8408    fn r#query(&self) -> Self::QueryResponseFut {
8409        fn _decode(
8410            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8411        ) -> Result<Vec<u8>, fidl::Error> {
8412            let _response = fidl::client::decode_transaction_body::<
8413                fidl_fuchsia_unknown::QueryableQueryResponse,
8414                fidl::encoding::DefaultFuchsiaResourceDialect,
8415                0x2658edee9decfc06,
8416            >(_buf?)?;
8417            Ok(_response.protocol)
8418        }
8419        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
8420            (),
8421            0x2658edee9decfc06,
8422            fidl::encoding::DynamicFlags::empty(),
8423            _decode,
8424        )
8425    }
8426
8427    fn r#deprecated_clone(
8428        &self,
8429        mut flags: OpenFlags,
8430        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
8431    ) -> Result<(), fidl::Error> {
8432        self.client.send::<NodeDeprecatedCloneRequest>(
8433            (flags, object),
8434            0x5a61678f293ce16f,
8435            fidl::encoding::DynamicFlags::FLEXIBLE,
8436        )
8437    }
8438
8439    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
8440        (i32, NodeAttributes),
8441        fidl::encoding::DefaultFuchsiaResourceDialect,
8442    >;
8443    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
8444        fn _decode(
8445            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8446        ) -> Result<(i32, NodeAttributes), fidl::Error> {
8447            let _response = fidl::client::decode_transaction_body::<
8448                NodeDeprecatedGetAttrResponse,
8449                fidl::encoding::DefaultFuchsiaResourceDialect,
8450                0x78985e216314dafd,
8451            >(_buf?)?;
8452            Ok((_response.s, _response.attributes))
8453        }
8454        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
8455            (),
8456            0x78985e216314dafd,
8457            fidl::encoding::DynamicFlags::empty(),
8458            _decode,
8459        )
8460    }
8461
8462    type DeprecatedSetAttrResponseFut =
8463        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8464    fn r#deprecated_set_attr(
8465        &self,
8466        mut flags: NodeAttributeFlags,
8467        mut attributes: &NodeAttributes,
8468    ) -> Self::DeprecatedSetAttrResponseFut {
8469        fn _decode(
8470            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8471        ) -> Result<i32, fidl::Error> {
8472            let _response = fidl::client::decode_transaction_body::<
8473                NodeDeprecatedSetAttrResponse,
8474                fidl::encoding::DefaultFuchsiaResourceDialect,
8475                0x4186c0f40d938f46,
8476            >(_buf?)?;
8477            Ok(_response.s)
8478        }
8479        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
8480            (flags, attributes),
8481            0x4186c0f40d938f46,
8482            fidl::encoding::DynamicFlags::empty(),
8483            _decode,
8484        )
8485    }
8486
8487    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
8488        (i32, OpenFlags),
8489        fidl::encoding::DefaultFuchsiaResourceDialect,
8490    >;
8491    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
8492        fn _decode(
8493            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8494        ) -> Result<(i32, OpenFlags), fidl::Error> {
8495            let _response = fidl::client::decode_transaction_body::<
8496                NodeDeprecatedGetFlagsResponse,
8497                fidl::encoding::DefaultFuchsiaResourceDialect,
8498                0x5b88fffb8eda3aa1,
8499            >(_buf?)?;
8500            Ok((_response.s, _response.flags))
8501        }
8502        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
8503            (),
8504            0x5b88fffb8eda3aa1,
8505            fidl::encoding::DynamicFlags::empty(),
8506            _decode,
8507        )
8508    }
8509
8510    type DeprecatedSetFlagsResponseFut =
8511        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8512    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
8513        fn _decode(
8514            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8515        ) -> Result<i32, fidl::Error> {
8516            let _response = fidl::client::decode_transaction_body::<
8517                NodeDeprecatedSetFlagsResponse,
8518                fidl::encoding::DefaultFuchsiaResourceDialect,
8519                0x5295b76c71fde733,
8520            >(_buf?)?;
8521            Ok(_response.s)
8522        }
8523        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
8524            (flags,),
8525            0x5295b76c71fde733,
8526            fidl::encoding::DynamicFlags::empty(),
8527            _decode,
8528        )
8529    }
8530
8531    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
8532        NodeGetFlagsResult,
8533        fidl::encoding::DefaultFuchsiaResourceDialect,
8534    >;
8535    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
8536        fn _decode(
8537            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8538        ) -> Result<NodeGetFlagsResult, fidl::Error> {
8539            let _response = fidl::client::decode_transaction_body::<
8540                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
8541                fidl::encoding::DefaultFuchsiaResourceDialect,
8542                0x176eb318f64ec23,
8543            >(_buf?)?
8544            .into_result::<FileMarker>("get_flags")?;
8545            Ok(_response.map(|x| x.flags))
8546        }
8547        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
8548            (),
8549            0x176eb318f64ec23,
8550            fidl::encoding::DynamicFlags::FLEXIBLE,
8551            _decode,
8552        )
8553    }
8554
8555    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
8556        NodeSetFlagsResult,
8557        fidl::encoding::DefaultFuchsiaResourceDialect,
8558    >;
8559    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
8560        fn _decode(
8561            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8562        ) -> Result<NodeSetFlagsResult, fidl::Error> {
8563            let _response = fidl::client::decode_transaction_body::<
8564                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
8565                fidl::encoding::DefaultFuchsiaResourceDialect,
8566                0x55a8028685791ea8,
8567            >(_buf?)?
8568            .into_result::<FileMarker>("set_flags")?;
8569            Ok(_response.map(|x| x))
8570        }
8571        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
8572            (flags,),
8573            0x55a8028685791ea8,
8574            fidl::encoding::DynamicFlags::FLEXIBLE,
8575            _decode,
8576        )
8577    }
8578
8579    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
8580        (i32, Option<Box<FilesystemInfo>>),
8581        fidl::encoding::DefaultFuchsiaResourceDialect,
8582    >;
8583    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
8584        fn _decode(
8585            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8586        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
8587            let _response = fidl::client::decode_transaction_body::<
8588                NodeQueryFilesystemResponse,
8589                fidl::encoding::DefaultFuchsiaResourceDialect,
8590                0x6f344a1c6b0a0610,
8591            >(_buf?)?;
8592            Ok((_response.s, _response.info))
8593        }
8594        self.client.send_query_and_decode::<
8595            fidl::encoding::EmptyPayload,
8596            (i32, Option<Box<FilesystemInfo>>),
8597        >(
8598            (),
8599            0x6f344a1c6b0a0610,
8600            fidl::encoding::DynamicFlags::empty(),
8601            _decode,
8602        )
8603    }
8604
8605    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
8606        NodeGetAttributesResult,
8607        fidl::encoding::DefaultFuchsiaResourceDialect,
8608    >;
8609    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
8610        fn _decode(
8611            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8612        ) -> Result<NodeGetAttributesResult, fidl::Error> {
8613            let _response = fidl::client::decode_transaction_body::<
8614                fidl::encoding::ResultType<NodeAttributes2, i32>,
8615                fidl::encoding::DefaultFuchsiaResourceDialect,
8616                0x3d4396a638ea053b,
8617            >(_buf?)?;
8618            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
8619        }
8620        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
8621            (query,),
8622            0x3d4396a638ea053b,
8623            fidl::encoding::DynamicFlags::empty(),
8624            _decode,
8625        )
8626    }
8627
8628    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
8629        NodeUpdateAttributesResult,
8630        fidl::encoding::DefaultFuchsiaResourceDialect,
8631    >;
8632    fn r#update_attributes(
8633        &self,
8634        mut payload: &MutableNodeAttributes,
8635    ) -> Self::UpdateAttributesResponseFut {
8636        fn _decode(
8637            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8638        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
8639            let _response = fidl::client::decode_transaction_body::<
8640                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8641                fidl::encoding::DefaultFuchsiaResourceDialect,
8642                0x3308c1da5a89bf08,
8643            >(_buf?)?;
8644            Ok(_response.map(|x| x))
8645        }
8646        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
8647            payload,
8648            0x3308c1da5a89bf08,
8649            fidl::encoding::DynamicFlags::empty(),
8650            _decode,
8651        )
8652    }
8653
8654    type SyncResponseFut = fidl::client::QueryResponseFut<
8655        NodeSyncResult,
8656        fidl::encoding::DefaultFuchsiaResourceDialect,
8657    >;
8658    fn r#sync(&self) -> Self::SyncResponseFut {
8659        fn _decode(
8660            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8661        ) -> Result<NodeSyncResult, fidl::Error> {
8662            let _response = fidl::client::decode_transaction_body::<
8663                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8664                fidl::encoding::DefaultFuchsiaResourceDialect,
8665                0x2c5c27ca0ab5dc49,
8666            >(_buf?)?;
8667            Ok(_response.map(|x| x))
8668        }
8669        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
8670            (),
8671            0x2c5c27ca0ab5dc49,
8672            fidl::encoding::DynamicFlags::empty(),
8673            _decode,
8674        )
8675    }
8676
8677    fn r#list_extended_attributes(
8678        &self,
8679        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8680    ) -> Result<(), fidl::Error> {
8681        self.client.send::<NodeListExtendedAttributesRequest>(
8682            (iterator,),
8683            0x4b61033de007fcd0,
8684            fidl::encoding::DynamicFlags::empty(),
8685        )
8686    }
8687
8688    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8689        NodeGetExtendedAttributeResult,
8690        fidl::encoding::DefaultFuchsiaResourceDialect,
8691    >;
8692    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
8693        fn _decode(
8694            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8695        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
8696            let _response = fidl::client::decode_transaction_body::<
8697                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
8698                fidl::encoding::DefaultFuchsiaResourceDialect,
8699                0x45ffa3ccfdeb76db,
8700            >(_buf?)?;
8701            Ok(_response.map(|x| x))
8702        }
8703        self.client.send_query_and_decode::<
8704            NodeGetExtendedAttributeRequest,
8705            NodeGetExtendedAttributeResult,
8706        >(
8707            (name,),
8708            0x45ffa3ccfdeb76db,
8709            fidl::encoding::DynamicFlags::empty(),
8710            _decode,
8711        )
8712    }
8713
8714    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8715        NodeSetExtendedAttributeResult,
8716        fidl::encoding::DefaultFuchsiaResourceDialect,
8717    >;
8718    fn r#set_extended_attribute(
8719        &self,
8720        mut name: &[u8],
8721        mut value: ExtendedAttributeValue,
8722        mut mode: SetExtendedAttributeMode,
8723    ) -> Self::SetExtendedAttributeResponseFut {
8724        fn _decode(
8725            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8726        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
8727            let _response = fidl::client::decode_transaction_body::<
8728                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8729                fidl::encoding::DefaultFuchsiaResourceDialect,
8730                0x4a951362f681f23c,
8731            >(_buf?)?;
8732            Ok(_response.map(|x| x))
8733        }
8734        self.client.send_query_and_decode::<
8735            NodeSetExtendedAttributeRequest,
8736            NodeSetExtendedAttributeResult,
8737        >(
8738            (name, &mut value, mode,),
8739            0x4a951362f681f23c,
8740            fidl::encoding::DynamicFlags::empty(),
8741            _decode,
8742        )
8743    }
8744
8745    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8746        NodeRemoveExtendedAttributeResult,
8747        fidl::encoding::DefaultFuchsiaResourceDialect,
8748    >;
8749    fn r#remove_extended_attribute(
8750        &self,
8751        mut name: &[u8],
8752    ) -> Self::RemoveExtendedAttributeResponseFut {
8753        fn _decode(
8754            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8755        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
8756            let _response = fidl::client::decode_transaction_body::<
8757                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8758                fidl::encoding::DefaultFuchsiaResourceDialect,
8759                0x7a0b9f3a9bf9032d,
8760            >(_buf?)?;
8761            Ok(_response.map(|x| x))
8762        }
8763        self.client.send_query_and_decode::<
8764            NodeRemoveExtendedAttributeRequest,
8765            NodeRemoveExtendedAttributeResult,
8766        >(
8767            (name,),
8768            0x7a0b9f3a9bf9032d,
8769            fidl::encoding::DynamicFlags::empty(),
8770            _decode,
8771        )
8772    }
8773
8774    type ReadResponseFut = fidl::client::QueryResponseFut<
8775        ReadableReadResult,
8776        fidl::encoding::DefaultFuchsiaResourceDialect,
8777    >;
8778    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
8779        fn _decode(
8780            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8781        ) -> Result<ReadableReadResult, fidl::Error> {
8782            let _response = fidl::client::decode_transaction_body::<
8783                fidl::encoding::ResultType<ReadableReadResponse, i32>,
8784                fidl::encoding::DefaultFuchsiaResourceDialect,
8785                0x57e419a298c8ede,
8786            >(_buf?)?;
8787            Ok(_response.map(|x| x.data))
8788        }
8789        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
8790            (count,),
8791            0x57e419a298c8ede,
8792            fidl::encoding::DynamicFlags::empty(),
8793            _decode,
8794        )
8795    }
8796
8797    type WriteResponseFut = fidl::client::QueryResponseFut<
8798        WritableWriteResult,
8799        fidl::encoding::DefaultFuchsiaResourceDialect,
8800    >;
8801    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
8802        fn _decode(
8803            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8804        ) -> Result<WritableWriteResult, fidl::Error> {
8805            let _response = fidl::client::decode_transaction_body::<
8806                fidl::encoding::ResultType<WritableWriteResponse, i32>,
8807                fidl::encoding::DefaultFuchsiaResourceDialect,
8808                0x6a31437832469f82,
8809            >(_buf?)?;
8810            Ok(_response.map(|x| x.actual_count))
8811        }
8812        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
8813            (data,),
8814            0x6a31437832469f82,
8815            fidl::encoding::DynamicFlags::empty(),
8816            _decode,
8817        )
8818    }
8819
8820    type DescribeResponseFut =
8821        fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
8822    fn r#describe(&self) -> Self::DescribeResponseFut {
8823        fn _decode(
8824            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8825        ) -> Result<FileInfo, fidl::Error> {
8826            let _response = fidl::client::decode_transaction_body::<
8827                FileInfo,
8828                fidl::encoding::DefaultFuchsiaResourceDialect,
8829                0x68b5ac00c62906bc,
8830            >(_buf?)?;
8831            Ok(_response)
8832        }
8833        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FileInfo>(
8834            (),
8835            0x68b5ac00c62906bc,
8836            fidl::encoding::DynamicFlags::empty(),
8837            _decode,
8838        )
8839    }
8840
8841    type SeekResponseFut = fidl::client::QueryResponseFut<
8842        FileSeekResult,
8843        fidl::encoding::DefaultFuchsiaResourceDialect,
8844    >;
8845    fn r#seek(&self, mut origin: SeekOrigin, mut offset: i64) -> Self::SeekResponseFut {
8846        fn _decode(
8847            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8848        ) -> Result<FileSeekResult, fidl::Error> {
8849            let _response = fidl::client::decode_transaction_body::<
8850                fidl::encoding::ResultType<FileSeekResponse, i32>,
8851                fidl::encoding::DefaultFuchsiaResourceDialect,
8852                0x78079168162c5207,
8853            >(_buf?)?;
8854            Ok(_response.map(|x| x.offset_from_start))
8855        }
8856        self.client.send_query_and_decode::<FileSeekRequest, FileSeekResult>(
8857            (origin, offset),
8858            0x78079168162c5207,
8859            fidl::encoding::DynamicFlags::empty(),
8860            _decode,
8861        )
8862    }
8863
8864    type ReadAtResponseFut = fidl::client::QueryResponseFut<
8865        FileReadAtResult,
8866        fidl::encoding::DefaultFuchsiaResourceDialect,
8867    >;
8868    fn r#read_at(&self, mut count: u64, mut offset: u64) -> Self::ReadAtResponseFut {
8869        fn _decode(
8870            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8871        ) -> Result<FileReadAtResult, fidl::Error> {
8872            let _response = fidl::client::decode_transaction_body::<
8873                fidl::encoding::ResultType<FileReadAtResponse, i32>,
8874                fidl::encoding::DefaultFuchsiaResourceDialect,
8875                0x1607a293a60d723e,
8876            >(_buf?)?;
8877            Ok(_response.map(|x| x.data))
8878        }
8879        self.client.send_query_and_decode::<FileReadAtRequest, FileReadAtResult>(
8880            (count, offset),
8881            0x1607a293a60d723e,
8882            fidl::encoding::DynamicFlags::empty(),
8883            _decode,
8884        )
8885    }
8886
8887    type WriteAtResponseFut = fidl::client::QueryResponseFut<
8888        FileWriteAtResult,
8889        fidl::encoding::DefaultFuchsiaResourceDialect,
8890    >;
8891    fn r#write_at(&self, mut data: &[u8], mut offset: u64) -> Self::WriteAtResponseFut {
8892        fn _decode(
8893            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8894        ) -> Result<FileWriteAtResult, fidl::Error> {
8895            let _response = fidl::client::decode_transaction_body::<
8896                fidl::encoding::ResultType<FileWriteAtResponse, i32>,
8897                fidl::encoding::DefaultFuchsiaResourceDialect,
8898                0x793eefc0045e792b,
8899            >(_buf?)?;
8900            Ok(_response.map(|x| x.actual_count))
8901        }
8902        self.client.send_query_and_decode::<FileWriteAtRequest, FileWriteAtResult>(
8903            (data, offset),
8904            0x793eefc0045e792b,
8905            fidl::encoding::DynamicFlags::empty(),
8906            _decode,
8907        )
8908    }
8909
8910    type ResizeResponseFut = fidl::client::QueryResponseFut<
8911        FileResizeResult,
8912        fidl::encoding::DefaultFuchsiaResourceDialect,
8913    >;
8914    fn r#resize(&self, mut length: u64) -> Self::ResizeResponseFut {
8915        fn _decode(
8916            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8917        ) -> Result<FileResizeResult, fidl::Error> {
8918            let _response = fidl::client::decode_transaction_body::<
8919                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8920                fidl::encoding::DefaultFuchsiaResourceDialect,
8921                0x2b80825f0535743a,
8922            >(_buf?)?;
8923            Ok(_response.map(|x| x))
8924        }
8925        self.client.send_query_and_decode::<FileResizeRequest, FileResizeResult>(
8926            (length,),
8927            0x2b80825f0535743a,
8928            fidl::encoding::DynamicFlags::empty(),
8929            _decode,
8930        )
8931    }
8932
8933    type GetBackingMemoryResponseFut = fidl::client::QueryResponseFut<
8934        FileGetBackingMemoryResult,
8935        fidl::encoding::DefaultFuchsiaResourceDialect,
8936    >;
8937    fn r#get_backing_memory(&self, mut flags: VmoFlags) -> Self::GetBackingMemoryResponseFut {
8938        fn _decode(
8939            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8940        ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
8941            let _response = fidl::client::decode_transaction_body::<
8942                fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
8943                fidl::encoding::DefaultFuchsiaResourceDialect,
8944                0xa6a9e654cbf62b,
8945            >(_buf?)?;
8946            Ok(_response.map(|x| x.vmo))
8947        }
8948        self.client
8949            .send_query_and_decode::<FileGetBackingMemoryRequest, FileGetBackingMemoryResult>(
8950                (flags,),
8951                0xa6a9e654cbf62b,
8952                fidl::encoding::DynamicFlags::empty(),
8953                _decode,
8954            )
8955    }
8956
8957    type AllocateResponseFut = fidl::client::QueryResponseFut<
8958        FileAllocateResult,
8959        fidl::encoding::DefaultFuchsiaResourceDialect,
8960    >;
8961    fn r#allocate(
8962        &self,
8963        mut offset: u64,
8964        mut length: u64,
8965        mut mode: AllocateMode,
8966    ) -> Self::AllocateResponseFut {
8967        fn _decode(
8968            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8969        ) -> Result<FileAllocateResult, fidl::Error> {
8970            let _response = fidl::client::decode_transaction_body::<
8971                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
8972                fidl::encoding::DefaultFuchsiaResourceDialect,
8973                0x77fa0c330b57fd2e,
8974            >(_buf?)?
8975            .into_result::<FileMarker>("allocate")?;
8976            Ok(_response.map(|x| x))
8977        }
8978        self.client.send_query_and_decode::<FileAllocateRequest, FileAllocateResult>(
8979            (offset, length, mode),
8980            0x77fa0c330b57fd2e,
8981            fidl::encoding::DynamicFlags::FLEXIBLE,
8982            _decode,
8983        )
8984    }
8985
8986    type EnableVerityResponseFut = fidl::client::QueryResponseFut<
8987        FileEnableVerityResult,
8988        fidl::encoding::DefaultFuchsiaResourceDialect,
8989    >;
8990    fn r#enable_verity(&self, mut options: &VerificationOptions) -> Self::EnableVerityResponseFut {
8991        fn _decode(
8992            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8993        ) -> Result<FileEnableVerityResult, fidl::Error> {
8994            let _response = fidl::client::decode_transaction_body::<
8995                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
8996                fidl::encoding::DefaultFuchsiaResourceDialect,
8997                0x2c421ec3faaeb8bb,
8998            >(_buf?)?
8999            .into_result::<FileMarker>("enable_verity")?;
9000            Ok(_response.map(|x| x))
9001        }
9002        self.client.send_query_and_decode::<FileEnableVerityRequest, FileEnableVerityResult>(
9003            (options,),
9004            0x2c421ec3faaeb8bb,
9005            fidl::encoding::DynamicFlags::FLEXIBLE,
9006            _decode,
9007        )
9008    }
9009}
9010
9011pub struct FileEventStream {
9012    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9013}
9014
9015impl std::marker::Unpin for FileEventStream {}
9016
9017impl futures::stream::FusedStream for FileEventStream {
9018    fn is_terminated(&self) -> bool {
9019        self.event_receiver.is_terminated()
9020    }
9021}
9022
9023impl futures::Stream for FileEventStream {
9024    type Item = Result<FileEvent, fidl::Error>;
9025
9026    fn poll_next(
9027        mut self: std::pin::Pin<&mut Self>,
9028        cx: &mut std::task::Context<'_>,
9029    ) -> std::task::Poll<Option<Self::Item>> {
9030        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9031            &mut self.event_receiver,
9032            cx
9033        )?) {
9034            Some(buf) => std::task::Poll::Ready(Some(FileEvent::decode(buf))),
9035            None => std::task::Poll::Ready(None),
9036        }
9037    }
9038}
9039
9040#[derive(Debug)]
9041pub enum FileEvent {
9042    OnOpen_ {
9043        s: i32,
9044        info: Option<Box<NodeInfoDeprecated>>,
9045    },
9046    OnRepresentation {
9047        payload: Representation,
9048    },
9049    #[non_exhaustive]
9050    _UnknownEvent {
9051        /// Ordinal of the event that was sent.
9052        ordinal: u64,
9053    },
9054}
9055
9056impl FileEvent {
9057    #[allow(irrefutable_let_patterns)]
9058    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
9059        if let FileEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
9060    }
9061    #[allow(irrefutable_let_patterns)]
9062    pub fn into_on_representation(self) -> Option<Representation> {
9063        if let FileEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
9064    }
9065
9066    /// Decodes a message buffer as a [`FileEvent`].
9067    fn decode(
9068        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9069    ) -> Result<FileEvent, fidl::Error> {
9070        let (bytes, _handles) = buf.split_mut();
9071        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9072        debug_assert_eq!(tx_header.tx_id, 0);
9073        match tx_header.ordinal {
9074            0x7fc7bbb1dbfd1972 => {
9075                let mut out = fidl::new_empty!(
9076                    NodeOnOpenRequest,
9077                    fidl::encoding::DefaultFuchsiaResourceDialect
9078                );
9079                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
9080                Ok((FileEvent::OnOpen_ { s: out.s, info: out.info }))
9081            }
9082            0x5cb40567d80a510c => {
9083                let mut out =
9084                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
9085                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
9086                Ok((FileEvent::OnRepresentation { payload: out }))
9087            }
9088            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9089                Ok(FileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9090            }
9091            _ => Err(fidl::Error::UnknownOrdinal {
9092                ordinal: tx_header.ordinal,
9093                protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9094            }),
9095        }
9096    }
9097}
9098
9099/// A Stream of incoming requests for fuchsia.io/File.
9100pub struct FileRequestStream {
9101    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9102    is_terminated: bool,
9103}
9104
9105impl std::marker::Unpin for FileRequestStream {}
9106
9107impl futures::stream::FusedStream for FileRequestStream {
9108    fn is_terminated(&self) -> bool {
9109        self.is_terminated
9110    }
9111}
9112
9113impl fidl::endpoints::RequestStream for FileRequestStream {
9114    type Protocol = FileMarker;
9115    type ControlHandle = FileControlHandle;
9116
9117    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9118        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9119    }
9120
9121    fn control_handle(&self) -> Self::ControlHandle {
9122        FileControlHandle { inner: self.inner.clone() }
9123    }
9124
9125    fn into_inner(
9126        self,
9127    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9128    {
9129        (self.inner, self.is_terminated)
9130    }
9131
9132    fn from_inner(
9133        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9134        is_terminated: bool,
9135    ) -> Self {
9136        Self { inner, is_terminated }
9137    }
9138}
9139
9140impl futures::Stream for FileRequestStream {
9141    type Item = Result<FileRequest, fidl::Error>;
9142
9143    fn poll_next(
9144        mut self: std::pin::Pin<&mut Self>,
9145        cx: &mut std::task::Context<'_>,
9146    ) -> std::task::Poll<Option<Self::Item>> {
9147        let this = &mut *self;
9148        if this.inner.check_shutdown(cx) {
9149            this.is_terminated = true;
9150            return std::task::Poll::Ready(None);
9151        }
9152        if this.is_terminated {
9153            panic!("polled FileRequestStream after completion");
9154        }
9155        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9156            |bytes, handles| {
9157                match this.inner.channel().read_etc(cx, bytes, handles) {
9158                    std::task::Poll::Ready(Ok(())) => {}
9159                    std::task::Poll::Pending => return std::task::Poll::Pending,
9160                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9161                        this.is_terminated = true;
9162                        return std::task::Poll::Ready(None);
9163                    }
9164                    std::task::Poll::Ready(Err(e)) => {
9165                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9166                            e.into(),
9167                        ))));
9168                    }
9169                }
9170
9171                // A message has been received from the channel
9172                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9173
9174                std::task::Poll::Ready(Some(match header.ordinal {
9175                    0x6ee9c0ad53ec87aa => {
9176                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9177                        let mut req = fidl::new_empty!(
9178                            AdvisoryLockingAdvisoryLockRequest,
9179                            fidl::encoding::DefaultFuchsiaResourceDialect
9180                        );
9181                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
9182                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9183                        Ok(FileRequest::AdvisoryLock {
9184                            request: req.request,
9185
9186                            responder: FileAdvisoryLockResponder {
9187                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9188                                tx_id: header.tx_id,
9189                            },
9190                        })
9191                    }
9192                    0x54f3949246a03e74 => {
9193                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9194                        let mut req = fidl::new_empty!(
9195                            LinkableLinkIntoRequest,
9196                            fidl::encoding::DefaultFuchsiaResourceDialect
9197                        );
9198                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
9199                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9200                        Ok(FileRequest::LinkInto {
9201                            dst_parent_token: req.dst_parent_token,
9202                            dst: req.dst,
9203
9204                            responder: FileLinkIntoResponder {
9205                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9206                                tx_id: header.tx_id,
9207                            },
9208                        })
9209                    }
9210                    0x20d8a7aba2168a79 => {
9211                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9212                        let mut req = fidl::new_empty!(
9213                            fidl_fuchsia_unknown::CloneableCloneRequest,
9214                            fidl::encoding::DefaultFuchsiaResourceDialect
9215                        );
9216                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9217                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9218                        Ok(FileRequest::Clone { request: req.request, control_handle })
9219                    }
9220                    0x5ac5d459ad7f657e => {
9221                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9222                        let mut req = fidl::new_empty!(
9223                            fidl::encoding::EmptyPayload,
9224                            fidl::encoding::DefaultFuchsiaResourceDialect
9225                        );
9226                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9227                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9228                        Ok(FileRequest::Close {
9229                            responder: FileCloseResponder {
9230                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9231                                tx_id: header.tx_id,
9232                            },
9233                        })
9234                    }
9235                    0x2658edee9decfc06 => {
9236                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9237                        let mut req = fidl::new_empty!(
9238                            fidl::encoding::EmptyPayload,
9239                            fidl::encoding::DefaultFuchsiaResourceDialect
9240                        );
9241                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9242                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9243                        Ok(FileRequest::Query {
9244                            responder: FileQueryResponder {
9245                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9246                                tx_id: header.tx_id,
9247                            },
9248                        })
9249                    }
9250                    0x5a61678f293ce16f => {
9251                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9252                        let mut req = fidl::new_empty!(
9253                            NodeDeprecatedCloneRequest,
9254                            fidl::encoding::DefaultFuchsiaResourceDialect
9255                        );
9256                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9257                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9258                        Ok(FileRequest::DeprecatedClone {
9259                            flags: req.flags,
9260                            object: req.object,
9261
9262                            control_handle,
9263                        })
9264                    }
9265                    0x78985e216314dafd => {
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::DeprecatedGetAttr {
9274                            responder: FileDeprecatedGetAttrResponder {
9275                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9276                                tx_id: header.tx_id,
9277                            },
9278                        })
9279                    }
9280                    0x4186c0f40d938f46 => {
9281                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9282                        let mut req = fidl::new_empty!(
9283                            NodeDeprecatedSetAttrRequest,
9284                            fidl::encoding::DefaultFuchsiaResourceDialect
9285                        );
9286                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
9287                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9288                        Ok(FileRequest::DeprecatedSetAttr {
9289                            flags: req.flags,
9290                            attributes: req.attributes,
9291
9292                            responder: FileDeprecatedSetAttrResponder {
9293                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9294                                tx_id: header.tx_id,
9295                            },
9296                        })
9297                    }
9298                    0x5b88fffb8eda3aa1 => {
9299                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9300                        let mut req = fidl::new_empty!(
9301                            fidl::encoding::EmptyPayload,
9302                            fidl::encoding::DefaultFuchsiaResourceDialect
9303                        );
9304                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9305                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9306                        Ok(FileRequest::DeprecatedGetFlags {
9307                            responder: FileDeprecatedGetFlagsResponder {
9308                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9309                                tx_id: header.tx_id,
9310                            },
9311                        })
9312                    }
9313                    0x5295b76c71fde733 => {
9314                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9315                        let mut req = fidl::new_empty!(
9316                            NodeDeprecatedSetFlagsRequest,
9317                            fidl::encoding::DefaultFuchsiaResourceDialect
9318                        );
9319                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9320                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9321                        Ok(FileRequest::DeprecatedSetFlags {
9322                            flags: req.flags,
9323
9324                            responder: FileDeprecatedSetFlagsResponder {
9325                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9326                                tx_id: header.tx_id,
9327                            },
9328                        })
9329                    }
9330                    0x176eb318f64ec23 => {
9331                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9332                        let mut req = fidl::new_empty!(
9333                            fidl::encoding::EmptyPayload,
9334                            fidl::encoding::DefaultFuchsiaResourceDialect
9335                        );
9336                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9337                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9338                        Ok(FileRequest::GetFlags {
9339                            responder: FileGetFlagsResponder {
9340                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9341                                tx_id: header.tx_id,
9342                            },
9343                        })
9344                    }
9345                    0x55a8028685791ea8 => {
9346                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9347                        let mut req = fidl::new_empty!(
9348                            NodeSetFlagsRequest,
9349                            fidl::encoding::DefaultFuchsiaResourceDialect
9350                        );
9351                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9352                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9353                        Ok(FileRequest::SetFlags {
9354                            flags: req.flags,
9355
9356                            responder: FileSetFlagsResponder {
9357                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9358                                tx_id: header.tx_id,
9359                            },
9360                        })
9361                    }
9362                    0x6f344a1c6b0a0610 => {
9363                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9364                        let mut req = fidl::new_empty!(
9365                            fidl::encoding::EmptyPayload,
9366                            fidl::encoding::DefaultFuchsiaResourceDialect
9367                        );
9368                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9369                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9370                        Ok(FileRequest::QueryFilesystem {
9371                            responder: FileQueryFilesystemResponder {
9372                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9373                                tx_id: header.tx_id,
9374                            },
9375                        })
9376                    }
9377                    0x3d4396a638ea053b => {
9378                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9379                        let mut req = fidl::new_empty!(
9380                            NodeGetAttributesRequest,
9381                            fidl::encoding::DefaultFuchsiaResourceDialect
9382                        );
9383                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9384                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9385                        Ok(FileRequest::GetAttributes {
9386                            query: req.query,
9387
9388                            responder: FileGetAttributesResponder {
9389                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9390                                tx_id: header.tx_id,
9391                            },
9392                        })
9393                    }
9394                    0x3308c1da5a89bf08 => {
9395                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9396                        let mut req = fidl::new_empty!(
9397                            MutableNodeAttributes,
9398                            fidl::encoding::DefaultFuchsiaResourceDialect
9399                        );
9400                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
9401                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9402                        Ok(FileRequest::UpdateAttributes {
9403                            payload: req,
9404                            responder: FileUpdateAttributesResponder {
9405                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9406                                tx_id: header.tx_id,
9407                            },
9408                        })
9409                    }
9410                    0x2c5c27ca0ab5dc49 => {
9411                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9412                        let mut req = fidl::new_empty!(
9413                            fidl::encoding::EmptyPayload,
9414                            fidl::encoding::DefaultFuchsiaResourceDialect
9415                        );
9416                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9417                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9418                        Ok(FileRequest::Sync {
9419                            responder: FileSyncResponder {
9420                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9421                                tx_id: header.tx_id,
9422                            },
9423                        })
9424                    }
9425                    0x4b61033de007fcd0 => {
9426                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9427                        let mut req = fidl::new_empty!(
9428                            NodeListExtendedAttributesRequest,
9429                            fidl::encoding::DefaultFuchsiaResourceDialect
9430                        );
9431                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9432                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9433                        Ok(FileRequest::ListExtendedAttributes {
9434                            iterator: req.iterator,
9435
9436                            control_handle,
9437                        })
9438                    }
9439                    0x45ffa3ccfdeb76db => {
9440                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9441                        let mut req = fidl::new_empty!(
9442                            NodeGetExtendedAttributeRequest,
9443                            fidl::encoding::DefaultFuchsiaResourceDialect
9444                        );
9445                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9446                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9447                        Ok(FileRequest::GetExtendedAttribute {
9448                            name: req.name,
9449
9450                            responder: FileGetExtendedAttributeResponder {
9451                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9452                                tx_id: header.tx_id,
9453                            },
9454                        })
9455                    }
9456                    0x4a951362f681f23c => {
9457                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9458                        let mut req = fidl::new_empty!(
9459                            NodeSetExtendedAttributeRequest,
9460                            fidl::encoding::DefaultFuchsiaResourceDialect
9461                        );
9462                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9463                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9464                        Ok(FileRequest::SetExtendedAttribute {
9465                            name: req.name,
9466                            value: req.value,
9467                            mode: req.mode,
9468
9469                            responder: FileSetExtendedAttributeResponder {
9470                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9471                                tx_id: header.tx_id,
9472                            },
9473                        })
9474                    }
9475                    0x7a0b9f3a9bf9032d => {
9476                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9477                        let mut req = fidl::new_empty!(
9478                            NodeRemoveExtendedAttributeRequest,
9479                            fidl::encoding::DefaultFuchsiaResourceDialect
9480                        );
9481                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9482                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9483                        Ok(FileRequest::RemoveExtendedAttribute {
9484                            name: req.name,
9485
9486                            responder: FileRemoveExtendedAttributeResponder {
9487                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9488                                tx_id: header.tx_id,
9489                            },
9490                        })
9491                    }
9492                    0x57e419a298c8ede => {
9493                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9494                        let mut req = fidl::new_empty!(
9495                            ReadableReadRequest,
9496                            fidl::encoding::DefaultFuchsiaResourceDialect
9497                        );
9498                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
9499                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9500                        Ok(FileRequest::Read {
9501                            count: req.count,
9502
9503                            responder: FileReadResponder {
9504                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9505                                tx_id: header.tx_id,
9506                            },
9507                        })
9508                    }
9509                    0x6a31437832469f82 => {
9510                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9511                        let mut req = fidl::new_empty!(
9512                            WritableWriteRequest,
9513                            fidl::encoding::DefaultFuchsiaResourceDialect
9514                        );
9515                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
9516                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9517                        Ok(FileRequest::Write {
9518                            data: req.data,
9519
9520                            responder: FileWriteResponder {
9521                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9522                                tx_id: header.tx_id,
9523                            },
9524                        })
9525                    }
9526                    0x68b5ac00c62906bc => {
9527                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9528                        let mut req = fidl::new_empty!(
9529                            fidl::encoding::EmptyPayload,
9530                            fidl::encoding::DefaultFuchsiaResourceDialect
9531                        );
9532                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9533                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9534                        Ok(FileRequest::Describe {
9535                            responder: FileDescribeResponder {
9536                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9537                                tx_id: header.tx_id,
9538                            },
9539                        })
9540                    }
9541                    0x78079168162c5207 => {
9542                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9543                        let mut req = fidl::new_empty!(
9544                            FileSeekRequest,
9545                            fidl::encoding::DefaultFuchsiaResourceDialect
9546                        );
9547                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileSeekRequest>(&header, _body_bytes, handles, &mut req)?;
9548                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9549                        Ok(FileRequest::Seek {
9550                            origin: req.origin,
9551                            offset: req.offset,
9552
9553                            responder: FileSeekResponder {
9554                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9555                                tx_id: header.tx_id,
9556                            },
9557                        })
9558                    }
9559                    0x1607a293a60d723e => {
9560                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9561                        let mut req = fidl::new_empty!(
9562                            FileReadAtRequest,
9563                            fidl::encoding::DefaultFuchsiaResourceDialect
9564                        );
9565                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileReadAtRequest>(&header, _body_bytes, handles, &mut req)?;
9566                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9567                        Ok(FileRequest::ReadAt {
9568                            count: req.count,
9569                            offset: req.offset,
9570
9571                            responder: FileReadAtResponder {
9572                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9573                                tx_id: header.tx_id,
9574                            },
9575                        })
9576                    }
9577                    0x793eefc0045e792b => {
9578                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9579                        let mut req = fidl::new_empty!(
9580                            FileWriteAtRequest,
9581                            fidl::encoding::DefaultFuchsiaResourceDialect
9582                        );
9583                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileWriteAtRequest>(&header, _body_bytes, handles, &mut req)?;
9584                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9585                        Ok(FileRequest::WriteAt {
9586                            data: req.data,
9587                            offset: req.offset,
9588
9589                            responder: FileWriteAtResponder {
9590                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9591                                tx_id: header.tx_id,
9592                            },
9593                        })
9594                    }
9595                    0x2b80825f0535743a => {
9596                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9597                        let mut req = fidl::new_empty!(
9598                            FileResizeRequest,
9599                            fidl::encoding::DefaultFuchsiaResourceDialect
9600                        );
9601                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileResizeRequest>(&header, _body_bytes, handles, &mut req)?;
9602                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9603                        Ok(FileRequest::Resize {
9604                            length: req.length,
9605
9606                            responder: FileResizeResponder {
9607                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9608                                tx_id: header.tx_id,
9609                            },
9610                        })
9611                    }
9612                    0xa6a9e654cbf62b => {
9613                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9614                        let mut req = fidl::new_empty!(
9615                            FileGetBackingMemoryRequest,
9616                            fidl::encoding::DefaultFuchsiaResourceDialect
9617                        );
9618                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileGetBackingMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
9619                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9620                        Ok(FileRequest::GetBackingMemory {
9621                            flags: req.flags,
9622
9623                            responder: FileGetBackingMemoryResponder {
9624                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9625                                tx_id: header.tx_id,
9626                            },
9627                        })
9628                    }
9629                    0x77fa0c330b57fd2e => {
9630                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9631                        let mut req = fidl::new_empty!(
9632                            FileAllocateRequest,
9633                            fidl::encoding::DefaultFuchsiaResourceDialect
9634                        );
9635                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileAllocateRequest>(&header, _body_bytes, handles, &mut req)?;
9636                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9637                        Ok(FileRequest::Allocate {
9638                            offset: req.offset,
9639                            length: req.length,
9640                            mode: req.mode,
9641
9642                            responder: FileAllocateResponder {
9643                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9644                                tx_id: header.tx_id,
9645                            },
9646                        })
9647                    }
9648                    0x2c421ec3faaeb8bb => {
9649                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9650                        let mut req = fidl::new_empty!(
9651                            FileEnableVerityRequest,
9652                            fidl::encoding::DefaultFuchsiaResourceDialect
9653                        );
9654                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileEnableVerityRequest>(&header, _body_bytes, handles, &mut req)?;
9655                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9656                        Ok(FileRequest::EnableVerity {
9657                            options: req.options,
9658
9659                            responder: FileEnableVerityResponder {
9660                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9661                                tx_id: header.tx_id,
9662                            },
9663                        })
9664                    }
9665                    _ if header.tx_id == 0
9666                        && header
9667                            .dynamic_flags()
9668                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9669                    {
9670                        Ok(FileRequest::_UnknownMethod {
9671                            ordinal: header.ordinal,
9672                            control_handle: FileControlHandle { inner: this.inner.clone() },
9673                            method_type: fidl::MethodType::OneWay,
9674                        })
9675                    }
9676                    _ if header
9677                        .dynamic_flags()
9678                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9679                    {
9680                        this.inner.send_framework_err(
9681                            fidl::encoding::FrameworkErr::UnknownMethod,
9682                            header.tx_id,
9683                            header.ordinal,
9684                            header.dynamic_flags(),
9685                            (bytes, handles),
9686                        )?;
9687                        Ok(FileRequest::_UnknownMethod {
9688                            ordinal: header.ordinal,
9689                            control_handle: FileControlHandle { inner: this.inner.clone() },
9690                            method_type: fidl::MethodType::TwoWay,
9691                        })
9692                    }
9693                    _ => Err(fidl::Error::UnknownOrdinal {
9694                        ordinal: header.ordinal,
9695                        protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9696                    }),
9697                }))
9698            },
9699        )
9700    }
9701}
9702
9703/// A [`Node`] which contains a sequence of bytes of definite length.
9704///
9705/// NOTE: cloned connections do not share their seek offset with their source
9706/// connection.
9707#[derive(Debug)]
9708pub enum FileRequest {
9709    /// Acquires an advisory lock on the underlying file.
9710    ///
9711    /// The lock lasts until either this connection is closed or
9712    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
9713    /// explicitly.
9714    ///
9715    /// Advisory locks are purely advisory. They do not prevent actual read or
9716    /// write operations from occurring on the file, either through this
9717    /// connection or through other connections.
9718    ///
9719    /// This method requires the following rights:
9720    ///
9721    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
9722    /// * [`Rights.WRITE_BYTES`] if `request.type` is
9723    ///   [`AdvisoryLockType.WRITE`].
9724    ///
9725    /// # Errors
9726    ///
9727    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
9728    ///   example, another connection might hold a conflicting lock type.
9729    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
9730    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
9731    ///   to acquire the given type of lock.
9732    AdvisoryLock {
9733        request: AdvisoryLockRequest,
9734        responder: FileAdvisoryLockResponder,
9735    },
9736    /// Creates a link to this this object with name `dst` in the directory represented by
9737    /// `dst_parent_token`.
9738    ///
9739    /// `dst` must be a resolved object name. Including "/" in the string will return
9740    /// `ZX_ERR_INVALID_ARGS`.
9741    ///
9742    /// This method requires the maximal set of rights supported by the filesystem for this object.
9743    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
9744    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
9745    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
9746    /// `ZX_ERR_ACCESS_DENIED`.
9747    ///
9748    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
9749    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
9750    ///
9751    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
9752    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
9753    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
9754    ///
9755    /// This method does not have the same atomicity properties has the `Directory::Link` method,
9756    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
9757    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
9758    LinkInto {
9759        dst_parent_token: fidl::Event,
9760        dst: String,
9761        responder: FileLinkIntoResponder,
9762    },
9763    Clone {
9764        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
9765        control_handle: FileControlHandle,
9766    },
9767    /// Terminates the connection.
9768    ///
9769    /// After calling `Close`, the client must not send any other requests.
9770    ///
9771    /// Servers, after sending the status response, should close the connection
9772    /// regardless of status and without sending an epitaph.
9773    ///
9774    /// Closing the client end of the channel should be semantically equivalent
9775    /// to calling `Close` without knowing when the close has completed or its
9776    /// status.
9777    Close {
9778        responder: FileCloseResponder,
9779    },
9780    Query {
9781        responder: FileQueryResponder,
9782    },
9783    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
9784    DeprecatedClone {
9785        flags: OpenFlags,
9786        object: fidl::endpoints::ServerEnd<NodeMarker>,
9787        control_handle: FileControlHandle,
9788    },
9789    /// DEPRECATED - Use `Node.GetAttributes` instead.
9790    DeprecatedGetAttr {
9791        responder: FileDeprecatedGetAttrResponder,
9792    },
9793    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
9794    DeprecatedSetAttr {
9795        flags: NodeAttributeFlags,
9796        attributes: NodeAttributes,
9797        responder: FileDeprecatedSetAttrResponder,
9798    },
9799    /// [DEPRECATED - Use new GetFlags method instead.]
9800    DeprecatedGetFlags {
9801        responder: FileDeprecatedGetFlagsResponder,
9802    },
9803    /// [DEPRECATED - Use new SetFlags method instead.]
9804    DeprecatedSetFlags {
9805        flags: OpenFlags,
9806        responder: FileDeprecatedSetFlagsResponder,
9807    },
9808    /// Queries the flags that apply to this node after it has been opened/created. This method does
9809    /// not require any rights.
9810    ///
9811    /// Note that the final set of flags that apply to the connection may differ from those
9812    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
9813    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
9814    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
9815    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
9816    GetFlags {
9817        responder: FileGetFlagsResponder,
9818    },
9819    /// Sets the flags that apply to this node after it has been opened. This method does not
9820    /// require any rights.
9821    ///
9822    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
9823    /// clear append mode.
9824    ///
9825    /// Errors:
9826    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
9827    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
9828    SetFlags {
9829        flags: Flags,
9830        responder: FileSetFlagsResponder,
9831    },
9832    /// Query the filesystem for filesystem-specific information.
9833    QueryFilesystem {
9834        responder: FileQueryFilesystemResponder,
9835    },
9836    /// Acquires information about the node.
9837    ///
9838    /// The attributes of a node should be stable, independent of the
9839    /// specific protocol used to access it.
9840    ///
9841    /// If a particular attribute is not applicable or not supported,
9842    /// filesystems should leave the corresponding field absent.
9843    ///
9844    /// + `query` a bit-mask specifying which attributes to fetch. The server
9845    ///   should not return more than necessary.
9846    /// - `attributes` the returned attributes.
9847    ///
9848    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9849    GetAttributes {
9850        query: NodeAttributesQuery,
9851        responder: FileGetAttributesResponder,
9852    },
9853    /// Updates information about the node.
9854    ///
9855    /// + `attributes` the presence of a table field in `attributes` indicates
9856    /// the intent to update the corresponding attribute.
9857    ///
9858    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
9859    ///
9860    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
9861    UpdateAttributes {
9862        payload: MutableNodeAttributes,
9863        responder: FileUpdateAttributesResponder,
9864    },
9865    /// Synchronizes updates to the node to the underlying media, if it exists.
9866    ///
9867    /// This method will return when the filesystem server has flushed the
9868    /// relevant updates to the underlying media, but does not guarantee the
9869    /// underlying media has persisted the information, nor that any information
9870    /// is committed to hardware. Clients may use `Sync` to ensure ordering
9871    /// between operations.
9872    ///
9873    /// This method does not require any rights.
9874    Sync {
9875        responder: FileSyncResponder,
9876    },
9877    /// Creates an iterator over all the extended attribute names associated
9878    /// with this node. If an error occurs it is returned as an epitaph on the
9879    /// iterator request channel, and then the channel is closed.
9880    ///
9881    /// GetExtendedAttributes can be used with any of these names to retrieve
9882    /// the associated value.
9883    ///
9884    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9885    ListExtendedAttributes {
9886        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
9887        control_handle: FileControlHandle,
9888    },
9889    /// Get the value associated with the given attribute `name` for this node.
9890    ///
9891    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
9892    /// particular structure is imposed on them.
9893    ///
9894    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9895    GetExtendedAttribute {
9896        name: Vec<u8>,
9897        responder: FileGetExtendedAttributeResponder,
9898    },
9899    /// Set the value for the given attribute `name` to `value` for this node.
9900    ///
9901    /// The attribute name may exist, in which case the attribute is updated.
9902    /// If the attribute doesn't exist, it is created. The name should have no
9903    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
9904    ///
9905    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
9906    SetExtendedAttribute {
9907        name: Vec<u8>,
9908        value: ExtendedAttributeValue,
9909        mode: SetExtendedAttributeMode,
9910        responder: FileSetExtendedAttributeResponder,
9911    },
9912    /// Remove the specified extended attribute.
9913    ///
9914    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
9915    ///
9916    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
9917    RemoveExtendedAttribute {
9918        name: Vec<u8>,
9919        responder: FileRemoveExtendedAttributeResponder,
9920    },
9921    /// Reads up to 'count' bytes at the seek offset.
9922    /// The seek offset is moved forward by the number of bytes read.
9923    ///
9924    /// ## Invariants
9925    ///
9926    /// * The returned `data.length` will never be greater than `count`.
9927    /// * If `data.length` is less than `count`, it means that the seek offset
9928    ///   has reached the end of file as part of this operation.
9929    /// * If `data.length` is zero while `count` is not, it means that the
9930    ///   seek offset is already at or beyond the end of file, and no data could
9931    ///   be read.
9932    /// * If `count` is zero, the server should perform all the checks ensuring
9933    ///   read access without actually read anything, and return an empty
9934    ///   `data` vector.
9935    ///
9936    /// This method requires the [`Rights.READ_BYTES`] right.
9937    ///
9938    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
9939    Read {
9940        count: u64,
9941        responder: FileReadResponder,
9942    },
9943    /// Writes data at the seek offset.
9944    /// The seek offset is moved forward by the number of bytes written.
9945    /// If the file is in append mode, the seek offset is first set to the end
9946    /// of the file, followed by the write, in one atomic step.
9947    ///
9948    /// The file size may grow if the seek offset plus `data.length` is beyond
9949    /// the current end of file.
9950    ///
9951    /// + request `data` the byte buffer to write to the file.
9952    /// - response `actual_count` the number of bytes written.
9953    ///
9954    /// ## Invariants
9955    ///
9956    /// * The returned `actual_count` will never be greater than `data.length`.
9957    /// * If the server is unable to write all the data due to e.g. not enough
9958    ///   space, `actual_count` may be less than `data.length`.  If no bytes
9959    ///   could be written, an error is returned.
9960    /// * If `data.length` is zero, the server should perform all the checks
9961    ///   ensuring write access without mutating the file and return a
9962    ///   successful write of zero bytes.  The seek offset is still updated if
9963    ///   in append mode.
9964    ///
9965    /// This method requires the [`Rights.WRITE_BYTES`] right.
9966    Write {
9967        data: Vec<u8>,
9968        responder: FileWriteResponder,
9969    },
9970    Describe {
9971        responder: FileDescribeResponder,
9972    },
9973    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
9974    /// will occur. The seek offset is specific to each file connection.
9975    ///
9976    /// + request `origin` the reference point where `offset` will be based on.
9977    /// + request `offset` the number of bytes to seek.
9978    /// - response `offset_from_start` the adjusted seek offset, from the start
9979    ///   of the file.
9980    ///
9981    /// This method does not require any rights.
9982    Seek {
9983        origin: SeekOrigin,
9984        offset: i64,
9985        responder: FileSeekResponder,
9986    },
9987    /// Reads up to 'count' bytes at the provided offset.
9988    /// Does not affect the seek offset.
9989    ///
9990    /// ## Invariants
9991    ///
9992    /// * The returned `data.length` will never be greater than `count`.
9993    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
9994    ///   the end of file as part of this operation.
9995    /// * If `data.length` is zero while `count` is not, it means that `offset`
9996    ///   is at or past the end of file, and no data can be read.
9997    /// * If `count` is zero, the server should perform all the checks ensuring
9998    ///   read access without actually reading anything, and return an empty
9999    ///   `data` vector.
10000    ///
10001    /// This method requires the [`Rights.READ_BYTES`] right.
10002    ///
10003    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
10004    ReadAt {
10005        count: u64,
10006        offset: u64,
10007        responder: FileReadAtResponder,
10008    },
10009    /// Writes data at the provided offset.
10010    /// Does not affect the seek offset.
10011    ///
10012    /// The file size may grow if `offset` plus `data.length` is past the
10013    /// current end of file.
10014    ///
10015    /// + request `data` the byte buffer to write to the file.
10016    /// + request `offset` the offset from start of the file to begin writing.
10017    /// - response `actual_count` the number of bytes written.
10018    ///
10019    /// ## Invariants
10020    ///
10021    /// * The returned `actual_count` will never be greater than `data.length`.
10022    /// * If the server is unable to write all the data due to e.g. not enough
10023    ///   space, `actual_count` may be less than `data.length`.  If no bytes
10024    ///   could be written, an error is returned.
10025    /// * If `data.length` is zero, the server should perform all the checks
10026    ///   ensuring write access without mutating the file, and will return a
10027    ///   successful write of zero bytes.
10028    ///
10029    /// This method requires the [`Rights.WRITE_BYTES`] right.
10030    WriteAt {
10031        data: Vec<u8>,
10032        offset: u64,
10033        responder: FileWriteAtResponder,
10034    },
10035    /// Shrinks or grows the file size to 'length' bytes.
10036    ///
10037    /// If file size is reduced by this operation, the extra trailing data'
10038    /// is discarded.
10039    /// If file size is increased by this operation, the extended area appears
10040    /// as if it was zeroed.
10041    ///
10042    /// This method requires the [`Rights.WRITE_BYTES`] right.
10043    Resize {
10044        length: u64,
10045        responder: FileResizeResponder,
10046    },
10047    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
10048    /// with the requested access rights.
10049    ///
10050    /// Implementations are not required to implement files backed by VMOs so
10051    /// this request may fail. Additionally, implementations may only support
10052    /// a certain subset of the flags. Clients should be prepared with fallback
10053    /// behavior if this request fails.
10054    ///
10055    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
10056    /// implementation is free to choose the semantics of the returned VMO.
10057    ///
10058    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
10059    /// - response `vmo` the requested [`zx.Handle:VMO`].
10060    /// * error a [`zx.Status`] value indicating the failure.
10061    ///
10062    /// This method requires the following rights:
10063    ///
10064    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
10065    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
10066    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
10067    GetBackingMemory {
10068        flags: VmoFlags,
10069        responder: FileGetBackingMemoryResponder,
10070    },
10071    /// Pre-allocate on-disk space for this file.
10072    Allocate {
10073        offset: u64,
10074        length: u64,
10075        mode: AllocateMode,
10076        responder: FileAllocateResponder,
10077    },
10078    /// Enables verification for the file (permanently) which involves computing a merkle tree for
10079    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
10080    /// captured. Future reads will be verified against the computed merkle tree and writes will be
10081    /// rejected. This method can take some time to complete as it depends on the size of the file.
10082    /// This method can be aborted by closing the connection that this method was issued on.
10083    ///
10084    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
10085    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
10086    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
10087    /// Also returns any error that might arise from reading the file, or from flushing the file,
10088    /// such as `ZX_ERR_IO`.
10089    EnableVerity {
10090        options: VerificationOptions,
10091        responder: FileEnableVerityResponder,
10092    },
10093    /// An interaction was received which does not match any known method.
10094    #[non_exhaustive]
10095    _UnknownMethod {
10096        /// Ordinal of the method that was called.
10097        ordinal: u64,
10098        control_handle: FileControlHandle,
10099        method_type: fidl::MethodType,
10100    },
10101}
10102
10103impl FileRequest {
10104    #[allow(irrefutable_let_patterns)]
10105    pub fn into_advisory_lock(self) -> Option<(AdvisoryLockRequest, FileAdvisoryLockResponder)> {
10106        if let FileRequest::AdvisoryLock { request, responder } = self {
10107            Some((request, responder))
10108        } else {
10109            None
10110        }
10111    }
10112
10113    #[allow(irrefutable_let_patterns)]
10114    pub fn into_link_into(self) -> Option<(fidl::Event, String, FileLinkIntoResponder)> {
10115        if let FileRequest::LinkInto { dst_parent_token, dst, responder } = self {
10116            Some((dst_parent_token, dst, responder))
10117        } else {
10118            None
10119        }
10120    }
10121
10122    #[allow(irrefutable_let_patterns)]
10123    pub fn into_clone(
10124        self,
10125    ) -> Option<(
10126        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10127        FileControlHandle,
10128    )> {
10129        if let FileRequest::Clone { request, control_handle } = self {
10130            Some((request, control_handle))
10131        } else {
10132            None
10133        }
10134    }
10135
10136    #[allow(irrefutable_let_patterns)]
10137    pub fn into_close(self) -> Option<(FileCloseResponder)> {
10138        if let FileRequest::Close { responder } = self { Some((responder)) } else { None }
10139    }
10140
10141    #[allow(irrefutable_let_patterns)]
10142    pub fn into_query(self) -> Option<(FileQueryResponder)> {
10143        if let FileRequest::Query { responder } = self { Some((responder)) } else { None }
10144    }
10145
10146    #[allow(irrefutable_let_patterns)]
10147    pub fn into_deprecated_clone(
10148        self,
10149    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, FileControlHandle)> {
10150        if let FileRequest::DeprecatedClone { flags, object, control_handle } = self {
10151            Some((flags, object, control_handle))
10152        } else {
10153            None
10154        }
10155    }
10156
10157    #[allow(irrefutable_let_patterns)]
10158    pub fn into_deprecated_get_attr(self) -> Option<(FileDeprecatedGetAttrResponder)> {
10159        if let FileRequest::DeprecatedGetAttr { responder } = self {
10160            Some((responder))
10161        } else {
10162            None
10163        }
10164    }
10165
10166    #[allow(irrefutable_let_patterns)]
10167    pub fn into_deprecated_set_attr(
10168        self,
10169    ) -> Option<(NodeAttributeFlags, NodeAttributes, FileDeprecatedSetAttrResponder)> {
10170        if let FileRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
10171            Some((flags, attributes, responder))
10172        } else {
10173            None
10174        }
10175    }
10176
10177    #[allow(irrefutable_let_patterns)]
10178    pub fn into_deprecated_get_flags(self) -> Option<(FileDeprecatedGetFlagsResponder)> {
10179        if let FileRequest::DeprecatedGetFlags { responder } = self {
10180            Some((responder))
10181        } else {
10182            None
10183        }
10184    }
10185
10186    #[allow(irrefutable_let_patterns)]
10187    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, FileDeprecatedSetFlagsResponder)> {
10188        if let FileRequest::DeprecatedSetFlags { flags, responder } = self {
10189            Some((flags, responder))
10190        } else {
10191            None
10192        }
10193    }
10194
10195    #[allow(irrefutable_let_patterns)]
10196    pub fn into_get_flags(self) -> Option<(FileGetFlagsResponder)> {
10197        if let FileRequest::GetFlags { responder } = self { Some((responder)) } else { None }
10198    }
10199
10200    #[allow(irrefutable_let_patterns)]
10201    pub fn into_set_flags(self) -> Option<(Flags, FileSetFlagsResponder)> {
10202        if let FileRequest::SetFlags { flags, responder } = self {
10203            Some((flags, responder))
10204        } else {
10205            None
10206        }
10207    }
10208
10209    #[allow(irrefutable_let_patterns)]
10210    pub fn into_query_filesystem(self) -> Option<(FileQueryFilesystemResponder)> {
10211        if let FileRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
10212    }
10213
10214    #[allow(irrefutable_let_patterns)]
10215    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, FileGetAttributesResponder)> {
10216        if let FileRequest::GetAttributes { query, responder } = self {
10217            Some((query, responder))
10218        } else {
10219            None
10220        }
10221    }
10222
10223    #[allow(irrefutable_let_patterns)]
10224    pub fn into_update_attributes(
10225        self,
10226    ) -> Option<(MutableNodeAttributes, FileUpdateAttributesResponder)> {
10227        if let FileRequest::UpdateAttributes { payload, responder } = self {
10228            Some((payload, responder))
10229        } else {
10230            None
10231        }
10232    }
10233
10234    #[allow(irrefutable_let_patterns)]
10235    pub fn into_sync(self) -> Option<(FileSyncResponder)> {
10236        if let FileRequest::Sync { responder } = self { Some((responder)) } else { None }
10237    }
10238
10239    #[allow(irrefutable_let_patterns)]
10240    pub fn into_list_extended_attributes(
10241        self,
10242    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, FileControlHandle)>
10243    {
10244        if let FileRequest::ListExtendedAttributes { iterator, control_handle } = self {
10245            Some((iterator, control_handle))
10246        } else {
10247            None
10248        }
10249    }
10250
10251    #[allow(irrefutable_let_patterns)]
10252    pub fn into_get_extended_attribute(
10253        self,
10254    ) -> Option<(Vec<u8>, FileGetExtendedAttributeResponder)> {
10255        if let FileRequest::GetExtendedAttribute { name, responder } = self {
10256            Some((name, responder))
10257        } else {
10258            None
10259        }
10260    }
10261
10262    #[allow(irrefutable_let_patterns)]
10263    pub fn into_set_extended_attribute(
10264        self,
10265    ) -> Option<(
10266        Vec<u8>,
10267        ExtendedAttributeValue,
10268        SetExtendedAttributeMode,
10269        FileSetExtendedAttributeResponder,
10270    )> {
10271        if let FileRequest::SetExtendedAttribute { name, value, mode, responder } = self {
10272            Some((name, value, mode, responder))
10273        } else {
10274            None
10275        }
10276    }
10277
10278    #[allow(irrefutable_let_patterns)]
10279    pub fn into_remove_extended_attribute(
10280        self,
10281    ) -> Option<(Vec<u8>, FileRemoveExtendedAttributeResponder)> {
10282        if let FileRequest::RemoveExtendedAttribute { name, responder } = self {
10283            Some((name, responder))
10284        } else {
10285            None
10286        }
10287    }
10288
10289    #[allow(irrefutable_let_patterns)]
10290    pub fn into_read(self) -> Option<(u64, FileReadResponder)> {
10291        if let FileRequest::Read { count, responder } = self {
10292            Some((count, responder))
10293        } else {
10294            None
10295        }
10296    }
10297
10298    #[allow(irrefutable_let_patterns)]
10299    pub fn into_write(self) -> Option<(Vec<u8>, FileWriteResponder)> {
10300        if let FileRequest::Write { data, responder } = self {
10301            Some((data, responder))
10302        } else {
10303            None
10304        }
10305    }
10306
10307    #[allow(irrefutable_let_patterns)]
10308    pub fn into_describe(self) -> Option<(FileDescribeResponder)> {
10309        if let FileRequest::Describe { responder } = self { Some((responder)) } else { None }
10310    }
10311
10312    #[allow(irrefutable_let_patterns)]
10313    pub fn into_seek(self) -> Option<(SeekOrigin, i64, FileSeekResponder)> {
10314        if let FileRequest::Seek { origin, offset, responder } = self {
10315            Some((origin, offset, responder))
10316        } else {
10317            None
10318        }
10319    }
10320
10321    #[allow(irrefutable_let_patterns)]
10322    pub fn into_read_at(self) -> Option<(u64, u64, FileReadAtResponder)> {
10323        if let FileRequest::ReadAt { count, offset, responder } = self {
10324            Some((count, offset, responder))
10325        } else {
10326            None
10327        }
10328    }
10329
10330    #[allow(irrefutable_let_patterns)]
10331    pub fn into_write_at(self) -> Option<(Vec<u8>, u64, FileWriteAtResponder)> {
10332        if let FileRequest::WriteAt { data, offset, responder } = self {
10333            Some((data, offset, responder))
10334        } else {
10335            None
10336        }
10337    }
10338
10339    #[allow(irrefutable_let_patterns)]
10340    pub fn into_resize(self) -> Option<(u64, FileResizeResponder)> {
10341        if let FileRequest::Resize { length, responder } = self {
10342            Some((length, responder))
10343        } else {
10344            None
10345        }
10346    }
10347
10348    #[allow(irrefutable_let_patterns)]
10349    pub fn into_get_backing_memory(self) -> Option<(VmoFlags, FileGetBackingMemoryResponder)> {
10350        if let FileRequest::GetBackingMemory { flags, responder } = self {
10351            Some((flags, responder))
10352        } else {
10353            None
10354        }
10355    }
10356
10357    #[allow(irrefutable_let_patterns)]
10358    pub fn into_allocate(self) -> Option<(u64, u64, AllocateMode, FileAllocateResponder)> {
10359        if let FileRequest::Allocate { offset, length, mode, responder } = self {
10360            Some((offset, length, mode, responder))
10361        } else {
10362            None
10363        }
10364    }
10365
10366    #[allow(irrefutable_let_patterns)]
10367    pub fn into_enable_verity(self) -> Option<(VerificationOptions, FileEnableVerityResponder)> {
10368        if let FileRequest::EnableVerity { options, responder } = self {
10369            Some((options, responder))
10370        } else {
10371            None
10372        }
10373    }
10374
10375    /// Name of the method defined in FIDL
10376    pub fn method_name(&self) -> &'static str {
10377        match *self {
10378            FileRequest::AdvisoryLock { .. } => "advisory_lock",
10379            FileRequest::LinkInto { .. } => "link_into",
10380            FileRequest::Clone { .. } => "clone",
10381            FileRequest::Close { .. } => "close",
10382            FileRequest::Query { .. } => "query",
10383            FileRequest::DeprecatedClone { .. } => "deprecated_clone",
10384            FileRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
10385            FileRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
10386            FileRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
10387            FileRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
10388            FileRequest::GetFlags { .. } => "get_flags",
10389            FileRequest::SetFlags { .. } => "set_flags",
10390            FileRequest::QueryFilesystem { .. } => "query_filesystem",
10391            FileRequest::GetAttributes { .. } => "get_attributes",
10392            FileRequest::UpdateAttributes { .. } => "update_attributes",
10393            FileRequest::Sync { .. } => "sync",
10394            FileRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
10395            FileRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
10396            FileRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
10397            FileRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
10398            FileRequest::Read { .. } => "read",
10399            FileRequest::Write { .. } => "write",
10400            FileRequest::Describe { .. } => "describe",
10401            FileRequest::Seek { .. } => "seek",
10402            FileRequest::ReadAt { .. } => "read_at",
10403            FileRequest::WriteAt { .. } => "write_at",
10404            FileRequest::Resize { .. } => "resize",
10405            FileRequest::GetBackingMemory { .. } => "get_backing_memory",
10406            FileRequest::Allocate { .. } => "allocate",
10407            FileRequest::EnableVerity { .. } => "enable_verity",
10408            FileRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10409                "unknown one-way method"
10410            }
10411            FileRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10412                "unknown two-way method"
10413            }
10414        }
10415    }
10416}
10417
10418#[derive(Debug, Clone)]
10419pub struct FileControlHandle {
10420    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10421}
10422
10423impl fidl::endpoints::ControlHandle for FileControlHandle {
10424    fn shutdown(&self) {
10425        self.inner.shutdown()
10426    }
10427    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10428        self.inner.shutdown_with_epitaph(status)
10429    }
10430
10431    fn is_closed(&self) -> bool {
10432        self.inner.channel().is_closed()
10433    }
10434    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10435        self.inner.channel().on_closed()
10436    }
10437
10438    #[cfg(target_os = "fuchsia")]
10439    fn signal_peer(
10440        &self,
10441        clear_mask: zx::Signals,
10442        set_mask: zx::Signals,
10443    ) -> Result<(), zx_status::Status> {
10444        use fidl::Peered;
10445        self.inner.channel().signal_peer(clear_mask, set_mask)
10446    }
10447}
10448
10449impl FileControlHandle {
10450    pub fn send_on_open_(
10451        &self,
10452        mut s: i32,
10453        mut info: Option<NodeInfoDeprecated>,
10454    ) -> Result<(), fidl::Error> {
10455        self.inner.send::<NodeOnOpenRequest>(
10456            (s, info.as_mut()),
10457            0,
10458            0x7fc7bbb1dbfd1972,
10459            fidl::encoding::DynamicFlags::FLEXIBLE,
10460        )
10461    }
10462
10463    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
10464        self.inner.send::<Representation>(
10465            &mut payload,
10466            0,
10467            0x5cb40567d80a510c,
10468            fidl::encoding::DynamicFlags::empty(),
10469        )
10470    }
10471}
10472
10473#[must_use = "FIDL methods require a response to be sent"]
10474#[derive(Debug)]
10475pub struct FileAdvisoryLockResponder {
10476    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10477    tx_id: u32,
10478}
10479
10480/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10481/// if the responder is dropped without sending a response, so that the client
10482/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10483impl std::ops::Drop for FileAdvisoryLockResponder {
10484    fn drop(&mut self) {
10485        self.control_handle.shutdown();
10486        // Safety: drops once, never accessed again
10487        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10488    }
10489}
10490
10491impl fidl::endpoints::Responder for FileAdvisoryLockResponder {
10492    type ControlHandle = FileControlHandle;
10493
10494    fn control_handle(&self) -> &FileControlHandle {
10495        &self.control_handle
10496    }
10497
10498    fn drop_without_shutdown(mut self) {
10499        // Safety: drops once, never accessed again due to mem::forget
10500        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10501        // Prevent Drop from running (which would shut down the channel)
10502        std::mem::forget(self);
10503    }
10504}
10505
10506impl FileAdvisoryLockResponder {
10507    /// Sends a response to the FIDL transaction.
10508    ///
10509    /// Sets the channel to shutdown if an error occurs.
10510    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10511        let _result = self.send_raw(result);
10512        if _result.is_err() {
10513            self.control_handle.shutdown();
10514        }
10515        self.drop_without_shutdown();
10516        _result
10517    }
10518
10519    /// Similar to "send" but does not shutdown the channel if an error occurs.
10520    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10521        let _result = self.send_raw(result);
10522        self.drop_without_shutdown();
10523        _result
10524    }
10525
10526    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10527        self.control_handle
10528            .inner
10529            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10530                result,
10531                self.tx_id,
10532                0x6ee9c0ad53ec87aa,
10533                fidl::encoding::DynamicFlags::empty(),
10534            )
10535    }
10536}
10537
10538#[must_use = "FIDL methods require a response to be sent"]
10539#[derive(Debug)]
10540pub struct FileLinkIntoResponder {
10541    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10542    tx_id: u32,
10543}
10544
10545/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10546/// if the responder is dropped without sending a response, so that the client
10547/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10548impl std::ops::Drop for FileLinkIntoResponder {
10549    fn drop(&mut self) {
10550        self.control_handle.shutdown();
10551        // Safety: drops once, never accessed again
10552        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10553    }
10554}
10555
10556impl fidl::endpoints::Responder for FileLinkIntoResponder {
10557    type ControlHandle = FileControlHandle;
10558
10559    fn control_handle(&self) -> &FileControlHandle {
10560        &self.control_handle
10561    }
10562
10563    fn drop_without_shutdown(mut self) {
10564        // Safety: drops once, never accessed again due to mem::forget
10565        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10566        // Prevent Drop from running (which would shut down the channel)
10567        std::mem::forget(self);
10568    }
10569}
10570
10571impl FileLinkIntoResponder {
10572    /// Sends a response to the FIDL transaction.
10573    ///
10574    /// Sets the channel to shutdown if an error occurs.
10575    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10576        let _result = self.send_raw(result);
10577        if _result.is_err() {
10578            self.control_handle.shutdown();
10579        }
10580        self.drop_without_shutdown();
10581        _result
10582    }
10583
10584    /// Similar to "send" but does not shutdown the channel if an error occurs.
10585    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10586        let _result = self.send_raw(result);
10587        self.drop_without_shutdown();
10588        _result
10589    }
10590
10591    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10592        self.control_handle
10593            .inner
10594            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10595                result,
10596                self.tx_id,
10597                0x54f3949246a03e74,
10598                fidl::encoding::DynamicFlags::empty(),
10599            )
10600    }
10601}
10602
10603#[must_use = "FIDL methods require a response to be sent"]
10604#[derive(Debug)]
10605pub struct FileCloseResponder {
10606    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10607    tx_id: u32,
10608}
10609
10610/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10611/// if the responder is dropped without sending a response, so that the client
10612/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10613impl std::ops::Drop for FileCloseResponder {
10614    fn drop(&mut self) {
10615        self.control_handle.shutdown();
10616        // Safety: drops once, never accessed again
10617        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10618    }
10619}
10620
10621impl fidl::endpoints::Responder for FileCloseResponder {
10622    type ControlHandle = FileControlHandle;
10623
10624    fn control_handle(&self) -> &FileControlHandle {
10625        &self.control_handle
10626    }
10627
10628    fn drop_without_shutdown(mut self) {
10629        // Safety: drops once, never accessed again due to mem::forget
10630        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10631        // Prevent Drop from running (which would shut down the channel)
10632        std::mem::forget(self);
10633    }
10634}
10635
10636impl FileCloseResponder {
10637    /// Sends a response to the FIDL transaction.
10638    ///
10639    /// Sets the channel to shutdown if an error occurs.
10640    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10641        let _result = self.send_raw(result);
10642        if _result.is_err() {
10643            self.control_handle.shutdown();
10644        }
10645        self.drop_without_shutdown();
10646        _result
10647    }
10648
10649    /// Similar to "send" but does not shutdown the channel if an error occurs.
10650    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10651        let _result = self.send_raw(result);
10652        self.drop_without_shutdown();
10653        _result
10654    }
10655
10656    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10657        self.control_handle
10658            .inner
10659            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10660                result,
10661                self.tx_id,
10662                0x5ac5d459ad7f657e,
10663                fidl::encoding::DynamicFlags::empty(),
10664            )
10665    }
10666}
10667
10668#[must_use = "FIDL methods require a response to be sent"]
10669#[derive(Debug)]
10670pub struct FileQueryResponder {
10671    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10672    tx_id: u32,
10673}
10674
10675/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10676/// if the responder is dropped without sending a response, so that the client
10677/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10678impl std::ops::Drop for FileQueryResponder {
10679    fn drop(&mut self) {
10680        self.control_handle.shutdown();
10681        // Safety: drops once, never accessed again
10682        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10683    }
10684}
10685
10686impl fidl::endpoints::Responder for FileQueryResponder {
10687    type ControlHandle = FileControlHandle;
10688
10689    fn control_handle(&self) -> &FileControlHandle {
10690        &self.control_handle
10691    }
10692
10693    fn drop_without_shutdown(mut self) {
10694        // Safety: drops once, never accessed again due to mem::forget
10695        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10696        // Prevent Drop from running (which would shut down the channel)
10697        std::mem::forget(self);
10698    }
10699}
10700
10701impl FileQueryResponder {
10702    /// Sends a response to the FIDL transaction.
10703    ///
10704    /// Sets the channel to shutdown if an error occurs.
10705    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10706        let _result = self.send_raw(protocol);
10707        if _result.is_err() {
10708            self.control_handle.shutdown();
10709        }
10710        self.drop_without_shutdown();
10711        _result
10712    }
10713
10714    /// Similar to "send" but does not shutdown the channel if an error occurs.
10715    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10716        let _result = self.send_raw(protocol);
10717        self.drop_without_shutdown();
10718        _result
10719    }
10720
10721    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10722        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
10723            (protocol,),
10724            self.tx_id,
10725            0x2658edee9decfc06,
10726            fidl::encoding::DynamicFlags::empty(),
10727        )
10728    }
10729}
10730
10731#[must_use = "FIDL methods require a response to be sent"]
10732#[derive(Debug)]
10733pub struct FileDeprecatedGetAttrResponder {
10734    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10735    tx_id: u32,
10736}
10737
10738/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10739/// if the responder is dropped without sending a response, so that the client
10740/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10741impl std::ops::Drop for FileDeprecatedGetAttrResponder {
10742    fn drop(&mut self) {
10743        self.control_handle.shutdown();
10744        // Safety: drops once, never accessed again
10745        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10746    }
10747}
10748
10749impl fidl::endpoints::Responder for FileDeprecatedGetAttrResponder {
10750    type ControlHandle = FileControlHandle;
10751
10752    fn control_handle(&self) -> &FileControlHandle {
10753        &self.control_handle
10754    }
10755
10756    fn drop_without_shutdown(mut self) {
10757        // Safety: drops once, never accessed again due to mem::forget
10758        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10759        // Prevent Drop from running (which would shut down the channel)
10760        std::mem::forget(self);
10761    }
10762}
10763
10764impl FileDeprecatedGetAttrResponder {
10765    /// Sends a response to the FIDL transaction.
10766    ///
10767    /// Sets the channel to shutdown if an error occurs.
10768    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
10769        let _result = self.send_raw(s, attributes);
10770        if _result.is_err() {
10771            self.control_handle.shutdown();
10772        }
10773        self.drop_without_shutdown();
10774        _result
10775    }
10776
10777    /// Similar to "send" but does not shutdown the channel if an error occurs.
10778    pub fn send_no_shutdown_on_err(
10779        self,
10780        mut s: i32,
10781        mut attributes: &NodeAttributes,
10782    ) -> Result<(), fidl::Error> {
10783        let _result = self.send_raw(s, attributes);
10784        self.drop_without_shutdown();
10785        _result
10786    }
10787
10788    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
10789        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
10790            (s, attributes),
10791            self.tx_id,
10792            0x78985e216314dafd,
10793            fidl::encoding::DynamicFlags::empty(),
10794        )
10795    }
10796}
10797
10798#[must_use = "FIDL methods require a response to be sent"]
10799#[derive(Debug)]
10800pub struct FileDeprecatedSetAttrResponder {
10801    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10802    tx_id: u32,
10803}
10804
10805/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10806/// if the responder is dropped without sending a response, so that the client
10807/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10808impl std::ops::Drop for FileDeprecatedSetAttrResponder {
10809    fn drop(&mut self) {
10810        self.control_handle.shutdown();
10811        // Safety: drops once, never accessed again
10812        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10813    }
10814}
10815
10816impl fidl::endpoints::Responder for FileDeprecatedSetAttrResponder {
10817    type ControlHandle = FileControlHandle;
10818
10819    fn control_handle(&self) -> &FileControlHandle {
10820        &self.control_handle
10821    }
10822
10823    fn drop_without_shutdown(mut self) {
10824        // Safety: drops once, never accessed again due to mem::forget
10825        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10826        // Prevent Drop from running (which would shut down the channel)
10827        std::mem::forget(self);
10828    }
10829}
10830
10831impl FileDeprecatedSetAttrResponder {
10832    /// Sends a response to the FIDL transaction.
10833    ///
10834    /// Sets the channel to shutdown if an error occurs.
10835    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
10836        let _result = self.send_raw(s);
10837        if _result.is_err() {
10838            self.control_handle.shutdown();
10839        }
10840        self.drop_without_shutdown();
10841        _result
10842    }
10843
10844    /// Similar to "send" but does not shutdown the channel if an error occurs.
10845    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
10846        let _result = self.send_raw(s);
10847        self.drop_without_shutdown();
10848        _result
10849    }
10850
10851    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
10852        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
10853            (s,),
10854            self.tx_id,
10855            0x4186c0f40d938f46,
10856            fidl::encoding::DynamicFlags::empty(),
10857        )
10858    }
10859}
10860
10861#[must_use = "FIDL methods require a response to be sent"]
10862#[derive(Debug)]
10863pub struct FileDeprecatedGetFlagsResponder {
10864    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10865    tx_id: u32,
10866}
10867
10868/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10869/// if the responder is dropped without sending a response, so that the client
10870/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10871impl std::ops::Drop for FileDeprecatedGetFlagsResponder {
10872    fn drop(&mut self) {
10873        self.control_handle.shutdown();
10874        // Safety: drops once, never accessed again
10875        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10876    }
10877}
10878
10879impl fidl::endpoints::Responder for FileDeprecatedGetFlagsResponder {
10880    type ControlHandle = FileControlHandle;
10881
10882    fn control_handle(&self) -> &FileControlHandle {
10883        &self.control_handle
10884    }
10885
10886    fn drop_without_shutdown(mut self) {
10887        // Safety: drops once, never accessed again due to mem::forget
10888        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10889        // Prevent Drop from running (which would shut down the channel)
10890        std::mem::forget(self);
10891    }
10892}
10893
10894impl FileDeprecatedGetFlagsResponder {
10895    /// Sends a response to the FIDL transaction.
10896    ///
10897    /// Sets the channel to shutdown if an error occurs.
10898    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
10899        let _result = self.send_raw(s, flags);
10900        if _result.is_err() {
10901            self.control_handle.shutdown();
10902        }
10903        self.drop_without_shutdown();
10904        _result
10905    }
10906
10907    /// Similar to "send" but does not shutdown the channel if an error occurs.
10908    pub fn send_no_shutdown_on_err(
10909        self,
10910        mut s: i32,
10911        mut flags: OpenFlags,
10912    ) -> Result<(), fidl::Error> {
10913        let _result = self.send_raw(s, flags);
10914        self.drop_without_shutdown();
10915        _result
10916    }
10917
10918    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
10919        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
10920            (s, flags),
10921            self.tx_id,
10922            0x5b88fffb8eda3aa1,
10923            fidl::encoding::DynamicFlags::empty(),
10924        )
10925    }
10926}
10927
10928#[must_use = "FIDL methods require a response to be sent"]
10929#[derive(Debug)]
10930pub struct FileDeprecatedSetFlagsResponder {
10931    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10932    tx_id: u32,
10933}
10934
10935/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10936/// if the responder is dropped without sending a response, so that the client
10937/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10938impl std::ops::Drop for FileDeprecatedSetFlagsResponder {
10939    fn drop(&mut self) {
10940        self.control_handle.shutdown();
10941        // Safety: drops once, never accessed again
10942        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10943    }
10944}
10945
10946impl fidl::endpoints::Responder for FileDeprecatedSetFlagsResponder {
10947    type ControlHandle = FileControlHandle;
10948
10949    fn control_handle(&self) -> &FileControlHandle {
10950        &self.control_handle
10951    }
10952
10953    fn drop_without_shutdown(mut self) {
10954        // Safety: drops once, never accessed again due to mem::forget
10955        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10956        // Prevent Drop from running (which would shut down the channel)
10957        std::mem::forget(self);
10958    }
10959}
10960
10961impl FileDeprecatedSetFlagsResponder {
10962    /// Sends a response to the FIDL transaction.
10963    ///
10964    /// Sets the channel to shutdown if an error occurs.
10965    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
10966        let _result = self.send_raw(s);
10967        if _result.is_err() {
10968            self.control_handle.shutdown();
10969        }
10970        self.drop_without_shutdown();
10971        _result
10972    }
10973
10974    /// Similar to "send" but does not shutdown the channel if an error occurs.
10975    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
10976        let _result = self.send_raw(s);
10977        self.drop_without_shutdown();
10978        _result
10979    }
10980
10981    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
10982        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
10983            (s,),
10984            self.tx_id,
10985            0x5295b76c71fde733,
10986            fidl::encoding::DynamicFlags::empty(),
10987        )
10988    }
10989}
10990
10991#[must_use = "FIDL methods require a response to be sent"]
10992#[derive(Debug)]
10993pub struct FileGetFlagsResponder {
10994    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10995    tx_id: u32,
10996}
10997
10998/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10999/// if the responder is dropped without sending a response, so that the client
11000/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11001impl std::ops::Drop for FileGetFlagsResponder {
11002    fn drop(&mut self) {
11003        self.control_handle.shutdown();
11004        // Safety: drops once, never accessed again
11005        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11006    }
11007}
11008
11009impl fidl::endpoints::Responder for FileGetFlagsResponder {
11010    type ControlHandle = FileControlHandle;
11011
11012    fn control_handle(&self) -> &FileControlHandle {
11013        &self.control_handle
11014    }
11015
11016    fn drop_without_shutdown(mut self) {
11017        // Safety: drops once, never accessed again due to mem::forget
11018        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11019        // Prevent Drop from running (which would shut down the channel)
11020        std::mem::forget(self);
11021    }
11022}
11023
11024impl FileGetFlagsResponder {
11025    /// Sends a response to the FIDL transaction.
11026    ///
11027    /// Sets the channel to shutdown if an error occurs.
11028    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11029        let _result = self.send_raw(result);
11030        if _result.is_err() {
11031            self.control_handle.shutdown();
11032        }
11033        self.drop_without_shutdown();
11034        _result
11035    }
11036
11037    /// Similar to "send" but does not shutdown the channel if an error occurs.
11038    pub fn send_no_shutdown_on_err(
11039        self,
11040        mut result: Result<Flags, i32>,
11041    ) -> Result<(), fidl::Error> {
11042        let _result = self.send_raw(result);
11043        self.drop_without_shutdown();
11044        _result
11045    }
11046
11047    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11048        self.control_handle
11049            .inner
11050            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
11051                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
11052                self.tx_id,
11053                0x176eb318f64ec23,
11054                fidl::encoding::DynamicFlags::FLEXIBLE,
11055            )
11056    }
11057}
11058
11059#[must_use = "FIDL methods require a response to be sent"]
11060#[derive(Debug)]
11061pub struct FileSetFlagsResponder {
11062    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11063    tx_id: u32,
11064}
11065
11066/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11067/// if the responder is dropped without sending a response, so that the client
11068/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11069impl std::ops::Drop for FileSetFlagsResponder {
11070    fn drop(&mut self) {
11071        self.control_handle.shutdown();
11072        // Safety: drops once, never accessed again
11073        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11074    }
11075}
11076
11077impl fidl::endpoints::Responder for FileSetFlagsResponder {
11078    type ControlHandle = FileControlHandle;
11079
11080    fn control_handle(&self) -> &FileControlHandle {
11081        &self.control_handle
11082    }
11083
11084    fn drop_without_shutdown(mut self) {
11085        // Safety: drops once, never accessed again due to mem::forget
11086        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11087        // Prevent Drop from running (which would shut down the channel)
11088        std::mem::forget(self);
11089    }
11090}
11091
11092impl FileSetFlagsResponder {
11093    /// Sends a response to the FIDL transaction.
11094    ///
11095    /// Sets the channel to shutdown if an error occurs.
11096    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11097        let _result = self.send_raw(result);
11098        if _result.is_err() {
11099            self.control_handle.shutdown();
11100        }
11101        self.drop_without_shutdown();
11102        _result
11103    }
11104
11105    /// Similar to "send" but does not shutdown the channel if an error occurs.
11106    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11107        let _result = self.send_raw(result);
11108        self.drop_without_shutdown();
11109        _result
11110    }
11111
11112    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11113        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11114            fidl::encoding::EmptyStruct,
11115            i32,
11116        >>(
11117            fidl::encoding::FlexibleResult::new(result),
11118            self.tx_id,
11119            0x55a8028685791ea8,
11120            fidl::encoding::DynamicFlags::FLEXIBLE,
11121        )
11122    }
11123}
11124
11125#[must_use = "FIDL methods require a response to be sent"]
11126#[derive(Debug)]
11127pub struct FileQueryFilesystemResponder {
11128    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11129    tx_id: u32,
11130}
11131
11132/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11133/// if the responder is dropped without sending a response, so that the client
11134/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11135impl std::ops::Drop for FileQueryFilesystemResponder {
11136    fn drop(&mut self) {
11137        self.control_handle.shutdown();
11138        // Safety: drops once, never accessed again
11139        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11140    }
11141}
11142
11143impl fidl::endpoints::Responder for FileQueryFilesystemResponder {
11144    type ControlHandle = FileControlHandle;
11145
11146    fn control_handle(&self) -> &FileControlHandle {
11147        &self.control_handle
11148    }
11149
11150    fn drop_without_shutdown(mut self) {
11151        // Safety: drops once, never accessed again due to mem::forget
11152        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11153        // Prevent Drop from running (which would shut down the channel)
11154        std::mem::forget(self);
11155    }
11156}
11157
11158impl FileQueryFilesystemResponder {
11159    /// Sends a response to the FIDL transaction.
11160    ///
11161    /// Sets the channel to shutdown if an error occurs.
11162    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11163        let _result = self.send_raw(s, info);
11164        if _result.is_err() {
11165            self.control_handle.shutdown();
11166        }
11167        self.drop_without_shutdown();
11168        _result
11169    }
11170
11171    /// Similar to "send" but does not shutdown the channel if an error occurs.
11172    pub fn send_no_shutdown_on_err(
11173        self,
11174        mut s: i32,
11175        mut info: Option<&FilesystemInfo>,
11176    ) -> Result<(), fidl::Error> {
11177        let _result = self.send_raw(s, info);
11178        self.drop_without_shutdown();
11179        _result
11180    }
11181
11182    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11183        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
11184            (s, info),
11185            self.tx_id,
11186            0x6f344a1c6b0a0610,
11187            fidl::encoding::DynamicFlags::empty(),
11188        )
11189    }
11190}
11191
11192#[must_use = "FIDL methods require a response to be sent"]
11193#[derive(Debug)]
11194pub struct FileGetAttributesResponder {
11195    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11196    tx_id: u32,
11197}
11198
11199/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11200/// if the responder is dropped without sending a response, so that the client
11201/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11202impl std::ops::Drop for FileGetAttributesResponder {
11203    fn drop(&mut self) {
11204        self.control_handle.shutdown();
11205        // Safety: drops once, never accessed again
11206        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11207    }
11208}
11209
11210impl fidl::endpoints::Responder for FileGetAttributesResponder {
11211    type ControlHandle = FileControlHandle;
11212
11213    fn control_handle(&self) -> &FileControlHandle {
11214        &self.control_handle
11215    }
11216
11217    fn drop_without_shutdown(mut self) {
11218        // Safety: drops once, never accessed again due to mem::forget
11219        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11220        // Prevent Drop from running (which would shut down the channel)
11221        std::mem::forget(self);
11222    }
11223}
11224
11225impl FileGetAttributesResponder {
11226    /// Sends a response to the FIDL transaction.
11227    ///
11228    /// Sets the channel to shutdown if an error occurs.
11229    pub fn send(
11230        self,
11231        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11232    ) -> Result<(), fidl::Error> {
11233        let _result = self.send_raw(result);
11234        if _result.is_err() {
11235            self.control_handle.shutdown();
11236        }
11237        self.drop_without_shutdown();
11238        _result
11239    }
11240
11241    /// Similar to "send" but does not shutdown the channel if an error occurs.
11242    pub fn send_no_shutdown_on_err(
11243        self,
11244        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11245    ) -> Result<(), fidl::Error> {
11246        let _result = self.send_raw(result);
11247        self.drop_without_shutdown();
11248        _result
11249    }
11250
11251    fn send_raw(
11252        &self,
11253        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11254    ) -> Result<(), fidl::Error> {
11255        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
11256            result,
11257            self.tx_id,
11258            0x3d4396a638ea053b,
11259            fidl::encoding::DynamicFlags::empty(),
11260        )
11261    }
11262}
11263
11264#[must_use = "FIDL methods require a response to be sent"]
11265#[derive(Debug)]
11266pub struct FileUpdateAttributesResponder {
11267    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11268    tx_id: u32,
11269}
11270
11271/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11272/// if the responder is dropped without sending a response, so that the client
11273/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11274impl std::ops::Drop for FileUpdateAttributesResponder {
11275    fn drop(&mut self) {
11276        self.control_handle.shutdown();
11277        // Safety: drops once, never accessed again
11278        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11279    }
11280}
11281
11282impl fidl::endpoints::Responder for FileUpdateAttributesResponder {
11283    type ControlHandle = FileControlHandle;
11284
11285    fn control_handle(&self) -> &FileControlHandle {
11286        &self.control_handle
11287    }
11288
11289    fn drop_without_shutdown(mut self) {
11290        // Safety: drops once, never accessed again due to mem::forget
11291        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11292        // Prevent Drop from running (which would shut down the channel)
11293        std::mem::forget(self);
11294    }
11295}
11296
11297impl FileUpdateAttributesResponder {
11298    /// Sends a response to the FIDL transaction.
11299    ///
11300    /// Sets the channel to shutdown if an error occurs.
11301    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11302        let _result = self.send_raw(result);
11303        if _result.is_err() {
11304            self.control_handle.shutdown();
11305        }
11306        self.drop_without_shutdown();
11307        _result
11308    }
11309
11310    /// Similar to "send" but does not shutdown the channel if an error occurs.
11311    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11312        let _result = self.send_raw(result);
11313        self.drop_without_shutdown();
11314        _result
11315    }
11316
11317    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11318        self.control_handle
11319            .inner
11320            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11321                result,
11322                self.tx_id,
11323                0x3308c1da5a89bf08,
11324                fidl::encoding::DynamicFlags::empty(),
11325            )
11326    }
11327}
11328
11329#[must_use = "FIDL methods require a response to be sent"]
11330#[derive(Debug)]
11331pub struct FileSyncResponder {
11332    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11333    tx_id: u32,
11334}
11335
11336/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11337/// if the responder is dropped without sending a response, so that the client
11338/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11339impl std::ops::Drop for FileSyncResponder {
11340    fn drop(&mut self) {
11341        self.control_handle.shutdown();
11342        // Safety: drops once, never accessed again
11343        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11344    }
11345}
11346
11347impl fidl::endpoints::Responder for FileSyncResponder {
11348    type ControlHandle = FileControlHandle;
11349
11350    fn control_handle(&self) -> &FileControlHandle {
11351        &self.control_handle
11352    }
11353
11354    fn drop_without_shutdown(mut self) {
11355        // Safety: drops once, never accessed again due to mem::forget
11356        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11357        // Prevent Drop from running (which would shut down the channel)
11358        std::mem::forget(self);
11359    }
11360}
11361
11362impl FileSyncResponder {
11363    /// Sends a response to the FIDL transaction.
11364    ///
11365    /// Sets the channel to shutdown if an error occurs.
11366    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11367        let _result = self.send_raw(result);
11368        if _result.is_err() {
11369            self.control_handle.shutdown();
11370        }
11371        self.drop_without_shutdown();
11372        _result
11373    }
11374
11375    /// Similar to "send" but does not shutdown the channel if an error occurs.
11376    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11377        let _result = self.send_raw(result);
11378        self.drop_without_shutdown();
11379        _result
11380    }
11381
11382    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11383        self.control_handle
11384            .inner
11385            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11386                result,
11387                self.tx_id,
11388                0x2c5c27ca0ab5dc49,
11389                fidl::encoding::DynamicFlags::empty(),
11390            )
11391    }
11392}
11393
11394#[must_use = "FIDL methods require a response to be sent"]
11395#[derive(Debug)]
11396pub struct FileGetExtendedAttributeResponder {
11397    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11398    tx_id: u32,
11399}
11400
11401/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11402/// if the responder is dropped without sending a response, so that the client
11403/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11404impl std::ops::Drop for FileGetExtendedAttributeResponder {
11405    fn drop(&mut self) {
11406        self.control_handle.shutdown();
11407        // Safety: drops once, never accessed again
11408        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11409    }
11410}
11411
11412impl fidl::endpoints::Responder for FileGetExtendedAttributeResponder {
11413    type ControlHandle = FileControlHandle;
11414
11415    fn control_handle(&self) -> &FileControlHandle {
11416        &self.control_handle
11417    }
11418
11419    fn drop_without_shutdown(mut self) {
11420        // Safety: drops once, never accessed again due to mem::forget
11421        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11422        // Prevent Drop from running (which would shut down the channel)
11423        std::mem::forget(self);
11424    }
11425}
11426
11427impl FileGetExtendedAttributeResponder {
11428    /// Sends a response to the FIDL transaction.
11429    ///
11430    /// Sets the channel to shutdown if an error occurs.
11431    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11432        let _result = self.send_raw(result);
11433        if _result.is_err() {
11434            self.control_handle.shutdown();
11435        }
11436        self.drop_without_shutdown();
11437        _result
11438    }
11439
11440    /// Similar to "send" but does not shutdown the channel if an error occurs.
11441    pub fn send_no_shutdown_on_err(
11442        self,
11443        mut result: Result<ExtendedAttributeValue, i32>,
11444    ) -> Result<(), fidl::Error> {
11445        let _result = self.send_raw(result);
11446        self.drop_without_shutdown();
11447        _result
11448    }
11449
11450    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11451        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
11452            result.as_mut().map_err(|e| *e),
11453            self.tx_id,
11454            0x45ffa3ccfdeb76db,
11455            fidl::encoding::DynamicFlags::empty(),
11456        )
11457    }
11458}
11459
11460#[must_use = "FIDL methods require a response to be sent"]
11461#[derive(Debug)]
11462pub struct FileSetExtendedAttributeResponder {
11463    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11464    tx_id: u32,
11465}
11466
11467/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11468/// if the responder is dropped without sending a response, so that the client
11469/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11470impl std::ops::Drop for FileSetExtendedAttributeResponder {
11471    fn drop(&mut self) {
11472        self.control_handle.shutdown();
11473        // Safety: drops once, never accessed again
11474        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11475    }
11476}
11477
11478impl fidl::endpoints::Responder for FileSetExtendedAttributeResponder {
11479    type ControlHandle = FileControlHandle;
11480
11481    fn control_handle(&self) -> &FileControlHandle {
11482        &self.control_handle
11483    }
11484
11485    fn drop_without_shutdown(mut self) {
11486        // Safety: drops once, never accessed again due to mem::forget
11487        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11488        // Prevent Drop from running (which would shut down the channel)
11489        std::mem::forget(self);
11490    }
11491}
11492
11493impl FileSetExtendedAttributeResponder {
11494    /// Sends a response to the FIDL transaction.
11495    ///
11496    /// Sets the channel to shutdown if an error occurs.
11497    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11498        let _result = self.send_raw(result);
11499        if _result.is_err() {
11500            self.control_handle.shutdown();
11501        }
11502        self.drop_without_shutdown();
11503        _result
11504    }
11505
11506    /// Similar to "send" but does not shutdown the channel if an error occurs.
11507    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11508        let _result = self.send_raw(result);
11509        self.drop_without_shutdown();
11510        _result
11511    }
11512
11513    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11514        self.control_handle
11515            .inner
11516            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11517                result,
11518                self.tx_id,
11519                0x4a951362f681f23c,
11520                fidl::encoding::DynamicFlags::empty(),
11521            )
11522    }
11523}
11524
11525#[must_use = "FIDL methods require a response to be sent"]
11526#[derive(Debug)]
11527pub struct FileRemoveExtendedAttributeResponder {
11528    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11529    tx_id: u32,
11530}
11531
11532/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11533/// if the responder is dropped without sending a response, so that the client
11534/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11535impl std::ops::Drop for FileRemoveExtendedAttributeResponder {
11536    fn drop(&mut self) {
11537        self.control_handle.shutdown();
11538        // Safety: drops once, never accessed again
11539        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11540    }
11541}
11542
11543impl fidl::endpoints::Responder for FileRemoveExtendedAttributeResponder {
11544    type ControlHandle = FileControlHandle;
11545
11546    fn control_handle(&self) -> &FileControlHandle {
11547        &self.control_handle
11548    }
11549
11550    fn drop_without_shutdown(mut self) {
11551        // Safety: drops once, never accessed again due to mem::forget
11552        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11553        // Prevent Drop from running (which would shut down the channel)
11554        std::mem::forget(self);
11555    }
11556}
11557
11558impl FileRemoveExtendedAttributeResponder {
11559    /// Sends a response to the FIDL transaction.
11560    ///
11561    /// Sets the channel to shutdown if an error occurs.
11562    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11563        let _result = self.send_raw(result);
11564        if _result.is_err() {
11565            self.control_handle.shutdown();
11566        }
11567        self.drop_without_shutdown();
11568        _result
11569    }
11570
11571    /// Similar to "send" but does not shutdown the channel if an error occurs.
11572    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11573        let _result = self.send_raw(result);
11574        self.drop_without_shutdown();
11575        _result
11576    }
11577
11578    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11579        self.control_handle
11580            .inner
11581            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11582                result,
11583                self.tx_id,
11584                0x7a0b9f3a9bf9032d,
11585                fidl::encoding::DynamicFlags::empty(),
11586            )
11587    }
11588}
11589
11590#[must_use = "FIDL methods require a response to be sent"]
11591#[derive(Debug)]
11592pub struct FileReadResponder {
11593    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11594    tx_id: u32,
11595}
11596
11597/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11598/// if the responder is dropped without sending a response, so that the client
11599/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11600impl std::ops::Drop for FileReadResponder {
11601    fn drop(&mut self) {
11602        self.control_handle.shutdown();
11603        // Safety: drops once, never accessed again
11604        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11605    }
11606}
11607
11608impl fidl::endpoints::Responder for FileReadResponder {
11609    type ControlHandle = FileControlHandle;
11610
11611    fn control_handle(&self) -> &FileControlHandle {
11612        &self.control_handle
11613    }
11614
11615    fn drop_without_shutdown(mut self) {
11616        // Safety: drops once, never accessed again due to mem::forget
11617        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11618        // Prevent Drop from running (which would shut down the channel)
11619        std::mem::forget(self);
11620    }
11621}
11622
11623impl FileReadResponder {
11624    /// Sends a response to the FIDL transaction.
11625    ///
11626    /// Sets the channel to shutdown if an error occurs.
11627    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11628        let _result = self.send_raw(result);
11629        if _result.is_err() {
11630            self.control_handle.shutdown();
11631        }
11632        self.drop_without_shutdown();
11633        _result
11634    }
11635
11636    /// Similar to "send" but does not shutdown the channel if an error occurs.
11637    pub fn send_no_shutdown_on_err(
11638        self,
11639        mut result: Result<&[u8], i32>,
11640    ) -> Result<(), fidl::Error> {
11641        let _result = self.send_raw(result);
11642        self.drop_without_shutdown();
11643        _result
11644    }
11645
11646    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11647        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
11648            result.map(|data| (data,)),
11649            self.tx_id,
11650            0x57e419a298c8ede,
11651            fidl::encoding::DynamicFlags::empty(),
11652        )
11653    }
11654}
11655
11656#[must_use = "FIDL methods require a response to be sent"]
11657#[derive(Debug)]
11658pub struct FileWriteResponder {
11659    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11660    tx_id: u32,
11661}
11662
11663/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11664/// if the responder is dropped without sending a response, so that the client
11665/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11666impl std::ops::Drop for FileWriteResponder {
11667    fn drop(&mut self) {
11668        self.control_handle.shutdown();
11669        // Safety: drops once, never accessed again
11670        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11671    }
11672}
11673
11674impl fidl::endpoints::Responder for FileWriteResponder {
11675    type ControlHandle = FileControlHandle;
11676
11677    fn control_handle(&self) -> &FileControlHandle {
11678        &self.control_handle
11679    }
11680
11681    fn drop_without_shutdown(mut self) {
11682        // Safety: drops once, never accessed again due to mem::forget
11683        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11684        // Prevent Drop from running (which would shut down the channel)
11685        std::mem::forget(self);
11686    }
11687}
11688
11689impl FileWriteResponder {
11690    /// Sends a response to the FIDL transaction.
11691    ///
11692    /// Sets the channel to shutdown if an error occurs.
11693    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11694        let _result = self.send_raw(result);
11695        if _result.is_err() {
11696            self.control_handle.shutdown();
11697        }
11698        self.drop_without_shutdown();
11699        _result
11700    }
11701
11702    /// Similar to "send" but does not shutdown the channel if an error occurs.
11703    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11704        let _result = self.send_raw(result);
11705        self.drop_without_shutdown();
11706        _result
11707    }
11708
11709    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11710        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
11711            result.map(|actual_count| (actual_count,)),
11712            self.tx_id,
11713            0x6a31437832469f82,
11714            fidl::encoding::DynamicFlags::empty(),
11715        )
11716    }
11717}
11718
11719#[must_use = "FIDL methods require a response to be sent"]
11720#[derive(Debug)]
11721pub struct FileDescribeResponder {
11722    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11723    tx_id: u32,
11724}
11725
11726/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11727/// if the responder is dropped without sending a response, so that the client
11728/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11729impl std::ops::Drop for FileDescribeResponder {
11730    fn drop(&mut self) {
11731        self.control_handle.shutdown();
11732        // Safety: drops once, never accessed again
11733        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11734    }
11735}
11736
11737impl fidl::endpoints::Responder for FileDescribeResponder {
11738    type ControlHandle = FileControlHandle;
11739
11740    fn control_handle(&self) -> &FileControlHandle {
11741        &self.control_handle
11742    }
11743
11744    fn drop_without_shutdown(mut self) {
11745        // Safety: drops once, never accessed again due to mem::forget
11746        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11747        // Prevent Drop from running (which would shut down the channel)
11748        std::mem::forget(self);
11749    }
11750}
11751
11752impl FileDescribeResponder {
11753    /// Sends a response to the FIDL transaction.
11754    ///
11755    /// Sets the channel to shutdown if an error occurs.
11756    pub fn send(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11757        let _result = self.send_raw(payload);
11758        if _result.is_err() {
11759            self.control_handle.shutdown();
11760        }
11761        self.drop_without_shutdown();
11762        _result
11763    }
11764
11765    /// Similar to "send" but does not shutdown the channel if an error occurs.
11766    pub fn send_no_shutdown_on_err(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11767        let _result = self.send_raw(payload);
11768        self.drop_without_shutdown();
11769        _result
11770    }
11771
11772    fn send_raw(&self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11773        self.control_handle.inner.send::<FileInfo>(
11774            &mut payload,
11775            self.tx_id,
11776            0x68b5ac00c62906bc,
11777            fidl::encoding::DynamicFlags::empty(),
11778        )
11779    }
11780}
11781
11782#[must_use = "FIDL methods require a response to be sent"]
11783#[derive(Debug)]
11784pub struct FileSeekResponder {
11785    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11786    tx_id: u32,
11787}
11788
11789/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11790/// if the responder is dropped without sending a response, so that the client
11791/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11792impl std::ops::Drop for FileSeekResponder {
11793    fn drop(&mut self) {
11794        self.control_handle.shutdown();
11795        // Safety: drops once, never accessed again
11796        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11797    }
11798}
11799
11800impl fidl::endpoints::Responder for FileSeekResponder {
11801    type ControlHandle = FileControlHandle;
11802
11803    fn control_handle(&self) -> &FileControlHandle {
11804        &self.control_handle
11805    }
11806
11807    fn drop_without_shutdown(mut self) {
11808        // Safety: drops once, never accessed again due to mem::forget
11809        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11810        // Prevent Drop from running (which would shut down the channel)
11811        std::mem::forget(self);
11812    }
11813}
11814
11815impl FileSeekResponder {
11816    /// Sends a response to the FIDL transaction.
11817    ///
11818    /// Sets the channel to shutdown if an error occurs.
11819    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11820        let _result = self.send_raw(result);
11821        if _result.is_err() {
11822            self.control_handle.shutdown();
11823        }
11824        self.drop_without_shutdown();
11825        _result
11826    }
11827
11828    /// Similar to "send" but does not shutdown the channel if an error occurs.
11829    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11830        let _result = self.send_raw(result);
11831        self.drop_without_shutdown();
11832        _result
11833    }
11834
11835    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11836        self.control_handle.inner.send::<fidl::encoding::ResultType<FileSeekResponse, i32>>(
11837            result.map(|offset_from_start| (offset_from_start,)),
11838            self.tx_id,
11839            0x78079168162c5207,
11840            fidl::encoding::DynamicFlags::empty(),
11841        )
11842    }
11843}
11844
11845#[must_use = "FIDL methods require a response to be sent"]
11846#[derive(Debug)]
11847pub struct FileReadAtResponder {
11848    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11849    tx_id: u32,
11850}
11851
11852/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11853/// if the responder is dropped without sending a response, so that the client
11854/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11855impl std::ops::Drop for FileReadAtResponder {
11856    fn drop(&mut self) {
11857        self.control_handle.shutdown();
11858        // Safety: drops once, never accessed again
11859        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11860    }
11861}
11862
11863impl fidl::endpoints::Responder for FileReadAtResponder {
11864    type ControlHandle = FileControlHandle;
11865
11866    fn control_handle(&self) -> &FileControlHandle {
11867        &self.control_handle
11868    }
11869
11870    fn drop_without_shutdown(mut self) {
11871        // Safety: drops once, never accessed again due to mem::forget
11872        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11873        // Prevent Drop from running (which would shut down the channel)
11874        std::mem::forget(self);
11875    }
11876}
11877
11878impl FileReadAtResponder {
11879    /// Sends a response to the FIDL transaction.
11880    ///
11881    /// Sets the channel to shutdown if an error occurs.
11882    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11883        let _result = self.send_raw(result);
11884        if _result.is_err() {
11885            self.control_handle.shutdown();
11886        }
11887        self.drop_without_shutdown();
11888        _result
11889    }
11890
11891    /// Similar to "send" but does not shutdown the channel if an error occurs.
11892    pub fn send_no_shutdown_on_err(
11893        self,
11894        mut result: Result<&[u8], i32>,
11895    ) -> Result<(), fidl::Error> {
11896        let _result = self.send_raw(result);
11897        self.drop_without_shutdown();
11898        _result
11899    }
11900
11901    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11902        self.control_handle.inner.send::<fidl::encoding::ResultType<FileReadAtResponse, i32>>(
11903            result.map(|data| (data,)),
11904            self.tx_id,
11905            0x1607a293a60d723e,
11906            fidl::encoding::DynamicFlags::empty(),
11907        )
11908    }
11909}
11910
11911#[must_use = "FIDL methods require a response to be sent"]
11912#[derive(Debug)]
11913pub struct FileWriteAtResponder {
11914    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11915    tx_id: u32,
11916}
11917
11918/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11919/// if the responder is dropped without sending a response, so that the client
11920/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11921impl std::ops::Drop for FileWriteAtResponder {
11922    fn drop(&mut self) {
11923        self.control_handle.shutdown();
11924        // Safety: drops once, never accessed again
11925        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11926    }
11927}
11928
11929impl fidl::endpoints::Responder for FileWriteAtResponder {
11930    type ControlHandle = FileControlHandle;
11931
11932    fn control_handle(&self) -> &FileControlHandle {
11933        &self.control_handle
11934    }
11935
11936    fn drop_without_shutdown(mut self) {
11937        // Safety: drops once, never accessed again due to mem::forget
11938        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11939        // Prevent Drop from running (which would shut down the channel)
11940        std::mem::forget(self);
11941    }
11942}
11943
11944impl FileWriteAtResponder {
11945    /// Sends a response to the FIDL transaction.
11946    ///
11947    /// Sets the channel to shutdown if an error occurs.
11948    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11949        let _result = self.send_raw(result);
11950        if _result.is_err() {
11951            self.control_handle.shutdown();
11952        }
11953        self.drop_without_shutdown();
11954        _result
11955    }
11956
11957    /// Similar to "send" but does not shutdown the channel if an error occurs.
11958    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11959        let _result = self.send_raw(result);
11960        self.drop_without_shutdown();
11961        _result
11962    }
11963
11964    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11965        self.control_handle.inner.send::<fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
11966            result.map(|actual_count| (actual_count,)),
11967            self.tx_id,
11968            0x793eefc0045e792b,
11969            fidl::encoding::DynamicFlags::empty(),
11970        )
11971    }
11972}
11973
11974#[must_use = "FIDL methods require a response to be sent"]
11975#[derive(Debug)]
11976pub struct FileResizeResponder {
11977    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11978    tx_id: u32,
11979}
11980
11981/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11982/// if the responder is dropped without sending a response, so that the client
11983/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11984impl std::ops::Drop for FileResizeResponder {
11985    fn drop(&mut self) {
11986        self.control_handle.shutdown();
11987        // Safety: drops once, never accessed again
11988        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11989    }
11990}
11991
11992impl fidl::endpoints::Responder for FileResizeResponder {
11993    type ControlHandle = FileControlHandle;
11994
11995    fn control_handle(&self) -> &FileControlHandle {
11996        &self.control_handle
11997    }
11998
11999    fn drop_without_shutdown(mut self) {
12000        // Safety: drops once, never accessed again due to mem::forget
12001        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12002        // Prevent Drop from running (which would shut down the channel)
12003        std::mem::forget(self);
12004    }
12005}
12006
12007impl FileResizeResponder {
12008    /// Sends a response to the FIDL transaction.
12009    ///
12010    /// Sets the channel to shutdown if an error occurs.
12011    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12012        let _result = self.send_raw(result);
12013        if _result.is_err() {
12014            self.control_handle.shutdown();
12015        }
12016        self.drop_without_shutdown();
12017        _result
12018    }
12019
12020    /// Similar to "send" but does not shutdown the channel if an error occurs.
12021    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12022        let _result = self.send_raw(result);
12023        self.drop_without_shutdown();
12024        _result
12025    }
12026
12027    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12028        self.control_handle
12029            .inner
12030            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12031                result,
12032                self.tx_id,
12033                0x2b80825f0535743a,
12034                fidl::encoding::DynamicFlags::empty(),
12035            )
12036    }
12037}
12038
12039#[must_use = "FIDL methods require a response to be sent"]
12040#[derive(Debug)]
12041pub struct FileGetBackingMemoryResponder {
12042    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12043    tx_id: u32,
12044}
12045
12046/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12047/// if the responder is dropped without sending a response, so that the client
12048/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12049impl std::ops::Drop for FileGetBackingMemoryResponder {
12050    fn drop(&mut self) {
12051        self.control_handle.shutdown();
12052        // Safety: drops once, never accessed again
12053        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12054    }
12055}
12056
12057impl fidl::endpoints::Responder for FileGetBackingMemoryResponder {
12058    type ControlHandle = FileControlHandle;
12059
12060    fn control_handle(&self) -> &FileControlHandle {
12061        &self.control_handle
12062    }
12063
12064    fn drop_without_shutdown(mut self) {
12065        // Safety: drops once, never accessed again due to mem::forget
12066        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12067        // Prevent Drop from running (which would shut down the channel)
12068        std::mem::forget(self);
12069    }
12070}
12071
12072impl FileGetBackingMemoryResponder {
12073    /// Sends a response to the FIDL transaction.
12074    ///
12075    /// Sets the channel to shutdown if an error occurs.
12076    pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12077        let _result = self.send_raw(result);
12078        if _result.is_err() {
12079            self.control_handle.shutdown();
12080        }
12081        self.drop_without_shutdown();
12082        _result
12083    }
12084
12085    /// Similar to "send" but does not shutdown the channel if an error occurs.
12086    pub fn send_no_shutdown_on_err(
12087        self,
12088        mut result: Result<fidl::Vmo, i32>,
12089    ) -> Result<(), fidl::Error> {
12090        let _result = self.send_raw(result);
12091        self.drop_without_shutdown();
12092        _result
12093    }
12094
12095    fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12096        self.control_handle
12097            .inner
12098            .send::<fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>>(
12099                result.map(|vmo| (vmo,)),
12100                self.tx_id,
12101                0xa6a9e654cbf62b,
12102                fidl::encoding::DynamicFlags::empty(),
12103            )
12104    }
12105}
12106
12107#[must_use = "FIDL methods require a response to be sent"]
12108#[derive(Debug)]
12109pub struct FileAllocateResponder {
12110    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12111    tx_id: u32,
12112}
12113
12114/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12115/// if the responder is dropped without sending a response, so that the client
12116/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12117impl std::ops::Drop for FileAllocateResponder {
12118    fn drop(&mut self) {
12119        self.control_handle.shutdown();
12120        // Safety: drops once, never accessed again
12121        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12122    }
12123}
12124
12125impl fidl::endpoints::Responder for FileAllocateResponder {
12126    type ControlHandle = FileControlHandle;
12127
12128    fn control_handle(&self) -> &FileControlHandle {
12129        &self.control_handle
12130    }
12131
12132    fn drop_without_shutdown(mut self) {
12133        // Safety: drops once, never accessed again due to mem::forget
12134        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12135        // Prevent Drop from running (which would shut down the channel)
12136        std::mem::forget(self);
12137    }
12138}
12139
12140impl FileAllocateResponder {
12141    /// Sends a response to the FIDL transaction.
12142    ///
12143    /// Sets the channel to shutdown if an error occurs.
12144    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12145        let _result = self.send_raw(result);
12146        if _result.is_err() {
12147            self.control_handle.shutdown();
12148        }
12149        self.drop_without_shutdown();
12150        _result
12151    }
12152
12153    /// Similar to "send" but does not shutdown the channel if an error occurs.
12154    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12155        let _result = self.send_raw(result);
12156        self.drop_without_shutdown();
12157        _result
12158    }
12159
12160    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12161        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12162            fidl::encoding::EmptyStruct,
12163            i32,
12164        >>(
12165            fidl::encoding::FlexibleResult::new(result),
12166            self.tx_id,
12167            0x77fa0c330b57fd2e,
12168            fidl::encoding::DynamicFlags::FLEXIBLE,
12169        )
12170    }
12171}
12172
12173#[must_use = "FIDL methods require a response to be sent"]
12174#[derive(Debug)]
12175pub struct FileEnableVerityResponder {
12176    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12177    tx_id: u32,
12178}
12179
12180/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12181/// if the responder is dropped without sending a response, so that the client
12182/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12183impl std::ops::Drop for FileEnableVerityResponder {
12184    fn drop(&mut self) {
12185        self.control_handle.shutdown();
12186        // Safety: drops once, never accessed again
12187        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12188    }
12189}
12190
12191impl fidl::endpoints::Responder for FileEnableVerityResponder {
12192    type ControlHandle = FileControlHandle;
12193
12194    fn control_handle(&self) -> &FileControlHandle {
12195        &self.control_handle
12196    }
12197
12198    fn drop_without_shutdown(mut self) {
12199        // Safety: drops once, never accessed again due to mem::forget
12200        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12201        // Prevent Drop from running (which would shut down the channel)
12202        std::mem::forget(self);
12203    }
12204}
12205
12206impl FileEnableVerityResponder {
12207    /// Sends a response to the FIDL transaction.
12208    ///
12209    /// Sets the channel to shutdown if an error occurs.
12210    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12211        let _result = self.send_raw(result);
12212        if _result.is_err() {
12213            self.control_handle.shutdown();
12214        }
12215        self.drop_without_shutdown();
12216        _result
12217    }
12218
12219    /// Similar to "send" but does not shutdown the channel if an error occurs.
12220    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12221        let _result = self.send_raw(result);
12222        self.drop_without_shutdown();
12223        _result
12224    }
12225
12226    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12227        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12228            fidl::encoding::EmptyStruct,
12229            i32,
12230        >>(
12231            fidl::encoding::FlexibleResult::new(result),
12232            self.tx_id,
12233            0x2c421ec3faaeb8bb,
12234            fidl::encoding::DynamicFlags::FLEXIBLE,
12235        )
12236    }
12237}
12238
12239#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12240pub struct LinkableMarker;
12241
12242impl fidl::endpoints::ProtocolMarker for LinkableMarker {
12243    type Proxy = LinkableProxy;
12244    type RequestStream = LinkableRequestStream;
12245    #[cfg(target_os = "fuchsia")]
12246    type SynchronousProxy = LinkableSynchronousProxy;
12247
12248    const DEBUG_NAME: &'static str = "(anonymous) Linkable";
12249}
12250pub type LinkableLinkIntoResult = Result<(), i32>;
12251
12252pub trait LinkableProxyInterface: Send + Sync {
12253    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
12254        + Send;
12255    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
12256}
12257#[derive(Debug)]
12258#[cfg(target_os = "fuchsia")]
12259pub struct LinkableSynchronousProxy {
12260    client: fidl::client::sync::Client,
12261}
12262
12263#[cfg(target_os = "fuchsia")]
12264impl fidl::endpoints::SynchronousProxy for LinkableSynchronousProxy {
12265    type Proxy = LinkableProxy;
12266    type Protocol = LinkableMarker;
12267
12268    fn from_channel(inner: fidl::Channel) -> Self {
12269        Self::new(inner)
12270    }
12271
12272    fn into_channel(self) -> fidl::Channel {
12273        self.client.into_channel()
12274    }
12275
12276    fn as_channel(&self) -> &fidl::Channel {
12277        self.client.as_channel()
12278    }
12279}
12280
12281#[cfg(target_os = "fuchsia")]
12282impl LinkableSynchronousProxy {
12283    pub fn new(channel: fidl::Channel) -> Self {
12284        let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12285        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
12286    }
12287
12288    pub fn into_channel(self) -> fidl::Channel {
12289        self.client.into_channel()
12290    }
12291
12292    /// Waits until an event arrives and returns it. It is safe for other
12293    /// threads to make concurrent requests while waiting for an event.
12294    pub fn wait_for_event(
12295        &self,
12296        deadline: zx::MonotonicInstant,
12297    ) -> Result<LinkableEvent, fidl::Error> {
12298        LinkableEvent::decode(self.client.wait_for_event(deadline)?)
12299    }
12300
12301    /// Creates a link to this this object with name `dst` in the directory represented by
12302    /// `dst_parent_token`.
12303    ///
12304    /// `dst` must be a resolved object name. Including "/" in the string will return
12305    /// `ZX_ERR_INVALID_ARGS`.
12306    ///
12307    /// This method requires the maximal set of rights supported by the filesystem for this object.
12308    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12309    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12310    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12311    /// `ZX_ERR_ACCESS_DENIED`.
12312    ///
12313    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12314    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12315    ///
12316    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12317    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12318    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12319    ///
12320    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12321    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12322    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12323    pub fn r#link_into(
12324        &self,
12325        mut dst_parent_token: fidl::Event,
12326        mut dst: &str,
12327        ___deadline: zx::MonotonicInstant,
12328    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12329        let _response = self.client.send_query::<
12330            LinkableLinkIntoRequest,
12331            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12332        >(
12333            (dst_parent_token, dst,),
12334            0x54f3949246a03e74,
12335            fidl::encoding::DynamicFlags::empty(),
12336            ___deadline,
12337        )?;
12338        Ok(_response.map(|x| x))
12339    }
12340}
12341
12342#[cfg(target_os = "fuchsia")]
12343impl From<LinkableSynchronousProxy> for zx::Handle {
12344    fn from(value: LinkableSynchronousProxy) -> Self {
12345        value.into_channel().into()
12346    }
12347}
12348
12349#[cfg(target_os = "fuchsia")]
12350impl From<fidl::Channel> for LinkableSynchronousProxy {
12351    fn from(value: fidl::Channel) -> Self {
12352        Self::new(value)
12353    }
12354}
12355
12356#[cfg(target_os = "fuchsia")]
12357impl fidl::endpoints::FromClient for LinkableSynchronousProxy {
12358    type Protocol = LinkableMarker;
12359
12360    fn from_client(value: fidl::endpoints::ClientEnd<LinkableMarker>) -> Self {
12361        Self::new(value.into_channel())
12362    }
12363}
12364
12365#[derive(Debug, Clone)]
12366pub struct LinkableProxy {
12367    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
12368}
12369
12370impl fidl::endpoints::Proxy for LinkableProxy {
12371    type Protocol = LinkableMarker;
12372
12373    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
12374        Self::new(inner)
12375    }
12376
12377    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
12378        self.client.into_channel().map_err(|client| Self { client })
12379    }
12380
12381    fn as_channel(&self) -> &::fidl::AsyncChannel {
12382        self.client.as_channel()
12383    }
12384}
12385
12386impl LinkableProxy {
12387    /// Create a new Proxy for fuchsia.io/Linkable.
12388    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
12389        let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12390        Self { client: fidl::client::Client::new(channel, protocol_name) }
12391    }
12392
12393    /// Get a Stream of events from the remote end of the protocol.
12394    ///
12395    /// # Panics
12396    ///
12397    /// Panics if the event stream was already taken.
12398    pub fn take_event_stream(&self) -> LinkableEventStream {
12399        LinkableEventStream { event_receiver: self.client.take_event_receiver() }
12400    }
12401
12402    /// Creates a link to this this object with name `dst` in the directory represented by
12403    /// `dst_parent_token`.
12404    ///
12405    /// `dst` must be a resolved object name. Including "/" in the string will return
12406    /// `ZX_ERR_INVALID_ARGS`.
12407    ///
12408    /// This method requires the maximal set of rights supported by the filesystem for this object.
12409    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12410    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12411    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12412    /// `ZX_ERR_ACCESS_DENIED`.
12413    ///
12414    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12415    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12416    ///
12417    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12418    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12419    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12420    ///
12421    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12422    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12423    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12424    pub fn r#link_into(
12425        &self,
12426        mut dst_parent_token: fidl::Event,
12427        mut dst: &str,
12428    ) -> fidl::client::QueryResponseFut<
12429        LinkableLinkIntoResult,
12430        fidl::encoding::DefaultFuchsiaResourceDialect,
12431    > {
12432        LinkableProxyInterface::r#link_into(self, dst_parent_token, dst)
12433    }
12434}
12435
12436impl LinkableProxyInterface for LinkableProxy {
12437    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
12438        LinkableLinkIntoResult,
12439        fidl::encoding::DefaultFuchsiaResourceDialect,
12440    >;
12441    fn r#link_into(
12442        &self,
12443        mut dst_parent_token: fidl::Event,
12444        mut dst: &str,
12445    ) -> Self::LinkIntoResponseFut {
12446        fn _decode(
12447            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
12448        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12449            let _response = fidl::client::decode_transaction_body::<
12450                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12451                fidl::encoding::DefaultFuchsiaResourceDialect,
12452                0x54f3949246a03e74,
12453            >(_buf?)?;
12454            Ok(_response.map(|x| x))
12455        }
12456        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
12457            (dst_parent_token, dst),
12458            0x54f3949246a03e74,
12459            fidl::encoding::DynamicFlags::empty(),
12460            _decode,
12461        )
12462    }
12463}
12464
12465pub struct LinkableEventStream {
12466    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
12467}
12468
12469impl std::marker::Unpin for LinkableEventStream {}
12470
12471impl futures::stream::FusedStream for LinkableEventStream {
12472    fn is_terminated(&self) -> bool {
12473        self.event_receiver.is_terminated()
12474    }
12475}
12476
12477impl futures::Stream for LinkableEventStream {
12478    type Item = Result<LinkableEvent, fidl::Error>;
12479
12480    fn poll_next(
12481        mut self: std::pin::Pin<&mut Self>,
12482        cx: &mut std::task::Context<'_>,
12483    ) -> std::task::Poll<Option<Self::Item>> {
12484        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
12485            &mut self.event_receiver,
12486            cx
12487        )?) {
12488            Some(buf) => std::task::Poll::Ready(Some(LinkableEvent::decode(buf))),
12489            None => std::task::Poll::Ready(None),
12490        }
12491    }
12492}
12493
12494#[derive(Debug)]
12495pub enum LinkableEvent {}
12496
12497impl LinkableEvent {
12498    /// Decodes a message buffer as a [`LinkableEvent`].
12499    fn decode(
12500        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
12501    ) -> Result<LinkableEvent, fidl::Error> {
12502        let (bytes, _handles) = buf.split_mut();
12503        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12504        debug_assert_eq!(tx_header.tx_id, 0);
12505        match tx_header.ordinal {
12506            _ => Err(fidl::Error::UnknownOrdinal {
12507                ordinal: tx_header.ordinal,
12508                protocol_name: <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12509            }),
12510        }
12511    }
12512}
12513
12514/// A Stream of incoming requests for fuchsia.io/Linkable.
12515pub struct LinkableRequestStream {
12516    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12517    is_terminated: bool,
12518}
12519
12520impl std::marker::Unpin for LinkableRequestStream {}
12521
12522impl futures::stream::FusedStream for LinkableRequestStream {
12523    fn is_terminated(&self) -> bool {
12524        self.is_terminated
12525    }
12526}
12527
12528impl fidl::endpoints::RequestStream for LinkableRequestStream {
12529    type Protocol = LinkableMarker;
12530    type ControlHandle = LinkableControlHandle;
12531
12532    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
12533        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
12534    }
12535
12536    fn control_handle(&self) -> Self::ControlHandle {
12537        LinkableControlHandle { inner: self.inner.clone() }
12538    }
12539
12540    fn into_inner(
12541        self,
12542    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
12543    {
12544        (self.inner, self.is_terminated)
12545    }
12546
12547    fn from_inner(
12548        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12549        is_terminated: bool,
12550    ) -> Self {
12551        Self { inner, is_terminated }
12552    }
12553}
12554
12555impl futures::Stream for LinkableRequestStream {
12556    type Item = Result<LinkableRequest, fidl::Error>;
12557
12558    fn poll_next(
12559        mut self: std::pin::Pin<&mut Self>,
12560        cx: &mut std::task::Context<'_>,
12561    ) -> std::task::Poll<Option<Self::Item>> {
12562        let this = &mut *self;
12563        if this.inner.check_shutdown(cx) {
12564            this.is_terminated = true;
12565            return std::task::Poll::Ready(None);
12566        }
12567        if this.is_terminated {
12568            panic!("polled LinkableRequestStream after completion");
12569        }
12570        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
12571            |bytes, handles| {
12572                match this.inner.channel().read_etc(cx, bytes, handles) {
12573                    std::task::Poll::Ready(Ok(())) => {}
12574                    std::task::Poll::Pending => return std::task::Poll::Pending,
12575                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
12576                        this.is_terminated = true;
12577                        return std::task::Poll::Ready(None);
12578                    }
12579                    std::task::Poll::Ready(Err(e)) => {
12580                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
12581                            e.into(),
12582                        ))));
12583                    }
12584                }
12585
12586                // A message has been received from the channel
12587                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12588
12589                std::task::Poll::Ready(Some(match header.ordinal {
12590                    0x54f3949246a03e74 => {
12591                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12592                        let mut req = fidl::new_empty!(
12593                            LinkableLinkIntoRequest,
12594                            fidl::encoding::DefaultFuchsiaResourceDialect
12595                        );
12596                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
12597                        let control_handle = LinkableControlHandle { inner: this.inner.clone() };
12598                        Ok(LinkableRequest::LinkInto {
12599                            dst_parent_token: req.dst_parent_token,
12600                            dst: req.dst,
12601
12602                            responder: LinkableLinkIntoResponder {
12603                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12604                                tx_id: header.tx_id,
12605                            },
12606                        })
12607                    }
12608                    _ => Err(fidl::Error::UnknownOrdinal {
12609                        ordinal: header.ordinal,
12610                        protocol_name:
12611                            <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12612                    }),
12613                }))
12614            },
12615        )
12616    }
12617}
12618
12619#[derive(Debug)]
12620pub enum LinkableRequest {
12621    /// Creates a link to this this object with name `dst` in the directory represented by
12622    /// `dst_parent_token`.
12623    ///
12624    /// `dst` must be a resolved object name. Including "/" in the string will return
12625    /// `ZX_ERR_INVALID_ARGS`.
12626    ///
12627    /// This method requires the maximal set of rights supported by the filesystem for this object.
12628    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12629    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12630    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12631    /// `ZX_ERR_ACCESS_DENIED`.
12632    ///
12633    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12634    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12635    ///
12636    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12637    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12638    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12639    ///
12640    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12641    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12642    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12643    LinkInto { dst_parent_token: fidl::Event, dst: String, responder: LinkableLinkIntoResponder },
12644}
12645
12646impl LinkableRequest {
12647    #[allow(irrefutable_let_patterns)]
12648    pub fn into_link_into(self) -> Option<(fidl::Event, String, LinkableLinkIntoResponder)> {
12649        if let LinkableRequest::LinkInto { dst_parent_token, dst, responder } = self {
12650            Some((dst_parent_token, dst, responder))
12651        } else {
12652            None
12653        }
12654    }
12655
12656    /// Name of the method defined in FIDL
12657    pub fn method_name(&self) -> &'static str {
12658        match *self {
12659            LinkableRequest::LinkInto { .. } => "link_into",
12660        }
12661    }
12662}
12663
12664#[derive(Debug, Clone)]
12665pub struct LinkableControlHandle {
12666    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12667}
12668
12669impl fidl::endpoints::ControlHandle for LinkableControlHandle {
12670    fn shutdown(&self) {
12671        self.inner.shutdown()
12672    }
12673    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
12674        self.inner.shutdown_with_epitaph(status)
12675    }
12676
12677    fn is_closed(&self) -> bool {
12678        self.inner.channel().is_closed()
12679    }
12680    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
12681        self.inner.channel().on_closed()
12682    }
12683
12684    #[cfg(target_os = "fuchsia")]
12685    fn signal_peer(
12686        &self,
12687        clear_mask: zx::Signals,
12688        set_mask: zx::Signals,
12689    ) -> Result<(), zx_status::Status> {
12690        use fidl::Peered;
12691        self.inner.channel().signal_peer(clear_mask, set_mask)
12692    }
12693}
12694
12695impl LinkableControlHandle {}
12696
12697#[must_use = "FIDL methods require a response to be sent"]
12698#[derive(Debug)]
12699pub struct LinkableLinkIntoResponder {
12700    control_handle: std::mem::ManuallyDrop<LinkableControlHandle>,
12701    tx_id: u32,
12702}
12703
12704/// Set the the channel to be shutdown (see [`LinkableControlHandle::shutdown`])
12705/// if the responder is dropped without sending a response, so that the client
12706/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12707impl std::ops::Drop for LinkableLinkIntoResponder {
12708    fn drop(&mut self) {
12709        self.control_handle.shutdown();
12710        // Safety: drops once, never accessed again
12711        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12712    }
12713}
12714
12715impl fidl::endpoints::Responder for LinkableLinkIntoResponder {
12716    type ControlHandle = LinkableControlHandle;
12717
12718    fn control_handle(&self) -> &LinkableControlHandle {
12719        &self.control_handle
12720    }
12721
12722    fn drop_without_shutdown(mut self) {
12723        // Safety: drops once, never accessed again due to mem::forget
12724        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12725        // Prevent Drop from running (which would shut down the channel)
12726        std::mem::forget(self);
12727    }
12728}
12729
12730impl LinkableLinkIntoResponder {
12731    /// Sends a response to the FIDL transaction.
12732    ///
12733    /// Sets the channel to shutdown if an error occurs.
12734    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12735        let _result = self.send_raw(result);
12736        if _result.is_err() {
12737            self.control_handle.shutdown();
12738        }
12739        self.drop_without_shutdown();
12740        _result
12741    }
12742
12743    /// Similar to "send" but does not shutdown the channel if an error occurs.
12744    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12745        let _result = self.send_raw(result);
12746        self.drop_without_shutdown();
12747        _result
12748    }
12749
12750    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12751        self.control_handle
12752            .inner
12753            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12754                result,
12755                self.tx_id,
12756                0x54f3949246a03e74,
12757                fidl::encoding::DynamicFlags::empty(),
12758            )
12759    }
12760}
12761
12762#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12763pub struct NodeMarker;
12764
12765impl fidl::endpoints::ProtocolMarker for NodeMarker {
12766    type Proxy = NodeProxy;
12767    type RequestStream = NodeRequestStream;
12768    #[cfg(target_os = "fuchsia")]
12769    type SynchronousProxy = NodeSynchronousProxy;
12770
12771    const DEBUG_NAME: &'static str = "fuchsia.io.Node";
12772}
12773impl fidl::endpoints::DiscoverableProtocolMarker for NodeMarker {}
12774pub type NodeGetFlagsResult = Result<Flags, i32>;
12775pub type NodeSetFlagsResult = Result<(), i32>;
12776pub type NodeGetAttributesResult = Result<(MutableNodeAttributes, ImmutableNodeAttributes), i32>;
12777pub type NodeUpdateAttributesResult = Result<(), i32>;
12778pub type NodeSyncResult = Result<(), i32>;
12779pub type NodeGetExtendedAttributeResult = Result<ExtendedAttributeValue, i32>;
12780pub type NodeSetExtendedAttributeResult = Result<(), i32>;
12781pub type NodeRemoveExtendedAttributeResult = Result<(), i32>;
12782
12783pub trait NodeProxyInterface: Send + Sync {
12784    fn r#clone(
12785        &self,
12786        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12787    ) -> Result<(), fidl::Error>;
12788    type CloseResponseFut: std::future::Future<
12789            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
12790        > + Send;
12791    fn r#close(&self) -> Self::CloseResponseFut;
12792    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
12793    fn r#query(&self) -> Self::QueryResponseFut;
12794    fn r#deprecated_clone(
12795        &self,
12796        flags: OpenFlags,
12797        object: fidl::endpoints::ServerEnd<NodeMarker>,
12798    ) -> Result<(), fidl::Error>;
12799    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
12800        + Send;
12801    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
12802    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
12803    fn r#deprecated_set_attr(
12804        &self,
12805        flags: NodeAttributeFlags,
12806        attributes: &NodeAttributes,
12807    ) -> Self::DeprecatedSetAttrResponseFut;
12808    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
12809        + Send;
12810    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
12811    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
12812        + Send;
12813    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
12814    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
12815        + Send;
12816    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
12817    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
12818        + Send;
12819    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
12820    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
12821        + Send;
12822    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
12823    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
12824        + Send;
12825    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
12826    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
12827        + Send;
12828    fn r#update_attributes(
12829        &self,
12830        payload: &MutableNodeAttributes,
12831    ) -> Self::UpdateAttributesResponseFut;
12832    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
12833    fn r#sync(&self) -> Self::SyncResponseFut;
12834    fn r#list_extended_attributes(
12835        &self,
12836        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
12837    ) -> Result<(), fidl::Error>;
12838    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
12839        + Send;
12840    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
12841    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
12842        + Send;
12843    fn r#set_extended_attribute(
12844        &self,
12845        name: &[u8],
12846        value: ExtendedAttributeValue,
12847        mode: SetExtendedAttributeMode,
12848    ) -> Self::SetExtendedAttributeResponseFut;
12849    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
12850        + Send;
12851    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
12852}
12853#[derive(Debug)]
12854#[cfg(target_os = "fuchsia")]
12855pub struct NodeSynchronousProxy {
12856    client: fidl::client::sync::Client,
12857}
12858
12859#[cfg(target_os = "fuchsia")]
12860impl fidl::endpoints::SynchronousProxy for NodeSynchronousProxy {
12861    type Proxy = NodeProxy;
12862    type Protocol = NodeMarker;
12863
12864    fn from_channel(inner: fidl::Channel) -> Self {
12865        Self::new(inner)
12866    }
12867
12868    fn into_channel(self) -> fidl::Channel {
12869        self.client.into_channel()
12870    }
12871
12872    fn as_channel(&self) -> &fidl::Channel {
12873        self.client.as_channel()
12874    }
12875}
12876
12877#[cfg(target_os = "fuchsia")]
12878impl NodeSynchronousProxy {
12879    pub fn new(channel: fidl::Channel) -> Self {
12880        let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12881        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
12882    }
12883
12884    pub fn into_channel(self) -> fidl::Channel {
12885        self.client.into_channel()
12886    }
12887
12888    /// Waits until an event arrives and returns it. It is safe for other
12889    /// threads to make concurrent requests while waiting for an event.
12890    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<NodeEvent, fidl::Error> {
12891        NodeEvent::decode(self.client.wait_for_event(deadline)?)
12892    }
12893
12894    pub fn r#clone(
12895        &self,
12896        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12897    ) -> Result<(), fidl::Error> {
12898        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
12899            (request,),
12900            0x20d8a7aba2168a79,
12901            fidl::encoding::DynamicFlags::empty(),
12902        )
12903    }
12904
12905    /// Terminates the connection.
12906    ///
12907    /// After calling `Close`, the client must not send any other requests.
12908    ///
12909    /// Servers, after sending the status response, should close the connection
12910    /// regardless of status and without sending an epitaph.
12911    ///
12912    /// Closing the client end of the channel should be semantically equivalent
12913    /// to calling `Close` without knowing when the close has completed or its
12914    /// status.
12915    pub fn r#close(
12916        &self,
12917        ___deadline: zx::MonotonicInstant,
12918    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
12919        let _response = self.client.send_query::<
12920            fidl::encoding::EmptyPayload,
12921            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12922        >(
12923            (),
12924            0x5ac5d459ad7f657e,
12925            fidl::encoding::DynamicFlags::empty(),
12926            ___deadline,
12927        )?;
12928        Ok(_response.map(|x| x))
12929    }
12930
12931    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
12932        let _response = self.client.send_query::<
12933            fidl::encoding::EmptyPayload,
12934            fidl_fuchsia_unknown::QueryableQueryResponse,
12935        >(
12936            (),
12937            0x2658edee9decfc06,
12938            fidl::encoding::DynamicFlags::empty(),
12939            ___deadline,
12940        )?;
12941        Ok(_response.protocol)
12942    }
12943
12944    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
12945    pub fn r#deprecated_clone(
12946        &self,
12947        mut flags: OpenFlags,
12948        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
12949    ) -> Result<(), fidl::Error> {
12950        self.client.send::<NodeDeprecatedCloneRequest>(
12951            (flags, object),
12952            0x5a61678f293ce16f,
12953            fidl::encoding::DynamicFlags::FLEXIBLE,
12954        )
12955    }
12956
12957    /// DEPRECATED - Use `Node.GetAttributes` instead.
12958    pub fn r#deprecated_get_attr(
12959        &self,
12960        ___deadline: zx::MonotonicInstant,
12961    ) -> Result<(i32, NodeAttributes), fidl::Error> {
12962        let _response =
12963            self.client.send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse>(
12964                (),
12965                0x78985e216314dafd,
12966                fidl::encoding::DynamicFlags::empty(),
12967                ___deadline,
12968            )?;
12969        Ok((_response.s, _response.attributes))
12970    }
12971
12972    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
12973    pub fn r#deprecated_set_attr(
12974        &self,
12975        mut flags: NodeAttributeFlags,
12976        mut attributes: &NodeAttributes,
12977        ___deadline: zx::MonotonicInstant,
12978    ) -> Result<i32, fidl::Error> {
12979        let _response =
12980            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
12981                (flags, attributes),
12982                0x4186c0f40d938f46,
12983                fidl::encoding::DynamicFlags::empty(),
12984                ___deadline,
12985            )?;
12986        Ok(_response.s)
12987    }
12988
12989    /// [DEPRECATED - Use new GetFlags method instead.]
12990    pub fn r#deprecated_get_flags(
12991        &self,
12992        ___deadline: zx::MonotonicInstant,
12993    ) -> Result<(i32, OpenFlags), fidl::Error> {
12994        let _response = self
12995            .client
12996            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
12997                (),
12998                0x5b88fffb8eda3aa1,
12999                fidl::encoding::DynamicFlags::empty(),
13000                ___deadline,
13001            )?;
13002        Ok((_response.s, _response.flags))
13003    }
13004
13005    /// [DEPRECATED - Use new SetFlags method instead.]
13006    pub fn r#deprecated_set_flags(
13007        &self,
13008        mut flags: OpenFlags,
13009        ___deadline: zx::MonotonicInstant,
13010    ) -> Result<i32, fidl::Error> {
13011        let _response = self
13012            .client
13013            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
13014                (flags,),
13015                0x5295b76c71fde733,
13016                fidl::encoding::DynamicFlags::empty(),
13017                ___deadline,
13018            )?;
13019        Ok(_response.s)
13020    }
13021
13022    /// Queries the flags that apply to this node after it has been opened/created. This method does
13023    /// not require any rights.
13024    ///
13025    /// Note that the final set of flags that apply to the connection may differ from those
13026    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13027    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13028    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13029    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13030    pub fn r#get_flags(
13031        &self,
13032        ___deadline: zx::MonotonicInstant,
13033    ) -> Result<NodeGetFlagsResult, fidl::Error> {
13034        let _response = self.client.send_query::<
13035            fidl::encoding::EmptyPayload,
13036            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
13037        >(
13038            (),
13039            0x176eb318f64ec23,
13040            fidl::encoding::DynamicFlags::FLEXIBLE,
13041            ___deadline,
13042        )?
13043        .into_result::<NodeMarker>("get_flags")?;
13044        Ok(_response.map(|x| x.flags))
13045    }
13046
13047    /// Sets the flags that apply to this node after it has been opened. This method does not
13048    /// require any rights.
13049    ///
13050    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13051    /// clear append mode.
13052    ///
13053    /// Errors:
13054    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13055    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13056    pub fn r#set_flags(
13057        &self,
13058        mut flags: Flags,
13059        ___deadline: zx::MonotonicInstant,
13060    ) -> Result<NodeSetFlagsResult, fidl::Error> {
13061        let _response = self.client.send_query::<
13062            NodeSetFlagsRequest,
13063            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
13064        >(
13065            (flags,),
13066            0x55a8028685791ea8,
13067            fidl::encoding::DynamicFlags::FLEXIBLE,
13068            ___deadline,
13069        )?
13070        .into_result::<NodeMarker>("set_flags")?;
13071        Ok(_response.map(|x| x))
13072    }
13073
13074    /// Query the filesystem for filesystem-specific information.
13075    pub fn r#query_filesystem(
13076        &self,
13077        ___deadline: zx::MonotonicInstant,
13078    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
13079        let _response =
13080            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
13081                (),
13082                0x6f344a1c6b0a0610,
13083                fidl::encoding::DynamicFlags::empty(),
13084                ___deadline,
13085            )?;
13086        Ok((_response.s, _response.info))
13087    }
13088
13089    /// Acquires information about the node.
13090    ///
13091    /// The attributes of a node should be stable, independent of the
13092    /// specific protocol used to access it.
13093    ///
13094    /// If a particular attribute is not applicable or not supported,
13095    /// filesystems should leave the corresponding field absent.
13096    ///
13097    /// + `query` a bit-mask specifying which attributes to fetch. The server
13098    ///   should not return more than necessary.
13099    /// - `attributes` the returned attributes.
13100    ///
13101    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13102    pub fn r#get_attributes(
13103        &self,
13104        mut query: NodeAttributesQuery,
13105        ___deadline: zx::MonotonicInstant,
13106    ) -> Result<NodeGetAttributesResult, fidl::Error> {
13107        let _response = self.client.send_query::<
13108            NodeGetAttributesRequest,
13109            fidl::encoding::ResultType<NodeAttributes2, i32>,
13110        >(
13111            (query,),
13112            0x3d4396a638ea053b,
13113            fidl::encoding::DynamicFlags::empty(),
13114            ___deadline,
13115        )?;
13116        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
13117    }
13118
13119    /// Updates information about the node.
13120    ///
13121    /// + `attributes` the presence of a table field in `attributes` indicates
13122    /// the intent to update the corresponding attribute.
13123    ///
13124    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13125    ///
13126    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13127    pub fn r#update_attributes(
13128        &self,
13129        mut payload: &MutableNodeAttributes,
13130        ___deadline: zx::MonotonicInstant,
13131    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
13132        let _response = self.client.send_query::<
13133            MutableNodeAttributes,
13134            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13135        >(
13136            payload,
13137            0x3308c1da5a89bf08,
13138            fidl::encoding::DynamicFlags::empty(),
13139            ___deadline,
13140        )?;
13141        Ok(_response.map(|x| x))
13142    }
13143
13144    /// Synchronizes updates to the node to the underlying media, if it exists.
13145    ///
13146    /// This method will return when the filesystem server has flushed the
13147    /// relevant updates to the underlying media, but does not guarantee the
13148    /// underlying media has persisted the information, nor that any information
13149    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13150    /// between operations.
13151    ///
13152    /// This method does not require any rights.
13153    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
13154        let _response = self.client.send_query::<
13155            fidl::encoding::EmptyPayload,
13156            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13157        >(
13158            (),
13159            0x2c5c27ca0ab5dc49,
13160            fidl::encoding::DynamicFlags::empty(),
13161            ___deadline,
13162        )?;
13163        Ok(_response.map(|x| x))
13164    }
13165
13166    /// Creates an iterator over all the extended attribute names associated
13167    /// with this node. If an error occurs it is returned as an epitaph on the
13168    /// iterator request channel, and then the channel is closed.
13169    ///
13170    /// GetExtendedAttributes can be used with any of these names to retrieve
13171    /// the associated value.
13172    ///
13173    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13174    pub fn r#list_extended_attributes(
13175        &self,
13176        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13177    ) -> Result<(), fidl::Error> {
13178        self.client.send::<NodeListExtendedAttributesRequest>(
13179            (iterator,),
13180            0x4b61033de007fcd0,
13181            fidl::encoding::DynamicFlags::empty(),
13182        )
13183    }
13184
13185    /// Get the value associated with the given attribute `name` for this node.
13186    ///
13187    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13188    /// particular structure is imposed on them.
13189    ///
13190    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13191    pub fn r#get_extended_attribute(
13192        &self,
13193        mut name: &[u8],
13194        ___deadline: zx::MonotonicInstant,
13195    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
13196        let _response = self.client.send_query::<
13197            NodeGetExtendedAttributeRequest,
13198            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
13199        >(
13200            (name,),
13201            0x45ffa3ccfdeb76db,
13202            fidl::encoding::DynamicFlags::empty(),
13203            ___deadline,
13204        )?;
13205        Ok(_response.map(|x| x))
13206    }
13207
13208    /// Set the value for the given attribute `name` to `value` for this node.
13209    ///
13210    /// The attribute name may exist, in which case the attribute is updated.
13211    /// If the attribute doesn't exist, it is created. The name should have no
13212    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13213    ///
13214    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13215    pub fn r#set_extended_attribute(
13216        &self,
13217        mut name: &[u8],
13218        mut value: ExtendedAttributeValue,
13219        mut mode: SetExtendedAttributeMode,
13220        ___deadline: zx::MonotonicInstant,
13221    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
13222        let _response = self.client.send_query::<
13223            NodeSetExtendedAttributeRequest,
13224            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13225        >(
13226            (name, &mut value, mode,),
13227            0x4a951362f681f23c,
13228            fidl::encoding::DynamicFlags::empty(),
13229            ___deadline,
13230        )?;
13231        Ok(_response.map(|x| x))
13232    }
13233
13234    /// Remove the specified extended attribute.
13235    ///
13236    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13237    ///
13238    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13239    pub fn r#remove_extended_attribute(
13240        &self,
13241        mut name: &[u8],
13242        ___deadline: zx::MonotonicInstant,
13243    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
13244        let _response = self.client.send_query::<
13245            NodeRemoveExtendedAttributeRequest,
13246            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13247        >(
13248            (name,),
13249            0x7a0b9f3a9bf9032d,
13250            fidl::encoding::DynamicFlags::empty(),
13251            ___deadline,
13252        )?;
13253        Ok(_response.map(|x| x))
13254    }
13255}
13256
13257#[cfg(target_os = "fuchsia")]
13258impl From<NodeSynchronousProxy> for zx::Handle {
13259    fn from(value: NodeSynchronousProxy) -> Self {
13260        value.into_channel().into()
13261    }
13262}
13263
13264#[cfg(target_os = "fuchsia")]
13265impl From<fidl::Channel> for NodeSynchronousProxy {
13266    fn from(value: fidl::Channel) -> Self {
13267        Self::new(value)
13268    }
13269}
13270
13271#[cfg(target_os = "fuchsia")]
13272impl fidl::endpoints::FromClient for NodeSynchronousProxy {
13273    type Protocol = NodeMarker;
13274
13275    fn from_client(value: fidl::endpoints::ClientEnd<NodeMarker>) -> Self {
13276        Self::new(value.into_channel())
13277    }
13278}
13279
13280#[derive(Debug, Clone)]
13281pub struct NodeProxy {
13282    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
13283}
13284
13285impl fidl::endpoints::Proxy for NodeProxy {
13286    type Protocol = NodeMarker;
13287
13288    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
13289        Self::new(inner)
13290    }
13291
13292    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
13293        self.client.into_channel().map_err(|client| Self { client })
13294    }
13295
13296    fn as_channel(&self) -> &::fidl::AsyncChannel {
13297        self.client.as_channel()
13298    }
13299}
13300
13301impl NodeProxy {
13302    /// Create a new Proxy for fuchsia.io/Node.
13303    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
13304        let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
13305        Self { client: fidl::client::Client::new(channel, protocol_name) }
13306    }
13307
13308    /// Get a Stream of events from the remote end of the protocol.
13309    ///
13310    /// # Panics
13311    ///
13312    /// Panics if the event stream was already taken.
13313    pub fn take_event_stream(&self) -> NodeEventStream {
13314        NodeEventStream { event_receiver: self.client.take_event_receiver() }
13315    }
13316
13317    pub fn r#clone(
13318        &self,
13319        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13320    ) -> Result<(), fidl::Error> {
13321        NodeProxyInterface::r#clone(self, request)
13322    }
13323
13324    /// Terminates the connection.
13325    ///
13326    /// After calling `Close`, the client must not send any other requests.
13327    ///
13328    /// Servers, after sending the status response, should close the connection
13329    /// regardless of status and without sending an epitaph.
13330    ///
13331    /// Closing the client end of the channel should be semantically equivalent
13332    /// to calling `Close` without knowing when the close has completed or its
13333    /// status.
13334    pub fn r#close(
13335        &self,
13336    ) -> fidl::client::QueryResponseFut<
13337        fidl_fuchsia_unknown::CloseableCloseResult,
13338        fidl::encoding::DefaultFuchsiaResourceDialect,
13339    > {
13340        NodeProxyInterface::r#close(self)
13341    }
13342
13343    pub fn r#query(
13344        &self,
13345    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
13346    {
13347        NodeProxyInterface::r#query(self)
13348    }
13349
13350    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
13351    pub fn r#deprecated_clone(
13352        &self,
13353        mut flags: OpenFlags,
13354        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13355    ) -> Result<(), fidl::Error> {
13356        NodeProxyInterface::r#deprecated_clone(self, flags, object)
13357    }
13358
13359    /// DEPRECATED - Use `Node.GetAttributes` instead.
13360    pub fn r#deprecated_get_attr(
13361        &self,
13362    ) -> fidl::client::QueryResponseFut<
13363        (i32, NodeAttributes),
13364        fidl::encoding::DefaultFuchsiaResourceDialect,
13365    > {
13366        NodeProxyInterface::r#deprecated_get_attr(self)
13367    }
13368
13369    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
13370    pub fn r#deprecated_set_attr(
13371        &self,
13372        mut flags: NodeAttributeFlags,
13373        mut attributes: &NodeAttributes,
13374    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13375        NodeProxyInterface::r#deprecated_set_attr(self, flags, attributes)
13376    }
13377
13378    /// [DEPRECATED - Use new GetFlags method instead.]
13379    pub fn r#deprecated_get_flags(
13380        &self,
13381    ) -> fidl::client::QueryResponseFut<
13382        (i32, OpenFlags),
13383        fidl::encoding::DefaultFuchsiaResourceDialect,
13384    > {
13385        NodeProxyInterface::r#deprecated_get_flags(self)
13386    }
13387
13388    /// [DEPRECATED - Use new SetFlags method instead.]
13389    pub fn r#deprecated_set_flags(
13390        &self,
13391        mut flags: OpenFlags,
13392    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13393        NodeProxyInterface::r#deprecated_set_flags(self, flags)
13394    }
13395
13396    /// Queries the flags that apply to this node after it has been opened/created. This method does
13397    /// not require any rights.
13398    ///
13399    /// Note that the final set of flags that apply to the connection may differ from those
13400    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13401    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13402    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13403    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13404    pub fn r#get_flags(
13405        &self,
13406    ) -> fidl::client::QueryResponseFut<
13407        NodeGetFlagsResult,
13408        fidl::encoding::DefaultFuchsiaResourceDialect,
13409    > {
13410        NodeProxyInterface::r#get_flags(self)
13411    }
13412
13413    /// Sets the flags that apply to this node after it has been opened. This method does not
13414    /// require any rights.
13415    ///
13416    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13417    /// clear append mode.
13418    ///
13419    /// Errors:
13420    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13421    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13422    pub fn r#set_flags(
13423        &self,
13424        mut flags: Flags,
13425    ) -> fidl::client::QueryResponseFut<
13426        NodeSetFlagsResult,
13427        fidl::encoding::DefaultFuchsiaResourceDialect,
13428    > {
13429        NodeProxyInterface::r#set_flags(self, flags)
13430    }
13431
13432    /// Query the filesystem for filesystem-specific information.
13433    pub fn r#query_filesystem(
13434        &self,
13435    ) -> fidl::client::QueryResponseFut<
13436        (i32, Option<Box<FilesystemInfo>>),
13437        fidl::encoding::DefaultFuchsiaResourceDialect,
13438    > {
13439        NodeProxyInterface::r#query_filesystem(self)
13440    }
13441
13442    /// Acquires information about the node.
13443    ///
13444    /// The attributes of a node should be stable, independent of the
13445    /// specific protocol used to access it.
13446    ///
13447    /// If a particular attribute is not applicable or not supported,
13448    /// filesystems should leave the corresponding field absent.
13449    ///
13450    /// + `query` a bit-mask specifying which attributes to fetch. The server
13451    ///   should not return more than necessary.
13452    /// - `attributes` the returned attributes.
13453    ///
13454    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13455    pub fn r#get_attributes(
13456        &self,
13457        mut query: NodeAttributesQuery,
13458    ) -> fidl::client::QueryResponseFut<
13459        NodeGetAttributesResult,
13460        fidl::encoding::DefaultFuchsiaResourceDialect,
13461    > {
13462        NodeProxyInterface::r#get_attributes(self, query)
13463    }
13464
13465    /// Updates information about the node.
13466    ///
13467    /// + `attributes` the presence of a table field in `attributes` indicates
13468    /// the intent to update the corresponding attribute.
13469    ///
13470    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13471    ///
13472    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13473    pub fn r#update_attributes(
13474        &self,
13475        mut payload: &MutableNodeAttributes,
13476    ) -> fidl::client::QueryResponseFut<
13477        NodeUpdateAttributesResult,
13478        fidl::encoding::DefaultFuchsiaResourceDialect,
13479    > {
13480        NodeProxyInterface::r#update_attributes(self, payload)
13481    }
13482
13483    /// Synchronizes updates to the node to the underlying media, if it exists.
13484    ///
13485    /// This method will return when the filesystem server has flushed the
13486    /// relevant updates to the underlying media, but does not guarantee the
13487    /// underlying media has persisted the information, nor that any information
13488    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13489    /// between operations.
13490    ///
13491    /// This method does not require any rights.
13492    pub fn r#sync(
13493        &self,
13494    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
13495    {
13496        NodeProxyInterface::r#sync(self)
13497    }
13498
13499    /// Creates an iterator over all the extended attribute names associated
13500    /// with this node. If an error occurs it is returned as an epitaph on the
13501    /// iterator request channel, and then the channel is closed.
13502    ///
13503    /// GetExtendedAttributes can be used with any of these names to retrieve
13504    /// the associated value.
13505    ///
13506    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13507    pub fn r#list_extended_attributes(
13508        &self,
13509        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13510    ) -> Result<(), fidl::Error> {
13511        NodeProxyInterface::r#list_extended_attributes(self, iterator)
13512    }
13513
13514    /// Get the value associated with the given attribute `name` for this node.
13515    ///
13516    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13517    /// particular structure is imposed on them.
13518    ///
13519    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13520    pub fn r#get_extended_attribute(
13521        &self,
13522        mut name: &[u8],
13523    ) -> fidl::client::QueryResponseFut<
13524        NodeGetExtendedAttributeResult,
13525        fidl::encoding::DefaultFuchsiaResourceDialect,
13526    > {
13527        NodeProxyInterface::r#get_extended_attribute(self, name)
13528    }
13529
13530    /// Set the value for the given attribute `name` to `value` for this node.
13531    ///
13532    /// The attribute name may exist, in which case the attribute is updated.
13533    /// If the attribute doesn't exist, it is created. The name should have no
13534    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13535    ///
13536    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13537    pub fn r#set_extended_attribute(
13538        &self,
13539        mut name: &[u8],
13540        mut value: ExtendedAttributeValue,
13541        mut mode: SetExtendedAttributeMode,
13542    ) -> fidl::client::QueryResponseFut<
13543        NodeSetExtendedAttributeResult,
13544        fidl::encoding::DefaultFuchsiaResourceDialect,
13545    > {
13546        NodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
13547    }
13548
13549    /// Remove the specified extended attribute.
13550    ///
13551    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13552    ///
13553    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13554    pub fn r#remove_extended_attribute(
13555        &self,
13556        mut name: &[u8],
13557    ) -> fidl::client::QueryResponseFut<
13558        NodeRemoveExtendedAttributeResult,
13559        fidl::encoding::DefaultFuchsiaResourceDialect,
13560    > {
13561        NodeProxyInterface::r#remove_extended_attribute(self, name)
13562    }
13563}
13564
13565impl NodeProxyInterface for NodeProxy {
13566    fn r#clone(
13567        &self,
13568        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13569    ) -> Result<(), fidl::Error> {
13570        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
13571            (request,),
13572            0x20d8a7aba2168a79,
13573            fidl::encoding::DynamicFlags::empty(),
13574        )
13575    }
13576
13577    type CloseResponseFut = fidl::client::QueryResponseFut<
13578        fidl_fuchsia_unknown::CloseableCloseResult,
13579        fidl::encoding::DefaultFuchsiaResourceDialect,
13580    >;
13581    fn r#close(&self) -> Self::CloseResponseFut {
13582        fn _decode(
13583            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13584        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
13585            let _response = fidl::client::decode_transaction_body::<
13586                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13587                fidl::encoding::DefaultFuchsiaResourceDialect,
13588                0x5ac5d459ad7f657e,
13589            >(_buf?)?;
13590            Ok(_response.map(|x| x))
13591        }
13592        self.client.send_query_and_decode::<
13593            fidl::encoding::EmptyPayload,
13594            fidl_fuchsia_unknown::CloseableCloseResult,
13595        >(
13596            (),
13597            0x5ac5d459ad7f657e,
13598            fidl::encoding::DynamicFlags::empty(),
13599            _decode,
13600        )
13601    }
13602
13603    type QueryResponseFut =
13604        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
13605    fn r#query(&self) -> Self::QueryResponseFut {
13606        fn _decode(
13607            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13608        ) -> Result<Vec<u8>, fidl::Error> {
13609            let _response = fidl::client::decode_transaction_body::<
13610                fidl_fuchsia_unknown::QueryableQueryResponse,
13611                fidl::encoding::DefaultFuchsiaResourceDialect,
13612                0x2658edee9decfc06,
13613            >(_buf?)?;
13614            Ok(_response.protocol)
13615        }
13616        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
13617            (),
13618            0x2658edee9decfc06,
13619            fidl::encoding::DynamicFlags::empty(),
13620            _decode,
13621        )
13622    }
13623
13624    fn r#deprecated_clone(
13625        &self,
13626        mut flags: OpenFlags,
13627        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13628    ) -> Result<(), fidl::Error> {
13629        self.client.send::<NodeDeprecatedCloneRequest>(
13630            (flags, object),
13631            0x5a61678f293ce16f,
13632            fidl::encoding::DynamicFlags::FLEXIBLE,
13633        )
13634    }
13635
13636    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
13637        (i32, NodeAttributes),
13638        fidl::encoding::DefaultFuchsiaResourceDialect,
13639    >;
13640    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
13641        fn _decode(
13642            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13643        ) -> Result<(i32, NodeAttributes), fidl::Error> {
13644            let _response = fidl::client::decode_transaction_body::<
13645                NodeDeprecatedGetAttrResponse,
13646                fidl::encoding::DefaultFuchsiaResourceDialect,
13647                0x78985e216314dafd,
13648            >(_buf?)?;
13649            Ok((_response.s, _response.attributes))
13650        }
13651        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
13652            (),
13653            0x78985e216314dafd,
13654            fidl::encoding::DynamicFlags::empty(),
13655            _decode,
13656        )
13657    }
13658
13659    type DeprecatedSetAttrResponseFut =
13660        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
13661    fn r#deprecated_set_attr(
13662        &self,
13663        mut flags: NodeAttributeFlags,
13664        mut attributes: &NodeAttributes,
13665    ) -> Self::DeprecatedSetAttrResponseFut {
13666        fn _decode(
13667            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13668        ) -> Result<i32, fidl::Error> {
13669            let _response = fidl::client::decode_transaction_body::<
13670                NodeDeprecatedSetAttrResponse,
13671                fidl::encoding::DefaultFuchsiaResourceDialect,
13672                0x4186c0f40d938f46,
13673            >(_buf?)?;
13674            Ok(_response.s)
13675        }
13676        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
13677            (flags, attributes),
13678            0x4186c0f40d938f46,
13679            fidl::encoding::DynamicFlags::empty(),
13680            _decode,
13681        )
13682    }
13683
13684    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
13685        (i32, OpenFlags),
13686        fidl::encoding::DefaultFuchsiaResourceDialect,
13687    >;
13688    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
13689        fn _decode(
13690            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13691        ) -> Result<(i32, OpenFlags), fidl::Error> {
13692            let _response = fidl::client::decode_transaction_body::<
13693                NodeDeprecatedGetFlagsResponse,
13694                fidl::encoding::DefaultFuchsiaResourceDialect,
13695                0x5b88fffb8eda3aa1,
13696            >(_buf?)?;
13697            Ok((_response.s, _response.flags))
13698        }
13699        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
13700            (),
13701            0x5b88fffb8eda3aa1,
13702            fidl::encoding::DynamicFlags::empty(),
13703            _decode,
13704        )
13705    }
13706
13707    type DeprecatedSetFlagsResponseFut =
13708        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
13709    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
13710        fn _decode(
13711            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13712        ) -> Result<i32, fidl::Error> {
13713            let _response = fidl::client::decode_transaction_body::<
13714                NodeDeprecatedSetFlagsResponse,
13715                fidl::encoding::DefaultFuchsiaResourceDialect,
13716                0x5295b76c71fde733,
13717            >(_buf?)?;
13718            Ok(_response.s)
13719        }
13720        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
13721            (flags,),
13722            0x5295b76c71fde733,
13723            fidl::encoding::DynamicFlags::empty(),
13724            _decode,
13725        )
13726    }
13727
13728    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
13729        NodeGetFlagsResult,
13730        fidl::encoding::DefaultFuchsiaResourceDialect,
13731    >;
13732    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
13733        fn _decode(
13734            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13735        ) -> Result<NodeGetFlagsResult, fidl::Error> {
13736            let _response = fidl::client::decode_transaction_body::<
13737                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
13738                fidl::encoding::DefaultFuchsiaResourceDialect,
13739                0x176eb318f64ec23,
13740            >(_buf?)?
13741            .into_result::<NodeMarker>("get_flags")?;
13742            Ok(_response.map(|x| x.flags))
13743        }
13744        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
13745            (),
13746            0x176eb318f64ec23,
13747            fidl::encoding::DynamicFlags::FLEXIBLE,
13748            _decode,
13749        )
13750    }
13751
13752    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
13753        NodeSetFlagsResult,
13754        fidl::encoding::DefaultFuchsiaResourceDialect,
13755    >;
13756    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
13757        fn _decode(
13758            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13759        ) -> Result<NodeSetFlagsResult, fidl::Error> {
13760            let _response = fidl::client::decode_transaction_body::<
13761                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
13762                fidl::encoding::DefaultFuchsiaResourceDialect,
13763                0x55a8028685791ea8,
13764            >(_buf?)?
13765            .into_result::<NodeMarker>("set_flags")?;
13766            Ok(_response.map(|x| x))
13767        }
13768        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
13769            (flags,),
13770            0x55a8028685791ea8,
13771            fidl::encoding::DynamicFlags::FLEXIBLE,
13772            _decode,
13773        )
13774    }
13775
13776    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
13777        (i32, Option<Box<FilesystemInfo>>),
13778        fidl::encoding::DefaultFuchsiaResourceDialect,
13779    >;
13780    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
13781        fn _decode(
13782            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13783        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
13784            let _response = fidl::client::decode_transaction_body::<
13785                NodeQueryFilesystemResponse,
13786                fidl::encoding::DefaultFuchsiaResourceDialect,
13787                0x6f344a1c6b0a0610,
13788            >(_buf?)?;
13789            Ok((_response.s, _response.info))
13790        }
13791        self.client.send_query_and_decode::<
13792            fidl::encoding::EmptyPayload,
13793            (i32, Option<Box<FilesystemInfo>>),
13794        >(
13795            (),
13796            0x6f344a1c6b0a0610,
13797            fidl::encoding::DynamicFlags::empty(),
13798            _decode,
13799        )
13800    }
13801
13802    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
13803        NodeGetAttributesResult,
13804        fidl::encoding::DefaultFuchsiaResourceDialect,
13805    >;
13806    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
13807        fn _decode(
13808            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13809        ) -> Result<NodeGetAttributesResult, fidl::Error> {
13810            let _response = fidl::client::decode_transaction_body::<
13811                fidl::encoding::ResultType<NodeAttributes2, i32>,
13812                fidl::encoding::DefaultFuchsiaResourceDialect,
13813                0x3d4396a638ea053b,
13814            >(_buf?)?;
13815            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
13816        }
13817        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
13818            (query,),
13819            0x3d4396a638ea053b,
13820            fidl::encoding::DynamicFlags::empty(),
13821            _decode,
13822        )
13823    }
13824
13825    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
13826        NodeUpdateAttributesResult,
13827        fidl::encoding::DefaultFuchsiaResourceDialect,
13828    >;
13829    fn r#update_attributes(
13830        &self,
13831        mut payload: &MutableNodeAttributes,
13832    ) -> Self::UpdateAttributesResponseFut {
13833        fn _decode(
13834            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13835        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
13836            let _response = fidl::client::decode_transaction_body::<
13837                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13838                fidl::encoding::DefaultFuchsiaResourceDialect,
13839                0x3308c1da5a89bf08,
13840            >(_buf?)?;
13841            Ok(_response.map(|x| x))
13842        }
13843        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
13844            payload,
13845            0x3308c1da5a89bf08,
13846            fidl::encoding::DynamicFlags::empty(),
13847            _decode,
13848        )
13849    }
13850
13851    type SyncResponseFut = fidl::client::QueryResponseFut<
13852        NodeSyncResult,
13853        fidl::encoding::DefaultFuchsiaResourceDialect,
13854    >;
13855    fn r#sync(&self) -> Self::SyncResponseFut {
13856        fn _decode(
13857            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13858        ) -> Result<NodeSyncResult, fidl::Error> {
13859            let _response = fidl::client::decode_transaction_body::<
13860                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13861                fidl::encoding::DefaultFuchsiaResourceDialect,
13862                0x2c5c27ca0ab5dc49,
13863            >(_buf?)?;
13864            Ok(_response.map(|x| x))
13865        }
13866        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
13867            (),
13868            0x2c5c27ca0ab5dc49,
13869            fidl::encoding::DynamicFlags::empty(),
13870            _decode,
13871        )
13872    }
13873
13874    fn r#list_extended_attributes(
13875        &self,
13876        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13877    ) -> Result<(), fidl::Error> {
13878        self.client.send::<NodeListExtendedAttributesRequest>(
13879            (iterator,),
13880            0x4b61033de007fcd0,
13881            fidl::encoding::DynamicFlags::empty(),
13882        )
13883    }
13884
13885    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
13886        NodeGetExtendedAttributeResult,
13887        fidl::encoding::DefaultFuchsiaResourceDialect,
13888    >;
13889    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
13890        fn _decode(
13891            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13892        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
13893            let _response = fidl::client::decode_transaction_body::<
13894                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
13895                fidl::encoding::DefaultFuchsiaResourceDialect,
13896                0x45ffa3ccfdeb76db,
13897            >(_buf?)?;
13898            Ok(_response.map(|x| x))
13899        }
13900        self.client.send_query_and_decode::<
13901            NodeGetExtendedAttributeRequest,
13902            NodeGetExtendedAttributeResult,
13903        >(
13904            (name,),
13905            0x45ffa3ccfdeb76db,
13906            fidl::encoding::DynamicFlags::empty(),
13907            _decode,
13908        )
13909    }
13910
13911    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
13912        NodeSetExtendedAttributeResult,
13913        fidl::encoding::DefaultFuchsiaResourceDialect,
13914    >;
13915    fn r#set_extended_attribute(
13916        &self,
13917        mut name: &[u8],
13918        mut value: ExtendedAttributeValue,
13919        mut mode: SetExtendedAttributeMode,
13920    ) -> Self::SetExtendedAttributeResponseFut {
13921        fn _decode(
13922            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13923        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
13924            let _response = fidl::client::decode_transaction_body::<
13925                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13926                fidl::encoding::DefaultFuchsiaResourceDialect,
13927                0x4a951362f681f23c,
13928            >(_buf?)?;
13929            Ok(_response.map(|x| x))
13930        }
13931        self.client.send_query_and_decode::<
13932            NodeSetExtendedAttributeRequest,
13933            NodeSetExtendedAttributeResult,
13934        >(
13935            (name, &mut value, mode,),
13936            0x4a951362f681f23c,
13937            fidl::encoding::DynamicFlags::empty(),
13938            _decode,
13939        )
13940    }
13941
13942    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
13943        NodeRemoveExtendedAttributeResult,
13944        fidl::encoding::DefaultFuchsiaResourceDialect,
13945    >;
13946    fn r#remove_extended_attribute(
13947        &self,
13948        mut name: &[u8],
13949    ) -> Self::RemoveExtendedAttributeResponseFut {
13950        fn _decode(
13951            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13952        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
13953            let _response = fidl::client::decode_transaction_body::<
13954                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13955                fidl::encoding::DefaultFuchsiaResourceDialect,
13956                0x7a0b9f3a9bf9032d,
13957            >(_buf?)?;
13958            Ok(_response.map(|x| x))
13959        }
13960        self.client.send_query_and_decode::<
13961            NodeRemoveExtendedAttributeRequest,
13962            NodeRemoveExtendedAttributeResult,
13963        >(
13964            (name,),
13965            0x7a0b9f3a9bf9032d,
13966            fidl::encoding::DynamicFlags::empty(),
13967            _decode,
13968        )
13969    }
13970}
13971
13972pub struct NodeEventStream {
13973    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
13974}
13975
13976impl std::marker::Unpin for NodeEventStream {}
13977
13978impl futures::stream::FusedStream for NodeEventStream {
13979    fn is_terminated(&self) -> bool {
13980        self.event_receiver.is_terminated()
13981    }
13982}
13983
13984impl futures::Stream for NodeEventStream {
13985    type Item = Result<NodeEvent, fidl::Error>;
13986
13987    fn poll_next(
13988        mut self: std::pin::Pin<&mut Self>,
13989        cx: &mut std::task::Context<'_>,
13990    ) -> std::task::Poll<Option<Self::Item>> {
13991        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
13992            &mut self.event_receiver,
13993            cx
13994        )?) {
13995            Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
13996            None => std::task::Poll::Ready(None),
13997        }
13998    }
13999}
14000
14001#[derive(Debug)]
14002pub enum NodeEvent {
14003    OnOpen_ {
14004        s: i32,
14005        info: Option<Box<NodeInfoDeprecated>>,
14006    },
14007    OnRepresentation {
14008        payload: Representation,
14009    },
14010    #[non_exhaustive]
14011    _UnknownEvent {
14012        /// Ordinal of the event that was sent.
14013        ordinal: u64,
14014    },
14015}
14016
14017impl NodeEvent {
14018    #[allow(irrefutable_let_patterns)]
14019    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
14020        if let NodeEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
14021    }
14022    #[allow(irrefutable_let_patterns)]
14023    pub fn into_on_representation(self) -> Option<Representation> {
14024        if let NodeEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
14025    }
14026
14027    /// Decodes a message buffer as a [`NodeEvent`].
14028    fn decode(
14029        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
14030    ) -> Result<NodeEvent, fidl::Error> {
14031        let (bytes, _handles) = buf.split_mut();
14032        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14033        debug_assert_eq!(tx_header.tx_id, 0);
14034        match tx_header.ordinal {
14035            0x7fc7bbb1dbfd1972 => {
14036                let mut out = fidl::new_empty!(
14037                    NodeOnOpenRequest,
14038                    fidl::encoding::DefaultFuchsiaResourceDialect
14039                );
14040                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
14041                Ok((NodeEvent::OnOpen_ { s: out.s, info: out.info }))
14042            }
14043            0x5cb40567d80a510c => {
14044                let mut out =
14045                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
14046                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
14047                Ok((NodeEvent::OnRepresentation { payload: out }))
14048            }
14049            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
14050                Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
14051            }
14052            _ => Err(fidl::Error::UnknownOrdinal {
14053                ordinal: tx_header.ordinal,
14054                protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14055            }),
14056        }
14057    }
14058}
14059
14060/// A Stream of incoming requests for fuchsia.io/Node.
14061pub struct NodeRequestStream {
14062    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14063    is_terminated: bool,
14064}
14065
14066impl std::marker::Unpin for NodeRequestStream {}
14067
14068impl futures::stream::FusedStream for NodeRequestStream {
14069    fn is_terminated(&self) -> bool {
14070        self.is_terminated
14071    }
14072}
14073
14074impl fidl::endpoints::RequestStream for NodeRequestStream {
14075    type Protocol = NodeMarker;
14076    type ControlHandle = NodeControlHandle;
14077
14078    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
14079        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
14080    }
14081
14082    fn control_handle(&self) -> Self::ControlHandle {
14083        NodeControlHandle { inner: self.inner.clone() }
14084    }
14085
14086    fn into_inner(
14087        self,
14088    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
14089    {
14090        (self.inner, self.is_terminated)
14091    }
14092
14093    fn from_inner(
14094        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14095        is_terminated: bool,
14096    ) -> Self {
14097        Self { inner, is_terminated }
14098    }
14099}
14100
14101impl futures::Stream for NodeRequestStream {
14102    type Item = Result<NodeRequest, fidl::Error>;
14103
14104    fn poll_next(
14105        mut self: std::pin::Pin<&mut Self>,
14106        cx: &mut std::task::Context<'_>,
14107    ) -> std::task::Poll<Option<Self::Item>> {
14108        let this = &mut *self;
14109        if this.inner.check_shutdown(cx) {
14110            this.is_terminated = true;
14111            return std::task::Poll::Ready(None);
14112        }
14113        if this.is_terminated {
14114            panic!("polled NodeRequestStream after completion");
14115        }
14116        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
14117            |bytes, handles| {
14118                match this.inner.channel().read_etc(cx, bytes, handles) {
14119                    std::task::Poll::Ready(Ok(())) => {}
14120                    std::task::Poll::Pending => return std::task::Poll::Pending,
14121                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
14122                        this.is_terminated = true;
14123                        return std::task::Poll::Ready(None);
14124                    }
14125                    std::task::Poll::Ready(Err(e)) => {
14126                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
14127                            e.into(),
14128                        ))));
14129                    }
14130                }
14131
14132                // A message has been received from the channel
14133                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14134
14135                std::task::Poll::Ready(Some(match header.ordinal {
14136                    0x20d8a7aba2168a79 => {
14137                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14138                        let mut req = fidl::new_empty!(
14139                            fidl_fuchsia_unknown::CloneableCloneRequest,
14140                            fidl::encoding::DefaultFuchsiaResourceDialect
14141                        );
14142                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14143                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14144                        Ok(NodeRequest::Clone { request: req.request, control_handle })
14145                    }
14146                    0x5ac5d459ad7f657e => {
14147                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14148                        let mut req = fidl::new_empty!(
14149                            fidl::encoding::EmptyPayload,
14150                            fidl::encoding::DefaultFuchsiaResourceDialect
14151                        );
14152                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14153                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14154                        Ok(NodeRequest::Close {
14155                            responder: NodeCloseResponder {
14156                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14157                                tx_id: header.tx_id,
14158                            },
14159                        })
14160                    }
14161                    0x2658edee9decfc06 => {
14162                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14163                        let mut req = fidl::new_empty!(
14164                            fidl::encoding::EmptyPayload,
14165                            fidl::encoding::DefaultFuchsiaResourceDialect
14166                        );
14167                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14168                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14169                        Ok(NodeRequest::Query {
14170                            responder: NodeQueryResponder {
14171                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14172                                tx_id: header.tx_id,
14173                            },
14174                        })
14175                    }
14176                    0x5a61678f293ce16f => {
14177                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14178                        let mut req = fidl::new_empty!(
14179                            NodeDeprecatedCloneRequest,
14180                            fidl::encoding::DefaultFuchsiaResourceDialect
14181                        );
14182                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14183                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14184                        Ok(NodeRequest::DeprecatedClone {
14185                            flags: req.flags,
14186                            object: req.object,
14187
14188                            control_handle,
14189                        })
14190                    }
14191                    0x78985e216314dafd => {
14192                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14193                        let mut req = fidl::new_empty!(
14194                            fidl::encoding::EmptyPayload,
14195                            fidl::encoding::DefaultFuchsiaResourceDialect
14196                        );
14197                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14198                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14199                        Ok(NodeRequest::DeprecatedGetAttr {
14200                            responder: NodeDeprecatedGetAttrResponder {
14201                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14202                                tx_id: header.tx_id,
14203                            },
14204                        })
14205                    }
14206                    0x4186c0f40d938f46 => {
14207                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14208                        let mut req = fidl::new_empty!(
14209                            NodeDeprecatedSetAttrRequest,
14210                            fidl::encoding::DefaultFuchsiaResourceDialect
14211                        );
14212                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
14213                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14214                        Ok(NodeRequest::DeprecatedSetAttr {
14215                            flags: req.flags,
14216                            attributes: req.attributes,
14217
14218                            responder: NodeDeprecatedSetAttrResponder {
14219                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14220                                tx_id: header.tx_id,
14221                            },
14222                        })
14223                    }
14224                    0x5b88fffb8eda3aa1 => {
14225                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14226                        let mut req = fidl::new_empty!(
14227                            fidl::encoding::EmptyPayload,
14228                            fidl::encoding::DefaultFuchsiaResourceDialect
14229                        );
14230                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14231                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14232                        Ok(NodeRequest::DeprecatedGetFlags {
14233                            responder: NodeDeprecatedGetFlagsResponder {
14234                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14235                                tx_id: header.tx_id,
14236                            },
14237                        })
14238                    }
14239                    0x5295b76c71fde733 => {
14240                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14241                        let mut req = fidl::new_empty!(
14242                            NodeDeprecatedSetFlagsRequest,
14243                            fidl::encoding::DefaultFuchsiaResourceDialect
14244                        );
14245                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14246                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14247                        Ok(NodeRequest::DeprecatedSetFlags {
14248                            flags: req.flags,
14249
14250                            responder: NodeDeprecatedSetFlagsResponder {
14251                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14252                                tx_id: header.tx_id,
14253                            },
14254                        })
14255                    }
14256                    0x176eb318f64ec23 => {
14257                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14258                        let mut req = fidl::new_empty!(
14259                            fidl::encoding::EmptyPayload,
14260                            fidl::encoding::DefaultFuchsiaResourceDialect
14261                        );
14262                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14263                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14264                        Ok(NodeRequest::GetFlags {
14265                            responder: NodeGetFlagsResponder {
14266                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14267                                tx_id: header.tx_id,
14268                            },
14269                        })
14270                    }
14271                    0x55a8028685791ea8 => {
14272                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14273                        let mut req = fidl::new_empty!(
14274                            NodeSetFlagsRequest,
14275                            fidl::encoding::DefaultFuchsiaResourceDialect
14276                        );
14277                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14278                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14279                        Ok(NodeRequest::SetFlags {
14280                            flags: req.flags,
14281
14282                            responder: NodeSetFlagsResponder {
14283                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14284                                tx_id: header.tx_id,
14285                            },
14286                        })
14287                    }
14288                    0x6f344a1c6b0a0610 => {
14289                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14290                        let mut req = fidl::new_empty!(
14291                            fidl::encoding::EmptyPayload,
14292                            fidl::encoding::DefaultFuchsiaResourceDialect
14293                        );
14294                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14295                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14296                        Ok(NodeRequest::QueryFilesystem {
14297                            responder: NodeQueryFilesystemResponder {
14298                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14299                                tx_id: header.tx_id,
14300                            },
14301                        })
14302                    }
14303                    0x3d4396a638ea053b => {
14304                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14305                        let mut req = fidl::new_empty!(
14306                            NodeGetAttributesRequest,
14307                            fidl::encoding::DefaultFuchsiaResourceDialect
14308                        );
14309                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14310                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14311                        Ok(NodeRequest::GetAttributes {
14312                            query: req.query,
14313
14314                            responder: NodeGetAttributesResponder {
14315                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14316                                tx_id: header.tx_id,
14317                            },
14318                        })
14319                    }
14320                    0x3308c1da5a89bf08 => {
14321                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14322                        let mut req = fidl::new_empty!(
14323                            MutableNodeAttributes,
14324                            fidl::encoding::DefaultFuchsiaResourceDialect
14325                        );
14326                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
14327                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14328                        Ok(NodeRequest::UpdateAttributes {
14329                            payload: req,
14330                            responder: NodeUpdateAttributesResponder {
14331                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14332                                tx_id: header.tx_id,
14333                            },
14334                        })
14335                    }
14336                    0x2c5c27ca0ab5dc49 => {
14337                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14338                        let mut req = fidl::new_empty!(
14339                            fidl::encoding::EmptyPayload,
14340                            fidl::encoding::DefaultFuchsiaResourceDialect
14341                        );
14342                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14343                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14344                        Ok(NodeRequest::Sync {
14345                            responder: NodeSyncResponder {
14346                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14347                                tx_id: header.tx_id,
14348                            },
14349                        })
14350                    }
14351                    0x4b61033de007fcd0 => {
14352                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14353                        let mut req = fidl::new_empty!(
14354                            NodeListExtendedAttributesRequest,
14355                            fidl::encoding::DefaultFuchsiaResourceDialect
14356                        );
14357                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14358                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14359                        Ok(NodeRequest::ListExtendedAttributes {
14360                            iterator: req.iterator,
14361
14362                            control_handle,
14363                        })
14364                    }
14365                    0x45ffa3ccfdeb76db => {
14366                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14367                        let mut req = fidl::new_empty!(
14368                            NodeGetExtendedAttributeRequest,
14369                            fidl::encoding::DefaultFuchsiaResourceDialect
14370                        );
14371                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14372                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14373                        Ok(NodeRequest::GetExtendedAttribute {
14374                            name: req.name,
14375
14376                            responder: NodeGetExtendedAttributeResponder {
14377                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14378                                tx_id: header.tx_id,
14379                            },
14380                        })
14381                    }
14382                    0x4a951362f681f23c => {
14383                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14384                        let mut req = fidl::new_empty!(
14385                            NodeSetExtendedAttributeRequest,
14386                            fidl::encoding::DefaultFuchsiaResourceDialect
14387                        );
14388                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14389                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14390                        Ok(NodeRequest::SetExtendedAttribute {
14391                            name: req.name,
14392                            value: req.value,
14393                            mode: req.mode,
14394
14395                            responder: NodeSetExtendedAttributeResponder {
14396                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14397                                tx_id: header.tx_id,
14398                            },
14399                        })
14400                    }
14401                    0x7a0b9f3a9bf9032d => {
14402                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14403                        let mut req = fidl::new_empty!(
14404                            NodeRemoveExtendedAttributeRequest,
14405                            fidl::encoding::DefaultFuchsiaResourceDialect
14406                        );
14407                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14408                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14409                        Ok(NodeRequest::RemoveExtendedAttribute {
14410                            name: req.name,
14411
14412                            responder: NodeRemoveExtendedAttributeResponder {
14413                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14414                                tx_id: header.tx_id,
14415                            },
14416                        })
14417                    }
14418                    _ if header.tx_id == 0
14419                        && header
14420                            .dynamic_flags()
14421                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14422                    {
14423                        Ok(NodeRequest::_UnknownMethod {
14424                            ordinal: header.ordinal,
14425                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14426                            method_type: fidl::MethodType::OneWay,
14427                        })
14428                    }
14429                    _ if header
14430                        .dynamic_flags()
14431                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14432                    {
14433                        this.inner.send_framework_err(
14434                            fidl::encoding::FrameworkErr::UnknownMethod,
14435                            header.tx_id,
14436                            header.ordinal,
14437                            header.dynamic_flags(),
14438                            (bytes, handles),
14439                        )?;
14440                        Ok(NodeRequest::_UnknownMethod {
14441                            ordinal: header.ordinal,
14442                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14443                            method_type: fidl::MethodType::TwoWay,
14444                        })
14445                    }
14446                    _ => Err(fidl::Error::UnknownOrdinal {
14447                        ordinal: header.ordinal,
14448                        protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14449                    }),
14450                }))
14451            },
14452        )
14453    }
14454}
14455
14456/// Node defines the minimal interface for entities which can be accessed in a filesystem.
14457#[derive(Debug)]
14458pub enum NodeRequest {
14459    Clone {
14460        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
14461        control_handle: NodeControlHandle,
14462    },
14463    /// Terminates the connection.
14464    ///
14465    /// After calling `Close`, the client must not send any other requests.
14466    ///
14467    /// Servers, after sending the status response, should close the connection
14468    /// regardless of status and without sending an epitaph.
14469    ///
14470    /// Closing the client end of the channel should be semantically equivalent
14471    /// to calling `Close` without knowing when the close has completed or its
14472    /// status.
14473    Close {
14474        responder: NodeCloseResponder,
14475    },
14476    Query {
14477        responder: NodeQueryResponder,
14478    },
14479    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
14480    DeprecatedClone {
14481        flags: OpenFlags,
14482        object: fidl::endpoints::ServerEnd<NodeMarker>,
14483        control_handle: NodeControlHandle,
14484    },
14485    /// DEPRECATED - Use `Node.GetAttributes` instead.
14486    DeprecatedGetAttr {
14487        responder: NodeDeprecatedGetAttrResponder,
14488    },
14489    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
14490    DeprecatedSetAttr {
14491        flags: NodeAttributeFlags,
14492        attributes: NodeAttributes,
14493        responder: NodeDeprecatedSetAttrResponder,
14494    },
14495    /// [DEPRECATED - Use new GetFlags method instead.]
14496    DeprecatedGetFlags {
14497        responder: NodeDeprecatedGetFlagsResponder,
14498    },
14499    /// [DEPRECATED - Use new SetFlags method instead.]
14500    DeprecatedSetFlags {
14501        flags: OpenFlags,
14502        responder: NodeDeprecatedSetFlagsResponder,
14503    },
14504    /// Queries the flags that apply to this node after it has been opened/created. This method does
14505    /// not require any rights.
14506    ///
14507    /// Note that the final set of flags that apply to the connection may differ from those
14508    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
14509    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
14510    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
14511    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
14512    GetFlags {
14513        responder: NodeGetFlagsResponder,
14514    },
14515    /// Sets the flags that apply to this node after it has been opened. This method does not
14516    /// require any rights.
14517    ///
14518    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
14519    /// clear append mode.
14520    ///
14521    /// Errors:
14522    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
14523    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
14524    SetFlags {
14525        flags: Flags,
14526        responder: NodeSetFlagsResponder,
14527    },
14528    /// Query the filesystem for filesystem-specific information.
14529    QueryFilesystem {
14530        responder: NodeQueryFilesystemResponder,
14531    },
14532    /// Acquires information about the node.
14533    ///
14534    /// The attributes of a node should be stable, independent of the
14535    /// specific protocol used to access it.
14536    ///
14537    /// If a particular attribute is not applicable or not supported,
14538    /// filesystems should leave the corresponding field absent.
14539    ///
14540    /// + `query` a bit-mask specifying which attributes to fetch. The server
14541    ///   should not return more than necessary.
14542    /// - `attributes` the returned attributes.
14543    ///
14544    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14545    GetAttributes {
14546        query: NodeAttributesQuery,
14547        responder: NodeGetAttributesResponder,
14548    },
14549    /// Updates information about the node.
14550    ///
14551    /// + `attributes` the presence of a table field in `attributes` indicates
14552    /// the intent to update the corresponding attribute.
14553    ///
14554    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
14555    ///
14556    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14557    UpdateAttributes {
14558        payload: MutableNodeAttributes,
14559        responder: NodeUpdateAttributesResponder,
14560    },
14561    /// Synchronizes updates to the node to the underlying media, if it exists.
14562    ///
14563    /// This method will return when the filesystem server has flushed the
14564    /// relevant updates to the underlying media, but does not guarantee the
14565    /// underlying media has persisted the information, nor that any information
14566    /// is committed to hardware. Clients may use `Sync` to ensure ordering
14567    /// between operations.
14568    ///
14569    /// This method does not require any rights.
14570    Sync {
14571        responder: NodeSyncResponder,
14572    },
14573    /// Creates an iterator over all the extended attribute names associated
14574    /// with this node. If an error occurs it is returned as an epitaph on the
14575    /// iterator request channel, and then the channel is closed.
14576    ///
14577    /// GetExtendedAttributes can be used with any of these names to retrieve
14578    /// the associated value.
14579    ///
14580    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14581    ListExtendedAttributes {
14582        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
14583        control_handle: NodeControlHandle,
14584    },
14585    /// Get the value associated with the given attribute `name` for this node.
14586    ///
14587    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
14588    /// particular structure is imposed on them.
14589    ///
14590    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14591    GetExtendedAttribute {
14592        name: Vec<u8>,
14593        responder: NodeGetExtendedAttributeResponder,
14594    },
14595    /// Set the value for the given attribute `name` to `value` for this node.
14596    ///
14597    /// The attribute name may exist, in which case the attribute is updated.
14598    /// If the attribute doesn't exist, it is created. The name should have no
14599    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
14600    ///
14601    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14602    SetExtendedAttribute {
14603        name: Vec<u8>,
14604        value: ExtendedAttributeValue,
14605        mode: SetExtendedAttributeMode,
14606        responder: NodeSetExtendedAttributeResponder,
14607    },
14608    /// Remove the specified extended attribute.
14609    ///
14610    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
14611    ///
14612    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14613    RemoveExtendedAttribute {
14614        name: Vec<u8>,
14615        responder: NodeRemoveExtendedAttributeResponder,
14616    },
14617    /// An interaction was received which does not match any known method.
14618    #[non_exhaustive]
14619    _UnknownMethod {
14620        /// Ordinal of the method that was called.
14621        ordinal: u64,
14622        control_handle: NodeControlHandle,
14623        method_type: fidl::MethodType,
14624    },
14625}
14626
14627impl NodeRequest {
14628    #[allow(irrefutable_let_patterns)]
14629    pub fn into_clone(
14630        self,
14631    ) -> Option<(
14632        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
14633        NodeControlHandle,
14634    )> {
14635        if let NodeRequest::Clone { request, control_handle } = self {
14636            Some((request, control_handle))
14637        } else {
14638            None
14639        }
14640    }
14641
14642    #[allow(irrefutable_let_patterns)]
14643    pub fn into_close(self) -> Option<(NodeCloseResponder)> {
14644        if let NodeRequest::Close { responder } = self { Some((responder)) } else { None }
14645    }
14646
14647    #[allow(irrefutable_let_patterns)]
14648    pub fn into_query(self) -> Option<(NodeQueryResponder)> {
14649        if let NodeRequest::Query { responder } = self { Some((responder)) } else { None }
14650    }
14651
14652    #[allow(irrefutable_let_patterns)]
14653    pub fn into_deprecated_clone(
14654        self,
14655    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, NodeControlHandle)> {
14656        if let NodeRequest::DeprecatedClone { flags, object, control_handle } = self {
14657            Some((flags, object, control_handle))
14658        } else {
14659            None
14660        }
14661    }
14662
14663    #[allow(irrefutable_let_patterns)]
14664    pub fn into_deprecated_get_attr(self) -> Option<(NodeDeprecatedGetAttrResponder)> {
14665        if let NodeRequest::DeprecatedGetAttr { responder } = self {
14666            Some((responder))
14667        } else {
14668            None
14669        }
14670    }
14671
14672    #[allow(irrefutable_let_patterns)]
14673    pub fn into_deprecated_set_attr(
14674        self,
14675    ) -> Option<(NodeAttributeFlags, NodeAttributes, NodeDeprecatedSetAttrResponder)> {
14676        if let NodeRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
14677            Some((flags, attributes, responder))
14678        } else {
14679            None
14680        }
14681    }
14682
14683    #[allow(irrefutable_let_patterns)]
14684    pub fn into_deprecated_get_flags(self) -> Option<(NodeDeprecatedGetFlagsResponder)> {
14685        if let NodeRequest::DeprecatedGetFlags { responder } = self {
14686            Some((responder))
14687        } else {
14688            None
14689        }
14690    }
14691
14692    #[allow(irrefutable_let_patterns)]
14693    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, NodeDeprecatedSetFlagsResponder)> {
14694        if let NodeRequest::DeprecatedSetFlags { flags, responder } = self {
14695            Some((flags, responder))
14696        } else {
14697            None
14698        }
14699    }
14700
14701    #[allow(irrefutable_let_patterns)]
14702    pub fn into_get_flags(self) -> Option<(NodeGetFlagsResponder)> {
14703        if let NodeRequest::GetFlags { responder } = self { Some((responder)) } else { None }
14704    }
14705
14706    #[allow(irrefutable_let_patterns)]
14707    pub fn into_set_flags(self) -> Option<(Flags, NodeSetFlagsResponder)> {
14708        if let NodeRequest::SetFlags { flags, responder } = self {
14709            Some((flags, responder))
14710        } else {
14711            None
14712        }
14713    }
14714
14715    #[allow(irrefutable_let_patterns)]
14716    pub fn into_query_filesystem(self) -> Option<(NodeQueryFilesystemResponder)> {
14717        if let NodeRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
14718    }
14719
14720    #[allow(irrefutable_let_patterns)]
14721    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, NodeGetAttributesResponder)> {
14722        if let NodeRequest::GetAttributes { query, responder } = self {
14723            Some((query, responder))
14724        } else {
14725            None
14726        }
14727    }
14728
14729    #[allow(irrefutable_let_patterns)]
14730    pub fn into_update_attributes(
14731        self,
14732    ) -> Option<(MutableNodeAttributes, NodeUpdateAttributesResponder)> {
14733        if let NodeRequest::UpdateAttributes { payload, responder } = self {
14734            Some((payload, responder))
14735        } else {
14736            None
14737        }
14738    }
14739
14740    #[allow(irrefutable_let_patterns)]
14741    pub fn into_sync(self) -> Option<(NodeSyncResponder)> {
14742        if let NodeRequest::Sync { responder } = self { Some((responder)) } else { None }
14743    }
14744
14745    #[allow(irrefutable_let_patterns)]
14746    pub fn into_list_extended_attributes(
14747        self,
14748    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, NodeControlHandle)>
14749    {
14750        if let NodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
14751            Some((iterator, control_handle))
14752        } else {
14753            None
14754        }
14755    }
14756
14757    #[allow(irrefutable_let_patterns)]
14758    pub fn into_get_extended_attribute(
14759        self,
14760    ) -> Option<(Vec<u8>, NodeGetExtendedAttributeResponder)> {
14761        if let NodeRequest::GetExtendedAttribute { name, responder } = self {
14762            Some((name, responder))
14763        } else {
14764            None
14765        }
14766    }
14767
14768    #[allow(irrefutable_let_patterns)]
14769    pub fn into_set_extended_attribute(
14770        self,
14771    ) -> Option<(
14772        Vec<u8>,
14773        ExtendedAttributeValue,
14774        SetExtendedAttributeMode,
14775        NodeSetExtendedAttributeResponder,
14776    )> {
14777        if let NodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
14778            Some((name, value, mode, responder))
14779        } else {
14780            None
14781        }
14782    }
14783
14784    #[allow(irrefutable_let_patterns)]
14785    pub fn into_remove_extended_attribute(
14786        self,
14787    ) -> Option<(Vec<u8>, NodeRemoveExtendedAttributeResponder)> {
14788        if let NodeRequest::RemoveExtendedAttribute { name, responder } = self {
14789            Some((name, responder))
14790        } else {
14791            None
14792        }
14793    }
14794
14795    /// Name of the method defined in FIDL
14796    pub fn method_name(&self) -> &'static str {
14797        match *self {
14798            NodeRequest::Clone { .. } => "clone",
14799            NodeRequest::Close { .. } => "close",
14800            NodeRequest::Query { .. } => "query",
14801            NodeRequest::DeprecatedClone { .. } => "deprecated_clone",
14802            NodeRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
14803            NodeRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
14804            NodeRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
14805            NodeRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
14806            NodeRequest::GetFlags { .. } => "get_flags",
14807            NodeRequest::SetFlags { .. } => "set_flags",
14808            NodeRequest::QueryFilesystem { .. } => "query_filesystem",
14809            NodeRequest::GetAttributes { .. } => "get_attributes",
14810            NodeRequest::UpdateAttributes { .. } => "update_attributes",
14811            NodeRequest::Sync { .. } => "sync",
14812            NodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
14813            NodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
14814            NodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
14815            NodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
14816            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
14817                "unknown one-way method"
14818            }
14819            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
14820                "unknown two-way method"
14821            }
14822        }
14823    }
14824}
14825
14826#[derive(Debug, Clone)]
14827pub struct NodeControlHandle {
14828    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14829}
14830
14831impl fidl::endpoints::ControlHandle for NodeControlHandle {
14832    fn shutdown(&self) {
14833        self.inner.shutdown()
14834    }
14835    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
14836        self.inner.shutdown_with_epitaph(status)
14837    }
14838
14839    fn is_closed(&self) -> bool {
14840        self.inner.channel().is_closed()
14841    }
14842    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
14843        self.inner.channel().on_closed()
14844    }
14845
14846    #[cfg(target_os = "fuchsia")]
14847    fn signal_peer(
14848        &self,
14849        clear_mask: zx::Signals,
14850        set_mask: zx::Signals,
14851    ) -> Result<(), zx_status::Status> {
14852        use fidl::Peered;
14853        self.inner.channel().signal_peer(clear_mask, set_mask)
14854    }
14855}
14856
14857impl NodeControlHandle {
14858    pub fn send_on_open_(
14859        &self,
14860        mut s: i32,
14861        mut info: Option<NodeInfoDeprecated>,
14862    ) -> Result<(), fidl::Error> {
14863        self.inner.send::<NodeOnOpenRequest>(
14864            (s, info.as_mut()),
14865            0,
14866            0x7fc7bbb1dbfd1972,
14867            fidl::encoding::DynamicFlags::FLEXIBLE,
14868        )
14869    }
14870
14871    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
14872        self.inner.send::<Representation>(
14873            &mut payload,
14874            0,
14875            0x5cb40567d80a510c,
14876            fidl::encoding::DynamicFlags::empty(),
14877        )
14878    }
14879}
14880
14881#[must_use = "FIDL methods require a response to be sent"]
14882#[derive(Debug)]
14883pub struct NodeCloseResponder {
14884    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
14885    tx_id: u32,
14886}
14887
14888/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
14889/// if the responder is dropped without sending a response, so that the client
14890/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
14891impl std::ops::Drop for NodeCloseResponder {
14892    fn drop(&mut self) {
14893        self.control_handle.shutdown();
14894        // Safety: drops once, never accessed again
14895        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14896    }
14897}
14898
14899impl fidl::endpoints::Responder for NodeCloseResponder {
14900    type ControlHandle = NodeControlHandle;
14901
14902    fn control_handle(&self) -> &NodeControlHandle {
14903        &self.control_handle
14904    }
14905
14906    fn drop_without_shutdown(mut self) {
14907        // Safety: drops once, never accessed again due to mem::forget
14908        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14909        // Prevent Drop from running (which would shut down the channel)
14910        std::mem::forget(self);
14911    }
14912}
14913
14914impl NodeCloseResponder {
14915    /// Sends a response to the FIDL transaction.
14916    ///
14917    /// Sets the channel to shutdown if an error occurs.
14918    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
14919        let _result = self.send_raw(result);
14920        if _result.is_err() {
14921            self.control_handle.shutdown();
14922        }
14923        self.drop_without_shutdown();
14924        _result
14925    }
14926
14927    /// Similar to "send" but does not shutdown the channel if an error occurs.
14928    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
14929        let _result = self.send_raw(result);
14930        self.drop_without_shutdown();
14931        _result
14932    }
14933
14934    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
14935        self.control_handle
14936            .inner
14937            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
14938                result,
14939                self.tx_id,
14940                0x5ac5d459ad7f657e,
14941                fidl::encoding::DynamicFlags::empty(),
14942            )
14943    }
14944}
14945
14946#[must_use = "FIDL methods require a response to be sent"]
14947#[derive(Debug)]
14948pub struct NodeQueryResponder {
14949    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
14950    tx_id: u32,
14951}
14952
14953/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
14954/// if the responder is dropped without sending a response, so that the client
14955/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
14956impl std::ops::Drop for NodeQueryResponder {
14957    fn drop(&mut self) {
14958        self.control_handle.shutdown();
14959        // Safety: drops once, never accessed again
14960        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14961    }
14962}
14963
14964impl fidl::endpoints::Responder for NodeQueryResponder {
14965    type ControlHandle = NodeControlHandle;
14966
14967    fn control_handle(&self) -> &NodeControlHandle {
14968        &self.control_handle
14969    }
14970
14971    fn drop_without_shutdown(mut self) {
14972        // Safety: drops once, never accessed again due to mem::forget
14973        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14974        // Prevent Drop from running (which would shut down the channel)
14975        std::mem::forget(self);
14976    }
14977}
14978
14979impl NodeQueryResponder {
14980    /// Sends a response to the FIDL transaction.
14981    ///
14982    /// Sets the channel to shutdown if an error occurs.
14983    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
14984        let _result = self.send_raw(protocol);
14985        if _result.is_err() {
14986            self.control_handle.shutdown();
14987        }
14988        self.drop_without_shutdown();
14989        _result
14990    }
14991
14992    /// Similar to "send" but does not shutdown the channel if an error occurs.
14993    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
14994        let _result = self.send_raw(protocol);
14995        self.drop_without_shutdown();
14996        _result
14997    }
14998
14999    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15000        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
15001            (protocol,),
15002            self.tx_id,
15003            0x2658edee9decfc06,
15004            fidl::encoding::DynamicFlags::empty(),
15005        )
15006    }
15007}
15008
15009#[must_use = "FIDL methods require a response to be sent"]
15010#[derive(Debug)]
15011pub struct NodeDeprecatedGetAttrResponder {
15012    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15013    tx_id: u32,
15014}
15015
15016/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15017/// if the responder is dropped without sending a response, so that the client
15018/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15019impl std::ops::Drop for NodeDeprecatedGetAttrResponder {
15020    fn drop(&mut self) {
15021        self.control_handle.shutdown();
15022        // Safety: drops once, never accessed again
15023        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15024    }
15025}
15026
15027impl fidl::endpoints::Responder for NodeDeprecatedGetAttrResponder {
15028    type ControlHandle = NodeControlHandle;
15029
15030    fn control_handle(&self) -> &NodeControlHandle {
15031        &self.control_handle
15032    }
15033
15034    fn drop_without_shutdown(mut self) {
15035        // Safety: drops once, never accessed again due to mem::forget
15036        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15037        // Prevent Drop from running (which would shut down the channel)
15038        std::mem::forget(self);
15039    }
15040}
15041
15042impl NodeDeprecatedGetAttrResponder {
15043    /// Sends a response to the FIDL transaction.
15044    ///
15045    /// Sets the channel to shutdown if an error occurs.
15046    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15047        let _result = self.send_raw(s, attributes);
15048        if _result.is_err() {
15049            self.control_handle.shutdown();
15050        }
15051        self.drop_without_shutdown();
15052        _result
15053    }
15054
15055    /// Similar to "send" but does not shutdown the channel if an error occurs.
15056    pub fn send_no_shutdown_on_err(
15057        self,
15058        mut s: i32,
15059        mut attributes: &NodeAttributes,
15060    ) -> Result<(), fidl::Error> {
15061        let _result = self.send_raw(s, attributes);
15062        self.drop_without_shutdown();
15063        _result
15064    }
15065
15066    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15067        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
15068            (s, attributes),
15069            self.tx_id,
15070            0x78985e216314dafd,
15071            fidl::encoding::DynamicFlags::empty(),
15072        )
15073    }
15074}
15075
15076#[must_use = "FIDL methods require a response to be sent"]
15077#[derive(Debug)]
15078pub struct NodeDeprecatedSetAttrResponder {
15079    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15080    tx_id: u32,
15081}
15082
15083/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15084/// if the responder is dropped without sending a response, so that the client
15085/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15086impl std::ops::Drop for NodeDeprecatedSetAttrResponder {
15087    fn drop(&mut self) {
15088        self.control_handle.shutdown();
15089        // Safety: drops once, never accessed again
15090        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15091    }
15092}
15093
15094impl fidl::endpoints::Responder for NodeDeprecatedSetAttrResponder {
15095    type ControlHandle = NodeControlHandle;
15096
15097    fn control_handle(&self) -> &NodeControlHandle {
15098        &self.control_handle
15099    }
15100
15101    fn drop_without_shutdown(mut self) {
15102        // Safety: drops once, never accessed again due to mem::forget
15103        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15104        // Prevent Drop from running (which would shut down the channel)
15105        std::mem::forget(self);
15106    }
15107}
15108
15109impl NodeDeprecatedSetAttrResponder {
15110    /// Sends a response to the FIDL transaction.
15111    ///
15112    /// Sets the channel to shutdown if an error occurs.
15113    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15114        let _result = self.send_raw(s);
15115        if _result.is_err() {
15116            self.control_handle.shutdown();
15117        }
15118        self.drop_without_shutdown();
15119        _result
15120    }
15121
15122    /// Similar to "send" but does not shutdown the channel if an error occurs.
15123    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15124        let _result = self.send_raw(s);
15125        self.drop_without_shutdown();
15126        _result
15127    }
15128
15129    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15130        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
15131            (s,),
15132            self.tx_id,
15133            0x4186c0f40d938f46,
15134            fidl::encoding::DynamicFlags::empty(),
15135        )
15136    }
15137}
15138
15139#[must_use = "FIDL methods require a response to be sent"]
15140#[derive(Debug)]
15141pub struct NodeDeprecatedGetFlagsResponder {
15142    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15143    tx_id: u32,
15144}
15145
15146/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15147/// if the responder is dropped without sending a response, so that the client
15148/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15149impl std::ops::Drop for NodeDeprecatedGetFlagsResponder {
15150    fn drop(&mut self) {
15151        self.control_handle.shutdown();
15152        // Safety: drops once, never accessed again
15153        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15154    }
15155}
15156
15157impl fidl::endpoints::Responder for NodeDeprecatedGetFlagsResponder {
15158    type ControlHandle = NodeControlHandle;
15159
15160    fn control_handle(&self) -> &NodeControlHandle {
15161        &self.control_handle
15162    }
15163
15164    fn drop_without_shutdown(mut self) {
15165        // Safety: drops once, never accessed again due to mem::forget
15166        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15167        // Prevent Drop from running (which would shut down the channel)
15168        std::mem::forget(self);
15169    }
15170}
15171
15172impl NodeDeprecatedGetFlagsResponder {
15173    /// Sends a response to the FIDL transaction.
15174    ///
15175    /// Sets the channel to shutdown if an error occurs.
15176    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15177        let _result = self.send_raw(s, flags);
15178        if _result.is_err() {
15179            self.control_handle.shutdown();
15180        }
15181        self.drop_without_shutdown();
15182        _result
15183    }
15184
15185    /// Similar to "send" but does not shutdown the channel if an error occurs.
15186    pub fn send_no_shutdown_on_err(
15187        self,
15188        mut s: i32,
15189        mut flags: OpenFlags,
15190    ) -> Result<(), fidl::Error> {
15191        let _result = self.send_raw(s, flags);
15192        self.drop_without_shutdown();
15193        _result
15194    }
15195
15196    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15197        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
15198            (s, flags),
15199            self.tx_id,
15200            0x5b88fffb8eda3aa1,
15201            fidl::encoding::DynamicFlags::empty(),
15202        )
15203    }
15204}
15205
15206#[must_use = "FIDL methods require a response to be sent"]
15207#[derive(Debug)]
15208pub struct NodeDeprecatedSetFlagsResponder {
15209    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15210    tx_id: u32,
15211}
15212
15213/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15214/// if the responder is dropped without sending a response, so that the client
15215/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15216impl std::ops::Drop for NodeDeprecatedSetFlagsResponder {
15217    fn drop(&mut self) {
15218        self.control_handle.shutdown();
15219        // Safety: drops once, never accessed again
15220        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15221    }
15222}
15223
15224impl fidl::endpoints::Responder for NodeDeprecatedSetFlagsResponder {
15225    type ControlHandle = NodeControlHandle;
15226
15227    fn control_handle(&self) -> &NodeControlHandle {
15228        &self.control_handle
15229    }
15230
15231    fn drop_without_shutdown(mut self) {
15232        // Safety: drops once, never accessed again due to mem::forget
15233        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15234        // Prevent Drop from running (which would shut down the channel)
15235        std::mem::forget(self);
15236    }
15237}
15238
15239impl NodeDeprecatedSetFlagsResponder {
15240    /// Sends a response to the FIDL transaction.
15241    ///
15242    /// Sets the channel to shutdown if an error occurs.
15243    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15244        let _result = self.send_raw(s);
15245        if _result.is_err() {
15246            self.control_handle.shutdown();
15247        }
15248        self.drop_without_shutdown();
15249        _result
15250    }
15251
15252    /// Similar to "send" but does not shutdown the channel if an error occurs.
15253    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15254        let _result = self.send_raw(s);
15255        self.drop_without_shutdown();
15256        _result
15257    }
15258
15259    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15260        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
15261            (s,),
15262            self.tx_id,
15263            0x5295b76c71fde733,
15264            fidl::encoding::DynamicFlags::empty(),
15265        )
15266    }
15267}
15268
15269#[must_use = "FIDL methods require a response to be sent"]
15270#[derive(Debug)]
15271pub struct NodeGetFlagsResponder {
15272    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15273    tx_id: u32,
15274}
15275
15276/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15277/// if the responder is dropped without sending a response, so that the client
15278/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15279impl std::ops::Drop for NodeGetFlagsResponder {
15280    fn drop(&mut self) {
15281        self.control_handle.shutdown();
15282        // Safety: drops once, never accessed again
15283        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15284    }
15285}
15286
15287impl fidl::endpoints::Responder for NodeGetFlagsResponder {
15288    type ControlHandle = NodeControlHandle;
15289
15290    fn control_handle(&self) -> &NodeControlHandle {
15291        &self.control_handle
15292    }
15293
15294    fn drop_without_shutdown(mut self) {
15295        // Safety: drops once, never accessed again due to mem::forget
15296        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15297        // Prevent Drop from running (which would shut down the channel)
15298        std::mem::forget(self);
15299    }
15300}
15301
15302impl NodeGetFlagsResponder {
15303    /// Sends a response to the FIDL transaction.
15304    ///
15305    /// Sets the channel to shutdown if an error occurs.
15306    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15307        let _result = self.send_raw(result);
15308        if _result.is_err() {
15309            self.control_handle.shutdown();
15310        }
15311        self.drop_without_shutdown();
15312        _result
15313    }
15314
15315    /// Similar to "send" but does not shutdown the channel if an error occurs.
15316    pub fn send_no_shutdown_on_err(
15317        self,
15318        mut result: Result<Flags, i32>,
15319    ) -> Result<(), fidl::Error> {
15320        let _result = self.send_raw(result);
15321        self.drop_without_shutdown();
15322        _result
15323    }
15324
15325    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15326        self.control_handle
15327            .inner
15328            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
15329                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
15330                self.tx_id,
15331                0x176eb318f64ec23,
15332                fidl::encoding::DynamicFlags::FLEXIBLE,
15333            )
15334    }
15335}
15336
15337#[must_use = "FIDL methods require a response to be sent"]
15338#[derive(Debug)]
15339pub struct NodeSetFlagsResponder {
15340    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15341    tx_id: u32,
15342}
15343
15344/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15345/// if the responder is dropped without sending a response, so that the client
15346/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15347impl std::ops::Drop for NodeSetFlagsResponder {
15348    fn drop(&mut self) {
15349        self.control_handle.shutdown();
15350        // Safety: drops once, never accessed again
15351        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15352    }
15353}
15354
15355impl fidl::endpoints::Responder for NodeSetFlagsResponder {
15356    type ControlHandle = NodeControlHandle;
15357
15358    fn control_handle(&self) -> &NodeControlHandle {
15359        &self.control_handle
15360    }
15361
15362    fn drop_without_shutdown(mut self) {
15363        // Safety: drops once, never accessed again due to mem::forget
15364        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15365        // Prevent Drop from running (which would shut down the channel)
15366        std::mem::forget(self);
15367    }
15368}
15369
15370impl NodeSetFlagsResponder {
15371    /// Sends a response to the FIDL transaction.
15372    ///
15373    /// Sets the channel to shutdown if an error occurs.
15374    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15375        let _result = self.send_raw(result);
15376        if _result.is_err() {
15377            self.control_handle.shutdown();
15378        }
15379        self.drop_without_shutdown();
15380        _result
15381    }
15382
15383    /// Similar to "send" but does not shutdown the channel if an error occurs.
15384    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15385        let _result = self.send_raw(result);
15386        self.drop_without_shutdown();
15387        _result
15388    }
15389
15390    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15391        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
15392            fidl::encoding::EmptyStruct,
15393            i32,
15394        >>(
15395            fidl::encoding::FlexibleResult::new(result),
15396            self.tx_id,
15397            0x55a8028685791ea8,
15398            fidl::encoding::DynamicFlags::FLEXIBLE,
15399        )
15400    }
15401}
15402
15403#[must_use = "FIDL methods require a response to be sent"]
15404#[derive(Debug)]
15405pub struct NodeQueryFilesystemResponder {
15406    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15407    tx_id: u32,
15408}
15409
15410/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15411/// if the responder is dropped without sending a response, so that the client
15412/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15413impl std::ops::Drop for NodeQueryFilesystemResponder {
15414    fn drop(&mut self) {
15415        self.control_handle.shutdown();
15416        // Safety: drops once, never accessed again
15417        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15418    }
15419}
15420
15421impl fidl::endpoints::Responder for NodeQueryFilesystemResponder {
15422    type ControlHandle = NodeControlHandle;
15423
15424    fn control_handle(&self) -> &NodeControlHandle {
15425        &self.control_handle
15426    }
15427
15428    fn drop_without_shutdown(mut self) {
15429        // Safety: drops once, never accessed again due to mem::forget
15430        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15431        // Prevent Drop from running (which would shut down the channel)
15432        std::mem::forget(self);
15433    }
15434}
15435
15436impl NodeQueryFilesystemResponder {
15437    /// Sends a response to the FIDL transaction.
15438    ///
15439    /// Sets the channel to shutdown if an error occurs.
15440    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15441        let _result = self.send_raw(s, info);
15442        if _result.is_err() {
15443            self.control_handle.shutdown();
15444        }
15445        self.drop_without_shutdown();
15446        _result
15447    }
15448
15449    /// Similar to "send" but does not shutdown the channel if an error occurs.
15450    pub fn send_no_shutdown_on_err(
15451        self,
15452        mut s: i32,
15453        mut info: Option<&FilesystemInfo>,
15454    ) -> Result<(), fidl::Error> {
15455        let _result = self.send_raw(s, info);
15456        self.drop_without_shutdown();
15457        _result
15458    }
15459
15460    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15461        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
15462            (s, info),
15463            self.tx_id,
15464            0x6f344a1c6b0a0610,
15465            fidl::encoding::DynamicFlags::empty(),
15466        )
15467    }
15468}
15469
15470#[must_use = "FIDL methods require a response to be sent"]
15471#[derive(Debug)]
15472pub struct NodeGetAttributesResponder {
15473    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15474    tx_id: u32,
15475}
15476
15477/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15478/// if the responder is dropped without sending a response, so that the client
15479/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15480impl std::ops::Drop for NodeGetAttributesResponder {
15481    fn drop(&mut self) {
15482        self.control_handle.shutdown();
15483        // Safety: drops once, never accessed again
15484        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15485    }
15486}
15487
15488impl fidl::endpoints::Responder for NodeGetAttributesResponder {
15489    type ControlHandle = NodeControlHandle;
15490
15491    fn control_handle(&self) -> &NodeControlHandle {
15492        &self.control_handle
15493    }
15494
15495    fn drop_without_shutdown(mut self) {
15496        // Safety: drops once, never accessed again due to mem::forget
15497        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15498        // Prevent Drop from running (which would shut down the channel)
15499        std::mem::forget(self);
15500    }
15501}
15502
15503impl NodeGetAttributesResponder {
15504    /// Sends a response to the FIDL transaction.
15505    ///
15506    /// Sets the channel to shutdown if an error occurs.
15507    pub fn send(
15508        self,
15509        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15510    ) -> Result<(), fidl::Error> {
15511        let _result = self.send_raw(result);
15512        if _result.is_err() {
15513            self.control_handle.shutdown();
15514        }
15515        self.drop_without_shutdown();
15516        _result
15517    }
15518
15519    /// Similar to "send" but does not shutdown the channel if an error occurs.
15520    pub fn send_no_shutdown_on_err(
15521        self,
15522        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15523    ) -> Result<(), fidl::Error> {
15524        let _result = self.send_raw(result);
15525        self.drop_without_shutdown();
15526        _result
15527    }
15528
15529    fn send_raw(
15530        &self,
15531        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15532    ) -> Result<(), fidl::Error> {
15533        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
15534            result,
15535            self.tx_id,
15536            0x3d4396a638ea053b,
15537            fidl::encoding::DynamicFlags::empty(),
15538        )
15539    }
15540}
15541
15542#[must_use = "FIDL methods require a response to be sent"]
15543#[derive(Debug)]
15544pub struct NodeUpdateAttributesResponder {
15545    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15546    tx_id: u32,
15547}
15548
15549/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15550/// if the responder is dropped without sending a response, so that the client
15551/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15552impl std::ops::Drop for NodeUpdateAttributesResponder {
15553    fn drop(&mut self) {
15554        self.control_handle.shutdown();
15555        // Safety: drops once, never accessed again
15556        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15557    }
15558}
15559
15560impl fidl::endpoints::Responder for NodeUpdateAttributesResponder {
15561    type ControlHandle = NodeControlHandle;
15562
15563    fn control_handle(&self) -> &NodeControlHandle {
15564        &self.control_handle
15565    }
15566
15567    fn drop_without_shutdown(mut self) {
15568        // Safety: drops once, never accessed again due to mem::forget
15569        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15570        // Prevent Drop from running (which would shut down the channel)
15571        std::mem::forget(self);
15572    }
15573}
15574
15575impl NodeUpdateAttributesResponder {
15576    /// Sends a response to the FIDL transaction.
15577    ///
15578    /// Sets the channel to shutdown if an error occurs.
15579    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15580        let _result = self.send_raw(result);
15581        if _result.is_err() {
15582            self.control_handle.shutdown();
15583        }
15584        self.drop_without_shutdown();
15585        _result
15586    }
15587
15588    /// Similar to "send" but does not shutdown the channel if an error occurs.
15589    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15590        let _result = self.send_raw(result);
15591        self.drop_without_shutdown();
15592        _result
15593    }
15594
15595    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15596        self.control_handle
15597            .inner
15598            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15599                result,
15600                self.tx_id,
15601                0x3308c1da5a89bf08,
15602                fidl::encoding::DynamicFlags::empty(),
15603            )
15604    }
15605}
15606
15607#[must_use = "FIDL methods require a response to be sent"]
15608#[derive(Debug)]
15609pub struct NodeSyncResponder {
15610    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15611    tx_id: u32,
15612}
15613
15614/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15615/// if the responder is dropped without sending a response, so that the client
15616/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15617impl std::ops::Drop for NodeSyncResponder {
15618    fn drop(&mut self) {
15619        self.control_handle.shutdown();
15620        // Safety: drops once, never accessed again
15621        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15622    }
15623}
15624
15625impl fidl::endpoints::Responder for NodeSyncResponder {
15626    type ControlHandle = NodeControlHandle;
15627
15628    fn control_handle(&self) -> &NodeControlHandle {
15629        &self.control_handle
15630    }
15631
15632    fn drop_without_shutdown(mut self) {
15633        // Safety: drops once, never accessed again due to mem::forget
15634        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15635        // Prevent Drop from running (which would shut down the channel)
15636        std::mem::forget(self);
15637    }
15638}
15639
15640impl NodeSyncResponder {
15641    /// Sends a response to the FIDL transaction.
15642    ///
15643    /// Sets the channel to shutdown if an error occurs.
15644    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15645        let _result = self.send_raw(result);
15646        if _result.is_err() {
15647            self.control_handle.shutdown();
15648        }
15649        self.drop_without_shutdown();
15650        _result
15651    }
15652
15653    /// Similar to "send" but does not shutdown the channel if an error occurs.
15654    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15655        let _result = self.send_raw(result);
15656        self.drop_without_shutdown();
15657        _result
15658    }
15659
15660    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15661        self.control_handle
15662            .inner
15663            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15664                result,
15665                self.tx_id,
15666                0x2c5c27ca0ab5dc49,
15667                fidl::encoding::DynamicFlags::empty(),
15668            )
15669    }
15670}
15671
15672#[must_use = "FIDL methods require a response to be sent"]
15673#[derive(Debug)]
15674pub struct NodeGetExtendedAttributeResponder {
15675    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15676    tx_id: u32,
15677}
15678
15679/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15680/// if the responder is dropped without sending a response, so that the client
15681/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15682impl std::ops::Drop for NodeGetExtendedAttributeResponder {
15683    fn drop(&mut self) {
15684        self.control_handle.shutdown();
15685        // Safety: drops once, never accessed again
15686        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15687    }
15688}
15689
15690impl fidl::endpoints::Responder for NodeGetExtendedAttributeResponder {
15691    type ControlHandle = NodeControlHandle;
15692
15693    fn control_handle(&self) -> &NodeControlHandle {
15694        &self.control_handle
15695    }
15696
15697    fn drop_without_shutdown(mut self) {
15698        // Safety: drops once, never accessed again due to mem::forget
15699        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15700        // Prevent Drop from running (which would shut down the channel)
15701        std::mem::forget(self);
15702    }
15703}
15704
15705impl NodeGetExtendedAttributeResponder {
15706    /// Sends a response to the FIDL transaction.
15707    ///
15708    /// Sets the channel to shutdown if an error occurs.
15709    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
15710        let _result = self.send_raw(result);
15711        if _result.is_err() {
15712            self.control_handle.shutdown();
15713        }
15714        self.drop_without_shutdown();
15715        _result
15716    }
15717
15718    /// Similar to "send" but does not shutdown the channel if an error occurs.
15719    pub fn send_no_shutdown_on_err(
15720        self,
15721        mut result: Result<ExtendedAttributeValue, i32>,
15722    ) -> Result<(), fidl::Error> {
15723        let _result = self.send_raw(result);
15724        self.drop_without_shutdown();
15725        _result
15726    }
15727
15728    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
15729        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
15730            result.as_mut().map_err(|e| *e),
15731            self.tx_id,
15732            0x45ffa3ccfdeb76db,
15733            fidl::encoding::DynamicFlags::empty(),
15734        )
15735    }
15736}
15737
15738#[must_use = "FIDL methods require a response to be sent"]
15739#[derive(Debug)]
15740pub struct NodeSetExtendedAttributeResponder {
15741    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15742    tx_id: u32,
15743}
15744
15745/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15746/// if the responder is dropped without sending a response, so that the client
15747/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15748impl std::ops::Drop for NodeSetExtendedAttributeResponder {
15749    fn drop(&mut self) {
15750        self.control_handle.shutdown();
15751        // Safety: drops once, never accessed again
15752        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15753    }
15754}
15755
15756impl fidl::endpoints::Responder for NodeSetExtendedAttributeResponder {
15757    type ControlHandle = NodeControlHandle;
15758
15759    fn control_handle(&self) -> &NodeControlHandle {
15760        &self.control_handle
15761    }
15762
15763    fn drop_without_shutdown(mut self) {
15764        // Safety: drops once, never accessed again due to mem::forget
15765        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15766        // Prevent Drop from running (which would shut down the channel)
15767        std::mem::forget(self);
15768    }
15769}
15770
15771impl NodeSetExtendedAttributeResponder {
15772    /// Sends a response to the FIDL transaction.
15773    ///
15774    /// Sets the channel to shutdown if an error occurs.
15775    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15776        let _result = self.send_raw(result);
15777        if _result.is_err() {
15778            self.control_handle.shutdown();
15779        }
15780        self.drop_without_shutdown();
15781        _result
15782    }
15783
15784    /// Similar to "send" but does not shutdown the channel if an error occurs.
15785    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15786        let _result = self.send_raw(result);
15787        self.drop_without_shutdown();
15788        _result
15789    }
15790
15791    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15792        self.control_handle
15793            .inner
15794            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15795                result,
15796                self.tx_id,
15797                0x4a951362f681f23c,
15798                fidl::encoding::DynamicFlags::empty(),
15799            )
15800    }
15801}
15802
15803#[must_use = "FIDL methods require a response to be sent"]
15804#[derive(Debug)]
15805pub struct NodeRemoveExtendedAttributeResponder {
15806    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15807    tx_id: u32,
15808}
15809
15810/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15811/// if the responder is dropped without sending a response, so that the client
15812/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15813impl std::ops::Drop for NodeRemoveExtendedAttributeResponder {
15814    fn drop(&mut self) {
15815        self.control_handle.shutdown();
15816        // Safety: drops once, never accessed again
15817        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15818    }
15819}
15820
15821impl fidl::endpoints::Responder for NodeRemoveExtendedAttributeResponder {
15822    type ControlHandle = NodeControlHandle;
15823
15824    fn control_handle(&self) -> &NodeControlHandle {
15825        &self.control_handle
15826    }
15827
15828    fn drop_without_shutdown(mut self) {
15829        // Safety: drops once, never accessed again due to mem::forget
15830        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15831        // Prevent Drop from running (which would shut down the channel)
15832        std::mem::forget(self);
15833    }
15834}
15835
15836impl NodeRemoveExtendedAttributeResponder {
15837    /// Sends a response to the FIDL transaction.
15838    ///
15839    /// Sets the channel to shutdown if an error occurs.
15840    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15841        let _result = self.send_raw(result);
15842        if _result.is_err() {
15843            self.control_handle.shutdown();
15844        }
15845        self.drop_without_shutdown();
15846        _result
15847    }
15848
15849    /// Similar to "send" but does not shutdown the channel if an error occurs.
15850    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15851        let _result = self.send_raw(result);
15852        self.drop_without_shutdown();
15853        _result
15854    }
15855
15856    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15857        self.control_handle
15858            .inner
15859            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15860                result,
15861                self.tx_id,
15862                0x7a0b9f3a9bf9032d,
15863                fidl::encoding::DynamicFlags::empty(),
15864            )
15865    }
15866}
15867
15868#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15869pub struct ReadableMarker;
15870
15871impl fidl::endpoints::ProtocolMarker for ReadableMarker {
15872    type Proxy = ReadableProxy;
15873    type RequestStream = ReadableRequestStream;
15874    #[cfg(target_os = "fuchsia")]
15875    type SynchronousProxy = ReadableSynchronousProxy;
15876
15877    const DEBUG_NAME: &'static str = "(anonymous) Readable";
15878}
15879pub type ReadableReadResult = Result<Vec<u8>, i32>;
15880
15881pub trait ReadableProxyInterface: Send + Sync {
15882    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
15883        + Send;
15884    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
15885}
15886#[derive(Debug)]
15887#[cfg(target_os = "fuchsia")]
15888pub struct ReadableSynchronousProxy {
15889    client: fidl::client::sync::Client,
15890}
15891
15892#[cfg(target_os = "fuchsia")]
15893impl fidl::endpoints::SynchronousProxy for ReadableSynchronousProxy {
15894    type Proxy = ReadableProxy;
15895    type Protocol = ReadableMarker;
15896
15897    fn from_channel(inner: fidl::Channel) -> Self {
15898        Self::new(inner)
15899    }
15900
15901    fn into_channel(self) -> fidl::Channel {
15902        self.client.into_channel()
15903    }
15904
15905    fn as_channel(&self) -> &fidl::Channel {
15906        self.client.as_channel()
15907    }
15908}
15909
15910#[cfg(target_os = "fuchsia")]
15911impl ReadableSynchronousProxy {
15912    pub fn new(channel: fidl::Channel) -> Self {
15913        let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
15914        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
15915    }
15916
15917    pub fn into_channel(self) -> fidl::Channel {
15918        self.client.into_channel()
15919    }
15920
15921    /// Waits until an event arrives and returns it. It is safe for other
15922    /// threads to make concurrent requests while waiting for an event.
15923    pub fn wait_for_event(
15924        &self,
15925        deadline: zx::MonotonicInstant,
15926    ) -> Result<ReadableEvent, fidl::Error> {
15927        ReadableEvent::decode(self.client.wait_for_event(deadline)?)
15928    }
15929
15930    /// Reads up to 'count' bytes at the seek offset.
15931    /// The seek offset is moved forward by the number of bytes read.
15932    ///
15933    /// ## Invariants
15934    ///
15935    /// * The returned `data.length` will never be greater than `count`.
15936    /// * If `data.length` is less than `count`, it means that the seek offset
15937    ///   has reached the end of file as part of this operation.
15938    /// * If `data.length` is zero while `count` is not, it means that the
15939    ///   seek offset is already at or beyond the end of file, and no data could
15940    ///   be read.
15941    /// * If `count` is zero, the server should perform all the checks ensuring
15942    ///   read access without actually read anything, and return an empty
15943    ///   `data` vector.
15944    ///
15945    /// This method requires the [`Rights.READ_BYTES`] right.
15946    ///
15947    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
15948    pub fn r#read(
15949        &self,
15950        mut count: u64,
15951        ___deadline: zx::MonotonicInstant,
15952    ) -> Result<ReadableReadResult, fidl::Error> {
15953        let _response = self.client.send_query::<
15954            ReadableReadRequest,
15955            fidl::encoding::ResultType<ReadableReadResponse, i32>,
15956        >(
15957            (count,),
15958            0x57e419a298c8ede,
15959            fidl::encoding::DynamicFlags::empty(),
15960            ___deadline,
15961        )?;
15962        Ok(_response.map(|x| x.data))
15963    }
15964}
15965
15966#[cfg(target_os = "fuchsia")]
15967impl From<ReadableSynchronousProxy> for zx::Handle {
15968    fn from(value: ReadableSynchronousProxy) -> Self {
15969        value.into_channel().into()
15970    }
15971}
15972
15973#[cfg(target_os = "fuchsia")]
15974impl From<fidl::Channel> for ReadableSynchronousProxy {
15975    fn from(value: fidl::Channel) -> Self {
15976        Self::new(value)
15977    }
15978}
15979
15980#[cfg(target_os = "fuchsia")]
15981impl fidl::endpoints::FromClient for ReadableSynchronousProxy {
15982    type Protocol = ReadableMarker;
15983
15984    fn from_client(value: fidl::endpoints::ClientEnd<ReadableMarker>) -> Self {
15985        Self::new(value.into_channel())
15986    }
15987}
15988
15989#[derive(Debug, Clone)]
15990pub struct ReadableProxy {
15991    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
15992}
15993
15994impl fidl::endpoints::Proxy for ReadableProxy {
15995    type Protocol = ReadableMarker;
15996
15997    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
15998        Self::new(inner)
15999    }
16000
16001    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
16002        self.client.into_channel().map_err(|client| Self { client })
16003    }
16004
16005    fn as_channel(&self) -> &::fidl::AsyncChannel {
16006        self.client.as_channel()
16007    }
16008}
16009
16010impl ReadableProxy {
16011    /// Create a new Proxy for fuchsia.io/Readable.
16012    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
16013        let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16014        Self { client: fidl::client::Client::new(channel, protocol_name) }
16015    }
16016
16017    /// Get a Stream of events from the remote end of the protocol.
16018    ///
16019    /// # Panics
16020    ///
16021    /// Panics if the event stream was already taken.
16022    pub fn take_event_stream(&self) -> ReadableEventStream {
16023        ReadableEventStream { event_receiver: self.client.take_event_receiver() }
16024    }
16025
16026    /// Reads up to 'count' bytes at the seek offset.
16027    /// The seek offset is moved forward by the number of bytes read.
16028    ///
16029    /// ## Invariants
16030    ///
16031    /// * The returned `data.length` will never be greater than `count`.
16032    /// * If `data.length` is less than `count`, it means that the seek offset
16033    ///   has reached the end of file as part of this operation.
16034    /// * If `data.length` is zero while `count` is not, it means that the
16035    ///   seek offset is already at or beyond the end of file, and no data could
16036    ///   be read.
16037    /// * If `count` is zero, the server should perform all the checks ensuring
16038    ///   read access without actually read anything, and return an empty
16039    ///   `data` vector.
16040    ///
16041    /// This method requires the [`Rights.READ_BYTES`] right.
16042    ///
16043    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16044    pub fn r#read(
16045        &self,
16046        mut count: u64,
16047    ) -> fidl::client::QueryResponseFut<
16048        ReadableReadResult,
16049        fidl::encoding::DefaultFuchsiaResourceDialect,
16050    > {
16051        ReadableProxyInterface::r#read(self, count)
16052    }
16053}
16054
16055impl ReadableProxyInterface for ReadableProxy {
16056    type ReadResponseFut = fidl::client::QueryResponseFut<
16057        ReadableReadResult,
16058        fidl::encoding::DefaultFuchsiaResourceDialect,
16059    >;
16060    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
16061        fn _decode(
16062            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
16063        ) -> Result<ReadableReadResult, fidl::Error> {
16064            let _response = fidl::client::decode_transaction_body::<
16065                fidl::encoding::ResultType<ReadableReadResponse, i32>,
16066                fidl::encoding::DefaultFuchsiaResourceDialect,
16067                0x57e419a298c8ede,
16068            >(_buf?)?;
16069            Ok(_response.map(|x| x.data))
16070        }
16071        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
16072            (count,),
16073            0x57e419a298c8ede,
16074            fidl::encoding::DynamicFlags::empty(),
16075            _decode,
16076        )
16077    }
16078}
16079
16080pub struct ReadableEventStream {
16081    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
16082}
16083
16084impl std::marker::Unpin for ReadableEventStream {}
16085
16086impl futures::stream::FusedStream for ReadableEventStream {
16087    fn is_terminated(&self) -> bool {
16088        self.event_receiver.is_terminated()
16089    }
16090}
16091
16092impl futures::Stream for ReadableEventStream {
16093    type Item = Result<ReadableEvent, fidl::Error>;
16094
16095    fn poll_next(
16096        mut self: std::pin::Pin<&mut Self>,
16097        cx: &mut std::task::Context<'_>,
16098    ) -> std::task::Poll<Option<Self::Item>> {
16099        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
16100            &mut self.event_receiver,
16101            cx
16102        )?) {
16103            Some(buf) => std::task::Poll::Ready(Some(ReadableEvent::decode(buf))),
16104            None => std::task::Poll::Ready(None),
16105        }
16106    }
16107}
16108
16109#[derive(Debug)]
16110pub enum ReadableEvent {}
16111
16112impl ReadableEvent {
16113    /// Decodes a message buffer as a [`ReadableEvent`].
16114    fn decode(
16115        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
16116    ) -> Result<ReadableEvent, fidl::Error> {
16117        let (bytes, _handles) = buf.split_mut();
16118        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16119        debug_assert_eq!(tx_header.tx_id, 0);
16120        match tx_header.ordinal {
16121            _ => Err(fidl::Error::UnknownOrdinal {
16122                ordinal: tx_header.ordinal,
16123                protocol_name: <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16124            }),
16125        }
16126    }
16127}
16128
16129/// A Stream of incoming requests for fuchsia.io/Readable.
16130pub struct ReadableRequestStream {
16131    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16132    is_terminated: bool,
16133}
16134
16135impl std::marker::Unpin for ReadableRequestStream {}
16136
16137impl futures::stream::FusedStream for ReadableRequestStream {
16138    fn is_terminated(&self) -> bool {
16139        self.is_terminated
16140    }
16141}
16142
16143impl fidl::endpoints::RequestStream for ReadableRequestStream {
16144    type Protocol = ReadableMarker;
16145    type ControlHandle = ReadableControlHandle;
16146
16147    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
16148        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
16149    }
16150
16151    fn control_handle(&self) -> Self::ControlHandle {
16152        ReadableControlHandle { inner: self.inner.clone() }
16153    }
16154
16155    fn into_inner(
16156        self,
16157    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
16158    {
16159        (self.inner, self.is_terminated)
16160    }
16161
16162    fn from_inner(
16163        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16164        is_terminated: bool,
16165    ) -> Self {
16166        Self { inner, is_terminated }
16167    }
16168}
16169
16170impl futures::Stream for ReadableRequestStream {
16171    type Item = Result<ReadableRequest, fidl::Error>;
16172
16173    fn poll_next(
16174        mut self: std::pin::Pin<&mut Self>,
16175        cx: &mut std::task::Context<'_>,
16176    ) -> std::task::Poll<Option<Self::Item>> {
16177        let this = &mut *self;
16178        if this.inner.check_shutdown(cx) {
16179            this.is_terminated = true;
16180            return std::task::Poll::Ready(None);
16181        }
16182        if this.is_terminated {
16183            panic!("polled ReadableRequestStream after completion");
16184        }
16185        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
16186            |bytes, handles| {
16187                match this.inner.channel().read_etc(cx, bytes, handles) {
16188                    std::task::Poll::Ready(Ok(())) => {}
16189                    std::task::Poll::Pending => return std::task::Poll::Pending,
16190                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
16191                        this.is_terminated = true;
16192                        return std::task::Poll::Ready(None);
16193                    }
16194                    std::task::Poll::Ready(Err(e)) => {
16195                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
16196                            e.into(),
16197                        ))));
16198                    }
16199                }
16200
16201                // A message has been received from the channel
16202                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16203
16204                std::task::Poll::Ready(Some(match header.ordinal {
16205                    0x57e419a298c8ede => {
16206                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
16207                        let mut req = fidl::new_empty!(
16208                            ReadableReadRequest,
16209                            fidl::encoding::DefaultFuchsiaResourceDialect
16210                        );
16211                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
16212                        let control_handle = ReadableControlHandle { inner: this.inner.clone() };
16213                        Ok(ReadableRequest::Read {
16214                            count: req.count,
16215
16216                            responder: ReadableReadResponder {
16217                                control_handle: std::mem::ManuallyDrop::new(control_handle),
16218                                tx_id: header.tx_id,
16219                            },
16220                        })
16221                    }
16222                    _ => Err(fidl::Error::UnknownOrdinal {
16223                        ordinal: header.ordinal,
16224                        protocol_name:
16225                            <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16226                    }),
16227                }))
16228            },
16229        )
16230    }
16231}
16232
16233#[derive(Debug)]
16234pub enum ReadableRequest {
16235    /// Reads up to 'count' bytes at the seek offset.
16236    /// The seek offset is moved forward by the number of bytes read.
16237    ///
16238    /// ## Invariants
16239    ///
16240    /// * The returned `data.length` will never be greater than `count`.
16241    /// * If `data.length` is less than `count`, it means that the seek offset
16242    ///   has reached the end of file as part of this operation.
16243    /// * If `data.length` is zero while `count` is not, it means that the
16244    ///   seek offset is already at or beyond the end of file, and no data could
16245    ///   be read.
16246    /// * If `count` is zero, the server should perform all the checks ensuring
16247    ///   read access without actually read anything, and return an empty
16248    ///   `data` vector.
16249    ///
16250    /// This method requires the [`Rights.READ_BYTES`] right.
16251    ///
16252    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16253    Read { count: u64, responder: ReadableReadResponder },
16254}
16255
16256impl ReadableRequest {
16257    #[allow(irrefutable_let_patterns)]
16258    pub fn into_read(self) -> Option<(u64, ReadableReadResponder)> {
16259        if let ReadableRequest::Read { count, responder } = self {
16260            Some((count, responder))
16261        } else {
16262            None
16263        }
16264    }
16265
16266    /// Name of the method defined in FIDL
16267    pub fn method_name(&self) -> &'static str {
16268        match *self {
16269            ReadableRequest::Read { .. } => "read",
16270        }
16271    }
16272}
16273
16274#[derive(Debug, Clone)]
16275pub struct ReadableControlHandle {
16276    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16277}
16278
16279impl fidl::endpoints::ControlHandle for ReadableControlHandle {
16280    fn shutdown(&self) {
16281        self.inner.shutdown()
16282    }
16283    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
16284        self.inner.shutdown_with_epitaph(status)
16285    }
16286
16287    fn is_closed(&self) -> bool {
16288        self.inner.channel().is_closed()
16289    }
16290    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
16291        self.inner.channel().on_closed()
16292    }
16293
16294    #[cfg(target_os = "fuchsia")]
16295    fn signal_peer(
16296        &self,
16297        clear_mask: zx::Signals,
16298        set_mask: zx::Signals,
16299    ) -> Result<(), zx_status::Status> {
16300        use fidl::Peered;
16301        self.inner.channel().signal_peer(clear_mask, set_mask)
16302    }
16303}
16304
16305impl ReadableControlHandle {}
16306
16307#[must_use = "FIDL methods require a response to be sent"]
16308#[derive(Debug)]
16309pub struct ReadableReadResponder {
16310    control_handle: std::mem::ManuallyDrop<ReadableControlHandle>,
16311    tx_id: u32,
16312}
16313
16314/// Set the the channel to be shutdown (see [`ReadableControlHandle::shutdown`])
16315/// if the responder is dropped without sending a response, so that the client
16316/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16317impl std::ops::Drop for ReadableReadResponder {
16318    fn drop(&mut self) {
16319        self.control_handle.shutdown();
16320        // Safety: drops once, never accessed again
16321        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16322    }
16323}
16324
16325impl fidl::endpoints::Responder for ReadableReadResponder {
16326    type ControlHandle = ReadableControlHandle;
16327
16328    fn control_handle(&self) -> &ReadableControlHandle {
16329        &self.control_handle
16330    }
16331
16332    fn drop_without_shutdown(mut self) {
16333        // Safety: drops once, never accessed again due to mem::forget
16334        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16335        // Prevent Drop from running (which would shut down the channel)
16336        std::mem::forget(self);
16337    }
16338}
16339
16340impl ReadableReadResponder {
16341    /// Sends a response to the FIDL transaction.
16342    ///
16343    /// Sets the channel to shutdown if an error occurs.
16344    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
16345        let _result = self.send_raw(result);
16346        if _result.is_err() {
16347            self.control_handle.shutdown();
16348        }
16349        self.drop_without_shutdown();
16350        _result
16351    }
16352
16353    /// Similar to "send" but does not shutdown the channel if an error occurs.
16354    pub fn send_no_shutdown_on_err(
16355        self,
16356        mut result: Result<&[u8], i32>,
16357    ) -> Result<(), fidl::Error> {
16358        let _result = self.send_raw(result);
16359        self.drop_without_shutdown();
16360        _result
16361    }
16362
16363    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
16364        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
16365            result.map(|data| (data,)),
16366            self.tx_id,
16367            0x57e419a298c8ede,
16368            fidl::encoding::DynamicFlags::empty(),
16369        )
16370    }
16371}
16372
16373#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
16374pub struct SymlinkMarker;
16375
16376impl fidl::endpoints::ProtocolMarker for SymlinkMarker {
16377    type Proxy = SymlinkProxy;
16378    type RequestStream = SymlinkRequestStream;
16379    #[cfg(target_os = "fuchsia")]
16380    type SynchronousProxy = SymlinkSynchronousProxy;
16381
16382    const DEBUG_NAME: &'static str = "fuchsia.io.Symlink";
16383}
16384impl fidl::endpoints::DiscoverableProtocolMarker for SymlinkMarker {}
16385
16386pub trait SymlinkProxyInterface: Send + Sync {
16387    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
16388        + Send;
16389    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
16390    fn r#clone(
16391        &self,
16392        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
16393    ) -> Result<(), fidl::Error>;
16394    type CloseResponseFut: std::future::Future<
16395            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
16396        > + Send;
16397    fn r#close(&self) -> Self::CloseResponseFut;
16398    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
16399    fn r#query(&self) -> Self::QueryResponseFut;
16400    fn r#deprecated_clone(
16401        &self,
16402        flags: OpenFlags,
16403        object: fidl::endpoints::ServerEnd<NodeMarker>,
16404    ) -> Result<(), fidl::Error>;
16405    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
16406        + Send;
16407    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
16408    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
16409    fn r#deprecated_set_attr(
16410        &self,
16411        flags: NodeAttributeFlags,
16412        attributes: &NodeAttributes,
16413    ) -> Self::DeprecatedSetAttrResponseFut;
16414    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
16415        + Send;
16416    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
16417    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
16418        + Send;
16419    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
16420    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
16421        + Send;
16422    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
16423    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
16424        + Send;
16425    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
16426    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
16427        + Send;
16428    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
16429    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
16430        + Send;
16431    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
16432    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
16433        + Send;
16434    fn r#update_attributes(
16435        &self,
16436        payload: &MutableNodeAttributes,
16437    ) -> Self::UpdateAttributesResponseFut;
16438    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
16439    fn r#sync(&self) -> Self::SyncResponseFut;
16440    fn r#list_extended_attributes(
16441        &self,
16442        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
16443    ) -> Result<(), fidl::Error>;
16444    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
16445        + Send;
16446    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
16447    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
16448        + Send;
16449    fn r#set_extended_attribute(
16450        &self,
16451        name: &[u8],
16452        value: ExtendedAttributeValue,
16453        mode: SetExtendedAttributeMode,
16454    ) -> Self::SetExtendedAttributeResponseFut;
16455    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
16456        + Send;
16457    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
16458    type DescribeResponseFut: std::future::Future<Output = Result<SymlinkInfo, fidl::Error>> + Send;
16459    fn r#describe(&self) -> Self::DescribeResponseFut;
16460}
16461#[derive(Debug)]
16462#[cfg(target_os = "fuchsia")]
16463pub struct SymlinkSynchronousProxy {
16464    client: fidl::client::sync::Client,
16465}
16466
16467#[cfg(target_os = "fuchsia")]
16468impl fidl::endpoints::SynchronousProxy for SymlinkSynchronousProxy {
16469    type Proxy = SymlinkProxy;
16470    type Protocol = SymlinkMarker;
16471
16472    fn from_channel(inner: fidl::Channel) -> Self {
16473        Self::new(inner)
16474    }
16475
16476    fn into_channel(self) -> fidl::Channel {
16477        self.client.into_channel()
16478    }
16479
16480    fn as_channel(&self) -> &fidl::Channel {
16481        self.client.as_channel()
16482    }
16483}
16484
16485#[cfg(target_os = "fuchsia")]
16486impl SymlinkSynchronousProxy {
16487    pub fn new(channel: fidl::Channel) -> Self {
16488        let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16489        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
16490    }
16491
16492    pub fn into_channel(self) -> fidl::Channel {
16493        self.client.into_channel()
16494    }
16495
16496    /// Waits until an event arrives and returns it. It is safe for other
16497    /// threads to make concurrent requests while waiting for an event.
16498    pub fn wait_for_event(
16499        &self,
16500        deadline: zx::MonotonicInstant,
16501    ) -> Result<SymlinkEvent, fidl::Error> {
16502        SymlinkEvent::decode(self.client.wait_for_event(deadline)?)
16503    }
16504
16505    /// Creates a link to this this object with name `dst` in the directory represented by
16506    /// `dst_parent_token`.
16507    ///
16508    /// `dst` must be a resolved object name. Including "/" in the string will return
16509    /// `ZX_ERR_INVALID_ARGS`.
16510    ///
16511    /// This method requires the maximal set of rights supported by the filesystem for this object.
16512    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
16513    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
16514    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
16515    /// `ZX_ERR_ACCESS_DENIED`.
16516    ///
16517    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
16518    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
16519    ///
16520    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
16521    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
16522    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
16523    ///
16524    /// This method does not have the same atomicity properties has the `Directory::Link` method,
16525    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
16526    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
16527    pub fn r#link_into(
16528        &self,
16529        mut dst_parent_token: fidl::Event,
16530        mut dst: &str,
16531        ___deadline: zx::MonotonicInstant,
16532    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
16533        let _response = self.client.send_query::<
16534            LinkableLinkIntoRequest,
16535            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16536        >(
16537            (dst_parent_token, dst,),
16538            0x54f3949246a03e74,
16539            fidl::encoding::DynamicFlags::empty(),
16540            ___deadline,
16541        )?;
16542        Ok(_response.map(|x| x))
16543    }
16544
16545    pub fn r#clone(
16546        &self,
16547        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
16548    ) -> Result<(), fidl::Error> {
16549        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
16550            (request,),
16551            0x20d8a7aba2168a79,
16552            fidl::encoding::DynamicFlags::empty(),
16553        )
16554    }
16555
16556    /// Terminates the connection.
16557    ///
16558    /// After calling `Close`, the client must not send any other requests.
16559    ///
16560    /// Servers, after sending the status response, should close the connection
16561    /// regardless of status and without sending an epitaph.
16562    ///
16563    /// Closing the client end of the channel should be semantically equivalent
16564    /// to calling `Close` without knowing when the close has completed or its
16565    /// status.
16566    pub fn r#close(
16567        &self,
16568        ___deadline: zx::MonotonicInstant,
16569    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
16570        let _response = self.client.send_query::<
16571            fidl::encoding::EmptyPayload,
16572            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16573        >(
16574            (),
16575            0x5ac5d459ad7f657e,
16576            fidl::encoding::DynamicFlags::empty(),
16577            ___deadline,
16578        )?;
16579        Ok(_response.map(|x| x))
16580    }
16581
16582    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
16583        let _response = self.client.send_query::<
16584            fidl::encoding::EmptyPayload,
16585            fidl_fuchsia_unknown::QueryableQueryResponse,
16586        >(
16587            (),
16588            0x2658edee9decfc06,
16589            fidl::encoding::DynamicFlags::empty(),
16590            ___deadline,
16591        )?;
16592        Ok(_response.protocol)
16593    }
16594
16595    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
16596    pub fn r#deprecated_clone(
16597        &self,
16598        mut flags: OpenFlags,
16599        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
16600    ) -> Result<(), fidl::Error> {
16601        self.client.send::<NodeDeprecatedCloneRequest>(
16602            (flags, object),
16603            0x5a61678f293ce16f,
16604            fidl::encoding::DynamicFlags::FLEXIBLE,
16605        )
16606    }
16607
16608    /// DEPRECATED - Use `Node.GetAttributes` instead.
16609    pub fn r#deprecated_get_attr(
16610        &self,
16611        ___deadline: zx::MonotonicInstant,
16612    ) -> Result<(i32, NodeAttributes), fidl::Error> {
16613        let _response =
16614            self.client.send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse>(
16615                (),
16616                0x78985e216314dafd,
16617                fidl::encoding::DynamicFlags::empty(),
16618                ___deadline,
16619            )?;
16620        Ok((_response.s, _response.attributes))
16621    }
16622
16623    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
16624    pub fn r#deprecated_set_attr(
16625        &self,
16626        mut flags: NodeAttributeFlags,
16627        mut attributes: &NodeAttributes,
16628        ___deadline: zx::MonotonicInstant,
16629    ) -> Result<i32, fidl::Error> {
16630        let _response =
16631            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
16632                (flags, attributes),
16633                0x4186c0f40d938f46,
16634                fidl::encoding::DynamicFlags::empty(),
16635                ___deadline,
16636            )?;
16637        Ok(_response.s)
16638    }
16639
16640    /// [DEPRECATED - Use new GetFlags method instead.]
16641    pub fn r#deprecated_get_flags(
16642        &self,
16643        ___deadline: zx::MonotonicInstant,
16644    ) -> Result<(i32, OpenFlags), fidl::Error> {
16645        let _response = self
16646            .client
16647            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
16648                (),
16649                0x5b88fffb8eda3aa1,
16650                fidl::encoding::DynamicFlags::empty(),
16651                ___deadline,
16652            )?;
16653        Ok((_response.s, _response.flags))
16654    }
16655
16656    /// [DEPRECATED - Use new SetFlags method instead.]
16657    pub fn r#deprecated_set_flags(
16658        &self,
16659        mut flags: OpenFlags,
16660        ___deadline: zx::MonotonicInstant,
16661    ) -> Result<i32, fidl::Error> {
16662        let _response = self
16663            .client
16664            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
16665                (flags,),
16666                0x5295b76c71fde733,
16667                fidl::encoding::DynamicFlags::empty(),
16668                ___deadline,
16669            )?;
16670        Ok(_response.s)
16671    }
16672
16673    /// Queries the flags that apply to this node after it has been opened/created. This method does
16674    /// not require any rights.
16675    ///
16676    /// Note that the final set of flags that apply to the connection may differ from those
16677    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
16678    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
16679    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
16680    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
16681    pub fn r#get_flags(
16682        &self,
16683        ___deadline: zx::MonotonicInstant,
16684    ) -> Result<NodeGetFlagsResult, fidl::Error> {
16685        let _response = self.client.send_query::<
16686            fidl::encoding::EmptyPayload,
16687            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
16688        >(
16689            (),
16690            0x176eb318f64ec23,
16691            fidl::encoding::DynamicFlags::FLEXIBLE,
16692            ___deadline,
16693        )?
16694        .into_result::<SymlinkMarker>("get_flags")?;
16695        Ok(_response.map(|x| x.flags))
16696    }
16697
16698    /// Sets the flags that apply to this node after it has been opened. This method does not
16699    /// require any rights.
16700    ///
16701    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
16702    /// clear append mode.
16703    ///
16704    /// Errors:
16705    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
16706    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
16707    pub fn r#set_flags(
16708        &self,
16709        mut flags: Flags,
16710        ___deadline: zx::MonotonicInstant,
16711    ) -> Result<NodeSetFlagsResult, fidl::Error> {
16712        let _response = self.client.send_query::<
16713            NodeSetFlagsRequest,
16714            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
16715        >(
16716            (flags,),
16717            0x55a8028685791ea8,
16718            fidl::encoding::DynamicFlags::FLEXIBLE,
16719            ___deadline,
16720        )?
16721        .into_result::<SymlinkMarker>("set_flags")?;
16722        Ok(_response.map(|x| x))
16723    }
16724
16725    /// Query the filesystem for filesystem-specific information.
16726    pub fn r#query_filesystem(
16727        &self,
16728        ___deadline: zx::MonotonicInstant,
16729    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
16730        let _response =
16731            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
16732                (),
16733                0x6f344a1c6b0a0610,
16734                fidl::encoding::DynamicFlags::empty(),
16735                ___deadline,
16736            )?;
16737        Ok((_response.s, _response.info))
16738    }
16739
16740    /// Acquires information about the node.
16741    ///
16742    /// The attributes of a node should be stable, independent of the
16743    /// specific protocol used to access it.
16744    ///
16745    /// If a particular attribute is not applicable or not supported,
16746    /// filesystems should leave the corresponding field absent.
16747    ///
16748    /// + `query` a bit-mask specifying which attributes to fetch. The server
16749    ///   should not return more than necessary.
16750    /// - `attributes` the returned attributes.
16751    ///
16752    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
16753    pub fn r#get_attributes(
16754        &self,
16755        mut query: NodeAttributesQuery,
16756        ___deadline: zx::MonotonicInstant,
16757    ) -> Result<NodeGetAttributesResult, fidl::Error> {
16758        let _response = self.client.send_query::<
16759            NodeGetAttributesRequest,
16760            fidl::encoding::ResultType<NodeAttributes2, i32>,
16761        >(
16762            (query,),
16763            0x3d4396a638ea053b,
16764            fidl::encoding::DynamicFlags::empty(),
16765            ___deadline,
16766        )?;
16767        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
16768    }
16769
16770    /// Updates information about the node.
16771    ///
16772    /// + `attributes` the presence of a table field in `attributes` indicates
16773    /// the intent to update the corresponding attribute.
16774    ///
16775    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
16776    ///
16777    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
16778    pub fn r#update_attributes(
16779        &self,
16780        mut payload: &MutableNodeAttributes,
16781        ___deadline: zx::MonotonicInstant,
16782    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
16783        let _response = self.client.send_query::<
16784            MutableNodeAttributes,
16785            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16786        >(
16787            payload,
16788            0x3308c1da5a89bf08,
16789            fidl::encoding::DynamicFlags::empty(),
16790            ___deadline,
16791        )?;
16792        Ok(_response.map(|x| x))
16793    }
16794
16795    /// Synchronizes updates to the node to the underlying media, if it exists.
16796    ///
16797    /// This method will return when the filesystem server has flushed the
16798    /// relevant updates to the underlying media, but does not guarantee the
16799    /// underlying media has persisted the information, nor that any information
16800    /// is committed to hardware. Clients may use `Sync` to ensure ordering
16801    /// between operations.
16802    ///
16803    /// This method does not require any rights.
16804    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
16805        let _response = self.client.send_query::<
16806            fidl::encoding::EmptyPayload,
16807            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16808        >(
16809            (),
16810            0x2c5c27ca0ab5dc49,
16811            fidl::encoding::DynamicFlags::empty(),
16812            ___deadline,
16813        )?;
16814        Ok(_response.map(|x| x))
16815    }
16816
16817    /// Creates an iterator over all the extended attribute names associated
16818    /// with this node. If an error occurs it is returned as an epitaph on the
16819    /// iterator request channel, and then the channel is closed.
16820    ///
16821    /// GetExtendedAttributes can be used with any of these names to retrieve
16822    /// the associated value.
16823    ///
16824    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
16825    pub fn r#list_extended_attributes(
16826        &self,
16827        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
16828    ) -> Result<(), fidl::Error> {
16829        self.client.send::<NodeListExtendedAttributesRequest>(
16830            (iterator,),
16831            0x4b61033de007fcd0,
16832            fidl::encoding::DynamicFlags::empty(),
16833        )
16834    }
16835
16836    /// Get the value associated with the given attribute `name` for this node.
16837    ///
16838    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
16839    /// particular structure is imposed on them.
16840    ///
16841    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
16842    pub fn r#get_extended_attribute(
16843        &self,
16844        mut name: &[u8],
16845        ___deadline: zx::MonotonicInstant,
16846    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
16847        let _response = self.client.send_query::<
16848            NodeGetExtendedAttributeRequest,
16849            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
16850        >(
16851            (name,),
16852            0x45ffa3ccfdeb76db,
16853            fidl::encoding::DynamicFlags::empty(),
16854            ___deadline,
16855        )?;
16856        Ok(_response.map(|x| x))
16857    }
16858
16859    /// Set the value for the given attribute `name` to `value` for this node.
16860    ///
16861    /// The attribute name may exist, in which case the attribute is updated.
16862    /// If the attribute doesn't exist, it is created. The name should have no
16863    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
16864    ///
16865    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
16866    pub fn r#set_extended_attribute(
16867        &self,
16868        mut name: &[u8],
16869        mut value: ExtendedAttributeValue,
16870        mut mode: SetExtendedAttributeMode,
16871        ___deadline: zx::MonotonicInstant,
16872    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
16873        let _response = self.client.send_query::<
16874            NodeSetExtendedAttributeRequest,
16875            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16876        >(
16877            (name, &mut value, mode,),
16878            0x4a951362f681f23c,
16879            fidl::encoding::DynamicFlags::empty(),
16880            ___deadline,
16881        )?;
16882        Ok(_response.map(|x| x))
16883    }
16884
16885    /// Remove the specified extended attribute.
16886    ///
16887    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
16888    ///
16889    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
16890    pub fn r#remove_extended_attribute(
16891        &self,
16892        mut name: &[u8],
16893        ___deadline: zx::MonotonicInstant,
16894    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
16895        let _response = self.client.send_query::<
16896            NodeRemoveExtendedAttributeRequest,
16897            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16898        >(
16899            (name,),
16900            0x7a0b9f3a9bf9032d,
16901            fidl::encoding::DynamicFlags::empty(),
16902            ___deadline,
16903        )?;
16904        Ok(_response.map(|x| x))
16905    }
16906
16907    pub fn r#describe(
16908        &self,
16909        ___deadline: zx::MonotonicInstant,
16910    ) -> Result<SymlinkInfo, fidl::Error> {
16911        let _response = self
16912            .client
16913            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleType<SymlinkInfo>>(
16914                (),
16915                0x742c2ea5e89831f3,
16916                fidl::encoding::DynamicFlags::FLEXIBLE,
16917                ___deadline,
16918            )?
16919            .into_result::<SymlinkMarker>("describe")?;
16920        Ok(_response)
16921    }
16922}
16923
16924#[cfg(target_os = "fuchsia")]
16925impl From<SymlinkSynchronousProxy> for zx::Handle {
16926    fn from(value: SymlinkSynchronousProxy) -> Self {
16927        value.into_channel().into()
16928    }
16929}
16930
16931#[cfg(target_os = "fuchsia")]
16932impl From<fidl::Channel> for SymlinkSynchronousProxy {
16933    fn from(value: fidl::Channel) -> Self {
16934        Self::new(value)
16935    }
16936}
16937
16938#[cfg(target_os = "fuchsia")]
16939impl fidl::endpoints::FromClient for SymlinkSynchronousProxy {
16940    type Protocol = SymlinkMarker;
16941
16942    fn from_client(value: fidl::endpoints::ClientEnd<SymlinkMarker>) -> Self {
16943        Self::new(value.into_channel())
16944    }
16945}
16946
16947#[derive(Debug, Clone)]
16948pub struct SymlinkProxy {
16949    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
16950}
16951
16952impl fidl::endpoints::Proxy for SymlinkProxy {
16953    type Protocol = SymlinkMarker;
16954
16955    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
16956        Self::new(inner)
16957    }
16958
16959    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
16960        self.client.into_channel().map_err(|client| Self { client })
16961    }
16962
16963    fn as_channel(&self) -> &::fidl::AsyncChannel {
16964        self.client.as_channel()
16965    }
16966}
16967
16968impl SymlinkProxy {
16969    /// Create a new Proxy for fuchsia.io/Symlink.
16970    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
16971        let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16972        Self { client: fidl::client::Client::new(channel, protocol_name) }
16973    }
16974
16975    /// Get a Stream of events from the remote end of the protocol.
16976    ///
16977    /// # Panics
16978    ///
16979    /// Panics if the event stream was already taken.
16980    pub fn take_event_stream(&self) -> SymlinkEventStream {
16981        SymlinkEventStream { event_receiver: self.client.take_event_receiver() }
16982    }
16983
16984    /// Creates a link to this this object with name `dst` in the directory represented by
16985    /// `dst_parent_token`.
16986    ///
16987    /// `dst` must be a resolved object name. Including "/" in the string will return
16988    /// `ZX_ERR_INVALID_ARGS`.
16989    ///
16990    /// This method requires the maximal set of rights supported by the filesystem for this object.
16991    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
16992    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
16993    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
16994    /// `ZX_ERR_ACCESS_DENIED`.
16995    ///
16996    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
16997    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
16998    ///
16999    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
17000    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
17001    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
17002    ///
17003    /// This method does not have the same atomicity properties has the `Directory::Link` method,
17004    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
17005    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
17006    pub fn r#link_into(
17007        &self,
17008        mut dst_parent_token: fidl::Event,
17009        mut dst: &str,
17010    ) -> fidl::client::QueryResponseFut<
17011        LinkableLinkIntoResult,
17012        fidl::encoding::DefaultFuchsiaResourceDialect,
17013    > {
17014        SymlinkProxyInterface::r#link_into(self, dst_parent_token, dst)
17015    }
17016
17017    pub fn r#clone(
17018        &self,
17019        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17020    ) -> Result<(), fidl::Error> {
17021        SymlinkProxyInterface::r#clone(self, request)
17022    }
17023
17024    /// Terminates the connection.
17025    ///
17026    /// After calling `Close`, the client must not send any other requests.
17027    ///
17028    /// Servers, after sending the status response, should close the connection
17029    /// regardless of status and without sending an epitaph.
17030    ///
17031    /// Closing the client end of the channel should be semantically equivalent
17032    /// to calling `Close` without knowing when the close has completed or its
17033    /// status.
17034    pub fn r#close(
17035        &self,
17036    ) -> fidl::client::QueryResponseFut<
17037        fidl_fuchsia_unknown::CloseableCloseResult,
17038        fidl::encoding::DefaultFuchsiaResourceDialect,
17039    > {
17040        SymlinkProxyInterface::r#close(self)
17041    }
17042
17043    pub fn r#query(
17044        &self,
17045    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
17046    {
17047        SymlinkProxyInterface::r#query(self)
17048    }
17049
17050    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
17051    pub fn r#deprecated_clone(
17052        &self,
17053        mut flags: OpenFlags,
17054        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17055    ) -> Result<(), fidl::Error> {
17056        SymlinkProxyInterface::r#deprecated_clone(self, flags, object)
17057    }
17058
17059    /// DEPRECATED - Use `Node.GetAttributes` instead.
17060    pub fn r#deprecated_get_attr(
17061        &self,
17062    ) -> fidl::client::QueryResponseFut<
17063        (i32, NodeAttributes),
17064        fidl::encoding::DefaultFuchsiaResourceDialect,
17065    > {
17066        SymlinkProxyInterface::r#deprecated_get_attr(self)
17067    }
17068
17069    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
17070    pub fn r#deprecated_set_attr(
17071        &self,
17072        mut flags: NodeAttributeFlags,
17073        mut attributes: &NodeAttributes,
17074    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
17075        SymlinkProxyInterface::r#deprecated_set_attr(self, flags, attributes)
17076    }
17077
17078    /// [DEPRECATED - Use new GetFlags method instead.]
17079    pub fn r#deprecated_get_flags(
17080        &self,
17081    ) -> fidl::client::QueryResponseFut<
17082        (i32, OpenFlags),
17083        fidl::encoding::DefaultFuchsiaResourceDialect,
17084    > {
17085        SymlinkProxyInterface::r#deprecated_get_flags(self)
17086    }
17087
17088    /// [DEPRECATED - Use new SetFlags method instead.]
17089    pub fn r#deprecated_set_flags(
17090        &self,
17091        mut flags: OpenFlags,
17092    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
17093        SymlinkProxyInterface::r#deprecated_set_flags(self, flags)
17094    }
17095
17096    /// Queries the flags that apply to this node after it has been opened/created. This method does
17097    /// not require any rights.
17098    ///
17099    /// Note that the final set of flags that apply to the connection may differ from those
17100    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
17101    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
17102    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
17103    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
17104    pub fn r#get_flags(
17105        &self,
17106    ) -> fidl::client::QueryResponseFut<
17107        NodeGetFlagsResult,
17108        fidl::encoding::DefaultFuchsiaResourceDialect,
17109    > {
17110        SymlinkProxyInterface::r#get_flags(self)
17111    }
17112
17113    /// Sets the flags that apply to this node after it has been opened. This method does not
17114    /// require any rights.
17115    ///
17116    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
17117    /// clear append mode.
17118    ///
17119    /// Errors:
17120    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
17121    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
17122    pub fn r#set_flags(
17123        &self,
17124        mut flags: Flags,
17125    ) -> fidl::client::QueryResponseFut<
17126        NodeSetFlagsResult,
17127        fidl::encoding::DefaultFuchsiaResourceDialect,
17128    > {
17129        SymlinkProxyInterface::r#set_flags(self, flags)
17130    }
17131
17132    /// Query the filesystem for filesystem-specific information.
17133    pub fn r#query_filesystem(
17134        &self,
17135    ) -> fidl::client::QueryResponseFut<
17136        (i32, Option<Box<FilesystemInfo>>),
17137        fidl::encoding::DefaultFuchsiaResourceDialect,
17138    > {
17139        SymlinkProxyInterface::r#query_filesystem(self)
17140    }
17141
17142    /// Acquires information about the node.
17143    ///
17144    /// The attributes of a node should be stable, independent of the
17145    /// specific protocol used to access it.
17146    ///
17147    /// If a particular attribute is not applicable or not supported,
17148    /// filesystems should leave the corresponding field absent.
17149    ///
17150    /// + `query` a bit-mask specifying which attributes to fetch. The server
17151    ///   should not return more than necessary.
17152    /// - `attributes` the returned attributes.
17153    ///
17154    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17155    pub fn r#get_attributes(
17156        &self,
17157        mut query: NodeAttributesQuery,
17158    ) -> fidl::client::QueryResponseFut<
17159        NodeGetAttributesResult,
17160        fidl::encoding::DefaultFuchsiaResourceDialect,
17161    > {
17162        SymlinkProxyInterface::r#get_attributes(self, query)
17163    }
17164
17165    /// Updates information about the node.
17166    ///
17167    /// + `attributes` the presence of a table field in `attributes` indicates
17168    /// the intent to update the corresponding attribute.
17169    ///
17170    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
17171    ///
17172    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17173    pub fn r#update_attributes(
17174        &self,
17175        mut payload: &MutableNodeAttributes,
17176    ) -> fidl::client::QueryResponseFut<
17177        NodeUpdateAttributesResult,
17178        fidl::encoding::DefaultFuchsiaResourceDialect,
17179    > {
17180        SymlinkProxyInterface::r#update_attributes(self, payload)
17181    }
17182
17183    /// Synchronizes updates to the node to the underlying media, if it exists.
17184    ///
17185    /// This method will return when the filesystem server has flushed the
17186    /// relevant updates to the underlying media, but does not guarantee the
17187    /// underlying media has persisted the information, nor that any information
17188    /// is committed to hardware. Clients may use `Sync` to ensure ordering
17189    /// between operations.
17190    ///
17191    /// This method does not require any rights.
17192    pub fn r#sync(
17193        &self,
17194    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
17195    {
17196        SymlinkProxyInterface::r#sync(self)
17197    }
17198
17199    /// Creates an iterator over all the extended attribute names associated
17200    /// with this node. If an error occurs it is returned as an epitaph on the
17201    /// iterator request channel, and then the channel is closed.
17202    ///
17203    /// GetExtendedAttributes can be used with any of these names to retrieve
17204    /// the associated value.
17205    ///
17206    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17207    pub fn r#list_extended_attributes(
17208        &self,
17209        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17210    ) -> Result<(), fidl::Error> {
17211        SymlinkProxyInterface::r#list_extended_attributes(self, iterator)
17212    }
17213
17214    /// Get the value associated with the given attribute `name` for this node.
17215    ///
17216    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
17217    /// particular structure is imposed on them.
17218    ///
17219    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17220    pub fn r#get_extended_attribute(
17221        &self,
17222        mut name: &[u8],
17223    ) -> fidl::client::QueryResponseFut<
17224        NodeGetExtendedAttributeResult,
17225        fidl::encoding::DefaultFuchsiaResourceDialect,
17226    > {
17227        SymlinkProxyInterface::r#get_extended_attribute(self, name)
17228    }
17229
17230    /// Set the value for the given attribute `name` to `value` for this node.
17231    ///
17232    /// The attribute name may exist, in which case the attribute is updated.
17233    /// If the attribute doesn't exist, it is created. The name should have no
17234    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
17235    ///
17236    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17237    pub fn r#set_extended_attribute(
17238        &self,
17239        mut name: &[u8],
17240        mut value: ExtendedAttributeValue,
17241        mut mode: SetExtendedAttributeMode,
17242    ) -> fidl::client::QueryResponseFut<
17243        NodeSetExtendedAttributeResult,
17244        fidl::encoding::DefaultFuchsiaResourceDialect,
17245    > {
17246        SymlinkProxyInterface::r#set_extended_attribute(self, name, value, mode)
17247    }
17248
17249    /// Remove the specified extended attribute.
17250    ///
17251    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
17252    ///
17253    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17254    pub fn r#remove_extended_attribute(
17255        &self,
17256        mut name: &[u8],
17257    ) -> fidl::client::QueryResponseFut<
17258        NodeRemoveExtendedAttributeResult,
17259        fidl::encoding::DefaultFuchsiaResourceDialect,
17260    > {
17261        SymlinkProxyInterface::r#remove_extended_attribute(self, name)
17262    }
17263
17264    pub fn r#describe(
17265        &self,
17266    ) -> fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
17267    {
17268        SymlinkProxyInterface::r#describe(self)
17269    }
17270}
17271
17272impl SymlinkProxyInterface for SymlinkProxy {
17273    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
17274        LinkableLinkIntoResult,
17275        fidl::encoding::DefaultFuchsiaResourceDialect,
17276    >;
17277    fn r#link_into(
17278        &self,
17279        mut dst_parent_token: fidl::Event,
17280        mut dst: &str,
17281    ) -> Self::LinkIntoResponseFut {
17282        fn _decode(
17283            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17284        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
17285            let _response = fidl::client::decode_transaction_body::<
17286                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17287                fidl::encoding::DefaultFuchsiaResourceDialect,
17288                0x54f3949246a03e74,
17289            >(_buf?)?;
17290            Ok(_response.map(|x| x))
17291        }
17292        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
17293            (dst_parent_token, dst),
17294            0x54f3949246a03e74,
17295            fidl::encoding::DynamicFlags::empty(),
17296            _decode,
17297        )
17298    }
17299
17300    fn r#clone(
17301        &self,
17302        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17303    ) -> Result<(), fidl::Error> {
17304        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
17305            (request,),
17306            0x20d8a7aba2168a79,
17307            fidl::encoding::DynamicFlags::empty(),
17308        )
17309    }
17310
17311    type CloseResponseFut = fidl::client::QueryResponseFut<
17312        fidl_fuchsia_unknown::CloseableCloseResult,
17313        fidl::encoding::DefaultFuchsiaResourceDialect,
17314    >;
17315    fn r#close(&self) -> Self::CloseResponseFut {
17316        fn _decode(
17317            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17318        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
17319            let _response = fidl::client::decode_transaction_body::<
17320                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17321                fidl::encoding::DefaultFuchsiaResourceDialect,
17322                0x5ac5d459ad7f657e,
17323            >(_buf?)?;
17324            Ok(_response.map(|x| x))
17325        }
17326        self.client.send_query_and_decode::<
17327            fidl::encoding::EmptyPayload,
17328            fidl_fuchsia_unknown::CloseableCloseResult,
17329        >(
17330            (),
17331            0x5ac5d459ad7f657e,
17332            fidl::encoding::DynamicFlags::empty(),
17333            _decode,
17334        )
17335    }
17336
17337    type QueryResponseFut =
17338        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
17339    fn r#query(&self) -> Self::QueryResponseFut {
17340        fn _decode(
17341            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17342        ) -> Result<Vec<u8>, fidl::Error> {
17343            let _response = fidl::client::decode_transaction_body::<
17344                fidl_fuchsia_unknown::QueryableQueryResponse,
17345                fidl::encoding::DefaultFuchsiaResourceDialect,
17346                0x2658edee9decfc06,
17347            >(_buf?)?;
17348            Ok(_response.protocol)
17349        }
17350        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
17351            (),
17352            0x2658edee9decfc06,
17353            fidl::encoding::DynamicFlags::empty(),
17354            _decode,
17355        )
17356    }
17357
17358    fn r#deprecated_clone(
17359        &self,
17360        mut flags: OpenFlags,
17361        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17362    ) -> Result<(), fidl::Error> {
17363        self.client.send::<NodeDeprecatedCloneRequest>(
17364            (flags, object),
17365            0x5a61678f293ce16f,
17366            fidl::encoding::DynamicFlags::FLEXIBLE,
17367        )
17368    }
17369
17370    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
17371        (i32, NodeAttributes),
17372        fidl::encoding::DefaultFuchsiaResourceDialect,
17373    >;
17374    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
17375        fn _decode(
17376            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17377        ) -> Result<(i32, NodeAttributes), fidl::Error> {
17378            let _response = fidl::client::decode_transaction_body::<
17379                NodeDeprecatedGetAttrResponse,
17380                fidl::encoding::DefaultFuchsiaResourceDialect,
17381                0x78985e216314dafd,
17382            >(_buf?)?;
17383            Ok((_response.s, _response.attributes))
17384        }
17385        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
17386            (),
17387            0x78985e216314dafd,
17388            fidl::encoding::DynamicFlags::empty(),
17389            _decode,
17390        )
17391    }
17392
17393    type DeprecatedSetAttrResponseFut =
17394        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
17395    fn r#deprecated_set_attr(
17396        &self,
17397        mut flags: NodeAttributeFlags,
17398        mut attributes: &NodeAttributes,
17399    ) -> Self::DeprecatedSetAttrResponseFut {
17400        fn _decode(
17401            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17402        ) -> Result<i32, fidl::Error> {
17403            let _response = fidl::client::decode_transaction_body::<
17404                NodeDeprecatedSetAttrResponse,
17405                fidl::encoding::DefaultFuchsiaResourceDialect,
17406                0x4186c0f40d938f46,
17407            >(_buf?)?;
17408            Ok(_response.s)
17409        }
17410        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
17411            (flags, attributes),
17412            0x4186c0f40d938f46,
17413            fidl::encoding::DynamicFlags::empty(),
17414            _decode,
17415        )
17416    }
17417
17418    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
17419        (i32, OpenFlags),
17420        fidl::encoding::DefaultFuchsiaResourceDialect,
17421    >;
17422    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
17423        fn _decode(
17424            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17425        ) -> Result<(i32, OpenFlags), fidl::Error> {
17426            let _response = fidl::client::decode_transaction_body::<
17427                NodeDeprecatedGetFlagsResponse,
17428                fidl::encoding::DefaultFuchsiaResourceDialect,
17429                0x5b88fffb8eda3aa1,
17430            >(_buf?)?;
17431            Ok((_response.s, _response.flags))
17432        }
17433        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
17434            (),
17435            0x5b88fffb8eda3aa1,
17436            fidl::encoding::DynamicFlags::empty(),
17437            _decode,
17438        )
17439    }
17440
17441    type DeprecatedSetFlagsResponseFut =
17442        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
17443    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
17444        fn _decode(
17445            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17446        ) -> Result<i32, fidl::Error> {
17447            let _response = fidl::client::decode_transaction_body::<
17448                NodeDeprecatedSetFlagsResponse,
17449                fidl::encoding::DefaultFuchsiaResourceDialect,
17450                0x5295b76c71fde733,
17451            >(_buf?)?;
17452            Ok(_response.s)
17453        }
17454        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
17455            (flags,),
17456            0x5295b76c71fde733,
17457            fidl::encoding::DynamicFlags::empty(),
17458            _decode,
17459        )
17460    }
17461
17462    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
17463        NodeGetFlagsResult,
17464        fidl::encoding::DefaultFuchsiaResourceDialect,
17465    >;
17466    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
17467        fn _decode(
17468            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17469        ) -> Result<NodeGetFlagsResult, fidl::Error> {
17470            let _response = fidl::client::decode_transaction_body::<
17471                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
17472                fidl::encoding::DefaultFuchsiaResourceDialect,
17473                0x176eb318f64ec23,
17474            >(_buf?)?
17475            .into_result::<SymlinkMarker>("get_flags")?;
17476            Ok(_response.map(|x| x.flags))
17477        }
17478        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
17479            (),
17480            0x176eb318f64ec23,
17481            fidl::encoding::DynamicFlags::FLEXIBLE,
17482            _decode,
17483        )
17484    }
17485
17486    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
17487        NodeSetFlagsResult,
17488        fidl::encoding::DefaultFuchsiaResourceDialect,
17489    >;
17490    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
17491        fn _decode(
17492            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17493        ) -> Result<NodeSetFlagsResult, fidl::Error> {
17494            let _response = fidl::client::decode_transaction_body::<
17495                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
17496                fidl::encoding::DefaultFuchsiaResourceDialect,
17497                0x55a8028685791ea8,
17498            >(_buf?)?
17499            .into_result::<SymlinkMarker>("set_flags")?;
17500            Ok(_response.map(|x| x))
17501        }
17502        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
17503            (flags,),
17504            0x55a8028685791ea8,
17505            fidl::encoding::DynamicFlags::FLEXIBLE,
17506            _decode,
17507        )
17508    }
17509
17510    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
17511        (i32, Option<Box<FilesystemInfo>>),
17512        fidl::encoding::DefaultFuchsiaResourceDialect,
17513    >;
17514    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
17515        fn _decode(
17516            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17517        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
17518            let _response = fidl::client::decode_transaction_body::<
17519                NodeQueryFilesystemResponse,
17520                fidl::encoding::DefaultFuchsiaResourceDialect,
17521                0x6f344a1c6b0a0610,
17522            >(_buf?)?;
17523            Ok((_response.s, _response.info))
17524        }
17525        self.client.send_query_and_decode::<
17526            fidl::encoding::EmptyPayload,
17527            (i32, Option<Box<FilesystemInfo>>),
17528        >(
17529            (),
17530            0x6f344a1c6b0a0610,
17531            fidl::encoding::DynamicFlags::empty(),
17532            _decode,
17533        )
17534    }
17535
17536    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
17537        NodeGetAttributesResult,
17538        fidl::encoding::DefaultFuchsiaResourceDialect,
17539    >;
17540    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
17541        fn _decode(
17542            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17543        ) -> Result<NodeGetAttributesResult, fidl::Error> {
17544            let _response = fidl::client::decode_transaction_body::<
17545                fidl::encoding::ResultType<NodeAttributes2, i32>,
17546                fidl::encoding::DefaultFuchsiaResourceDialect,
17547                0x3d4396a638ea053b,
17548            >(_buf?)?;
17549            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
17550        }
17551        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
17552            (query,),
17553            0x3d4396a638ea053b,
17554            fidl::encoding::DynamicFlags::empty(),
17555            _decode,
17556        )
17557    }
17558
17559    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
17560        NodeUpdateAttributesResult,
17561        fidl::encoding::DefaultFuchsiaResourceDialect,
17562    >;
17563    fn r#update_attributes(
17564        &self,
17565        mut payload: &MutableNodeAttributes,
17566    ) -> Self::UpdateAttributesResponseFut {
17567        fn _decode(
17568            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17569        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
17570            let _response = fidl::client::decode_transaction_body::<
17571                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17572                fidl::encoding::DefaultFuchsiaResourceDialect,
17573                0x3308c1da5a89bf08,
17574            >(_buf?)?;
17575            Ok(_response.map(|x| x))
17576        }
17577        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
17578            payload,
17579            0x3308c1da5a89bf08,
17580            fidl::encoding::DynamicFlags::empty(),
17581            _decode,
17582        )
17583    }
17584
17585    type SyncResponseFut = fidl::client::QueryResponseFut<
17586        NodeSyncResult,
17587        fidl::encoding::DefaultFuchsiaResourceDialect,
17588    >;
17589    fn r#sync(&self) -> Self::SyncResponseFut {
17590        fn _decode(
17591            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17592        ) -> Result<NodeSyncResult, fidl::Error> {
17593            let _response = fidl::client::decode_transaction_body::<
17594                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17595                fidl::encoding::DefaultFuchsiaResourceDialect,
17596                0x2c5c27ca0ab5dc49,
17597            >(_buf?)?;
17598            Ok(_response.map(|x| x))
17599        }
17600        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
17601            (),
17602            0x2c5c27ca0ab5dc49,
17603            fidl::encoding::DynamicFlags::empty(),
17604            _decode,
17605        )
17606    }
17607
17608    fn r#list_extended_attributes(
17609        &self,
17610        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17611    ) -> Result<(), fidl::Error> {
17612        self.client.send::<NodeListExtendedAttributesRequest>(
17613            (iterator,),
17614            0x4b61033de007fcd0,
17615            fidl::encoding::DynamicFlags::empty(),
17616        )
17617    }
17618
17619    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
17620        NodeGetExtendedAttributeResult,
17621        fidl::encoding::DefaultFuchsiaResourceDialect,
17622    >;
17623    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
17624        fn _decode(
17625            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17626        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
17627            let _response = fidl::client::decode_transaction_body::<
17628                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
17629                fidl::encoding::DefaultFuchsiaResourceDialect,
17630                0x45ffa3ccfdeb76db,
17631            >(_buf?)?;
17632            Ok(_response.map(|x| x))
17633        }
17634        self.client.send_query_and_decode::<
17635            NodeGetExtendedAttributeRequest,
17636            NodeGetExtendedAttributeResult,
17637        >(
17638            (name,),
17639            0x45ffa3ccfdeb76db,
17640            fidl::encoding::DynamicFlags::empty(),
17641            _decode,
17642        )
17643    }
17644
17645    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
17646        NodeSetExtendedAttributeResult,
17647        fidl::encoding::DefaultFuchsiaResourceDialect,
17648    >;
17649    fn r#set_extended_attribute(
17650        &self,
17651        mut name: &[u8],
17652        mut value: ExtendedAttributeValue,
17653        mut mode: SetExtendedAttributeMode,
17654    ) -> Self::SetExtendedAttributeResponseFut {
17655        fn _decode(
17656            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17657        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
17658            let _response = fidl::client::decode_transaction_body::<
17659                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17660                fidl::encoding::DefaultFuchsiaResourceDialect,
17661                0x4a951362f681f23c,
17662            >(_buf?)?;
17663            Ok(_response.map(|x| x))
17664        }
17665        self.client.send_query_and_decode::<
17666            NodeSetExtendedAttributeRequest,
17667            NodeSetExtendedAttributeResult,
17668        >(
17669            (name, &mut value, mode,),
17670            0x4a951362f681f23c,
17671            fidl::encoding::DynamicFlags::empty(),
17672            _decode,
17673        )
17674    }
17675
17676    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
17677        NodeRemoveExtendedAttributeResult,
17678        fidl::encoding::DefaultFuchsiaResourceDialect,
17679    >;
17680    fn r#remove_extended_attribute(
17681        &self,
17682        mut name: &[u8],
17683    ) -> Self::RemoveExtendedAttributeResponseFut {
17684        fn _decode(
17685            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17686        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
17687            let _response = fidl::client::decode_transaction_body::<
17688                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17689                fidl::encoding::DefaultFuchsiaResourceDialect,
17690                0x7a0b9f3a9bf9032d,
17691            >(_buf?)?;
17692            Ok(_response.map(|x| x))
17693        }
17694        self.client.send_query_and_decode::<
17695            NodeRemoveExtendedAttributeRequest,
17696            NodeRemoveExtendedAttributeResult,
17697        >(
17698            (name,),
17699            0x7a0b9f3a9bf9032d,
17700            fidl::encoding::DynamicFlags::empty(),
17701            _decode,
17702        )
17703    }
17704
17705    type DescribeResponseFut =
17706        fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
17707    fn r#describe(&self) -> Self::DescribeResponseFut {
17708        fn _decode(
17709            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17710        ) -> Result<SymlinkInfo, fidl::Error> {
17711            let _response = fidl::client::decode_transaction_body::<
17712                fidl::encoding::FlexibleType<SymlinkInfo>,
17713                fidl::encoding::DefaultFuchsiaResourceDialect,
17714                0x742c2ea5e89831f3,
17715            >(_buf?)?
17716            .into_result::<SymlinkMarker>("describe")?;
17717            Ok(_response)
17718        }
17719        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SymlinkInfo>(
17720            (),
17721            0x742c2ea5e89831f3,
17722            fidl::encoding::DynamicFlags::FLEXIBLE,
17723            _decode,
17724        )
17725    }
17726}
17727
17728pub struct SymlinkEventStream {
17729    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
17730}
17731
17732impl std::marker::Unpin for SymlinkEventStream {}
17733
17734impl futures::stream::FusedStream for SymlinkEventStream {
17735    fn is_terminated(&self) -> bool {
17736        self.event_receiver.is_terminated()
17737    }
17738}
17739
17740impl futures::Stream for SymlinkEventStream {
17741    type Item = Result<SymlinkEvent, fidl::Error>;
17742
17743    fn poll_next(
17744        mut self: std::pin::Pin<&mut Self>,
17745        cx: &mut std::task::Context<'_>,
17746    ) -> std::task::Poll<Option<Self::Item>> {
17747        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
17748            &mut self.event_receiver,
17749            cx
17750        )?) {
17751            Some(buf) => std::task::Poll::Ready(Some(SymlinkEvent::decode(buf))),
17752            None => std::task::Poll::Ready(None),
17753        }
17754    }
17755}
17756
17757#[derive(Debug)]
17758pub enum SymlinkEvent {
17759    OnOpen_ {
17760        s: i32,
17761        info: Option<Box<NodeInfoDeprecated>>,
17762    },
17763    OnRepresentation {
17764        payload: Representation,
17765    },
17766    #[non_exhaustive]
17767    _UnknownEvent {
17768        /// Ordinal of the event that was sent.
17769        ordinal: u64,
17770    },
17771}
17772
17773impl SymlinkEvent {
17774    #[allow(irrefutable_let_patterns)]
17775    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
17776        if let SymlinkEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
17777    }
17778    #[allow(irrefutable_let_patterns)]
17779    pub fn into_on_representation(self) -> Option<Representation> {
17780        if let SymlinkEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
17781    }
17782
17783    /// Decodes a message buffer as a [`SymlinkEvent`].
17784    fn decode(
17785        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
17786    ) -> Result<SymlinkEvent, fidl::Error> {
17787        let (bytes, _handles) = buf.split_mut();
17788        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17789        debug_assert_eq!(tx_header.tx_id, 0);
17790        match tx_header.ordinal {
17791            0x7fc7bbb1dbfd1972 => {
17792                let mut out = fidl::new_empty!(
17793                    NodeOnOpenRequest,
17794                    fidl::encoding::DefaultFuchsiaResourceDialect
17795                );
17796                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
17797                Ok((SymlinkEvent::OnOpen_ { s: out.s, info: out.info }))
17798            }
17799            0x5cb40567d80a510c => {
17800                let mut out =
17801                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
17802                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
17803                Ok((SymlinkEvent::OnRepresentation { payload: out }))
17804            }
17805            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
17806                Ok(SymlinkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
17807            }
17808            _ => Err(fidl::Error::UnknownOrdinal {
17809                ordinal: tx_header.ordinal,
17810                protocol_name: <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
17811            }),
17812        }
17813    }
17814}
17815
17816/// A Stream of incoming requests for fuchsia.io/Symlink.
17817pub struct SymlinkRequestStream {
17818    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
17819    is_terminated: bool,
17820}
17821
17822impl std::marker::Unpin for SymlinkRequestStream {}
17823
17824impl futures::stream::FusedStream for SymlinkRequestStream {
17825    fn is_terminated(&self) -> bool {
17826        self.is_terminated
17827    }
17828}
17829
17830impl fidl::endpoints::RequestStream for SymlinkRequestStream {
17831    type Protocol = SymlinkMarker;
17832    type ControlHandle = SymlinkControlHandle;
17833
17834    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
17835        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
17836    }
17837
17838    fn control_handle(&self) -> Self::ControlHandle {
17839        SymlinkControlHandle { inner: self.inner.clone() }
17840    }
17841
17842    fn into_inner(
17843        self,
17844    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
17845    {
17846        (self.inner, self.is_terminated)
17847    }
17848
17849    fn from_inner(
17850        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
17851        is_terminated: bool,
17852    ) -> Self {
17853        Self { inner, is_terminated }
17854    }
17855}
17856
17857impl futures::Stream for SymlinkRequestStream {
17858    type Item = Result<SymlinkRequest, fidl::Error>;
17859
17860    fn poll_next(
17861        mut self: std::pin::Pin<&mut Self>,
17862        cx: &mut std::task::Context<'_>,
17863    ) -> std::task::Poll<Option<Self::Item>> {
17864        let this = &mut *self;
17865        if this.inner.check_shutdown(cx) {
17866            this.is_terminated = true;
17867            return std::task::Poll::Ready(None);
17868        }
17869        if this.is_terminated {
17870            panic!("polled SymlinkRequestStream after completion");
17871        }
17872        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
17873            |bytes, handles| {
17874                match this.inner.channel().read_etc(cx, bytes, handles) {
17875                    std::task::Poll::Ready(Ok(())) => {}
17876                    std::task::Poll::Pending => return std::task::Poll::Pending,
17877                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
17878                        this.is_terminated = true;
17879                        return std::task::Poll::Ready(None);
17880                    }
17881                    std::task::Poll::Ready(Err(e)) => {
17882                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
17883                            e.into(),
17884                        ))));
17885                    }
17886                }
17887
17888                // A message has been received from the channel
17889                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17890
17891                std::task::Poll::Ready(Some(match header.ordinal {
17892                    0x54f3949246a03e74 => {
17893                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17894                        let mut req = fidl::new_empty!(
17895                            LinkableLinkIntoRequest,
17896                            fidl::encoding::DefaultFuchsiaResourceDialect
17897                        );
17898                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
17899                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17900                        Ok(SymlinkRequest::LinkInto {
17901                            dst_parent_token: req.dst_parent_token,
17902                            dst: req.dst,
17903
17904                            responder: SymlinkLinkIntoResponder {
17905                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17906                                tx_id: header.tx_id,
17907                            },
17908                        })
17909                    }
17910                    0x20d8a7aba2168a79 => {
17911                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
17912                        let mut req = fidl::new_empty!(
17913                            fidl_fuchsia_unknown::CloneableCloneRequest,
17914                            fidl::encoding::DefaultFuchsiaResourceDialect
17915                        );
17916                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
17917                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17918                        Ok(SymlinkRequest::Clone { request: req.request, control_handle })
17919                    }
17920                    0x5ac5d459ad7f657e => {
17921                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17922                        let mut req = fidl::new_empty!(
17923                            fidl::encoding::EmptyPayload,
17924                            fidl::encoding::DefaultFuchsiaResourceDialect
17925                        );
17926                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
17927                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17928                        Ok(SymlinkRequest::Close {
17929                            responder: SymlinkCloseResponder {
17930                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17931                                tx_id: header.tx_id,
17932                            },
17933                        })
17934                    }
17935                    0x2658edee9decfc06 => {
17936                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17937                        let mut req = fidl::new_empty!(
17938                            fidl::encoding::EmptyPayload,
17939                            fidl::encoding::DefaultFuchsiaResourceDialect
17940                        );
17941                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
17942                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17943                        Ok(SymlinkRequest::Query {
17944                            responder: SymlinkQueryResponder {
17945                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17946                                tx_id: header.tx_id,
17947                            },
17948                        })
17949                    }
17950                    0x5a61678f293ce16f => {
17951                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
17952                        let mut req = fidl::new_empty!(
17953                            NodeDeprecatedCloneRequest,
17954                            fidl::encoding::DefaultFuchsiaResourceDialect
17955                        );
17956                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
17957                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17958                        Ok(SymlinkRequest::DeprecatedClone {
17959                            flags: req.flags,
17960                            object: req.object,
17961
17962                            control_handle,
17963                        })
17964                    }
17965                    0x78985e216314dafd => {
17966                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17967                        let mut req = fidl::new_empty!(
17968                            fidl::encoding::EmptyPayload,
17969                            fidl::encoding::DefaultFuchsiaResourceDialect
17970                        );
17971                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
17972                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17973                        Ok(SymlinkRequest::DeprecatedGetAttr {
17974                            responder: SymlinkDeprecatedGetAttrResponder {
17975                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17976                                tx_id: header.tx_id,
17977                            },
17978                        })
17979                    }
17980                    0x4186c0f40d938f46 => {
17981                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17982                        let mut req = fidl::new_empty!(
17983                            NodeDeprecatedSetAttrRequest,
17984                            fidl::encoding::DefaultFuchsiaResourceDialect
17985                        );
17986                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
17987                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17988                        Ok(SymlinkRequest::DeprecatedSetAttr {
17989                            flags: req.flags,
17990                            attributes: req.attributes,
17991
17992                            responder: SymlinkDeprecatedSetAttrResponder {
17993                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17994                                tx_id: header.tx_id,
17995                            },
17996                        })
17997                    }
17998                    0x5b88fffb8eda3aa1 => {
17999                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18000                        let mut req = fidl::new_empty!(
18001                            fidl::encoding::EmptyPayload,
18002                            fidl::encoding::DefaultFuchsiaResourceDialect
18003                        );
18004                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18005                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18006                        Ok(SymlinkRequest::DeprecatedGetFlags {
18007                            responder: SymlinkDeprecatedGetFlagsResponder {
18008                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18009                                tx_id: header.tx_id,
18010                            },
18011                        })
18012                    }
18013                    0x5295b76c71fde733 => {
18014                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18015                        let mut req = fidl::new_empty!(
18016                            NodeDeprecatedSetFlagsRequest,
18017                            fidl::encoding::DefaultFuchsiaResourceDialect
18018                        );
18019                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
18020                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18021                        Ok(SymlinkRequest::DeprecatedSetFlags {
18022                            flags: req.flags,
18023
18024                            responder: SymlinkDeprecatedSetFlagsResponder {
18025                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18026                                tx_id: header.tx_id,
18027                            },
18028                        })
18029                    }
18030                    0x176eb318f64ec23 => {
18031                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18032                        let mut req = fidl::new_empty!(
18033                            fidl::encoding::EmptyPayload,
18034                            fidl::encoding::DefaultFuchsiaResourceDialect
18035                        );
18036                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18037                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18038                        Ok(SymlinkRequest::GetFlags {
18039                            responder: SymlinkGetFlagsResponder {
18040                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18041                                tx_id: header.tx_id,
18042                            },
18043                        })
18044                    }
18045                    0x55a8028685791ea8 => {
18046                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18047                        let mut req = fidl::new_empty!(
18048                            NodeSetFlagsRequest,
18049                            fidl::encoding::DefaultFuchsiaResourceDialect
18050                        );
18051                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
18052                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18053                        Ok(SymlinkRequest::SetFlags {
18054                            flags: req.flags,
18055
18056                            responder: SymlinkSetFlagsResponder {
18057                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18058                                tx_id: header.tx_id,
18059                            },
18060                        })
18061                    }
18062                    0x6f344a1c6b0a0610 => {
18063                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18064                        let mut req = fidl::new_empty!(
18065                            fidl::encoding::EmptyPayload,
18066                            fidl::encoding::DefaultFuchsiaResourceDialect
18067                        );
18068                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18069                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18070                        Ok(SymlinkRequest::QueryFilesystem {
18071                            responder: SymlinkQueryFilesystemResponder {
18072                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18073                                tx_id: header.tx_id,
18074                            },
18075                        })
18076                    }
18077                    0x3d4396a638ea053b => {
18078                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18079                        let mut req = fidl::new_empty!(
18080                            NodeGetAttributesRequest,
18081                            fidl::encoding::DefaultFuchsiaResourceDialect
18082                        );
18083                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
18084                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18085                        Ok(SymlinkRequest::GetAttributes {
18086                            query: req.query,
18087
18088                            responder: SymlinkGetAttributesResponder {
18089                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18090                                tx_id: header.tx_id,
18091                            },
18092                        })
18093                    }
18094                    0x3308c1da5a89bf08 => {
18095                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18096                        let mut req = fidl::new_empty!(
18097                            MutableNodeAttributes,
18098                            fidl::encoding::DefaultFuchsiaResourceDialect
18099                        );
18100                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
18101                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18102                        Ok(SymlinkRequest::UpdateAttributes {
18103                            payload: req,
18104                            responder: SymlinkUpdateAttributesResponder {
18105                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18106                                tx_id: header.tx_id,
18107                            },
18108                        })
18109                    }
18110                    0x2c5c27ca0ab5dc49 => {
18111                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18112                        let mut req = fidl::new_empty!(
18113                            fidl::encoding::EmptyPayload,
18114                            fidl::encoding::DefaultFuchsiaResourceDialect
18115                        );
18116                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18117                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18118                        Ok(SymlinkRequest::Sync {
18119                            responder: SymlinkSyncResponder {
18120                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18121                                tx_id: header.tx_id,
18122                            },
18123                        })
18124                    }
18125                    0x4b61033de007fcd0 => {
18126                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18127                        let mut req = fidl::new_empty!(
18128                            NodeListExtendedAttributesRequest,
18129                            fidl::encoding::DefaultFuchsiaResourceDialect
18130                        );
18131                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
18132                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18133                        Ok(SymlinkRequest::ListExtendedAttributes {
18134                            iterator: req.iterator,
18135
18136                            control_handle,
18137                        })
18138                    }
18139                    0x45ffa3ccfdeb76db => {
18140                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18141                        let mut req = fidl::new_empty!(
18142                            NodeGetExtendedAttributeRequest,
18143                            fidl::encoding::DefaultFuchsiaResourceDialect
18144                        );
18145                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18146                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18147                        Ok(SymlinkRequest::GetExtendedAttribute {
18148                            name: req.name,
18149
18150                            responder: SymlinkGetExtendedAttributeResponder {
18151                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18152                                tx_id: header.tx_id,
18153                            },
18154                        })
18155                    }
18156                    0x4a951362f681f23c => {
18157                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18158                        let mut req = fidl::new_empty!(
18159                            NodeSetExtendedAttributeRequest,
18160                            fidl::encoding::DefaultFuchsiaResourceDialect
18161                        );
18162                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18163                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18164                        Ok(SymlinkRequest::SetExtendedAttribute {
18165                            name: req.name,
18166                            value: req.value,
18167                            mode: req.mode,
18168
18169                            responder: SymlinkSetExtendedAttributeResponder {
18170                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18171                                tx_id: header.tx_id,
18172                            },
18173                        })
18174                    }
18175                    0x7a0b9f3a9bf9032d => {
18176                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18177                        let mut req = fidl::new_empty!(
18178                            NodeRemoveExtendedAttributeRequest,
18179                            fidl::encoding::DefaultFuchsiaResourceDialect
18180                        );
18181                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18182                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18183                        Ok(SymlinkRequest::RemoveExtendedAttribute {
18184                            name: req.name,
18185
18186                            responder: SymlinkRemoveExtendedAttributeResponder {
18187                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18188                                tx_id: header.tx_id,
18189                            },
18190                        })
18191                    }
18192                    0x742c2ea5e89831f3 => {
18193                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18194                        let mut req = fidl::new_empty!(
18195                            fidl::encoding::EmptyPayload,
18196                            fidl::encoding::DefaultFuchsiaResourceDialect
18197                        );
18198                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18199                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18200                        Ok(SymlinkRequest::Describe {
18201                            responder: SymlinkDescribeResponder {
18202                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18203                                tx_id: header.tx_id,
18204                            },
18205                        })
18206                    }
18207                    _ if header.tx_id == 0
18208                        && header
18209                            .dynamic_flags()
18210                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
18211                    {
18212                        Ok(SymlinkRequest::_UnknownMethod {
18213                            ordinal: header.ordinal,
18214                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
18215                            method_type: fidl::MethodType::OneWay,
18216                        })
18217                    }
18218                    _ if header
18219                        .dynamic_flags()
18220                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
18221                    {
18222                        this.inner.send_framework_err(
18223                            fidl::encoding::FrameworkErr::UnknownMethod,
18224                            header.tx_id,
18225                            header.ordinal,
18226                            header.dynamic_flags(),
18227                            (bytes, handles),
18228                        )?;
18229                        Ok(SymlinkRequest::_UnknownMethod {
18230                            ordinal: header.ordinal,
18231                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
18232                            method_type: fidl::MethodType::TwoWay,
18233                        })
18234                    }
18235                    _ => Err(fidl::Error::UnknownOrdinal {
18236                        ordinal: header.ordinal,
18237                        protocol_name:
18238                            <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
18239                    }),
18240                }))
18241            },
18242        )
18243    }
18244}
18245
18246/// A ['Node'] which contains a symbolic link.
18247#[derive(Debug)]
18248pub enum SymlinkRequest {
18249    /// Creates a link to this this object with name `dst` in the directory represented by
18250    /// `dst_parent_token`.
18251    ///
18252    /// `dst` must be a resolved object name. Including "/" in the string will return
18253    /// `ZX_ERR_INVALID_ARGS`.
18254    ///
18255    /// This method requires the maximal set of rights supported by the filesystem for this object.
18256    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
18257    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
18258    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
18259    /// `ZX_ERR_ACCESS_DENIED`.
18260    ///
18261    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
18262    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
18263    ///
18264    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
18265    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
18266    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
18267    ///
18268    /// This method does not have the same atomicity properties has the `Directory::Link` method,
18269    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
18270    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
18271    LinkInto {
18272        dst_parent_token: fidl::Event,
18273        dst: String,
18274        responder: SymlinkLinkIntoResponder,
18275    },
18276    Clone {
18277        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
18278        control_handle: SymlinkControlHandle,
18279    },
18280    /// Terminates the connection.
18281    ///
18282    /// After calling `Close`, the client must not send any other requests.
18283    ///
18284    /// Servers, after sending the status response, should close the connection
18285    /// regardless of status and without sending an epitaph.
18286    ///
18287    /// Closing the client end of the channel should be semantically equivalent
18288    /// to calling `Close` without knowing when the close has completed or its
18289    /// status.
18290    Close {
18291        responder: SymlinkCloseResponder,
18292    },
18293    Query {
18294        responder: SymlinkQueryResponder,
18295    },
18296    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
18297    DeprecatedClone {
18298        flags: OpenFlags,
18299        object: fidl::endpoints::ServerEnd<NodeMarker>,
18300        control_handle: SymlinkControlHandle,
18301    },
18302    /// DEPRECATED - Use `Node.GetAttributes` instead.
18303    DeprecatedGetAttr {
18304        responder: SymlinkDeprecatedGetAttrResponder,
18305    },
18306    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
18307    DeprecatedSetAttr {
18308        flags: NodeAttributeFlags,
18309        attributes: NodeAttributes,
18310        responder: SymlinkDeprecatedSetAttrResponder,
18311    },
18312    /// [DEPRECATED - Use new GetFlags method instead.]
18313    DeprecatedGetFlags {
18314        responder: SymlinkDeprecatedGetFlagsResponder,
18315    },
18316    /// [DEPRECATED - Use new SetFlags method instead.]
18317    DeprecatedSetFlags {
18318        flags: OpenFlags,
18319        responder: SymlinkDeprecatedSetFlagsResponder,
18320    },
18321    /// Queries the flags that apply to this node after it has been opened/created. This method does
18322    /// not require any rights.
18323    ///
18324    /// Note that the final set of flags that apply to the connection may differ from those
18325    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
18326    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
18327    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
18328    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
18329    GetFlags {
18330        responder: SymlinkGetFlagsResponder,
18331    },
18332    /// Sets the flags that apply to this node after it has been opened. This method does not
18333    /// require any rights.
18334    ///
18335    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
18336    /// clear append mode.
18337    ///
18338    /// Errors:
18339    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
18340    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
18341    SetFlags {
18342        flags: Flags,
18343        responder: SymlinkSetFlagsResponder,
18344    },
18345    /// Query the filesystem for filesystem-specific information.
18346    QueryFilesystem {
18347        responder: SymlinkQueryFilesystemResponder,
18348    },
18349    /// Acquires information about the node.
18350    ///
18351    /// The attributes of a node should be stable, independent of the
18352    /// specific protocol used to access it.
18353    ///
18354    /// If a particular attribute is not applicable or not supported,
18355    /// filesystems should leave the corresponding field absent.
18356    ///
18357    /// + `query` a bit-mask specifying which attributes to fetch. The server
18358    ///   should not return more than necessary.
18359    /// - `attributes` the returned attributes.
18360    ///
18361    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18362    GetAttributes {
18363        query: NodeAttributesQuery,
18364        responder: SymlinkGetAttributesResponder,
18365    },
18366    /// Updates information about the node.
18367    ///
18368    /// + `attributes` the presence of a table field in `attributes` indicates
18369    /// the intent to update the corresponding attribute.
18370    ///
18371    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
18372    ///
18373    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
18374    UpdateAttributes {
18375        payload: MutableNodeAttributes,
18376        responder: SymlinkUpdateAttributesResponder,
18377    },
18378    /// Synchronizes updates to the node to the underlying media, if it exists.
18379    ///
18380    /// This method will return when the filesystem server has flushed the
18381    /// relevant updates to the underlying media, but does not guarantee the
18382    /// underlying media has persisted the information, nor that any information
18383    /// is committed to hardware. Clients may use `Sync` to ensure ordering
18384    /// between operations.
18385    ///
18386    /// This method does not require any rights.
18387    Sync {
18388        responder: SymlinkSyncResponder,
18389    },
18390    /// Creates an iterator over all the extended attribute names associated
18391    /// with this node. If an error occurs it is returned as an epitaph on the
18392    /// iterator request channel, and then the channel is closed.
18393    ///
18394    /// GetExtendedAttributes can be used with any of these names to retrieve
18395    /// the associated value.
18396    ///
18397    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18398    ListExtendedAttributes {
18399        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
18400        control_handle: SymlinkControlHandle,
18401    },
18402    /// Get the value associated with the given attribute `name` for this node.
18403    ///
18404    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
18405    /// particular structure is imposed on them.
18406    ///
18407    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18408    GetExtendedAttribute {
18409        name: Vec<u8>,
18410        responder: SymlinkGetExtendedAttributeResponder,
18411    },
18412    /// Set the value for the given attribute `name` to `value` for this node.
18413    ///
18414    /// The attribute name may exist, in which case the attribute is updated.
18415    /// If the attribute doesn't exist, it is created. The name should have no
18416    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
18417    ///
18418    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
18419    SetExtendedAttribute {
18420        name: Vec<u8>,
18421        value: ExtendedAttributeValue,
18422        mode: SetExtendedAttributeMode,
18423        responder: SymlinkSetExtendedAttributeResponder,
18424    },
18425    /// Remove the specified extended attribute.
18426    ///
18427    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
18428    ///
18429    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
18430    RemoveExtendedAttribute {
18431        name: Vec<u8>,
18432        responder: SymlinkRemoveExtendedAttributeResponder,
18433    },
18434    Describe {
18435        responder: SymlinkDescribeResponder,
18436    },
18437    /// An interaction was received which does not match any known method.
18438    #[non_exhaustive]
18439    _UnknownMethod {
18440        /// Ordinal of the method that was called.
18441        ordinal: u64,
18442        control_handle: SymlinkControlHandle,
18443        method_type: fidl::MethodType,
18444    },
18445}
18446
18447impl SymlinkRequest {
18448    #[allow(irrefutable_let_patterns)]
18449    pub fn into_link_into(self) -> Option<(fidl::Event, String, SymlinkLinkIntoResponder)> {
18450        if let SymlinkRequest::LinkInto { dst_parent_token, dst, responder } = self {
18451            Some((dst_parent_token, dst, responder))
18452        } else {
18453            None
18454        }
18455    }
18456
18457    #[allow(irrefutable_let_patterns)]
18458    pub fn into_clone(
18459        self,
18460    ) -> Option<(
18461        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
18462        SymlinkControlHandle,
18463    )> {
18464        if let SymlinkRequest::Clone { request, control_handle } = self {
18465            Some((request, control_handle))
18466        } else {
18467            None
18468        }
18469    }
18470
18471    #[allow(irrefutable_let_patterns)]
18472    pub fn into_close(self) -> Option<(SymlinkCloseResponder)> {
18473        if let SymlinkRequest::Close { responder } = self { Some((responder)) } else { None }
18474    }
18475
18476    #[allow(irrefutable_let_patterns)]
18477    pub fn into_query(self) -> Option<(SymlinkQueryResponder)> {
18478        if let SymlinkRequest::Query { responder } = self { Some((responder)) } else { None }
18479    }
18480
18481    #[allow(irrefutable_let_patterns)]
18482    pub fn into_deprecated_clone(
18483        self,
18484    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, SymlinkControlHandle)> {
18485        if let SymlinkRequest::DeprecatedClone { flags, object, control_handle } = self {
18486            Some((flags, object, control_handle))
18487        } else {
18488            None
18489        }
18490    }
18491
18492    #[allow(irrefutable_let_patterns)]
18493    pub fn into_deprecated_get_attr(self) -> Option<(SymlinkDeprecatedGetAttrResponder)> {
18494        if let SymlinkRequest::DeprecatedGetAttr { responder } = self {
18495            Some((responder))
18496        } else {
18497            None
18498        }
18499    }
18500
18501    #[allow(irrefutable_let_patterns)]
18502    pub fn into_deprecated_set_attr(
18503        self,
18504    ) -> Option<(NodeAttributeFlags, NodeAttributes, SymlinkDeprecatedSetAttrResponder)> {
18505        if let SymlinkRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
18506            Some((flags, attributes, responder))
18507        } else {
18508            None
18509        }
18510    }
18511
18512    #[allow(irrefutable_let_patterns)]
18513    pub fn into_deprecated_get_flags(self) -> Option<(SymlinkDeprecatedGetFlagsResponder)> {
18514        if let SymlinkRequest::DeprecatedGetFlags { responder } = self {
18515            Some((responder))
18516        } else {
18517            None
18518        }
18519    }
18520
18521    #[allow(irrefutable_let_patterns)]
18522    pub fn into_deprecated_set_flags(
18523        self,
18524    ) -> Option<(OpenFlags, SymlinkDeprecatedSetFlagsResponder)> {
18525        if let SymlinkRequest::DeprecatedSetFlags { flags, responder } = self {
18526            Some((flags, responder))
18527        } else {
18528            None
18529        }
18530    }
18531
18532    #[allow(irrefutable_let_patterns)]
18533    pub fn into_get_flags(self) -> Option<(SymlinkGetFlagsResponder)> {
18534        if let SymlinkRequest::GetFlags { responder } = self { Some((responder)) } else { None }
18535    }
18536
18537    #[allow(irrefutable_let_patterns)]
18538    pub fn into_set_flags(self) -> Option<(Flags, SymlinkSetFlagsResponder)> {
18539        if let SymlinkRequest::SetFlags { flags, responder } = self {
18540            Some((flags, responder))
18541        } else {
18542            None
18543        }
18544    }
18545
18546    #[allow(irrefutable_let_patterns)]
18547    pub fn into_query_filesystem(self) -> Option<(SymlinkQueryFilesystemResponder)> {
18548        if let SymlinkRequest::QueryFilesystem { responder } = self {
18549            Some((responder))
18550        } else {
18551            None
18552        }
18553    }
18554
18555    #[allow(irrefutable_let_patterns)]
18556    pub fn into_get_attributes(
18557        self,
18558    ) -> Option<(NodeAttributesQuery, SymlinkGetAttributesResponder)> {
18559        if let SymlinkRequest::GetAttributes { query, responder } = self {
18560            Some((query, responder))
18561        } else {
18562            None
18563        }
18564    }
18565
18566    #[allow(irrefutable_let_patterns)]
18567    pub fn into_update_attributes(
18568        self,
18569    ) -> Option<(MutableNodeAttributes, SymlinkUpdateAttributesResponder)> {
18570        if let SymlinkRequest::UpdateAttributes { payload, responder } = self {
18571            Some((payload, responder))
18572        } else {
18573            None
18574        }
18575    }
18576
18577    #[allow(irrefutable_let_patterns)]
18578    pub fn into_sync(self) -> Option<(SymlinkSyncResponder)> {
18579        if let SymlinkRequest::Sync { responder } = self { Some((responder)) } else { None }
18580    }
18581
18582    #[allow(irrefutable_let_patterns)]
18583    pub fn into_list_extended_attributes(
18584        self,
18585    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, SymlinkControlHandle)>
18586    {
18587        if let SymlinkRequest::ListExtendedAttributes { iterator, control_handle } = self {
18588            Some((iterator, control_handle))
18589        } else {
18590            None
18591        }
18592    }
18593
18594    #[allow(irrefutable_let_patterns)]
18595    pub fn into_get_extended_attribute(
18596        self,
18597    ) -> Option<(Vec<u8>, SymlinkGetExtendedAttributeResponder)> {
18598        if let SymlinkRequest::GetExtendedAttribute { name, responder } = self {
18599            Some((name, responder))
18600        } else {
18601            None
18602        }
18603    }
18604
18605    #[allow(irrefutable_let_patterns)]
18606    pub fn into_set_extended_attribute(
18607        self,
18608    ) -> Option<(
18609        Vec<u8>,
18610        ExtendedAttributeValue,
18611        SetExtendedAttributeMode,
18612        SymlinkSetExtendedAttributeResponder,
18613    )> {
18614        if let SymlinkRequest::SetExtendedAttribute { name, value, mode, responder } = self {
18615            Some((name, value, mode, responder))
18616        } else {
18617            None
18618        }
18619    }
18620
18621    #[allow(irrefutable_let_patterns)]
18622    pub fn into_remove_extended_attribute(
18623        self,
18624    ) -> Option<(Vec<u8>, SymlinkRemoveExtendedAttributeResponder)> {
18625        if let SymlinkRequest::RemoveExtendedAttribute { name, responder } = self {
18626            Some((name, responder))
18627        } else {
18628            None
18629        }
18630    }
18631
18632    #[allow(irrefutable_let_patterns)]
18633    pub fn into_describe(self) -> Option<(SymlinkDescribeResponder)> {
18634        if let SymlinkRequest::Describe { responder } = self { Some((responder)) } else { None }
18635    }
18636
18637    /// Name of the method defined in FIDL
18638    pub fn method_name(&self) -> &'static str {
18639        match *self {
18640            SymlinkRequest::LinkInto { .. } => "link_into",
18641            SymlinkRequest::Clone { .. } => "clone",
18642            SymlinkRequest::Close { .. } => "close",
18643            SymlinkRequest::Query { .. } => "query",
18644            SymlinkRequest::DeprecatedClone { .. } => "deprecated_clone",
18645            SymlinkRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
18646            SymlinkRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
18647            SymlinkRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
18648            SymlinkRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
18649            SymlinkRequest::GetFlags { .. } => "get_flags",
18650            SymlinkRequest::SetFlags { .. } => "set_flags",
18651            SymlinkRequest::QueryFilesystem { .. } => "query_filesystem",
18652            SymlinkRequest::GetAttributes { .. } => "get_attributes",
18653            SymlinkRequest::UpdateAttributes { .. } => "update_attributes",
18654            SymlinkRequest::Sync { .. } => "sync",
18655            SymlinkRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
18656            SymlinkRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
18657            SymlinkRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
18658            SymlinkRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
18659            SymlinkRequest::Describe { .. } => "describe",
18660            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
18661                "unknown one-way method"
18662            }
18663            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
18664                "unknown two-way method"
18665            }
18666        }
18667    }
18668}
18669
18670#[derive(Debug, Clone)]
18671pub struct SymlinkControlHandle {
18672    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
18673}
18674
18675impl fidl::endpoints::ControlHandle for SymlinkControlHandle {
18676    fn shutdown(&self) {
18677        self.inner.shutdown()
18678    }
18679    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
18680        self.inner.shutdown_with_epitaph(status)
18681    }
18682
18683    fn is_closed(&self) -> bool {
18684        self.inner.channel().is_closed()
18685    }
18686    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
18687        self.inner.channel().on_closed()
18688    }
18689
18690    #[cfg(target_os = "fuchsia")]
18691    fn signal_peer(
18692        &self,
18693        clear_mask: zx::Signals,
18694        set_mask: zx::Signals,
18695    ) -> Result<(), zx_status::Status> {
18696        use fidl::Peered;
18697        self.inner.channel().signal_peer(clear_mask, set_mask)
18698    }
18699}
18700
18701impl SymlinkControlHandle {
18702    pub fn send_on_open_(
18703        &self,
18704        mut s: i32,
18705        mut info: Option<NodeInfoDeprecated>,
18706    ) -> Result<(), fidl::Error> {
18707        self.inner.send::<NodeOnOpenRequest>(
18708            (s, info.as_mut()),
18709            0,
18710            0x7fc7bbb1dbfd1972,
18711            fidl::encoding::DynamicFlags::FLEXIBLE,
18712        )
18713    }
18714
18715    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
18716        self.inner.send::<Representation>(
18717            &mut payload,
18718            0,
18719            0x5cb40567d80a510c,
18720            fidl::encoding::DynamicFlags::empty(),
18721        )
18722    }
18723}
18724
18725#[must_use = "FIDL methods require a response to be sent"]
18726#[derive(Debug)]
18727pub struct SymlinkLinkIntoResponder {
18728    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18729    tx_id: u32,
18730}
18731
18732/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18733/// if the responder is dropped without sending a response, so that the client
18734/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18735impl std::ops::Drop for SymlinkLinkIntoResponder {
18736    fn drop(&mut self) {
18737        self.control_handle.shutdown();
18738        // Safety: drops once, never accessed again
18739        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18740    }
18741}
18742
18743impl fidl::endpoints::Responder for SymlinkLinkIntoResponder {
18744    type ControlHandle = SymlinkControlHandle;
18745
18746    fn control_handle(&self) -> &SymlinkControlHandle {
18747        &self.control_handle
18748    }
18749
18750    fn drop_without_shutdown(mut self) {
18751        // Safety: drops once, never accessed again due to mem::forget
18752        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18753        // Prevent Drop from running (which would shut down the channel)
18754        std::mem::forget(self);
18755    }
18756}
18757
18758impl SymlinkLinkIntoResponder {
18759    /// Sends a response to the FIDL transaction.
18760    ///
18761    /// Sets the channel to shutdown if an error occurs.
18762    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18763        let _result = self.send_raw(result);
18764        if _result.is_err() {
18765            self.control_handle.shutdown();
18766        }
18767        self.drop_without_shutdown();
18768        _result
18769    }
18770
18771    /// Similar to "send" but does not shutdown the channel if an error occurs.
18772    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18773        let _result = self.send_raw(result);
18774        self.drop_without_shutdown();
18775        _result
18776    }
18777
18778    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18779        self.control_handle
18780            .inner
18781            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
18782                result,
18783                self.tx_id,
18784                0x54f3949246a03e74,
18785                fidl::encoding::DynamicFlags::empty(),
18786            )
18787    }
18788}
18789
18790#[must_use = "FIDL methods require a response to be sent"]
18791#[derive(Debug)]
18792pub struct SymlinkCloseResponder {
18793    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18794    tx_id: u32,
18795}
18796
18797/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18798/// if the responder is dropped without sending a response, so that the client
18799/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18800impl std::ops::Drop for SymlinkCloseResponder {
18801    fn drop(&mut self) {
18802        self.control_handle.shutdown();
18803        // Safety: drops once, never accessed again
18804        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18805    }
18806}
18807
18808impl fidl::endpoints::Responder for SymlinkCloseResponder {
18809    type ControlHandle = SymlinkControlHandle;
18810
18811    fn control_handle(&self) -> &SymlinkControlHandle {
18812        &self.control_handle
18813    }
18814
18815    fn drop_without_shutdown(mut self) {
18816        // Safety: drops once, never accessed again due to mem::forget
18817        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18818        // Prevent Drop from running (which would shut down the channel)
18819        std::mem::forget(self);
18820    }
18821}
18822
18823impl SymlinkCloseResponder {
18824    /// Sends a response to the FIDL transaction.
18825    ///
18826    /// Sets the channel to shutdown if an error occurs.
18827    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18828        let _result = self.send_raw(result);
18829        if _result.is_err() {
18830            self.control_handle.shutdown();
18831        }
18832        self.drop_without_shutdown();
18833        _result
18834    }
18835
18836    /// Similar to "send" but does not shutdown the channel if an error occurs.
18837    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18838        let _result = self.send_raw(result);
18839        self.drop_without_shutdown();
18840        _result
18841    }
18842
18843    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18844        self.control_handle
18845            .inner
18846            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
18847                result,
18848                self.tx_id,
18849                0x5ac5d459ad7f657e,
18850                fidl::encoding::DynamicFlags::empty(),
18851            )
18852    }
18853}
18854
18855#[must_use = "FIDL methods require a response to be sent"]
18856#[derive(Debug)]
18857pub struct SymlinkQueryResponder {
18858    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18859    tx_id: u32,
18860}
18861
18862/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18863/// if the responder is dropped without sending a response, so that the client
18864/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18865impl std::ops::Drop for SymlinkQueryResponder {
18866    fn drop(&mut self) {
18867        self.control_handle.shutdown();
18868        // Safety: drops once, never accessed again
18869        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18870    }
18871}
18872
18873impl fidl::endpoints::Responder for SymlinkQueryResponder {
18874    type ControlHandle = SymlinkControlHandle;
18875
18876    fn control_handle(&self) -> &SymlinkControlHandle {
18877        &self.control_handle
18878    }
18879
18880    fn drop_without_shutdown(mut self) {
18881        // Safety: drops once, never accessed again due to mem::forget
18882        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18883        // Prevent Drop from running (which would shut down the channel)
18884        std::mem::forget(self);
18885    }
18886}
18887
18888impl SymlinkQueryResponder {
18889    /// Sends a response to the FIDL transaction.
18890    ///
18891    /// Sets the channel to shutdown if an error occurs.
18892    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
18893        let _result = self.send_raw(protocol);
18894        if _result.is_err() {
18895            self.control_handle.shutdown();
18896        }
18897        self.drop_without_shutdown();
18898        _result
18899    }
18900
18901    /// Similar to "send" but does not shutdown the channel if an error occurs.
18902    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
18903        let _result = self.send_raw(protocol);
18904        self.drop_without_shutdown();
18905        _result
18906    }
18907
18908    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
18909        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
18910            (protocol,),
18911            self.tx_id,
18912            0x2658edee9decfc06,
18913            fidl::encoding::DynamicFlags::empty(),
18914        )
18915    }
18916}
18917
18918#[must_use = "FIDL methods require a response to be sent"]
18919#[derive(Debug)]
18920pub struct SymlinkDeprecatedGetAttrResponder {
18921    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18922    tx_id: u32,
18923}
18924
18925/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18926/// if the responder is dropped without sending a response, so that the client
18927/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18928impl std::ops::Drop for SymlinkDeprecatedGetAttrResponder {
18929    fn drop(&mut self) {
18930        self.control_handle.shutdown();
18931        // Safety: drops once, never accessed again
18932        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18933    }
18934}
18935
18936impl fidl::endpoints::Responder for SymlinkDeprecatedGetAttrResponder {
18937    type ControlHandle = SymlinkControlHandle;
18938
18939    fn control_handle(&self) -> &SymlinkControlHandle {
18940        &self.control_handle
18941    }
18942
18943    fn drop_without_shutdown(mut self) {
18944        // Safety: drops once, never accessed again due to mem::forget
18945        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18946        // Prevent Drop from running (which would shut down the channel)
18947        std::mem::forget(self);
18948    }
18949}
18950
18951impl SymlinkDeprecatedGetAttrResponder {
18952    /// Sends a response to the FIDL transaction.
18953    ///
18954    /// Sets the channel to shutdown if an error occurs.
18955    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
18956        let _result = self.send_raw(s, attributes);
18957        if _result.is_err() {
18958            self.control_handle.shutdown();
18959        }
18960        self.drop_without_shutdown();
18961        _result
18962    }
18963
18964    /// Similar to "send" but does not shutdown the channel if an error occurs.
18965    pub fn send_no_shutdown_on_err(
18966        self,
18967        mut s: i32,
18968        mut attributes: &NodeAttributes,
18969    ) -> Result<(), fidl::Error> {
18970        let _result = self.send_raw(s, attributes);
18971        self.drop_without_shutdown();
18972        _result
18973    }
18974
18975    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
18976        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
18977            (s, attributes),
18978            self.tx_id,
18979            0x78985e216314dafd,
18980            fidl::encoding::DynamicFlags::empty(),
18981        )
18982    }
18983}
18984
18985#[must_use = "FIDL methods require a response to be sent"]
18986#[derive(Debug)]
18987pub struct SymlinkDeprecatedSetAttrResponder {
18988    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18989    tx_id: u32,
18990}
18991
18992/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18993/// if the responder is dropped without sending a response, so that the client
18994/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18995impl std::ops::Drop for SymlinkDeprecatedSetAttrResponder {
18996    fn drop(&mut self) {
18997        self.control_handle.shutdown();
18998        // Safety: drops once, never accessed again
18999        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19000    }
19001}
19002
19003impl fidl::endpoints::Responder for SymlinkDeprecatedSetAttrResponder {
19004    type ControlHandle = SymlinkControlHandle;
19005
19006    fn control_handle(&self) -> &SymlinkControlHandle {
19007        &self.control_handle
19008    }
19009
19010    fn drop_without_shutdown(mut self) {
19011        // Safety: drops once, never accessed again due to mem::forget
19012        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19013        // Prevent Drop from running (which would shut down the channel)
19014        std::mem::forget(self);
19015    }
19016}
19017
19018impl SymlinkDeprecatedSetAttrResponder {
19019    /// Sends a response to the FIDL transaction.
19020    ///
19021    /// Sets the channel to shutdown if an error occurs.
19022    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
19023        let _result = self.send_raw(s);
19024        if _result.is_err() {
19025            self.control_handle.shutdown();
19026        }
19027        self.drop_without_shutdown();
19028        _result
19029    }
19030
19031    /// Similar to "send" but does not shutdown the channel if an error occurs.
19032    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
19033        let _result = self.send_raw(s);
19034        self.drop_without_shutdown();
19035        _result
19036    }
19037
19038    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
19039        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
19040            (s,),
19041            self.tx_id,
19042            0x4186c0f40d938f46,
19043            fidl::encoding::DynamicFlags::empty(),
19044        )
19045    }
19046}
19047
19048#[must_use = "FIDL methods require a response to be sent"]
19049#[derive(Debug)]
19050pub struct SymlinkDeprecatedGetFlagsResponder {
19051    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19052    tx_id: u32,
19053}
19054
19055/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19056/// if the responder is dropped without sending a response, so that the client
19057/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19058impl std::ops::Drop for SymlinkDeprecatedGetFlagsResponder {
19059    fn drop(&mut self) {
19060        self.control_handle.shutdown();
19061        // Safety: drops once, never accessed again
19062        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19063    }
19064}
19065
19066impl fidl::endpoints::Responder for SymlinkDeprecatedGetFlagsResponder {
19067    type ControlHandle = SymlinkControlHandle;
19068
19069    fn control_handle(&self) -> &SymlinkControlHandle {
19070        &self.control_handle
19071    }
19072
19073    fn drop_without_shutdown(mut self) {
19074        // Safety: drops once, never accessed again due to mem::forget
19075        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19076        // Prevent Drop from running (which would shut down the channel)
19077        std::mem::forget(self);
19078    }
19079}
19080
19081impl SymlinkDeprecatedGetFlagsResponder {
19082    /// Sends a response to the FIDL transaction.
19083    ///
19084    /// Sets the channel to shutdown if an error occurs.
19085    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
19086        let _result = self.send_raw(s, flags);
19087        if _result.is_err() {
19088            self.control_handle.shutdown();
19089        }
19090        self.drop_without_shutdown();
19091        _result
19092    }
19093
19094    /// Similar to "send" but does not shutdown the channel if an error occurs.
19095    pub fn send_no_shutdown_on_err(
19096        self,
19097        mut s: i32,
19098        mut flags: OpenFlags,
19099    ) -> Result<(), fidl::Error> {
19100        let _result = self.send_raw(s, flags);
19101        self.drop_without_shutdown();
19102        _result
19103    }
19104
19105    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
19106        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
19107            (s, flags),
19108            self.tx_id,
19109            0x5b88fffb8eda3aa1,
19110            fidl::encoding::DynamicFlags::empty(),
19111        )
19112    }
19113}
19114
19115#[must_use = "FIDL methods require a response to be sent"]
19116#[derive(Debug)]
19117pub struct SymlinkDeprecatedSetFlagsResponder {
19118    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19119    tx_id: u32,
19120}
19121
19122/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19123/// if the responder is dropped without sending a response, so that the client
19124/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19125impl std::ops::Drop for SymlinkDeprecatedSetFlagsResponder {
19126    fn drop(&mut self) {
19127        self.control_handle.shutdown();
19128        // Safety: drops once, never accessed again
19129        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19130    }
19131}
19132
19133impl fidl::endpoints::Responder for SymlinkDeprecatedSetFlagsResponder {
19134    type ControlHandle = SymlinkControlHandle;
19135
19136    fn control_handle(&self) -> &SymlinkControlHandle {
19137        &self.control_handle
19138    }
19139
19140    fn drop_without_shutdown(mut self) {
19141        // Safety: drops once, never accessed again due to mem::forget
19142        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19143        // Prevent Drop from running (which would shut down the channel)
19144        std::mem::forget(self);
19145    }
19146}
19147
19148impl SymlinkDeprecatedSetFlagsResponder {
19149    /// Sends a response to the FIDL transaction.
19150    ///
19151    /// Sets the channel to shutdown if an error occurs.
19152    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
19153        let _result = self.send_raw(s);
19154        if _result.is_err() {
19155            self.control_handle.shutdown();
19156        }
19157        self.drop_without_shutdown();
19158        _result
19159    }
19160
19161    /// Similar to "send" but does not shutdown the channel if an error occurs.
19162    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
19163        let _result = self.send_raw(s);
19164        self.drop_without_shutdown();
19165        _result
19166    }
19167
19168    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
19169        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
19170            (s,),
19171            self.tx_id,
19172            0x5295b76c71fde733,
19173            fidl::encoding::DynamicFlags::empty(),
19174        )
19175    }
19176}
19177
19178#[must_use = "FIDL methods require a response to be sent"]
19179#[derive(Debug)]
19180pub struct SymlinkGetFlagsResponder {
19181    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19182    tx_id: u32,
19183}
19184
19185/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19186/// if the responder is dropped without sending a response, so that the client
19187/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19188impl std::ops::Drop for SymlinkGetFlagsResponder {
19189    fn drop(&mut self) {
19190        self.control_handle.shutdown();
19191        // Safety: drops once, never accessed again
19192        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19193    }
19194}
19195
19196impl fidl::endpoints::Responder for SymlinkGetFlagsResponder {
19197    type ControlHandle = SymlinkControlHandle;
19198
19199    fn control_handle(&self) -> &SymlinkControlHandle {
19200        &self.control_handle
19201    }
19202
19203    fn drop_without_shutdown(mut self) {
19204        // Safety: drops once, never accessed again due to mem::forget
19205        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19206        // Prevent Drop from running (which would shut down the channel)
19207        std::mem::forget(self);
19208    }
19209}
19210
19211impl SymlinkGetFlagsResponder {
19212    /// Sends a response to the FIDL transaction.
19213    ///
19214    /// Sets the channel to shutdown if an error occurs.
19215    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
19216        let _result = self.send_raw(result);
19217        if _result.is_err() {
19218            self.control_handle.shutdown();
19219        }
19220        self.drop_without_shutdown();
19221        _result
19222    }
19223
19224    /// Similar to "send" but does not shutdown the channel if an error occurs.
19225    pub fn send_no_shutdown_on_err(
19226        self,
19227        mut result: Result<Flags, i32>,
19228    ) -> Result<(), fidl::Error> {
19229        let _result = self.send_raw(result);
19230        self.drop_without_shutdown();
19231        _result
19232    }
19233
19234    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
19235        self.control_handle
19236            .inner
19237            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
19238                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
19239                self.tx_id,
19240                0x176eb318f64ec23,
19241                fidl::encoding::DynamicFlags::FLEXIBLE,
19242            )
19243    }
19244}
19245
19246#[must_use = "FIDL methods require a response to be sent"]
19247#[derive(Debug)]
19248pub struct SymlinkSetFlagsResponder {
19249    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19250    tx_id: u32,
19251}
19252
19253/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19254/// if the responder is dropped without sending a response, so that the client
19255/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19256impl std::ops::Drop for SymlinkSetFlagsResponder {
19257    fn drop(&mut self) {
19258        self.control_handle.shutdown();
19259        // Safety: drops once, never accessed again
19260        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19261    }
19262}
19263
19264impl fidl::endpoints::Responder for SymlinkSetFlagsResponder {
19265    type ControlHandle = SymlinkControlHandle;
19266
19267    fn control_handle(&self) -> &SymlinkControlHandle {
19268        &self.control_handle
19269    }
19270
19271    fn drop_without_shutdown(mut self) {
19272        // Safety: drops once, never accessed again due to mem::forget
19273        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19274        // Prevent Drop from running (which would shut down the channel)
19275        std::mem::forget(self);
19276    }
19277}
19278
19279impl SymlinkSetFlagsResponder {
19280    /// Sends a response to the FIDL transaction.
19281    ///
19282    /// Sets the channel to shutdown if an error occurs.
19283    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19284        let _result = self.send_raw(result);
19285        if _result.is_err() {
19286            self.control_handle.shutdown();
19287        }
19288        self.drop_without_shutdown();
19289        _result
19290    }
19291
19292    /// Similar to "send" but does not shutdown the channel if an error occurs.
19293    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19294        let _result = self.send_raw(result);
19295        self.drop_without_shutdown();
19296        _result
19297    }
19298
19299    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19300        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
19301            fidl::encoding::EmptyStruct,
19302            i32,
19303        >>(
19304            fidl::encoding::FlexibleResult::new(result),
19305            self.tx_id,
19306            0x55a8028685791ea8,
19307            fidl::encoding::DynamicFlags::FLEXIBLE,
19308        )
19309    }
19310}
19311
19312#[must_use = "FIDL methods require a response to be sent"]
19313#[derive(Debug)]
19314pub struct SymlinkQueryFilesystemResponder {
19315    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19316    tx_id: u32,
19317}
19318
19319/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19320/// if the responder is dropped without sending a response, so that the client
19321/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19322impl std::ops::Drop for SymlinkQueryFilesystemResponder {
19323    fn drop(&mut self) {
19324        self.control_handle.shutdown();
19325        // Safety: drops once, never accessed again
19326        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19327    }
19328}
19329
19330impl fidl::endpoints::Responder for SymlinkQueryFilesystemResponder {
19331    type ControlHandle = SymlinkControlHandle;
19332
19333    fn control_handle(&self) -> &SymlinkControlHandle {
19334        &self.control_handle
19335    }
19336
19337    fn drop_without_shutdown(mut self) {
19338        // Safety: drops once, never accessed again due to mem::forget
19339        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19340        // Prevent Drop from running (which would shut down the channel)
19341        std::mem::forget(self);
19342    }
19343}
19344
19345impl SymlinkQueryFilesystemResponder {
19346    /// Sends a response to the FIDL transaction.
19347    ///
19348    /// Sets the channel to shutdown if an error occurs.
19349    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
19350        let _result = self.send_raw(s, info);
19351        if _result.is_err() {
19352            self.control_handle.shutdown();
19353        }
19354        self.drop_without_shutdown();
19355        _result
19356    }
19357
19358    /// Similar to "send" but does not shutdown the channel if an error occurs.
19359    pub fn send_no_shutdown_on_err(
19360        self,
19361        mut s: i32,
19362        mut info: Option<&FilesystemInfo>,
19363    ) -> Result<(), fidl::Error> {
19364        let _result = self.send_raw(s, info);
19365        self.drop_without_shutdown();
19366        _result
19367    }
19368
19369    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
19370        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
19371            (s, info),
19372            self.tx_id,
19373            0x6f344a1c6b0a0610,
19374            fidl::encoding::DynamicFlags::empty(),
19375        )
19376    }
19377}
19378
19379#[must_use = "FIDL methods require a response to be sent"]
19380#[derive(Debug)]
19381pub struct SymlinkGetAttributesResponder {
19382    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19383    tx_id: u32,
19384}
19385
19386/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19387/// if the responder is dropped without sending a response, so that the client
19388/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19389impl std::ops::Drop for SymlinkGetAttributesResponder {
19390    fn drop(&mut self) {
19391        self.control_handle.shutdown();
19392        // Safety: drops once, never accessed again
19393        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19394    }
19395}
19396
19397impl fidl::endpoints::Responder for SymlinkGetAttributesResponder {
19398    type ControlHandle = SymlinkControlHandle;
19399
19400    fn control_handle(&self) -> &SymlinkControlHandle {
19401        &self.control_handle
19402    }
19403
19404    fn drop_without_shutdown(mut self) {
19405        // Safety: drops once, never accessed again due to mem::forget
19406        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19407        // Prevent Drop from running (which would shut down the channel)
19408        std::mem::forget(self);
19409    }
19410}
19411
19412impl SymlinkGetAttributesResponder {
19413    /// Sends a response to the FIDL transaction.
19414    ///
19415    /// Sets the channel to shutdown if an error occurs.
19416    pub fn send(
19417        self,
19418        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
19419    ) -> Result<(), fidl::Error> {
19420        let _result = self.send_raw(result);
19421        if _result.is_err() {
19422            self.control_handle.shutdown();
19423        }
19424        self.drop_without_shutdown();
19425        _result
19426    }
19427
19428    /// Similar to "send" but does not shutdown the channel if an error occurs.
19429    pub fn send_no_shutdown_on_err(
19430        self,
19431        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
19432    ) -> Result<(), fidl::Error> {
19433        let _result = self.send_raw(result);
19434        self.drop_without_shutdown();
19435        _result
19436    }
19437
19438    fn send_raw(
19439        &self,
19440        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
19441    ) -> Result<(), fidl::Error> {
19442        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
19443            result,
19444            self.tx_id,
19445            0x3d4396a638ea053b,
19446            fidl::encoding::DynamicFlags::empty(),
19447        )
19448    }
19449}
19450
19451#[must_use = "FIDL methods require a response to be sent"]
19452#[derive(Debug)]
19453pub struct SymlinkUpdateAttributesResponder {
19454    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19455    tx_id: u32,
19456}
19457
19458/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19459/// if the responder is dropped without sending a response, so that the client
19460/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19461impl std::ops::Drop for SymlinkUpdateAttributesResponder {
19462    fn drop(&mut self) {
19463        self.control_handle.shutdown();
19464        // Safety: drops once, never accessed again
19465        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19466    }
19467}
19468
19469impl fidl::endpoints::Responder for SymlinkUpdateAttributesResponder {
19470    type ControlHandle = SymlinkControlHandle;
19471
19472    fn control_handle(&self) -> &SymlinkControlHandle {
19473        &self.control_handle
19474    }
19475
19476    fn drop_without_shutdown(mut self) {
19477        // Safety: drops once, never accessed again due to mem::forget
19478        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19479        // Prevent Drop from running (which would shut down the channel)
19480        std::mem::forget(self);
19481    }
19482}
19483
19484impl SymlinkUpdateAttributesResponder {
19485    /// Sends a response to the FIDL transaction.
19486    ///
19487    /// Sets the channel to shutdown if an error occurs.
19488    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19489        let _result = self.send_raw(result);
19490        if _result.is_err() {
19491            self.control_handle.shutdown();
19492        }
19493        self.drop_without_shutdown();
19494        _result
19495    }
19496
19497    /// Similar to "send" but does not shutdown the channel if an error occurs.
19498    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19499        let _result = self.send_raw(result);
19500        self.drop_without_shutdown();
19501        _result
19502    }
19503
19504    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19505        self.control_handle
19506            .inner
19507            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19508                result,
19509                self.tx_id,
19510                0x3308c1da5a89bf08,
19511                fidl::encoding::DynamicFlags::empty(),
19512            )
19513    }
19514}
19515
19516#[must_use = "FIDL methods require a response to be sent"]
19517#[derive(Debug)]
19518pub struct SymlinkSyncResponder {
19519    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19520    tx_id: u32,
19521}
19522
19523/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19524/// if the responder is dropped without sending a response, so that the client
19525/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19526impl std::ops::Drop for SymlinkSyncResponder {
19527    fn drop(&mut self) {
19528        self.control_handle.shutdown();
19529        // Safety: drops once, never accessed again
19530        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19531    }
19532}
19533
19534impl fidl::endpoints::Responder for SymlinkSyncResponder {
19535    type ControlHandle = SymlinkControlHandle;
19536
19537    fn control_handle(&self) -> &SymlinkControlHandle {
19538        &self.control_handle
19539    }
19540
19541    fn drop_without_shutdown(mut self) {
19542        // Safety: drops once, never accessed again due to mem::forget
19543        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19544        // Prevent Drop from running (which would shut down the channel)
19545        std::mem::forget(self);
19546    }
19547}
19548
19549impl SymlinkSyncResponder {
19550    /// Sends a response to the FIDL transaction.
19551    ///
19552    /// Sets the channel to shutdown if an error occurs.
19553    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19554        let _result = self.send_raw(result);
19555        if _result.is_err() {
19556            self.control_handle.shutdown();
19557        }
19558        self.drop_without_shutdown();
19559        _result
19560    }
19561
19562    /// Similar to "send" but does not shutdown the channel if an error occurs.
19563    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19564        let _result = self.send_raw(result);
19565        self.drop_without_shutdown();
19566        _result
19567    }
19568
19569    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19570        self.control_handle
19571            .inner
19572            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19573                result,
19574                self.tx_id,
19575                0x2c5c27ca0ab5dc49,
19576                fidl::encoding::DynamicFlags::empty(),
19577            )
19578    }
19579}
19580
19581#[must_use = "FIDL methods require a response to be sent"]
19582#[derive(Debug)]
19583pub struct SymlinkGetExtendedAttributeResponder {
19584    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19585    tx_id: u32,
19586}
19587
19588/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19589/// if the responder is dropped without sending a response, so that the client
19590/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19591impl std::ops::Drop for SymlinkGetExtendedAttributeResponder {
19592    fn drop(&mut self) {
19593        self.control_handle.shutdown();
19594        // Safety: drops once, never accessed again
19595        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19596    }
19597}
19598
19599impl fidl::endpoints::Responder for SymlinkGetExtendedAttributeResponder {
19600    type ControlHandle = SymlinkControlHandle;
19601
19602    fn control_handle(&self) -> &SymlinkControlHandle {
19603        &self.control_handle
19604    }
19605
19606    fn drop_without_shutdown(mut self) {
19607        // Safety: drops once, never accessed again due to mem::forget
19608        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19609        // Prevent Drop from running (which would shut down the channel)
19610        std::mem::forget(self);
19611    }
19612}
19613
19614impl SymlinkGetExtendedAttributeResponder {
19615    /// Sends a response to the FIDL transaction.
19616    ///
19617    /// Sets the channel to shutdown if an error occurs.
19618    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
19619        let _result = self.send_raw(result);
19620        if _result.is_err() {
19621            self.control_handle.shutdown();
19622        }
19623        self.drop_without_shutdown();
19624        _result
19625    }
19626
19627    /// Similar to "send" but does not shutdown the channel if an error occurs.
19628    pub fn send_no_shutdown_on_err(
19629        self,
19630        mut result: Result<ExtendedAttributeValue, i32>,
19631    ) -> Result<(), fidl::Error> {
19632        let _result = self.send_raw(result);
19633        self.drop_without_shutdown();
19634        _result
19635    }
19636
19637    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
19638        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
19639            result.as_mut().map_err(|e| *e),
19640            self.tx_id,
19641            0x45ffa3ccfdeb76db,
19642            fidl::encoding::DynamicFlags::empty(),
19643        )
19644    }
19645}
19646
19647#[must_use = "FIDL methods require a response to be sent"]
19648#[derive(Debug)]
19649pub struct SymlinkSetExtendedAttributeResponder {
19650    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19651    tx_id: u32,
19652}
19653
19654/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19655/// if the responder is dropped without sending a response, so that the client
19656/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19657impl std::ops::Drop for SymlinkSetExtendedAttributeResponder {
19658    fn drop(&mut self) {
19659        self.control_handle.shutdown();
19660        // Safety: drops once, never accessed again
19661        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19662    }
19663}
19664
19665impl fidl::endpoints::Responder for SymlinkSetExtendedAttributeResponder {
19666    type ControlHandle = SymlinkControlHandle;
19667
19668    fn control_handle(&self) -> &SymlinkControlHandle {
19669        &self.control_handle
19670    }
19671
19672    fn drop_without_shutdown(mut self) {
19673        // Safety: drops once, never accessed again due to mem::forget
19674        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19675        // Prevent Drop from running (which would shut down the channel)
19676        std::mem::forget(self);
19677    }
19678}
19679
19680impl SymlinkSetExtendedAttributeResponder {
19681    /// Sends a response to the FIDL transaction.
19682    ///
19683    /// Sets the channel to shutdown if an error occurs.
19684    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19685        let _result = self.send_raw(result);
19686        if _result.is_err() {
19687            self.control_handle.shutdown();
19688        }
19689        self.drop_without_shutdown();
19690        _result
19691    }
19692
19693    /// Similar to "send" but does not shutdown the channel if an error occurs.
19694    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19695        let _result = self.send_raw(result);
19696        self.drop_without_shutdown();
19697        _result
19698    }
19699
19700    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19701        self.control_handle
19702            .inner
19703            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19704                result,
19705                self.tx_id,
19706                0x4a951362f681f23c,
19707                fidl::encoding::DynamicFlags::empty(),
19708            )
19709    }
19710}
19711
19712#[must_use = "FIDL methods require a response to be sent"]
19713#[derive(Debug)]
19714pub struct SymlinkRemoveExtendedAttributeResponder {
19715    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19716    tx_id: u32,
19717}
19718
19719/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19720/// if the responder is dropped without sending a response, so that the client
19721/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19722impl std::ops::Drop for SymlinkRemoveExtendedAttributeResponder {
19723    fn drop(&mut self) {
19724        self.control_handle.shutdown();
19725        // Safety: drops once, never accessed again
19726        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19727    }
19728}
19729
19730impl fidl::endpoints::Responder for SymlinkRemoveExtendedAttributeResponder {
19731    type ControlHandle = SymlinkControlHandle;
19732
19733    fn control_handle(&self) -> &SymlinkControlHandle {
19734        &self.control_handle
19735    }
19736
19737    fn drop_without_shutdown(mut self) {
19738        // Safety: drops once, never accessed again due to mem::forget
19739        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19740        // Prevent Drop from running (which would shut down the channel)
19741        std::mem::forget(self);
19742    }
19743}
19744
19745impl SymlinkRemoveExtendedAttributeResponder {
19746    /// Sends a response to the FIDL transaction.
19747    ///
19748    /// Sets the channel to shutdown if an error occurs.
19749    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19750        let _result = self.send_raw(result);
19751        if _result.is_err() {
19752            self.control_handle.shutdown();
19753        }
19754        self.drop_without_shutdown();
19755        _result
19756    }
19757
19758    /// Similar to "send" but does not shutdown the channel if an error occurs.
19759    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19760        let _result = self.send_raw(result);
19761        self.drop_without_shutdown();
19762        _result
19763    }
19764
19765    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19766        self.control_handle
19767            .inner
19768            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19769                result,
19770                self.tx_id,
19771                0x7a0b9f3a9bf9032d,
19772                fidl::encoding::DynamicFlags::empty(),
19773            )
19774    }
19775}
19776
19777#[must_use = "FIDL methods require a response to be sent"]
19778#[derive(Debug)]
19779pub struct SymlinkDescribeResponder {
19780    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19781    tx_id: u32,
19782}
19783
19784/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19785/// if the responder is dropped without sending a response, so that the client
19786/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19787impl std::ops::Drop for SymlinkDescribeResponder {
19788    fn drop(&mut self) {
19789        self.control_handle.shutdown();
19790        // Safety: drops once, never accessed again
19791        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19792    }
19793}
19794
19795impl fidl::endpoints::Responder for SymlinkDescribeResponder {
19796    type ControlHandle = SymlinkControlHandle;
19797
19798    fn control_handle(&self) -> &SymlinkControlHandle {
19799        &self.control_handle
19800    }
19801
19802    fn drop_without_shutdown(mut self) {
19803        // Safety: drops once, never accessed again due to mem::forget
19804        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19805        // Prevent Drop from running (which would shut down the channel)
19806        std::mem::forget(self);
19807    }
19808}
19809
19810impl SymlinkDescribeResponder {
19811    /// Sends a response to the FIDL transaction.
19812    ///
19813    /// Sets the channel to shutdown if an error occurs.
19814    pub fn send(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
19815        let _result = self.send_raw(payload);
19816        if _result.is_err() {
19817            self.control_handle.shutdown();
19818        }
19819        self.drop_without_shutdown();
19820        _result
19821    }
19822
19823    /// Similar to "send" but does not shutdown the channel if an error occurs.
19824    pub fn send_no_shutdown_on_err(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
19825        let _result = self.send_raw(payload);
19826        self.drop_without_shutdown();
19827        _result
19828    }
19829
19830    fn send_raw(&self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
19831        self.control_handle.inner.send::<fidl::encoding::FlexibleType<SymlinkInfo>>(
19832            fidl::encoding::Flexible::new(payload),
19833            self.tx_id,
19834            0x742c2ea5e89831f3,
19835            fidl::encoding::DynamicFlags::FLEXIBLE,
19836        )
19837    }
19838}
19839
19840#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
19841pub struct WritableMarker;
19842
19843impl fidl::endpoints::ProtocolMarker for WritableMarker {
19844    type Proxy = WritableProxy;
19845    type RequestStream = WritableRequestStream;
19846    #[cfg(target_os = "fuchsia")]
19847    type SynchronousProxy = WritableSynchronousProxy;
19848
19849    const DEBUG_NAME: &'static str = "(anonymous) Writable";
19850}
19851pub type WritableWriteResult = Result<u64, i32>;
19852
19853pub trait WritableProxyInterface: Send + Sync {
19854    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
19855        + Send;
19856    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
19857}
19858#[derive(Debug)]
19859#[cfg(target_os = "fuchsia")]
19860pub struct WritableSynchronousProxy {
19861    client: fidl::client::sync::Client,
19862}
19863
19864#[cfg(target_os = "fuchsia")]
19865impl fidl::endpoints::SynchronousProxy for WritableSynchronousProxy {
19866    type Proxy = WritableProxy;
19867    type Protocol = WritableMarker;
19868
19869    fn from_channel(inner: fidl::Channel) -> Self {
19870        Self::new(inner)
19871    }
19872
19873    fn into_channel(self) -> fidl::Channel {
19874        self.client.into_channel()
19875    }
19876
19877    fn as_channel(&self) -> &fidl::Channel {
19878        self.client.as_channel()
19879    }
19880}
19881
19882#[cfg(target_os = "fuchsia")]
19883impl WritableSynchronousProxy {
19884    pub fn new(channel: fidl::Channel) -> Self {
19885        let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
19886        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
19887    }
19888
19889    pub fn into_channel(self) -> fidl::Channel {
19890        self.client.into_channel()
19891    }
19892
19893    /// Waits until an event arrives and returns it. It is safe for other
19894    /// threads to make concurrent requests while waiting for an event.
19895    pub fn wait_for_event(
19896        &self,
19897        deadline: zx::MonotonicInstant,
19898    ) -> Result<WritableEvent, fidl::Error> {
19899        WritableEvent::decode(self.client.wait_for_event(deadline)?)
19900    }
19901
19902    /// Writes data at the seek offset.
19903    /// The seek offset is moved forward by the number of bytes written.
19904    /// If the file is in append mode, the seek offset is first set to the end
19905    /// of the file, followed by the write, in one atomic step.
19906    ///
19907    /// The file size may grow if the seek offset plus `data.length` is beyond
19908    /// the current end of file.
19909    ///
19910    /// + request `data` the byte buffer to write to the file.
19911    /// - response `actual_count` the number of bytes written.
19912    ///
19913    /// ## Invariants
19914    ///
19915    /// * The returned `actual_count` will never be greater than `data.length`.
19916    /// * If the server is unable to write all the data due to e.g. not enough
19917    ///   space, `actual_count` may be less than `data.length`.  If no bytes
19918    ///   could be written, an error is returned.
19919    /// * If `data.length` is zero, the server should perform all the checks
19920    ///   ensuring write access without mutating the file and return a
19921    ///   successful write of zero bytes.  The seek offset is still updated if
19922    ///   in append mode.
19923    ///
19924    /// This method requires the [`Rights.WRITE_BYTES`] right.
19925    pub fn r#write(
19926        &self,
19927        mut data: &[u8],
19928        ___deadline: zx::MonotonicInstant,
19929    ) -> Result<WritableWriteResult, fidl::Error> {
19930        let _response = self.client.send_query::<
19931            WritableWriteRequest,
19932            fidl::encoding::ResultType<WritableWriteResponse, i32>,
19933        >(
19934            (data,),
19935            0x6a31437832469f82,
19936            fidl::encoding::DynamicFlags::empty(),
19937            ___deadline,
19938        )?;
19939        Ok(_response.map(|x| x.actual_count))
19940    }
19941}
19942
19943#[cfg(target_os = "fuchsia")]
19944impl From<WritableSynchronousProxy> for zx::Handle {
19945    fn from(value: WritableSynchronousProxy) -> Self {
19946        value.into_channel().into()
19947    }
19948}
19949
19950#[cfg(target_os = "fuchsia")]
19951impl From<fidl::Channel> for WritableSynchronousProxy {
19952    fn from(value: fidl::Channel) -> Self {
19953        Self::new(value)
19954    }
19955}
19956
19957#[cfg(target_os = "fuchsia")]
19958impl fidl::endpoints::FromClient for WritableSynchronousProxy {
19959    type Protocol = WritableMarker;
19960
19961    fn from_client(value: fidl::endpoints::ClientEnd<WritableMarker>) -> Self {
19962        Self::new(value.into_channel())
19963    }
19964}
19965
19966#[derive(Debug, Clone)]
19967pub struct WritableProxy {
19968    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
19969}
19970
19971impl fidl::endpoints::Proxy for WritableProxy {
19972    type Protocol = WritableMarker;
19973
19974    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
19975        Self::new(inner)
19976    }
19977
19978    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
19979        self.client.into_channel().map_err(|client| Self { client })
19980    }
19981
19982    fn as_channel(&self) -> &::fidl::AsyncChannel {
19983        self.client.as_channel()
19984    }
19985}
19986
19987impl WritableProxy {
19988    /// Create a new Proxy for fuchsia.io/Writable.
19989    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
19990        let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
19991        Self { client: fidl::client::Client::new(channel, protocol_name) }
19992    }
19993
19994    /// Get a Stream of events from the remote end of the protocol.
19995    ///
19996    /// # Panics
19997    ///
19998    /// Panics if the event stream was already taken.
19999    pub fn take_event_stream(&self) -> WritableEventStream {
20000        WritableEventStream { event_receiver: self.client.take_event_receiver() }
20001    }
20002
20003    /// Writes data at the seek offset.
20004    /// The seek offset is moved forward by the number of bytes written.
20005    /// If the file is in append mode, the seek offset is first set to the end
20006    /// of the file, followed by the write, in one atomic step.
20007    ///
20008    /// The file size may grow if the seek offset plus `data.length` is beyond
20009    /// the current end of file.
20010    ///
20011    /// + request `data` the byte buffer to write to the file.
20012    /// - response `actual_count` the number of bytes written.
20013    ///
20014    /// ## Invariants
20015    ///
20016    /// * The returned `actual_count` will never be greater than `data.length`.
20017    /// * If the server is unable to write all the data due to e.g. not enough
20018    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20019    ///   could be written, an error is returned.
20020    /// * If `data.length` is zero, the server should perform all the checks
20021    ///   ensuring write access without mutating the file and return a
20022    ///   successful write of zero bytes.  The seek offset is still updated if
20023    ///   in append mode.
20024    ///
20025    /// This method requires the [`Rights.WRITE_BYTES`] right.
20026    pub fn r#write(
20027        &self,
20028        mut data: &[u8],
20029    ) -> fidl::client::QueryResponseFut<
20030        WritableWriteResult,
20031        fidl::encoding::DefaultFuchsiaResourceDialect,
20032    > {
20033        WritableProxyInterface::r#write(self, data)
20034    }
20035}
20036
20037impl WritableProxyInterface for WritableProxy {
20038    type WriteResponseFut = fidl::client::QueryResponseFut<
20039        WritableWriteResult,
20040        fidl::encoding::DefaultFuchsiaResourceDialect,
20041    >;
20042    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
20043        fn _decode(
20044            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
20045        ) -> Result<WritableWriteResult, fidl::Error> {
20046            let _response = fidl::client::decode_transaction_body::<
20047                fidl::encoding::ResultType<WritableWriteResponse, i32>,
20048                fidl::encoding::DefaultFuchsiaResourceDialect,
20049                0x6a31437832469f82,
20050            >(_buf?)?;
20051            Ok(_response.map(|x| x.actual_count))
20052        }
20053        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
20054            (data,),
20055            0x6a31437832469f82,
20056            fidl::encoding::DynamicFlags::empty(),
20057            _decode,
20058        )
20059    }
20060}
20061
20062pub struct WritableEventStream {
20063    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
20064}
20065
20066impl std::marker::Unpin for WritableEventStream {}
20067
20068impl futures::stream::FusedStream for WritableEventStream {
20069    fn is_terminated(&self) -> bool {
20070        self.event_receiver.is_terminated()
20071    }
20072}
20073
20074impl futures::Stream for WritableEventStream {
20075    type Item = Result<WritableEvent, fidl::Error>;
20076
20077    fn poll_next(
20078        mut self: std::pin::Pin<&mut Self>,
20079        cx: &mut std::task::Context<'_>,
20080    ) -> std::task::Poll<Option<Self::Item>> {
20081        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
20082            &mut self.event_receiver,
20083            cx
20084        )?) {
20085            Some(buf) => std::task::Poll::Ready(Some(WritableEvent::decode(buf))),
20086            None => std::task::Poll::Ready(None),
20087        }
20088    }
20089}
20090
20091#[derive(Debug)]
20092pub enum WritableEvent {}
20093
20094impl WritableEvent {
20095    /// Decodes a message buffer as a [`WritableEvent`].
20096    fn decode(
20097        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
20098    ) -> Result<WritableEvent, fidl::Error> {
20099        let (bytes, _handles) = buf.split_mut();
20100        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
20101        debug_assert_eq!(tx_header.tx_id, 0);
20102        match tx_header.ordinal {
20103            _ => Err(fidl::Error::UnknownOrdinal {
20104                ordinal: tx_header.ordinal,
20105                protocol_name: <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
20106            }),
20107        }
20108    }
20109}
20110
20111/// A Stream of incoming requests for fuchsia.io/Writable.
20112pub struct WritableRequestStream {
20113    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20114    is_terminated: bool,
20115}
20116
20117impl std::marker::Unpin for WritableRequestStream {}
20118
20119impl futures::stream::FusedStream for WritableRequestStream {
20120    fn is_terminated(&self) -> bool {
20121        self.is_terminated
20122    }
20123}
20124
20125impl fidl::endpoints::RequestStream for WritableRequestStream {
20126    type Protocol = WritableMarker;
20127    type ControlHandle = WritableControlHandle;
20128
20129    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
20130        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
20131    }
20132
20133    fn control_handle(&self) -> Self::ControlHandle {
20134        WritableControlHandle { inner: self.inner.clone() }
20135    }
20136
20137    fn into_inner(
20138        self,
20139    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
20140    {
20141        (self.inner, self.is_terminated)
20142    }
20143
20144    fn from_inner(
20145        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20146        is_terminated: bool,
20147    ) -> Self {
20148        Self { inner, is_terminated }
20149    }
20150}
20151
20152impl futures::Stream for WritableRequestStream {
20153    type Item = Result<WritableRequest, fidl::Error>;
20154
20155    fn poll_next(
20156        mut self: std::pin::Pin<&mut Self>,
20157        cx: &mut std::task::Context<'_>,
20158    ) -> std::task::Poll<Option<Self::Item>> {
20159        let this = &mut *self;
20160        if this.inner.check_shutdown(cx) {
20161            this.is_terminated = true;
20162            return std::task::Poll::Ready(None);
20163        }
20164        if this.is_terminated {
20165            panic!("polled WritableRequestStream after completion");
20166        }
20167        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
20168            |bytes, handles| {
20169                match this.inner.channel().read_etc(cx, bytes, handles) {
20170                    std::task::Poll::Ready(Ok(())) => {}
20171                    std::task::Poll::Pending => return std::task::Poll::Pending,
20172                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
20173                        this.is_terminated = true;
20174                        return std::task::Poll::Ready(None);
20175                    }
20176                    std::task::Poll::Ready(Err(e)) => {
20177                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
20178                            e.into(),
20179                        ))));
20180                    }
20181                }
20182
20183                // A message has been received from the channel
20184                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
20185
20186                std::task::Poll::Ready(Some(match header.ordinal {
20187                    0x6a31437832469f82 => {
20188                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
20189                        let mut req = fidl::new_empty!(
20190                            WritableWriteRequest,
20191                            fidl::encoding::DefaultFuchsiaResourceDialect
20192                        );
20193                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
20194                        let control_handle = WritableControlHandle { inner: this.inner.clone() };
20195                        Ok(WritableRequest::Write {
20196                            data: req.data,
20197
20198                            responder: WritableWriteResponder {
20199                                control_handle: std::mem::ManuallyDrop::new(control_handle),
20200                                tx_id: header.tx_id,
20201                            },
20202                        })
20203                    }
20204                    _ => Err(fidl::Error::UnknownOrdinal {
20205                        ordinal: header.ordinal,
20206                        protocol_name:
20207                            <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
20208                    }),
20209                }))
20210            },
20211        )
20212    }
20213}
20214
20215#[derive(Debug)]
20216pub enum WritableRequest {
20217    /// Writes data at the seek offset.
20218    /// The seek offset is moved forward by the number of bytes written.
20219    /// If the file is in append mode, the seek offset is first set to the end
20220    /// of the file, followed by the write, in one atomic step.
20221    ///
20222    /// The file size may grow if the seek offset plus `data.length` is beyond
20223    /// the current end of file.
20224    ///
20225    /// + request `data` the byte buffer to write to the file.
20226    /// - response `actual_count` the number of bytes written.
20227    ///
20228    /// ## Invariants
20229    ///
20230    /// * The returned `actual_count` will never be greater than `data.length`.
20231    /// * If the server is unable to write all the data due to e.g. not enough
20232    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20233    ///   could be written, an error is returned.
20234    /// * If `data.length` is zero, the server should perform all the checks
20235    ///   ensuring write access without mutating the file and return a
20236    ///   successful write of zero bytes.  The seek offset is still updated if
20237    ///   in append mode.
20238    ///
20239    /// This method requires the [`Rights.WRITE_BYTES`] right.
20240    Write { data: Vec<u8>, responder: WritableWriteResponder },
20241}
20242
20243impl WritableRequest {
20244    #[allow(irrefutable_let_patterns)]
20245    pub fn into_write(self) -> Option<(Vec<u8>, WritableWriteResponder)> {
20246        if let WritableRequest::Write { data, responder } = self {
20247            Some((data, responder))
20248        } else {
20249            None
20250        }
20251    }
20252
20253    /// Name of the method defined in FIDL
20254    pub fn method_name(&self) -> &'static str {
20255        match *self {
20256            WritableRequest::Write { .. } => "write",
20257        }
20258    }
20259}
20260
20261#[derive(Debug, Clone)]
20262pub struct WritableControlHandle {
20263    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20264}
20265
20266impl fidl::endpoints::ControlHandle for WritableControlHandle {
20267    fn shutdown(&self) {
20268        self.inner.shutdown()
20269    }
20270    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
20271        self.inner.shutdown_with_epitaph(status)
20272    }
20273
20274    fn is_closed(&self) -> bool {
20275        self.inner.channel().is_closed()
20276    }
20277    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
20278        self.inner.channel().on_closed()
20279    }
20280
20281    #[cfg(target_os = "fuchsia")]
20282    fn signal_peer(
20283        &self,
20284        clear_mask: zx::Signals,
20285        set_mask: zx::Signals,
20286    ) -> Result<(), zx_status::Status> {
20287        use fidl::Peered;
20288        self.inner.channel().signal_peer(clear_mask, set_mask)
20289    }
20290}
20291
20292impl WritableControlHandle {}
20293
20294#[must_use = "FIDL methods require a response to be sent"]
20295#[derive(Debug)]
20296pub struct WritableWriteResponder {
20297    control_handle: std::mem::ManuallyDrop<WritableControlHandle>,
20298    tx_id: u32,
20299}
20300
20301/// Set the the channel to be shutdown (see [`WritableControlHandle::shutdown`])
20302/// if the responder is dropped without sending a response, so that the client
20303/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20304impl std::ops::Drop for WritableWriteResponder {
20305    fn drop(&mut self) {
20306        self.control_handle.shutdown();
20307        // Safety: drops once, never accessed again
20308        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20309    }
20310}
20311
20312impl fidl::endpoints::Responder for WritableWriteResponder {
20313    type ControlHandle = WritableControlHandle;
20314
20315    fn control_handle(&self) -> &WritableControlHandle {
20316        &self.control_handle
20317    }
20318
20319    fn drop_without_shutdown(mut self) {
20320        // Safety: drops once, never accessed again due to mem::forget
20321        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20322        // Prevent Drop from running (which would shut down the channel)
20323        std::mem::forget(self);
20324    }
20325}
20326
20327impl WritableWriteResponder {
20328    /// Sends a response to the FIDL transaction.
20329    ///
20330    /// Sets the channel to shutdown if an error occurs.
20331    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
20332        let _result = self.send_raw(result);
20333        if _result.is_err() {
20334            self.control_handle.shutdown();
20335        }
20336        self.drop_without_shutdown();
20337        _result
20338    }
20339
20340    /// Similar to "send" but does not shutdown the channel if an error occurs.
20341    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
20342        let _result = self.send_raw(result);
20343        self.drop_without_shutdown();
20344        _result
20345    }
20346
20347    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
20348        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
20349            result.map(|actual_count| (actual_count,)),
20350            self.tx_id,
20351            0x6a31437832469f82,
20352            fidl::encoding::DynamicFlags::empty(),
20353        )
20354    }
20355}
20356
20357mod internal {
20358    use super::*;
20359
20360    impl fidl::encoding::ResourceTypeMarker for DirectoryCreateSymlinkRequest {
20361        type Borrowed<'a> = &'a mut Self;
20362        fn take_or_borrow<'a>(
20363            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20364        ) -> Self::Borrowed<'a> {
20365            value
20366        }
20367    }
20368
20369    unsafe impl fidl::encoding::TypeMarker for DirectoryCreateSymlinkRequest {
20370        type Owned = Self;
20371
20372        #[inline(always)]
20373        fn inline_align(_context: fidl::encoding::Context) -> usize {
20374            8
20375        }
20376
20377        #[inline(always)]
20378        fn inline_size(_context: fidl::encoding::Context) -> usize {
20379            40
20380        }
20381    }
20382
20383    unsafe impl
20384        fidl::encoding::Encode<
20385            DirectoryCreateSymlinkRequest,
20386            fidl::encoding::DefaultFuchsiaResourceDialect,
20387        > for &mut DirectoryCreateSymlinkRequest
20388    {
20389        #[inline]
20390        unsafe fn encode(
20391            self,
20392            encoder: &mut fidl::encoding::Encoder<
20393                '_,
20394                fidl::encoding::DefaultFuchsiaResourceDialect,
20395            >,
20396            offset: usize,
20397            _depth: fidl::encoding::Depth,
20398        ) -> fidl::Result<()> {
20399            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
20400            // Delegate to tuple encoding.
20401            fidl::encoding::Encode::<
20402                DirectoryCreateSymlinkRequest,
20403                fidl::encoding::DefaultFuchsiaResourceDialect,
20404            >::encode(
20405                (
20406                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
20407                        &self.name,
20408                    ),
20409                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
20410                        &self.target,
20411                    ),
20412                    <fidl::encoding::Optional<
20413                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20414                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20415                        &mut self.connection
20416                    ),
20417                ),
20418                encoder,
20419                offset,
20420                _depth,
20421            )
20422        }
20423    }
20424    unsafe impl<
20425        T0: fidl::encoding::Encode<
20426                fidl::encoding::BoundedString<255>,
20427                fidl::encoding::DefaultFuchsiaResourceDialect,
20428            >,
20429        T1: fidl::encoding::Encode<
20430                fidl::encoding::Vector<u8, 4095>,
20431                fidl::encoding::DefaultFuchsiaResourceDialect,
20432            >,
20433        T2: fidl::encoding::Encode<
20434                fidl::encoding::Optional<
20435                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20436                >,
20437                fidl::encoding::DefaultFuchsiaResourceDialect,
20438            >,
20439    >
20440        fidl::encoding::Encode<
20441            DirectoryCreateSymlinkRequest,
20442            fidl::encoding::DefaultFuchsiaResourceDialect,
20443        > for (T0, T1, T2)
20444    {
20445        #[inline]
20446        unsafe fn encode(
20447            self,
20448            encoder: &mut fidl::encoding::Encoder<
20449                '_,
20450                fidl::encoding::DefaultFuchsiaResourceDialect,
20451            >,
20452            offset: usize,
20453            depth: fidl::encoding::Depth,
20454        ) -> fidl::Result<()> {
20455            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
20456            // Zero out padding regions. There's no need to apply masks
20457            // because the unmasked parts will be overwritten by fields.
20458            unsafe {
20459                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
20460                (ptr as *mut u64).write_unaligned(0);
20461            }
20462            // Write the fields.
20463            self.0.encode(encoder, offset + 0, depth)?;
20464            self.1.encode(encoder, offset + 16, depth)?;
20465            self.2.encode(encoder, offset + 32, depth)?;
20466            Ok(())
20467        }
20468    }
20469
20470    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20471        for DirectoryCreateSymlinkRequest
20472    {
20473        #[inline(always)]
20474        fn new_empty() -> Self {
20475            Self {
20476                name: fidl::new_empty!(
20477                    fidl::encoding::BoundedString<255>,
20478                    fidl::encoding::DefaultFuchsiaResourceDialect
20479                ),
20480                target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect),
20481                connection: fidl::new_empty!(
20482                    fidl::encoding::Optional<
20483                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20484                    >,
20485                    fidl::encoding::DefaultFuchsiaResourceDialect
20486                ),
20487            }
20488        }
20489
20490        #[inline]
20491        unsafe fn decode(
20492            &mut self,
20493            decoder: &mut fidl::encoding::Decoder<
20494                '_,
20495                fidl::encoding::DefaultFuchsiaResourceDialect,
20496            >,
20497            offset: usize,
20498            _depth: fidl::encoding::Depth,
20499        ) -> fidl::Result<()> {
20500            decoder.debug_check_bounds::<Self>(offset);
20501            // Verify that padding bytes are zero.
20502            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
20503            let padval = unsafe { (ptr as *const u64).read_unaligned() };
20504            let mask = 0xffffffff00000000u64;
20505            let maskedval = padval & mask;
20506            if maskedval != 0 {
20507                return Err(fidl::Error::NonZeroPadding {
20508                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
20509                });
20510            }
20511            fidl::decode!(
20512                fidl::encoding::BoundedString<255>,
20513                fidl::encoding::DefaultFuchsiaResourceDialect,
20514                &mut self.name,
20515                decoder,
20516                offset + 0,
20517                _depth
20518            )?;
20519            fidl::decode!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.target, decoder, offset + 16, _depth)?;
20520            fidl::decode!(
20521                fidl::encoding::Optional<
20522                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20523                >,
20524                fidl::encoding::DefaultFuchsiaResourceDialect,
20525                &mut self.connection,
20526                decoder,
20527                offset + 32,
20528                _depth
20529            )?;
20530            Ok(())
20531        }
20532    }
20533
20534    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedOpenRequest {
20535        type Borrowed<'a> = &'a mut Self;
20536        fn take_or_borrow<'a>(
20537            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20538        ) -> Self::Borrowed<'a> {
20539            value
20540        }
20541    }
20542
20543    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedOpenRequest {
20544        type Owned = Self;
20545
20546        #[inline(always)]
20547        fn inline_align(_context: fidl::encoding::Context) -> usize {
20548            8
20549        }
20550
20551        #[inline(always)]
20552        fn inline_size(_context: fidl::encoding::Context) -> usize {
20553            32
20554        }
20555    }
20556
20557    unsafe impl
20558        fidl::encoding::Encode<
20559            DirectoryDeprecatedOpenRequest,
20560            fidl::encoding::DefaultFuchsiaResourceDialect,
20561        > for &mut DirectoryDeprecatedOpenRequest
20562    {
20563        #[inline]
20564        unsafe fn encode(
20565            self,
20566            encoder: &mut fidl::encoding::Encoder<
20567                '_,
20568                fidl::encoding::DefaultFuchsiaResourceDialect,
20569            >,
20570            offset: usize,
20571            _depth: fidl::encoding::Depth,
20572        ) -> fidl::Result<()> {
20573            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
20574            // Delegate to tuple encoding.
20575            fidl::encoding::Encode::<DirectoryDeprecatedOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
20576                (
20577                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
20578                    <ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
20579                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
20580                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
20581                ),
20582                encoder, offset, _depth
20583            )
20584        }
20585    }
20586    unsafe impl<
20587        T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
20588        T1: fidl::encoding::Encode<ModeType, fidl::encoding::DefaultFuchsiaResourceDialect>,
20589        T2: fidl::encoding::Encode<
20590                fidl::encoding::BoundedString<4095>,
20591                fidl::encoding::DefaultFuchsiaResourceDialect,
20592            >,
20593        T3: fidl::encoding::Encode<
20594                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
20595                fidl::encoding::DefaultFuchsiaResourceDialect,
20596            >,
20597    >
20598        fidl::encoding::Encode<
20599            DirectoryDeprecatedOpenRequest,
20600            fidl::encoding::DefaultFuchsiaResourceDialect,
20601        > for (T0, T1, T2, T3)
20602    {
20603        #[inline]
20604        unsafe fn encode(
20605            self,
20606            encoder: &mut fidl::encoding::Encoder<
20607                '_,
20608                fidl::encoding::DefaultFuchsiaResourceDialect,
20609            >,
20610            offset: usize,
20611            depth: fidl::encoding::Depth,
20612        ) -> fidl::Result<()> {
20613            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
20614            // Zero out padding regions. There's no need to apply masks
20615            // because the unmasked parts will be overwritten by fields.
20616            unsafe {
20617                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
20618                (ptr as *mut u64).write_unaligned(0);
20619            }
20620            // Write the fields.
20621            self.0.encode(encoder, offset + 0, depth)?;
20622            self.1.encode(encoder, offset + 4, depth)?;
20623            self.2.encode(encoder, offset + 8, depth)?;
20624            self.3.encode(encoder, offset + 24, depth)?;
20625            Ok(())
20626        }
20627    }
20628
20629    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20630        for DirectoryDeprecatedOpenRequest
20631    {
20632        #[inline(always)]
20633        fn new_empty() -> Self {
20634            Self {
20635                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
20636                mode: fidl::new_empty!(ModeType, fidl::encoding::DefaultFuchsiaResourceDialect),
20637                path: fidl::new_empty!(
20638                    fidl::encoding::BoundedString<4095>,
20639                    fidl::encoding::DefaultFuchsiaResourceDialect
20640                ),
20641                object: fidl::new_empty!(
20642                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
20643                    fidl::encoding::DefaultFuchsiaResourceDialect
20644                ),
20645            }
20646        }
20647
20648        #[inline]
20649        unsafe fn decode(
20650            &mut self,
20651            decoder: &mut fidl::encoding::Decoder<
20652                '_,
20653                fidl::encoding::DefaultFuchsiaResourceDialect,
20654            >,
20655            offset: usize,
20656            _depth: fidl::encoding::Depth,
20657        ) -> fidl::Result<()> {
20658            decoder.debug_check_bounds::<Self>(offset);
20659            // Verify that padding bytes are zero.
20660            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
20661            let padval = unsafe { (ptr as *const u64).read_unaligned() };
20662            let mask = 0xffffffff00000000u64;
20663            let maskedval = padval & mask;
20664            if maskedval != 0 {
20665                return Err(fidl::Error::NonZeroPadding {
20666                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
20667                });
20668            }
20669            fidl::decode!(
20670                OpenFlags,
20671                fidl::encoding::DefaultFuchsiaResourceDialect,
20672                &mut self.flags,
20673                decoder,
20674                offset + 0,
20675                _depth
20676            )?;
20677            fidl::decode!(
20678                ModeType,
20679                fidl::encoding::DefaultFuchsiaResourceDialect,
20680                &mut self.mode,
20681                decoder,
20682                offset + 4,
20683                _depth
20684            )?;
20685            fidl::decode!(
20686                fidl::encoding::BoundedString<4095>,
20687                fidl::encoding::DefaultFuchsiaResourceDialect,
20688                &mut self.path,
20689                decoder,
20690                offset + 8,
20691                _depth
20692            )?;
20693            fidl::decode!(
20694                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
20695                fidl::encoding::DefaultFuchsiaResourceDialect,
20696                &mut self.object,
20697                decoder,
20698                offset + 24,
20699                _depth
20700            )?;
20701            Ok(())
20702        }
20703    }
20704
20705    impl fidl::encoding::ResourceTypeMarker for DirectoryGetTokenResponse {
20706        type Borrowed<'a> = &'a mut Self;
20707        fn take_or_borrow<'a>(
20708            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20709        ) -> Self::Borrowed<'a> {
20710            value
20711        }
20712    }
20713
20714    unsafe impl fidl::encoding::TypeMarker for DirectoryGetTokenResponse {
20715        type Owned = Self;
20716
20717        #[inline(always)]
20718        fn inline_align(_context: fidl::encoding::Context) -> usize {
20719            4
20720        }
20721
20722        #[inline(always)]
20723        fn inline_size(_context: fidl::encoding::Context) -> usize {
20724            8
20725        }
20726    }
20727
20728    unsafe impl
20729        fidl::encoding::Encode<
20730            DirectoryGetTokenResponse,
20731            fidl::encoding::DefaultFuchsiaResourceDialect,
20732        > for &mut DirectoryGetTokenResponse
20733    {
20734        #[inline]
20735        unsafe fn encode(
20736            self,
20737            encoder: &mut fidl::encoding::Encoder<
20738                '_,
20739                fidl::encoding::DefaultFuchsiaResourceDialect,
20740            >,
20741            offset: usize,
20742            _depth: fidl::encoding::Depth,
20743        ) -> fidl::Result<()> {
20744            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
20745            // Delegate to tuple encoding.
20746            fidl::encoding::Encode::<
20747                DirectoryGetTokenResponse,
20748                fidl::encoding::DefaultFuchsiaResourceDialect,
20749            >::encode(
20750                (
20751                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
20752                    <fidl::encoding::Optional<
20753                        fidl::encoding::HandleType<
20754                            fidl::Handle,
20755                            { fidl::ObjectType::NONE.into_raw() },
20756                            2147483648,
20757                        >,
20758                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20759                        &mut self.token
20760                    ),
20761                ),
20762                encoder,
20763                offset,
20764                _depth,
20765            )
20766        }
20767    }
20768    unsafe impl<
20769        T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
20770        T1: fidl::encoding::Encode<
20771                fidl::encoding::Optional<
20772                    fidl::encoding::HandleType<
20773                        fidl::Handle,
20774                        { fidl::ObjectType::NONE.into_raw() },
20775                        2147483648,
20776                    >,
20777                >,
20778                fidl::encoding::DefaultFuchsiaResourceDialect,
20779            >,
20780    >
20781        fidl::encoding::Encode<
20782            DirectoryGetTokenResponse,
20783            fidl::encoding::DefaultFuchsiaResourceDialect,
20784        > for (T0, T1)
20785    {
20786        #[inline]
20787        unsafe fn encode(
20788            self,
20789            encoder: &mut fidl::encoding::Encoder<
20790                '_,
20791                fidl::encoding::DefaultFuchsiaResourceDialect,
20792            >,
20793            offset: usize,
20794            depth: fidl::encoding::Depth,
20795        ) -> fidl::Result<()> {
20796            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
20797            // Zero out padding regions. There's no need to apply masks
20798            // because the unmasked parts will be overwritten by fields.
20799            // Write the fields.
20800            self.0.encode(encoder, offset + 0, depth)?;
20801            self.1.encode(encoder, offset + 4, depth)?;
20802            Ok(())
20803        }
20804    }
20805
20806    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20807        for DirectoryGetTokenResponse
20808    {
20809        #[inline(always)]
20810        fn new_empty() -> Self {
20811            Self {
20812                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
20813                token: fidl::new_empty!(
20814                    fidl::encoding::Optional<
20815                        fidl::encoding::HandleType<
20816                            fidl::Handle,
20817                            { fidl::ObjectType::NONE.into_raw() },
20818                            2147483648,
20819                        >,
20820                    >,
20821                    fidl::encoding::DefaultFuchsiaResourceDialect
20822                ),
20823            }
20824        }
20825
20826        #[inline]
20827        unsafe fn decode(
20828            &mut self,
20829            decoder: &mut fidl::encoding::Decoder<
20830                '_,
20831                fidl::encoding::DefaultFuchsiaResourceDialect,
20832            >,
20833            offset: usize,
20834            _depth: fidl::encoding::Depth,
20835        ) -> fidl::Result<()> {
20836            decoder.debug_check_bounds::<Self>(offset);
20837            // Verify that padding bytes are zero.
20838            fidl::decode!(
20839                i32,
20840                fidl::encoding::DefaultFuchsiaResourceDialect,
20841                &mut self.s,
20842                decoder,
20843                offset + 0,
20844                _depth
20845            )?;
20846            fidl::decode!(
20847                fidl::encoding::Optional<
20848                    fidl::encoding::HandleType<
20849                        fidl::Handle,
20850                        { fidl::ObjectType::NONE.into_raw() },
20851                        2147483648,
20852                    >,
20853                >,
20854                fidl::encoding::DefaultFuchsiaResourceDialect,
20855                &mut self.token,
20856                decoder,
20857                offset + 4,
20858                _depth
20859            )?;
20860            Ok(())
20861        }
20862    }
20863
20864    impl fidl::encoding::ResourceTypeMarker for DirectoryLinkRequest {
20865        type Borrowed<'a> = &'a mut Self;
20866        fn take_or_borrow<'a>(
20867            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20868        ) -> Self::Borrowed<'a> {
20869            value
20870        }
20871    }
20872
20873    unsafe impl fidl::encoding::TypeMarker for DirectoryLinkRequest {
20874        type Owned = Self;
20875
20876        #[inline(always)]
20877        fn inline_align(_context: fidl::encoding::Context) -> usize {
20878            8
20879        }
20880
20881        #[inline(always)]
20882        fn inline_size(_context: fidl::encoding::Context) -> usize {
20883            40
20884        }
20885    }
20886
20887    unsafe impl
20888        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
20889        for &mut DirectoryLinkRequest
20890    {
20891        #[inline]
20892        unsafe fn encode(
20893            self,
20894            encoder: &mut fidl::encoding::Encoder<
20895                '_,
20896                fidl::encoding::DefaultFuchsiaResourceDialect,
20897            >,
20898            offset: usize,
20899            _depth: fidl::encoding::Depth,
20900        ) -> fidl::Result<()> {
20901            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
20902            // Delegate to tuple encoding.
20903            fidl::encoding::Encode::<
20904                DirectoryLinkRequest,
20905                fidl::encoding::DefaultFuchsiaResourceDialect,
20906            >::encode(
20907                (
20908                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
20909                        &self.src,
20910                    ),
20911                    <fidl::encoding::HandleType<
20912                        fidl::Handle,
20913                        { fidl::ObjectType::NONE.into_raw() },
20914                        2147483648,
20915                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20916                        &mut self.dst_parent_token,
20917                    ),
20918                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
20919                        &self.dst,
20920                    ),
20921                ),
20922                encoder,
20923                offset,
20924                _depth,
20925            )
20926        }
20927    }
20928    unsafe impl<
20929        T0: fidl::encoding::Encode<
20930                fidl::encoding::BoundedString<255>,
20931                fidl::encoding::DefaultFuchsiaResourceDialect,
20932            >,
20933        T1: fidl::encoding::Encode<
20934                fidl::encoding::HandleType<
20935                    fidl::Handle,
20936                    { fidl::ObjectType::NONE.into_raw() },
20937                    2147483648,
20938                >,
20939                fidl::encoding::DefaultFuchsiaResourceDialect,
20940            >,
20941        T2: fidl::encoding::Encode<
20942                fidl::encoding::BoundedString<255>,
20943                fidl::encoding::DefaultFuchsiaResourceDialect,
20944            >,
20945    >
20946        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
20947        for (T0, T1, T2)
20948    {
20949        #[inline]
20950        unsafe fn encode(
20951            self,
20952            encoder: &mut fidl::encoding::Encoder<
20953                '_,
20954                fidl::encoding::DefaultFuchsiaResourceDialect,
20955            >,
20956            offset: usize,
20957            depth: fidl::encoding::Depth,
20958        ) -> fidl::Result<()> {
20959            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
20960            // Zero out padding regions. There's no need to apply masks
20961            // because the unmasked parts will be overwritten by fields.
20962            unsafe {
20963                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
20964                (ptr as *mut u64).write_unaligned(0);
20965            }
20966            // Write the fields.
20967            self.0.encode(encoder, offset + 0, depth)?;
20968            self.1.encode(encoder, offset + 16, depth)?;
20969            self.2.encode(encoder, offset + 24, depth)?;
20970            Ok(())
20971        }
20972    }
20973
20974    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20975        for DirectoryLinkRequest
20976    {
20977        #[inline(always)]
20978        fn new_empty() -> Self {
20979            Self {
20980                src: fidl::new_empty!(
20981                    fidl::encoding::BoundedString<255>,
20982                    fidl::encoding::DefaultFuchsiaResourceDialect
20983                ),
20984                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
20985                dst: fidl::new_empty!(
20986                    fidl::encoding::BoundedString<255>,
20987                    fidl::encoding::DefaultFuchsiaResourceDialect
20988                ),
20989            }
20990        }
20991
20992        #[inline]
20993        unsafe fn decode(
20994            &mut self,
20995            decoder: &mut fidl::encoding::Decoder<
20996                '_,
20997                fidl::encoding::DefaultFuchsiaResourceDialect,
20998            >,
20999            offset: usize,
21000            _depth: fidl::encoding::Depth,
21001        ) -> fidl::Result<()> {
21002            decoder.debug_check_bounds::<Self>(offset);
21003            // Verify that padding bytes are zero.
21004            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21005            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21006            let mask = 0xffffffff00000000u64;
21007            let maskedval = padval & mask;
21008            if maskedval != 0 {
21009                return Err(fidl::Error::NonZeroPadding {
21010                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21011                });
21012            }
21013            fidl::decode!(
21014                fidl::encoding::BoundedString<255>,
21015                fidl::encoding::DefaultFuchsiaResourceDialect,
21016                &mut self.src,
21017                decoder,
21018                offset + 0,
21019                _depth
21020            )?;
21021            fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dst_parent_token, decoder, offset + 16, _depth)?;
21022            fidl::decode!(
21023                fidl::encoding::BoundedString<255>,
21024                fidl::encoding::DefaultFuchsiaResourceDialect,
21025                &mut self.dst,
21026                decoder,
21027                offset + 24,
21028                _depth
21029            )?;
21030            Ok(())
21031        }
21032    }
21033
21034    impl fidl::encoding::ResourceTypeMarker for DirectoryOpenRequest {
21035        type Borrowed<'a> = &'a mut Self;
21036        fn take_or_borrow<'a>(
21037            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21038        ) -> Self::Borrowed<'a> {
21039            value
21040        }
21041    }
21042
21043    unsafe impl fidl::encoding::TypeMarker for DirectoryOpenRequest {
21044        type Owned = Self;
21045
21046        #[inline(always)]
21047        fn inline_align(_context: fidl::encoding::Context) -> usize {
21048            8
21049        }
21050
21051        #[inline(always)]
21052        fn inline_size(_context: fidl::encoding::Context) -> usize {
21053            48
21054        }
21055    }
21056
21057    unsafe impl
21058        fidl::encoding::Encode<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21059        for &mut DirectoryOpenRequest
21060    {
21061        #[inline]
21062        unsafe fn encode(
21063            self,
21064            encoder: &mut fidl::encoding::Encoder<
21065                '_,
21066                fidl::encoding::DefaultFuchsiaResourceDialect,
21067            >,
21068            offset: usize,
21069            _depth: fidl::encoding::Depth,
21070        ) -> fidl::Result<()> {
21071            encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
21072            // Delegate to tuple encoding.
21073            fidl::encoding::Encode::<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21074                (
21075                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
21076                    <Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
21077                    <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
21078                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
21079                ),
21080                encoder, offset, _depth
21081            )
21082        }
21083    }
21084    unsafe impl<
21085        T0: fidl::encoding::Encode<
21086                fidl::encoding::BoundedString<4095>,
21087                fidl::encoding::DefaultFuchsiaResourceDialect,
21088            >,
21089        T1: fidl::encoding::Encode<Flags, fidl::encoding::DefaultFuchsiaResourceDialect>,
21090        T2: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
21091        T3: fidl::encoding::Encode<
21092                fidl::encoding::HandleType<
21093                    fidl::Channel,
21094                    { fidl::ObjectType::CHANNEL.into_raw() },
21095                    2147483648,
21096                >,
21097                fidl::encoding::DefaultFuchsiaResourceDialect,
21098            >,
21099    >
21100        fidl::encoding::Encode<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21101        for (T0, T1, T2, T3)
21102    {
21103        #[inline]
21104        unsafe fn encode(
21105            self,
21106            encoder: &mut fidl::encoding::Encoder<
21107                '_,
21108                fidl::encoding::DefaultFuchsiaResourceDialect,
21109            >,
21110            offset: usize,
21111            depth: fidl::encoding::Depth,
21112        ) -> fidl::Result<()> {
21113            encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
21114            // Zero out padding regions. There's no need to apply masks
21115            // because the unmasked parts will be overwritten by fields.
21116            unsafe {
21117                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
21118                (ptr as *mut u64).write_unaligned(0);
21119            }
21120            // Write the fields.
21121            self.0.encode(encoder, offset + 0, depth)?;
21122            self.1.encode(encoder, offset + 16, depth)?;
21123            self.2.encode(encoder, offset + 24, depth)?;
21124            self.3.encode(encoder, offset + 40, depth)?;
21125            Ok(())
21126        }
21127    }
21128
21129    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21130        for DirectoryOpenRequest
21131    {
21132        #[inline(always)]
21133        fn new_empty() -> Self {
21134            Self {
21135                path: fidl::new_empty!(
21136                    fidl::encoding::BoundedString<4095>,
21137                    fidl::encoding::DefaultFuchsiaResourceDialect
21138                ),
21139                flags: fidl::new_empty!(Flags, fidl::encoding::DefaultFuchsiaResourceDialect),
21140                options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
21141                object: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21142            }
21143        }
21144
21145        #[inline]
21146        unsafe fn decode(
21147            &mut self,
21148            decoder: &mut fidl::encoding::Decoder<
21149                '_,
21150                fidl::encoding::DefaultFuchsiaResourceDialect,
21151            >,
21152            offset: usize,
21153            _depth: fidl::encoding::Depth,
21154        ) -> fidl::Result<()> {
21155            decoder.debug_check_bounds::<Self>(offset);
21156            // Verify that padding bytes are zero.
21157            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
21158            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21159            let mask = 0xffffffff00000000u64;
21160            let maskedval = padval & mask;
21161            if maskedval != 0 {
21162                return Err(fidl::Error::NonZeroPadding {
21163                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
21164                });
21165            }
21166            fidl::decode!(
21167                fidl::encoding::BoundedString<4095>,
21168                fidl::encoding::DefaultFuchsiaResourceDialect,
21169                &mut self.path,
21170                decoder,
21171                offset + 0,
21172                _depth
21173            )?;
21174            fidl::decode!(
21175                Flags,
21176                fidl::encoding::DefaultFuchsiaResourceDialect,
21177                &mut self.flags,
21178                decoder,
21179                offset + 16,
21180                _depth
21181            )?;
21182            fidl::decode!(
21183                Options,
21184                fidl::encoding::DefaultFuchsiaResourceDialect,
21185                &mut self.options,
21186                decoder,
21187                offset + 24,
21188                _depth
21189            )?;
21190            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.object, decoder, offset + 40, _depth)?;
21191            Ok(())
21192        }
21193    }
21194
21195    impl fidl::encoding::ResourceTypeMarker for DirectoryRenameRequest {
21196        type Borrowed<'a> = &'a mut Self;
21197        fn take_or_borrow<'a>(
21198            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21199        ) -> Self::Borrowed<'a> {
21200            value
21201        }
21202    }
21203
21204    unsafe impl fidl::encoding::TypeMarker for DirectoryRenameRequest {
21205        type Owned = Self;
21206
21207        #[inline(always)]
21208        fn inline_align(_context: fidl::encoding::Context) -> usize {
21209            8
21210        }
21211
21212        #[inline(always)]
21213        fn inline_size(_context: fidl::encoding::Context) -> usize {
21214            40
21215        }
21216    }
21217
21218    unsafe impl
21219        fidl::encoding::Encode<
21220            DirectoryRenameRequest,
21221            fidl::encoding::DefaultFuchsiaResourceDialect,
21222        > for &mut DirectoryRenameRequest
21223    {
21224        #[inline]
21225        unsafe fn encode(
21226            self,
21227            encoder: &mut fidl::encoding::Encoder<
21228                '_,
21229                fidl::encoding::DefaultFuchsiaResourceDialect,
21230            >,
21231            offset: usize,
21232            _depth: fidl::encoding::Depth,
21233        ) -> fidl::Result<()> {
21234            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
21235            // Delegate to tuple encoding.
21236            fidl::encoding::Encode::<
21237                DirectoryRenameRequest,
21238                fidl::encoding::DefaultFuchsiaResourceDialect,
21239            >::encode(
21240                (
21241                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21242                        &self.src,
21243                    ),
21244                    <fidl::encoding::HandleType<
21245                        fidl::Event,
21246                        { fidl::ObjectType::EVENT.into_raw() },
21247                        2147483648,
21248                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21249                        &mut self.dst_parent_token,
21250                    ),
21251                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21252                        &self.dst,
21253                    ),
21254                ),
21255                encoder,
21256                offset,
21257                _depth,
21258            )
21259        }
21260    }
21261    unsafe impl<
21262        T0: fidl::encoding::Encode<
21263                fidl::encoding::BoundedString<255>,
21264                fidl::encoding::DefaultFuchsiaResourceDialect,
21265            >,
21266        T1: fidl::encoding::Encode<
21267                fidl::encoding::HandleType<
21268                    fidl::Event,
21269                    { fidl::ObjectType::EVENT.into_raw() },
21270                    2147483648,
21271                >,
21272                fidl::encoding::DefaultFuchsiaResourceDialect,
21273            >,
21274        T2: fidl::encoding::Encode<
21275                fidl::encoding::BoundedString<255>,
21276                fidl::encoding::DefaultFuchsiaResourceDialect,
21277            >,
21278    >
21279        fidl::encoding::Encode<
21280            DirectoryRenameRequest,
21281            fidl::encoding::DefaultFuchsiaResourceDialect,
21282        > for (T0, T1, T2)
21283    {
21284        #[inline]
21285        unsafe fn encode(
21286            self,
21287            encoder: &mut fidl::encoding::Encoder<
21288                '_,
21289                fidl::encoding::DefaultFuchsiaResourceDialect,
21290            >,
21291            offset: usize,
21292            depth: fidl::encoding::Depth,
21293        ) -> fidl::Result<()> {
21294            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
21295            // Zero out padding regions. There's no need to apply masks
21296            // because the unmasked parts will be overwritten by fields.
21297            unsafe {
21298                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21299                (ptr as *mut u64).write_unaligned(0);
21300            }
21301            // Write the fields.
21302            self.0.encode(encoder, offset + 0, depth)?;
21303            self.1.encode(encoder, offset + 16, depth)?;
21304            self.2.encode(encoder, offset + 24, depth)?;
21305            Ok(())
21306        }
21307    }
21308
21309    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21310        for DirectoryRenameRequest
21311    {
21312        #[inline(always)]
21313        fn new_empty() -> Self {
21314            Self {
21315                src: fidl::new_empty!(
21316                    fidl::encoding::BoundedString<255>,
21317                    fidl::encoding::DefaultFuchsiaResourceDialect
21318                ),
21319                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21320                dst: fidl::new_empty!(
21321                    fidl::encoding::BoundedString<255>,
21322                    fidl::encoding::DefaultFuchsiaResourceDialect
21323                ),
21324            }
21325        }
21326
21327        #[inline]
21328        unsafe fn decode(
21329            &mut self,
21330            decoder: &mut fidl::encoding::Decoder<
21331                '_,
21332                fidl::encoding::DefaultFuchsiaResourceDialect,
21333            >,
21334            offset: usize,
21335            _depth: fidl::encoding::Depth,
21336        ) -> fidl::Result<()> {
21337            decoder.debug_check_bounds::<Self>(offset);
21338            // Verify that padding bytes are zero.
21339            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21340            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21341            let mask = 0xffffffff00000000u64;
21342            let maskedval = padval & mask;
21343            if maskedval != 0 {
21344                return Err(fidl::Error::NonZeroPadding {
21345                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21346                });
21347            }
21348            fidl::decode!(
21349                fidl::encoding::BoundedString<255>,
21350                fidl::encoding::DefaultFuchsiaResourceDialect,
21351                &mut self.src,
21352                decoder,
21353                offset + 0,
21354                _depth
21355            )?;
21356            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)?;
21357            fidl::decode!(
21358                fidl::encoding::BoundedString<255>,
21359                fidl::encoding::DefaultFuchsiaResourceDialect,
21360                &mut self.dst,
21361                decoder,
21362                offset + 24,
21363                _depth
21364            )?;
21365            Ok(())
21366        }
21367    }
21368
21369    impl fidl::encoding::ResourceTypeMarker for DirectoryWatchRequest {
21370        type Borrowed<'a> = &'a mut Self;
21371        fn take_or_borrow<'a>(
21372            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21373        ) -> Self::Borrowed<'a> {
21374            value
21375        }
21376    }
21377
21378    unsafe impl fidl::encoding::TypeMarker for DirectoryWatchRequest {
21379        type Owned = Self;
21380
21381        #[inline(always)]
21382        fn inline_align(_context: fidl::encoding::Context) -> usize {
21383            4
21384        }
21385
21386        #[inline(always)]
21387        fn inline_size(_context: fidl::encoding::Context) -> usize {
21388            12
21389        }
21390    }
21391
21392    unsafe impl
21393        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21394        for &mut DirectoryWatchRequest
21395    {
21396        #[inline]
21397        unsafe fn encode(
21398            self,
21399            encoder: &mut fidl::encoding::Encoder<
21400                '_,
21401                fidl::encoding::DefaultFuchsiaResourceDialect,
21402            >,
21403            offset: usize,
21404            _depth: fidl::encoding::Depth,
21405        ) -> fidl::Result<()> {
21406            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
21407            // Delegate to tuple encoding.
21408            fidl::encoding::Encode::<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21409                (
21410                    <WatchMask as fidl::encoding::ValueTypeMarker>::borrow(&self.mask),
21411                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
21412                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
21413                ),
21414                encoder, offset, _depth
21415            )
21416        }
21417    }
21418    unsafe impl<
21419        T0: fidl::encoding::Encode<WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect>,
21420        T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
21421        T2: fidl::encoding::Encode<
21422                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
21423                fidl::encoding::DefaultFuchsiaResourceDialect,
21424            >,
21425    >
21426        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21427        for (T0, T1, T2)
21428    {
21429        #[inline]
21430        unsafe fn encode(
21431            self,
21432            encoder: &mut fidl::encoding::Encoder<
21433                '_,
21434                fidl::encoding::DefaultFuchsiaResourceDialect,
21435            >,
21436            offset: usize,
21437            depth: fidl::encoding::Depth,
21438        ) -> fidl::Result<()> {
21439            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
21440            // Zero out padding regions. There's no need to apply masks
21441            // because the unmasked parts will be overwritten by fields.
21442            // Write the fields.
21443            self.0.encode(encoder, offset + 0, depth)?;
21444            self.1.encode(encoder, offset + 4, depth)?;
21445            self.2.encode(encoder, offset + 8, depth)?;
21446            Ok(())
21447        }
21448    }
21449
21450    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21451        for DirectoryWatchRequest
21452    {
21453        #[inline(always)]
21454        fn new_empty() -> Self {
21455            Self {
21456                mask: fidl::new_empty!(WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect),
21457                options: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
21458                watcher: fidl::new_empty!(
21459                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
21460                    fidl::encoding::DefaultFuchsiaResourceDialect
21461                ),
21462            }
21463        }
21464
21465        #[inline]
21466        unsafe fn decode(
21467            &mut self,
21468            decoder: &mut fidl::encoding::Decoder<
21469                '_,
21470                fidl::encoding::DefaultFuchsiaResourceDialect,
21471            >,
21472            offset: usize,
21473            _depth: fidl::encoding::Depth,
21474        ) -> fidl::Result<()> {
21475            decoder.debug_check_bounds::<Self>(offset);
21476            // Verify that padding bytes are zero.
21477            fidl::decode!(
21478                WatchMask,
21479                fidl::encoding::DefaultFuchsiaResourceDialect,
21480                &mut self.mask,
21481                decoder,
21482                offset + 0,
21483                _depth
21484            )?;
21485            fidl::decode!(
21486                u32,
21487                fidl::encoding::DefaultFuchsiaResourceDialect,
21488                &mut self.options,
21489                decoder,
21490                offset + 4,
21491                _depth
21492            )?;
21493            fidl::decode!(
21494                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
21495                fidl::encoding::DefaultFuchsiaResourceDialect,
21496                &mut self.watcher,
21497                decoder,
21498                offset + 8,
21499                _depth
21500            )?;
21501            Ok(())
21502        }
21503    }
21504
21505    impl fidl::encoding::ResourceTypeMarker for FileAllocateRequest {
21506        type Borrowed<'a> = &'a mut Self;
21507        fn take_or_borrow<'a>(
21508            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21509        ) -> Self::Borrowed<'a> {
21510            value
21511        }
21512    }
21513
21514    unsafe impl fidl::encoding::TypeMarker for FileAllocateRequest {
21515        type Owned = Self;
21516
21517        #[inline(always)]
21518        fn inline_align(_context: fidl::encoding::Context) -> usize {
21519            8
21520        }
21521
21522        #[inline(always)]
21523        fn inline_size(_context: fidl::encoding::Context) -> usize {
21524            24
21525        }
21526    }
21527
21528    unsafe impl
21529        fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21530        for &mut FileAllocateRequest
21531    {
21532        #[inline]
21533        unsafe fn encode(
21534            self,
21535            encoder: &mut fidl::encoding::Encoder<
21536                '_,
21537                fidl::encoding::DefaultFuchsiaResourceDialect,
21538            >,
21539            offset: usize,
21540            _depth: fidl::encoding::Depth,
21541        ) -> fidl::Result<()> {
21542            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
21543            // Delegate to tuple encoding.
21544            fidl::encoding::Encode::<
21545                FileAllocateRequest,
21546                fidl::encoding::DefaultFuchsiaResourceDialect,
21547            >::encode(
21548                (
21549                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
21550                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
21551                    <AllocateMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
21552                ),
21553                encoder,
21554                offset,
21555                _depth,
21556            )
21557        }
21558    }
21559    unsafe impl<
21560        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
21561        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
21562        T2: fidl::encoding::Encode<AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect>,
21563    > fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21564        for (T0, T1, T2)
21565    {
21566        #[inline]
21567        unsafe fn encode(
21568            self,
21569            encoder: &mut fidl::encoding::Encoder<
21570                '_,
21571                fidl::encoding::DefaultFuchsiaResourceDialect,
21572            >,
21573            offset: usize,
21574            depth: fidl::encoding::Depth,
21575        ) -> fidl::Result<()> {
21576            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
21577            // Zero out padding regions. There's no need to apply masks
21578            // because the unmasked parts will be overwritten by fields.
21579            unsafe {
21580                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21581                (ptr as *mut u64).write_unaligned(0);
21582            }
21583            // Write the fields.
21584            self.0.encode(encoder, offset + 0, depth)?;
21585            self.1.encode(encoder, offset + 8, depth)?;
21586            self.2.encode(encoder, offset + 16, depth)?;
21587            Ok(())
21588        }
21589    }
21590
21591    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21592        for FileAllocateRequest
21593    {
21594        #[inline(always)]
21595        fn new_empty() -> Self {
21596            Self {
21597                offset: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
21598                length: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
21599                mode: fidl::new_empty!(AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect),
21600            }
21601        }
21602
21603        #[inline]
21604        unsafe fn decode(
21605            &mut self,
21606            decoder: &mut fidl::encoding::Decoder<
21607                '_,
21608                fidl::encoding::DefaultFuchsiaResourceDialect,
21609            >,
21610            offset: usize,
21611            _depth: fidl::encoding::Depth,
21612        ) -> fidl::Result<()> {
21613            decoder.debug_check_bounds::<Self>(offset);
21614            // Verify that padding bytes are zero.
21615            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21616            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21617            let mask = 0xffffffff00000000u64;
21618            let maskedval = padval & mask;
21619            if maskedval != 0 {
21620                return Err(fidl::Error::NonZeroPadding {
21621                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21622                });
21623            }
21624            fidl::decode!(
21625                u64,
21626                fidl::encoding::DefaultFuchsiaResourceDialect,
21627                &mut self.offset,
21628                decoder,
21629                offset + 0,
21630                _depth
21631            )?;
21632            fidl::decode!(
21633                u64,
21634                fidl::encoding::DefaultFuchsiaResourceDialect,
21635                &mut self.length,
21636                decoder,
21637                offset + 8,
21638                _depth
21639            )?;
21640            fidl::decode!(
21641                AllocateMode,
21642                fidl::encoding::DefaultFuchsiaResourceDialect,
21643                &mut self.mode,
21644                decoder,
21645                offset + 16,
21646                _depth
21647            )?;
21648            Ok(())
21649        }
21650    }
21651
21652    impl fidl::encoding::ResourceTypeMarker for FileEnableVerityRequest {
21653        type Borrowed<'a> = &'a mut Self;
21654        fn take_or_borrow<'a>(
21655            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21656        ) -> Self::Borrowed<'a> {
21657            value
21658        }
21659    }
21660
21661    unsafe impl fidl::encoding::TypeMarker for FileEnableVerityRequest {
21662        type Owned = Self;
21663
21664        #[inline(always)]
21665        fn inline_align(_context: fidl::encoding::Context) -> usize {
21666            8
21667        }
21668
21669        #[inline(always)]
21670        fn inline_size(_context: fidl::encoding::Context) -> usize {
21671            16
21672        }
21673    }
21674
21675    unsafe impl
21676        fidl::encoding::Encode<
21677            FileEnableVerityRequest,
21678            fidl::encoding::DefaultFuchsiaResourceDialect,
21679        > for &mut FileEnableVerityRequest
21680    {
21681        #[inline]
21682        unsafe fn encode(
21683            self,
21684            encoder: &mut fidl::encoding::Encoder<
21685                '_,
21686                fidl::encoding::DefaultFuchsiaResourceDialect,
21687            >,
21688            offset: usize,
21689            _depth: fidl::encoding::Depth,
21690        ) -> fidl::Result<()> {
21691            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
21692            // Delegate to tuple encoding.
21693            fidl::encoding::Encode::<
21694                FileEnableVerityRequest,
21695                fidl::encoding::DefaultFuchsiaResourceDialect,
21696            >::encode(
21697                (<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
21698                encoder,
21699                offset,
21700                _depth,
21701            )
21702        }
21703    }
21704    unsafe impl<
21705        T0: fidl::encoding::Encode<VerificationOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
21706    >
21707        fidl::encoding::Encode<
21708            FileEnableVerityRequest,
21709            fidl::encoding::DefaultFuchsiaResourceDialect,
21710        > for (T0,)
21711    {
21712        #[inline]
21713        unsafe fn encode(
21714            self,
21715            encoder: &mut fidl::encoding::Encoder<
21716                '_,
21717                fidl::encoding::DefaultFuchsiaResourceDialect,
21718            >,
21719            offset: usize,
21720            depth: fidl::encoding::Depth,
21721        ) -> fidl::Result<()> {
21722            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
21723            // Zero out padding regions. There's no need to apply masks
21724            // because the unmasked parts will be overwritten by fields.
21725            // Write the fields.
21726            self.0.encode(encoder, offset + 0, depth)?;
21727            Ok(())
21728        }
21729    }
21730
21731    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21732        for FileEnableVerityRequest
21733    {
21734        #[inline(always)]
21735        fn new_empty() -> Self {
21736            Self {
21737                options: fidl::new_empty!(
21738                    VerificationOptions,
21739                    fidl::encoding::DefaultFuchsiaResourceDialect
21740                ),
21741            }
21742        }
21743
21744        #[inline]
21745        unsafe fn decode(
21746            &mut self,
21747            decoder: &mut fidl::encoding::Decoder<
21748                '_,
21749                fidl::encoding::DefaultFuchsiaResourceDialect,
21750            >,
21751            offset: usize,
21752            _depth: fidl::encoding::Depth,
21753        ) -> fidl::Result<()> {
21754            decoder.debug_check_bounds::<Self>(offset);
21755            // Verify that padding bytes are zero.
21756            fidl::decode!(
21757                VerificationOptions,
21758                fidl::encoding::DefaultFuchsiaResourceDialect,
21759                &mut self.options,
21760                decoder,
21761                offset + 0,
21762                _depth
21763            )?;
21764            Ok(())
21765        }
21766    }
21767
21768    impl fidl::encoding::ResourceTypeMarker for FileObject {
21769        type Borrowed<'a> = &'a mut Self;
21770        fn take_or_borrow<'a>(
21771            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21772        ) -> Self::Borrowed<'a> {
21773            value
21774        }
21775    }
21776
21777    unsafe impl fidl::encoding::TypeMarker for FileObject {
21778        type Owned = Self;
21779
21780        #[inline(always)]
21781        fn inline_align(_context: fidl::encoding::Context) -> usize {
21782            4
21783        }
21784
21785        #[inline(always)]
21786        fn inline_size(_context: fidl::encoding::Context) -> usize {
21787            8
21788        }
21789    }
21790
21791    unsafe impl fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
21792        for &mut FileObject
21793    {
21794        #[inline]
21795        unsafe fn encode(
21796            self,
21797            encoder: &mut fidl::encoding::Encoder<
21798                '_,
21799                fidl::encoding::DefaultFuchsiaResourceDialect,
21800            >,
21801            offset: usize,
21802            _depth: fidl::encoding::Depth,
21803        ) -> fidl::Result<()> {
21804            encoder.debug_check_bounds::<FileObject>(offset);
21805            // Delegate to tuple encoding.
21806            fidl::encoding::Encode::<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21807                (
21808                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.event),
21809                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stream),
21810                ),
21811                encoder, offset, _depth
21812            )
21813        }
21814    }
21815    unsafe impl<
21816        T0: fidl::encoding::Encode<
21817                fidl::encoding::Optional<
21818                    fidl::encoding::HandleType<
21819                        fidl::Event,
21820                        { fidl::ObjectType::EVENT.into_raw() },
21821                        2147483648,
21822                    >,
21823                >,
21824                fidl::encoding::DefaultFuchsiaResourceDialect,
21825            >,
21826        T1: fidl::encoding::Encode<
21827                fidl::encoding::Optional<
21828                    fidl::encoding::HandleType<
21829                        fidl::Stream,
21830                        { fidl::ObjectType::STREAM.into_raw() },
21831                        2147483648,
21832                    >,
21833                >,
21834                fidl::encoding::DefaultFuchsiaResourceDialect,
21835            >,
21836    > fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
21837        for (T0, T1)
21838    {
21839        #[inline]
21840        unsafe fn encode(
21841            self,
21842            encoder: &mut fidl::encoding::Encoder<
21843                '_,
21844                fidl::encoding::DefaultFuchsiaResourceDialect,
21845            >,
21846            offset: usize,
21847            depth: fidl::encoding::Depth,
21848        ) -> fidl::Result<()> {
21849            encoder.debug_check_bounds::<FileObject>(offset);
21850            // Zero out padding regions. There's no need to apply masks
21851            // because the unmasked parts will be overwritten by fields.
21852            // Write the fields.
21853            self.0.encode(encoder, offset + 0, depth)?;
21854            self.1.encode(encoder, offset + 4, depth)?;
21855            Ok(())
21856        }
21857    }
21858
21859    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileObject {
21860        #[inline(always)]
21861        fn new_empty() -> Self {
21862            Self {
21863                event: fidl::new_empty!(
21864                    fidl::encoding::Optional<
21865                        fidl::encoding::HandleType<
21866                            fidl::Event,
21867                            { fidl::ObjectType::EVENT.into_raw() },
21868                            2147483648,
21869                        >,
21870                    >,
21871                    fidl::encoding::DefaultFuchsiaResourceDialect
21872                ),
21873                stream: fidl::new_empty!(
21874                    fidl::encoding::Optional<
21875                        fidl::encoding::HandleType<
21876                            fidl::Stream,
21877                            { fidl::ObjectType::STREAM.into_raw() },
21878                            2147483648,
21879                        >,
21880                    >,
21881                    fidl::encoding::DefaultFuchsiaResourceDialect
21882                ),
21883            }
21884        }
21885
21886        #[inline]
21887        unsafe fn decode(
21888            &mut self,
21889            decoder: &mut fidl::encoding::Decoder<
21890                '_,
21891                fidl::encoding::DefaultFuchsiaResourceDialect,
21892            >,
21893            offset: usize,
21894            _depth: fidl::encoding::Depth,
21895        ) -> fidl::Result<()> {
21896            decoder.debug_check_bounds::<Self>(offset);
21897            // Verify that padding bytes are zero.
21898            fidl::decode!(
21899                fidl::encoding::Optional<
21900                    fidl::encoding::HandleType<
21901                        fidl::Event,
21902                        { fidl::ObjectType::EVENT.into_raw() },
21903                        2147483648,
21904                    >,
21905                >,
21906                fidl::encoding::DefaultFuchsiaResourceDialect,
21907                &mut self.event,
21908                decoder,
21909                offset + 0,
21910                _depth
21911            )?;
21912            fidl::decode!(
21913                fidl::encoding::Optional<
21914                    fidl::encoding::HandleType<
21915                        fidl::Stream,
21916                        { fidl::ObjectType::STREAM.into_raw() },
21917                        2147483648,
21918                    >,
21919                >,
21920                fidl::encoding::DefaultFuchsiaResourceDialect,
21921                &mut self.stream,
21922                decoder,
21923                offset + 4,
21924                _depth
21925            )?;
21926            Ok(())
21927        }
21928    }
21929
21930    impl fidl::encoding::ResourceTypeMarker for FileGetBackingMemoryResponse {
21931        type Borrowed<'a> = &'a mut Self;
21932        fn take_or_borrow<'a>(
21933            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21934        ) -> Self::Borrowed<'a> {
21935            value
21936        }
21937    }
21938
21939    unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryResponse {
21940        type Owned = Self;
21941
21942        #[inline(always)]
21943        fn inline_align(_context: fidl::encoding::Context) -> usize {
21944            4
21945        }
21946
21947        #[inline(always)]
21948        fn inline_size(_context: fidl::encoding::Context) -> usize {
21949            4
21950        }
21951    }
21952
21953    unsafe impl
21954        fidl::encoding::Encode<
21955            FileGetBackingMemoryResponse,
21956            fidl::encoding::DefaultFuchsiaResourceDialect,
21957        > for &mut FileGetBackingMemoryResponse
21958    {
21959        #[inline]
21960        unsafe fn encode(
21961            self,
21962            encoder: &mut fidl::encoding::Encoder<
21963                '_,
21964                fidl::encoding::DefaultFuchsiaResourceDialect,
21965            >,
21966            offset: usize,
21967            _depth: fidl::encoding::Depth,
21968        ) -> fidl::Result<()> {
21969            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
21970            // Delegate to tuple encoding.
21971            fidl::encoding::Encode::<
21972                FileGetBackingMemoryResponse,
21973                fidl::encoding::DefaultFuchsiaResourceDialect,
21974            >::encode(
21975                (<fidl::encoding::HandleType<
21976                    fidl::Vmo,
21977                    { fidl::ObjectType::VMO.into_raw() },
21978                    2147483648,
21979                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21980                    &mut self.vmo
21981                ),),
21982                encoder,
21983                offset,
21984                _depth,
21985            )
21986        }
21987    }
21988    unsafe impl<
21989        T0: fidl::encoding::Encode<
21990                fidl::encoding::HandleType<
21991                    fidl::Vmo,
21992                    { fidl::ObjectType::VMO.into_raw() },
21993                    2147483648,
21994                >,
21995                fidl::encoding::DefaultFuchsiaResourceDialect,
21996            >,
21997    >
21998        fidl::encoding::Encode<
21999            FileGetBackingMemoryResponse,
22000            fidl::encoding::DefaultFuchsiaResourceDialect,
22001        > for (T0,)
22002    {
22003        #[inline]
22004        unsafe fn encode(
22005            self,
22006            encoder: &mut fidl::encoding::Encoder<
22007                '_,
22008                fidl::encoding::DefaultFuchsiaResourceDialect,
22009            >,
22010            offset: usize,
22011            depth: fidl::encoding::Depth,
22012        ) -> fidl::Result<()> {
22013            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
22014            // Zero out padding regions. There's no need to apply masks
22015            // because the unmasked parts will be overwritten by fields.
22016            // Write the fields.
22017            self.0.encode(encoder, offset + 0, depth)?;
22018            Ok(())
22019        }
22020    }
22021
22022    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22023        for FileGetBackingMemoryResponse
22024    {
22025        #[inline(always)]
22026        fn new_empty() -> Self {
22027            Self {
22028                vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22029            }
22030        }
22031
22032        #[inline]
22033        unsafe fn decode(
22034            &mut self,
22035            decoder: &mut fidl::encoding::Decoder<
22036                '_,
22037                fidl::encoding::DefaultFuchsiaResourceDialect,
22038            >,
22039            offset: usize,
22040            _depth: fidl::encoding::Depth,
22041        ) -> fidl::Result<()> {
22042            decoder.debug_check_bounds::<Self>(offset);
22043            // Verify that padding bytes are zero.
22044            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
22045            Ok(())
22046        }
22047    }
22048
22049    impl fidl::encoding::ResourceTypeMarker for LinkableLinkIntoRequest {
22050        type Borrowed<'a> = &'a mut Self;
22051        fn take_or_borrow<'a>(
22052            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22053        ) -> Self::Borrowed<'a> {
22054            value
22055        }
22056    }
22057
22058    unsafe impl fidl::encoding::TypeMarker for LinkableLinkIntoRequest {
22059        type Owned = Self;
22060
22061        #[inline(always)]
22062        fn inline_align(_context: fidl::encoding::Context) -> usize {
22063            8
22064        }
22065
22066        #[inline(always)]
22067        fn inline_size(_context: fidl::encoding::Context) -> usize {
22068            24
22069        }
22070    }
22071
22072    unsafe impl
22073        fidl::encoding::Encode<
22074            LinkableLinkIntoRequest,
22075            fidl::encoding::DefaultFuchsiaResourceDialect,
22076        > for &mut LinkableLinkIntoRequest
22077    {
22078        #[inline]
22079        unsafe fn encode(
22080            self,
22081            encoder: &mut fidl::encoding::Encoder<
22082                '_,
22083                fidl::encoding::DefaultFuchsiaResourceDialect,
22084            >,
22085            offset: usize,
22086            _depth: fidl::encoding::Depth,
22087        ) -> fidl::Result<()> {
22088            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
22089            // Delegate to tuple encoding.
22090            fidl::encoding::Encode::<
22091                LinkableLinkIntoRequest,
22092                fidl::encoding::DefaultFuchsiaResourceDialect,
22093            >::encode(
22094                (
22095                    <fidl::encoding::HandleType<
22096                        fidl::Event,
22097                        { fidl::ObjectType::EVENT.into_raw() },
22098                        2147483648,
22099                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22100                        &mut self.dst_parent_token,
22101                    ),
22102                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
22103                        &self.dst,
22104                    ),
22105                ),
22106                encoder,
22107                offset,
22108                _depth,
22109            )
22110        }
22111    }
22112    unsafe impl<
22113        T0: fidl::encoding::Encode<
22114                fidl::encoding::HandleType<
22115                    fidl::Event,
22116                    { fidl::ObjectType::EVENT.into_raw() },
22117                    2147483648,
22118                >,
22119                fidl::encoding::DefaultFuchsiaResourceDialect,
22120            >,
22121        T1: fidl::encoding::Encode<
22122                fidl::encoding::BoundedString<255>,
22123                fidl::encoding::DefaultFuchsiaResourceDialect,
22124            >,
22125    >
22126        fidl::encoding::Encode<
22127            LinkableLinkIntoRequest,
22128            fidl::encoding::DefaultFuchsiaResourceDialect,
22129        > for (T0, T1)
22130    {
22131        #[inline]
22132        unsafe fn encode(
22133            self,
22134            encoder: &mut fidl::encoding::Encoder<
22135                '_,
22136                fidl::encoding::DefaultFuchsiaResourceDialect,
22137            >,
22138            offset: usize,
22139            depth: fidl::encoding::Depth,
22140        ) -> fidl::Result<()> {
22141            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
22142            // Zero out padding regions. There's no need to apply masks
22143            // because the unmasked parts will be overwritten by fields.
22144            unsafe {
22145                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
22146                (ptr as *mut u64).write_unaligned(0);
22147            }
22148            // Write the fields.
22149            self.0.encode(encoder, offset + 0, depth)?;
22150            self.1.encode(encoder, offset + 8, depth)?;
22151            Ok(())
22152        }
22153    }
22154
22155    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22156        for LinkableLinkIntoRequest
22157    {
22158        #[inline(always)]
22159        fn new_empty() -> Self {
22160            Self {
22161                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22162                dst: fidl::new_empty!(
22163                    fidl::encoding::BoundedString<255>,
22164                    fidl::encoding::DefaultFuchsiaResourceDialect
22165                ),
22166            }
22167        }
22168
22169        #[inline]
22170        unsafe fn decode(
22171            &mut self,
22172            decoder: &mut fidl::encoding::Decoder<
22173                '_,
22174                fidl::encoding::DefaultFuchsiaResourceDialect,
22175            >,
22176            offset: usize,
22177            _depth: fidl::encoding::Depth,
22178        ) -> fidl::Result<()> {
22179            decoder.debug_check_bounds::<Self>(offset);
22180            // Verify that padding bytes are zero.
22181            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
22182            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22183            let mask = 0xffffffff00000000u64;
22184            let maskedval = padval & mask;
22185            if maskedval != 0 {
22186                return Err(fidl::Error::NonZeroPadding {
22187                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
22188                });
22189            }
22190            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)?;
22191            fidl::decode!(
22192                fidl::encoding::BoundedString<255>,
22193                fidl::encoding::DefaultFuchsiaResourceDialect,
22194                &mut self.dst,
22195                decoder,
22196                offset + 8,
22197                _depth
22198            )?;
22199            Ok(())
22200        }
22201    }
22202
22203    impl fidl::encoding::ResourceTypeMarker for NodeDeprecatedCloneRequest {
22204        type Borrowed<'a> = &'a mut Self;
22205        fn take_or_borrow<'a>(
22206            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22207        ) -> Self::Borrowed<'a> {
22208            value
22209        }
22210    }
22211
22212    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedCloneRequest {
22213        type Owned = Self;
22214
22215        #[inline(always)]
22216        fn inline_align(_context: fidl::encoding::Context) -> usize {
22217            4
22218        }
22219
22220        #[inline(always)]
22221        fn inline_size(_context: fidl::encoding::Context) -> usize {
22222            8
22223        }
22224    }
22225
22226    unsafe impl
22227        fidl::encoding::Encode<
22228            NodeDeprecatedCloneRequest,
22229            fidl::encoding::DefaultFuchsiaResourceDialect,
22230        > for &mut NodeDeprecatedCloneRequest
22231    {
22232        #[inline]
22233        unsafe fn encode(
22234            self,
22235            encoder: &mut fidl::encoding::Encoder<
22236                '_,
22237                fidl::encoding::DefaultFuchsiaResourceDialect,
22238            >,
22239            offset: usize,
22240            _depth: fidl::encoding::Depth,
22241        ) -> fidl::Result<()> {
22242            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
22243            // Delegate to tuple encoding.
22244            fidl::encoding::Encode::<NodeDeprecatedCloneRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22245                (
22246                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
22247                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
22248                ),
22249                encoder, offset, _depth
22250            )
22251        }
22252    }
22253    unsafe impl<
22254        T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
22255        T1: fidl::encoding::Encode<
22256                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22257                fidl::encoding::DefaultFuchsiaResourceDialect,
22258            >,
22259    >
22260        fidl::encoding::Encode<
22261            NodeDeprecatedCloneRequest,
22262            fidl::encoding::DefaultFuchsiaResourceDialect,
22263        > for (T0, T1)
22264    {
22265        #[inline]
22266        unsafe fn encode(
22267            self,
22268            encoder: &mut fidl::encoding::Encoder<
22269                '_,
22270                fidl::encoding::DefaultFuchsiaResourceDialect,
22271            >,
22272            offset: usize,
22273            depth: fidl::encoding::Depth,
22274        ) -> fidl::Result<()> {
22275            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
22276            // Zero out padding regions. There's no need to apply masks
22277            // because the unmasked parts will be overwritten by fields.
22278            // Write the fields.
22279            self.0.encode(encoder, offset + 0, depth)?;
22280            self.1.encode(encoder, offset + 4, depth)?;
22281            Ok(())
22282        }
22283    }
22284
22285    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22286        for NodeDeprecatedCloneRequest
22287    {
22288        #[inline(always)]
22289        fn new_empty() -> Self {
22290            Self {
22291                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
22292                object: fidl::new_empty!(
22293                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22294                    fidl::encoding::DefaultFuchsiaResourceDialect
22295                ),
22296            }
22297        }
22298
22299        #[inline]
22300        unsafe fn decode(
22301            &mut self,
22302            decoder: &mut fidl::encoding::Decoder<
22303                '_,
22304                fidl::encoding::DefaultFuchsiaResourceDialect,
22305            >,
22306            offset: usize,
22307            _depth: fidl::encoding::Depth,
22308        ) -> fidl::Result<()> {
22309            decoder.debug_check_bounds::<Self>(offset);
22310            // Verify that padding bytes are zero.
22311            fidl::decode!(
22312                OpenFlags,
22313                fidl::encoding::DefaultFuchsiaResourceDialect,
22314                &mut self.flags,
22315                decoder,
22316                offset + 0,
22317                _depth
22318            )?;
22319            fidl::decode!(
22320                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22321                fidl::encoding::DefaultFuchsiaResourceDialect,
22322                &mut self.object,
22323                decoder,
22324                offset + 4,
22325                _depth
22326            )?;
22327            Ok(())
22328        }
22329    }
22330
22331    impl fidl::encoding::ResourceTypeMarker for NodeListExtendedAttributesRequest {
22332        type Borrowed<'a> = &'a mut Self;
22333        fn take_or_borrow<'a>(
22334            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22335        ) -> Self::Borrowed<'a> {
22336            value
22337        }
22338    }
22339
22340    unsafe impl fidl::encoding::TypeMarker for NodeListExtendedAttributesRequest {
22341        type Owned = Self;
22342
22343        #[inline(always)]
22344        fn inline_align(_context: fidl::encoding::Context) -> usize {
22345            4
22346        }
22347
22348        #[inline(always)]
22349        fn inline_size(_context: fidl::encoding::Context) -> usize {
22350            4
22351        }
22352    }
22353
22354    unsafe impl
22355        fidl::encoding::Encode<
22356            NodeListExtendedAttributesRequest,
22357            fidl::encoding::DefaultFuchsiaResourceDialect,
22358        > for &mut NodeListExtendedAttributesRequest
22359    {
22360        #[inline]
22361        unsafe fn encode(
22362            self,
22363            encoder: &mut fidl::encoding::Encoder<
22364                '_,
22365                fidl::encoding::DefaultFuchsiaResourceDialect,
22366            >,
22367            offset: usize,
22368            _depth: fidl::encoding::Depth,
22369        ) -> fidl::Result<()> {
22370            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
22371            // Delegate to tuple encoding.
22372            fidl::encoding::Encode::<
22373                NodeListExtendedAttributesRequest,
22374                fidl::encoding::DefaultFuchsiaResourceDialect,
22375            >::encode(
22376                (<fidl::encoding::Endpoint<
22377                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22378                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22379                    &mut self.iterator
22380                ),),
22381                encoder,
22382                offset,
22383                _depth,
22384            )
22385        }
22386    }
22387    unsafe impl<
22388        T0: fidl::encoding::Encode<
22389                fidl::encoding::Endpoint<
22390                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22391                >,
22392                fidl::encoding::DefaultFuchsiaResourceDialect,
22393            >,
22394    >
22395        fidl::encoding::Encode<
22396            NodeListExtendedAttributesRequest,
22397            fidl::encoding::DefaultFuchsiaResourceDialect,
22398        > for (T0,)
22399    {
22400        #[inline]
22401        unsafe fn encode(
22402            self,
22403            encoder: &mut fidl::encoding::Encoder<
22404                '_,
22405                fidl::encoding::DefaultFuchsiaResourceDialect,
22406            >,
22407            offset: usize,
22408            depth: fidl::encoding::Depth,
22409        ) -> fidl::Result<()> {
22410            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
22411            // Zero out padding regions. There's no need to apply masks
22412            // because the unmasked parts will be overwritten by fields.
22413            // Write the fields.
22414            self.0.encode(encoder, offset + 0, depth)?;
22415            Ok(())
22416        }
22417    }
22418
22419    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22420        for NodeListExtendedAttributesRequest
22421    {
22422        #[inline(always)]
22423        fn new_empty() -> Self {
22424            Self {
22425                iterator: fidl::new_empty!(
22426                    fidl::encoding::Endpoint<
22427                        fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22428                    >,
22429                    fidl::encoding::DefaultFuchsiaResourceDialect
22430                ),
22431            }
22432        }
22433
22434        #[inline]
22435        unsafe fn decode(
22436            &mut self,
22437            decoder: &mut fidl::encoding::Decoder<
22438                '_,
22439                fidl::encoding::DefaultFuchsiaResourceDialect,
22440            >,
22441            offset: usize,
22442            _depth: fidl::encoding::Depth,
22443        ) -> fidl::Result<()> {
22444            decoder.debug_check_bounds::<Self>(offset);
22445            // Verify that padding bytes are zero.
22446            fidl::decode!(
22447                fidl::encoding::Endpoint<
22448                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22449                >,
22450                fidl::encoding::DefaultFuchsiaResourceDialect,
22451                &mut self.iterator,
22452                decoder,
22453                offset + 0,
22454                _depth
22455            )?;
22456            Ok(())
22457        }
22458    }
22459
22460    impl fidl::encoding::ResourceTypeMarker for NodeOnOpenRequest {
22461        type Borrowed<'a> = &'a mut Self;
22462        fn take_or_borrow<'a>(
22463            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22464        ) -> Self::Borrowed<'a> {
22465            value
22466        }
22467    }
22468
22469    unsafe impl fidl::encoding::TypeMarker for NodeOnOpenRequest {
22470        type Owned = Self;
22471
22472        #[inline(always)]
22473        fn inline_align(_context: fidl::encoding::Context) -> usize {
22474            8
22475        }
22476
22477        #[inline(always)]
22478        fn inline_size(_context: fidl::encoding::Context) -> usize {
22479            24
22480        }
22481    }
22482
22483    unsafe impl
22484        fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22485        for &mut NodeOnOpenRequest
22486    {
22487        #[inline]
22488        unsafe fn encode(
22489            self,
22490            encoder: &mut fidl::encoding::Encoder<
22491                '_,
22492                fidl::encoding::DefaultFuchsiaResourceDialect,
22493            >,
22494            offset: usize,
22495            _depth: fidl::encoding::Depth,
22496        ) -> fidl::Result<()> {
22497            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
22498            // Delegate to tuple encoding.
22499            fidl::encoding::Encode::<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22500                (
22501                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
22502                    <fidl::encoding::OptionalUnion<NodeInfoDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
22503                ),
22504                encoder, offset, _depth
22505            )
22506        }
22507    }
22508    unsafe impl<
22509        T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
22510        T1: fidl::encoding::Encode<
22511                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
22512                fidl::encoding::DefaultFuchsiaResourceDialect,
22513            >,
22514    > fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22515        for (T0, T1)
22516    {
22517        #[inline]
22518        unsafe fn encode(
22519            self,
22520            encoder: &mut fidl::encoding::Encoder<
22521                '_,
22522                fidl::encoding::DefaultFuchsiaResourceDialect,
22523            >,
22524            offset: usize,
22525            depth: fidl::encoding::Depth,
22526        ) -> fidl::Result<()> {
22527            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
22528            // Zero out padding regions. There's no need to apply masks
22529            // because the unmasked parts will be overwritten by fields.
22530            unsafe {
22531                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
22532                (ptr as *mut u64).write_unaligned(0);
22533            }
22534            // Write the fields.
22535            self.0.encode(encoder, offset + 0, depth)?;
22536            self.1.encode(encoder, offset + 8, depth)?;
22537            Ok(())
22538        }
22539    }
22540
22541    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22542        for NodeOnOpenRequest
22543    {
22544        #[inline(always)]
22545        fn new_empty() -> Self {
22546            Self {
22547                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
22548                info: fidl::new_empty!(
22549                    fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
22550                    fidl::encoding::DefaultFuchsiaResourceDialect
22551                ),
22552            }
22553        }
22554
22555        #[inline]
22556        unsafe fn decode(
22557            &mut self,
22558            decoder: &mut fidl::encoding::Decoder<
22559                '_,
22560                fidl::encoding::DefaultFuchsiaResourceDialect,
22561            >,
22562            offset: usize,
22563            _depth: fidl::encoding::Depth,
22564        ) -> fidl::Result<()> {
22565            decoder.debug_check_bounds::<Self>(offset);
22566            // Verify that padding bytes are zero.
22567            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
22568            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22569            let mask = 0xffffffff00000000u64;
22570            let maskedval = padval & mask;
22571            if maskedval != 0 {
22572                return Err(fidl::Error::NonZeroPadding {
22573                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
22574                });
22575            }
22576            fidl::decode!(
22577                i32,
22578                fidl::encoding::DefaultFuchsiaResourceDialect,
22579                &mut self.s,
22580                decoder,
22581                offset + 0,
22582                _depth
22583            )?;
22584            fidl::decode!(
22585                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
22586                fidl::encoding::DefaultFuchsiaResourceDialect,
22587                &mut self.info,
22588                decoder,
22589                offset + 8,
22590                _depth
22591            )?;
22592            Ok(())
22593        }
22594    }
22595
22596    impl fidl::encoding::ResourceTypeMarker for NodeSetExtendedAttributeRequest {
22597        type Borrowed<'a> = &'a mut Self;
22598        fn take_or_borrow<'a>(
22599            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22600        ) -> Self::Borrowed<'a> {
22601            value
22602        }
22603    }
22604
22605    unsafe impl fidl::encoding::TypeMarker for NodeSetExtendedAttributeRequest {
22606        type Owned = Self;
22607
22608        #[inline(always)]
22609        fn inline_align(_context: fidl::encoding::Context) -> usize {
22610            8
22611        }
22612
22613        #[inline(always)]
22614        fn inline_size(_context: fidl::encoding::Context) -> usize {
22615            40
22616        }
22617    }
22618
22619    unsafe impl
22620        fidl::encoding::Encode<
22621            NodeSetExtendedAttributeRequest,
22622            fidl::encoding::DefaultFuchsiaResourceDialect,
22623        > for &mut NodeSetExtendedAttributeRequest
22624    {
22625        #[inline]
22626        unsafe fn encode(
22627            self,
22628            encoder: &mut fidl::encoding::Encoder<
22629                '_,
22630                fidl::encoding::DefaultFuchsiaResourceDialect,
22631            >,
22632            offset: usize,
22633            _depth: fidl::encoding::Depth,
22634        ) -> fidl::Result<()> {
22635            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
22636            // Delegate to tuple encoding.
22637            fidl::encoding::Encode::<
22638                NodeSetExtendedAttributeRequest,
22639                fidl::encoding::DefaultFuchsiaResourceDialect,
22640            >::encode(
22641                (
22642                    <fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
22643                        &self.name,
22644                    ),
22645                    <ExtendedAttributeValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22646                        &mut self.value,
22647                    ),
22648                    <SetExtendedAttributeMode as fidl::encoding::ValueTypeMarker>::borrow(
22649                        &self.mode,
22650                    ),
22651                ),
22652                encoder,
22653                offset,
22654                _depth,
22655            )
22656        }
22657    }
22658    unsafe impl<
22659        T0: fidl::encoding::Encode<
22660                fidl::encoding::Vector<u8, 255>,
22661                fidl::encoding::DefaultFuchsiaResourceDialect,
22662            >,
22663        T1: fidl::encoding::Encode<
22664                ExtendedAttributeValue,
22665                fidl::encoding::DefaultFuchsiaResourceDialect,
22666            >,
22667        T2: fidl::encoding::Encode<
22668                SetExtendedAttributeMode,
22669                fidl::encoding::DefaultFuchsiaResourceDialect,
22670            >,
22671    >
22672        fidl::encoding::Encode<
22673            NodeSetExtendedAttributeRequest,
22674            fidl::encoding::DefaultFuchsiaResourceDialect,
22675        > for (T0, T1, T2)
22676    {
22677        #[inline]
22678        unsafe fn encode(
22679            self,
22680            encoder: &mut fidl::encoding::Encoder<
22681                '_,
22682                fidl::encoding::DefaultFuchsiaResourceDialect,
22683            >,
22684            offset: usize,
22685            depth: fidl::encoding::Depth,
22686        ) -> fidl::Result<()> {
22687            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
22688            // Zero out padding regions. There's no need to apply masks
22689            // because the unmasked parts will be overwritten by fields.
22690            unsafe {
22691                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
22692                (ptr as *mut u64).write_unaligned(0);
22693            }
22694            // Write the fields.
22695            self.0.encode(encoder, offset + 0, depth)?;
22696            self.1.encode(encoder, offset + 16, depth)?;
22697            self.2.encode(encoder, offset + 32, depth)?;
22698            Ok(())
22699        }
22700    }
22701
22702    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22703        for NodeSetExtendedAttributeRequest
22704    {
22705        #[inline(always)]
22706        fn new_empty() -> Self {
22707            Self {
22708                name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect),
22709                value: fidl::new_empty!(
22710                    ExtendedAttributeValue,
22711                    fidl::encoding::DefaultFuchsiaResourceDialect
22712                ),
22713                mode: fidl::new_empty!(
22714                    SetExtendedAttributeMode,
22715                    fidl::encoding::DefaultFuchsiaResourceDialect
22716                ),
22717            }
22718        }
22719
22720        #[inline]
22721        unsafe fn decode(
22722            &mut self,
22723            decoder: &mut fidl::encoding::Decoder<
22724                '_,
22725                fidl::encoding::DefaultFuchsiaResourceDialect,
22726            >,
22727            offset: usize,
22728            _depth: fidl::encoding::Depth,
22729        ) -> fidl::Result<()> {
22730            decoder.debug_check_bounds::<Self>(offset);
22731            // Verify that padding bytes are zero.
22732            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
22733            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22734            let mask = 0xffffffff00000000u64;
22735            let maskedval = padval & mask;
22736            if maskedval != 0 {
22737                return Err(fidl::Error::NonZeroPadding {
22738                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
22739                });
22740            }
22741            fidl::decode!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.name, decoder, offset + 0, _depth)?;
22742            fidl::decode!(
22743                ExtendedAttributeValue,
22744                fidl::encoding::DefaultFuchsiaResourceDialect,
22745                &mut self.value,
22746                decoder,
22747                offset + 16,
22748                _depth
22749            )?;
22750            fidl::decode!(
22751                SetExtendedAttributeMode,
22752                fidl::encoding::DefaultFuchsiaResourceDialect,
22753                &mut self.mode,
22754                decoder,
22755                offset + 32,
22756                _depth
22757            )?;
22758            Ok(())
22759        }
22760    }
22761
22762    impl ConnectionInfo {
22763        #[inline(always)]
22764        fn max_ordinal_present(&self) -> u64 {
22765            if let Some(_) = self.rights {
22766                return 1;
22767            }
22768            0
22769        }
22770    }
22771
22772    impl fidl::encoding::ResourceTypeMarker for ConnectionInfo {
22773        type Borrowed<'a> = &'a mut Self;
22774        fn take_or_borrow<'a>(
22775            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22776        ) -> Self::Borrowed<'a> {
22777            value
22778        }
22779    }
22780
22781    unsafe impl fidl::encoding::TypeMarker for ConnectionInfo {
22782        type Owned = Self;
22783
22784        #[inline(always)]
22785        fn inline_align(_context: fidl::encoding::Context) -> usize {
22786            8
22787        }
22788
22789        #[inline(always)]
22790        fn inline_size(_context: fidl::encoding::Context) -> usize {
22791            16
22792        }
22793    }
22794
22795    unsafe impl
22796        fidl::encoding::Encode<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
22797        for &mut ConnectionInfo
22798    {
22799        unsafe fn encode(
22800            self,
22801            encoder: &mut fidl::encoding::Encoder<
22802                '_,
22803                fidl::encoding::DefaultFuchsiaResourceDialect,
22804            >,
22805            offset: usize,
22806            mut depth: fidl::encoding::Depth,
22807        ) -> fidl::Result<()> {
22808            encoder.debug_check_bounds::<ConnectionInfo>(offset);
22809            // Vector header
22810            let max_ordinal: u64 = self.max_ordinal_present();
22811            encoder.write_num(max_ordinal, offset);
22812            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
22813            // Calling encoder.out_of_line_offset(0) is not allowed.
22814            if max_ordinal == 0 {
22815                return Ok(());
22816            }
22817            depth.increment()?;
22818            let envelope_size = 8;
22819            let bytes_len = max_ordinal as usize * envelope_size;
22820            #[allow(unused_variables)]
22821            let offset = encoder.out_of_line_offset(bytes_len);
22822            let mut _prev_end_offset: usize = 0;
22823            if 1 > max_ordinal {
22824                return Ok(());
22825            }
22826
22827            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
22828            // are envelope_size bytes.
22829            let cur_offset: usize = (1 - 1) * envelope_size;
22830
22831            // Zero reserved fields.
22832            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22833
22834            // Safety:
22835            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
22836            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
22837            //   envelope_size bytes, there is always sufficient room.
22838            fidl::encoding::encode_in_envelope_optional::<
22839                Operations,
22840                fidl::encoding::DefaultFuchsiaResourceDialect,
22841            >(
22842                self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
22843                encoder,
22844                offset + cur_offset,
22845                depth,
22846            )?;
22847
22848            _prev_end_offset = cur_offset + envelope_size;
22849
22850            Ok(())
22851        }
22852    }
22853
22854    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22855        for ConnectionInfo
22856    {
22857        #[inline(always)]
22858        fn new_empty() -> Self {
22859            Self::default()
22860        }
22861
22862        unsafe fn decode(
22863            &mut self,
22864            decoder: &mut fidl::encoding::Decoder<
22865                '_,
22866                fidl::encoding::DefaultFuchsiaResourceDialect,
22867            >,
22868            offset: usize,
22869            mut depth: fidl::encoding::Depth,
22870        ) -> fidl::Result<()> {
22871            decoder.debug_check_bounds::<Self>(offset);
22872            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22873                None => return Err(fidl::Error::NotNullable),
22874                Some(len) => len,
22875            };
22876            // Calling decoder.out_of_line_offset(0) is not allowed.
22877            if len == 0 {
22878                return Ok(());
22879            };
22880            depth.increment()?;
22881            let envelope_size = 8;
22882            let bytes_len = len * envelope_size;
22883            let offset = decoder.out_of_line_offset(bytes_len)?;
22884            // Decode the envelope for each type.
22885            let mut _next_ordinal_to_read = 0;
22886            let mut next_offset = offset;
22887            let end_offset = offset + bytes_len;
22888            _next_ordinal_to_read += 1;
22889            if next_offset >= end_offset {
22890                return Ok(());
22891            }
22892
22893            // Decode unknown envelopes for gaps in ordinals.
22894            while _next_ordinal_to_read < 1 {
22895                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22896                _next_ordinal_to_read += 1;
22897                next_offset += envelope_size;
22898            }
22899
22900            let next_out_of_line = decoder.next_out_of_line();
22901            let handles_before = decoder.remaining_handles();
22902            if let Some((inlined, num_bytes, num_handles)) =
22903                fidl::encoding::decode_envelope_header(decoder, next_offset)?
22904            {
22905                let member_inline_size =
22906                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22907                if inlined != (member_inline_size <= 4) {
22908                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
22909                }
22910                let inner_offset;
22911                let mut inner_depth = depth.clone();
22912                if inlined {
22913                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22914                    inner_offset = next_offset;
22915                } else {
22916                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22917                    inner_depth.increment()?;
22918                }
22919                let val_ref = self.rights.get_or_insert_with(|| {
22920                    fidl::new_empty!(Operations, fidl::encoding::DefaultFuchsiaResourceDialect)
22921                });
22922                fidl::decode!(
22923                    Operations,
22924                    fidl::encoding::DefaultFuchsiaResourceDialect,
22925                    val_ref,
22926                    decoder,
22927                    inner_offset,
22928                    inner_depth
22929                )?;
22930                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22931                {
22932                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
22933                }
22934                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22935                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22936                }
22937            }
22938
22939            next_offset += envelope_size;
22940
22941            // Decode the remaining unknown envelopes.
22942            while next_offset < end_offset {
22943                _next_ordinal_to_read += 1;
22944                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22945                next_offset += envelope_size;
22946            }
22947
22948            Ok(())
22949        }
22950    }
22951
22952    impl FileInfo {
22953        #[inline(always)]
22954        fn max_ordinal_present(&self) -> u64 {
22955            if let Some(_) = self.attributes {
22956                return 4;
22957            }
22958            if let Some(_) = self.stream {
22959                return 3;
22960            }
22961            if let Some(_) = self.observer {
22962                return 2;
22963            }
22964            if let Some(_) = self.is_append {
22965                return 1;
22966            }
22967            0
22968        }
22969    }
22970
22971    impl fidl::encoding::ResourceTypeMarker for FileInfo {
22972        type Borrowed<'a> = &'a mut Self;
22973        fn take_or_borrow<'a>(
22974            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22975        ) -> Self::Borrowed<'a> {
22976            value
22977        }
22978    }
22979
22980    unsafe impl fidl::encoding::TypeMarker for FileInfo {
22981        type Owned = Self;
22982
22983        #[inline(always)]
22984        fn inline_align(_context: fidl::encoding::Context) -> usize {
22985            8
22986        }
22987
22988        #[inline(always)]
22989        fn inline_size(_context: fidl::encoding::Context) -> usize {
22990            16
22991        }
22992    }
22993
22994    unsafe impl fidl::encoding::Encode<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
22995        for &mut FileInfo
22996    {
22997        unsafe fn encode(
22998            self,
22999            encoder: &mut fidl::encoding::Encoder<
23000                '_,
23001                fidl::encoding::DefaultFuchsiaResourceDialect,
23002            >,
23003            offset: usize,
23004            mut depth: fidl::encoding::Depth,
23005        ) -> fidl::Result<()> {
23006            encoder.debug_check_bounds::<FileInfo>(offset);
23007            // Vector header
23008            let max_ordinal: u64 = self.max_ordinal_present();
23009            encoder.write_num(max_ordinal, offset);
23010            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23011            // Calling encoder.out_of_line_offset(0) is not allowed.
23012            if max_ordinal == 0 {
23013                return Ok(());
23014            }
23015            depth.increment()?;
23016            let envelope_size = 8;
23017            let bytes_len = max_ordinal as usize * envelope_size;
23018            #[allow(unused_variables)]
23019            let offset = encoder.out_of_line_offset(bytes_len);
23020            let mut _prev_end_offset: usize = 0;
23021            if 1 > max_ordinal {
23022                return Ok(());
23023            }
23024
23025            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23026            // are envelope_size bytes.
23027            let cur_offset: usize = (1 - 1) * envelope_size;
23028
23029            // Zero reserved fields.
23030            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23031
23032            // Safety:
23033            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23034            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23035            //   envelope_size bytes, there is always sufficient room.
23036            fidl::encoding::encode_in_envelope_optional::<
23037                bool,
23038                fidl::encoding::DefaultFuchsiaResourceDialect,
23039            >(
23040                self.is_append.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
23041                encoder,
23042                offset + cur_offset,
23043                depth,
23044            )?;
23045
23046            _prev_end_offset = cur_offset + envelope_size;
23047            if 2 > max_ordinal {
23048                return Ok(());
23049            }
23050
23051            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23052            // are envelope_size bytes.
23053            let cur_offset: usize = (2 - 1) * envelope_size;
23054
23055            // Zero reserved fields.
23056            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23057
23058            // Safety:
23059            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23060            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23061            //   envelope_size bytes, there is always sufficient room.
23062            fidl::encoding::encode_in_envelope_optional::<
23063                fidl::encoding::HandleType<
23064                    fidl::Event,
23065                    { fidl::ObjectType::EVENT.into_raw() },
23066                    2147483648,
23067                >,
23068                fidl::encoding::DefaultFuchsiaResourceDialect,
23069            >(
23070                self.observer.as_mut().map(
23071                    <fidl::encoding::HandleType<
23072                        fidl::Event,
23073                        { fidl::ObjectType::EVENT.into_raw() },
23074                        2147483648,
23075                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
23076                ),
23077                encoder,
23078                offset + cur_offset,
23079                depth,
23080            )?;
23081
23082            _prev_end_offset = cur_offset + envelope_size;
23083            if 3 > max_ordinal {
23084                return Ok(());
23085            }
23086
23087            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23088            // are envelope_size bytes.
23089            let cur_offset: usize = (3 - 1) * envelope_size;
23090
23091            // Zero reserved fields.
23092            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23093
23094            // Safety:
23095            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23096            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23097            //   envelope_size bytes, there is always sufficient room.
23098            fidl::encoding::encode_in_envelope_optional::<
23099                fidl::encoding::HandleType<
23100                    fidl::Stream,
23101                    { fidl::ObjectType::STREAM.into_raw() },
23102                    2147483648,
23103                >,
23104                fidl::encoding::DefaultFuchsiaResourceDialect,
23105            >(
23106                self.stream.as_mut().map(
23107                    <fidl::encoding::HandleType<
23108                        fidl::Stream,
23109                        { fidl::ObjectType::STREAM.into_raw() },
23110                        2147483648,
23111                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
23112                ),
23113                encoder,
23114                offset + cur_offset,
23115                depth,
23116            )?;
23117
23118            _prev_end_offset = cur_offset + envelope_size;
23119            if 4 > max_ordinal {
23120                return Ok(());
23121            }
23122
23123            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23124            // are envelope_size bytes.
23125            let cur_offset: usize = (4 - 1) * envelope_size;
23126
23127            // Zero reserved fields.
23128            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23129
23130            // Safety:
23131            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23132            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23133            //   envelope_size bytes, there is always sufficient room.
23134            fidl::encoding::encode_in_envelope_optional::<
23135                NodeAttributes2,
23136                fidl::encoding::DefaultFuchsiaResourceDialect,
23137            >(
23138                self.attributes
23139                    .as_ref()
23140                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
23141                encoder,
23142                offset + cur_offset,
23143                depth,
23144            )?;
23145
23146            _prev_end_offset = cur_offset + envelope_size;
23147
23148            Ok(())
23149        }
23150    }
23151
23152    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileInfo {
23153        #[inline(always)]
23154        fn new_empty() -> Self {
23155            Self::default()
23156        }
23157
23158        unsafe fn decode(
23159            &mut self,
23160            decoder: &mut fidl::encoding::Decoder<
23161                '_,
23162                fidl::encoding::DefaultFuchsiaResourceDialect,
23163            >,
23164            offset: usize,
23165            mut depth: fidl::encoding::Depth,
23166        ) -> fidl::Result<()> {
23167            decoder.debug_check_bounds::<Self>(offset);
23168            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23169                None => return Err(fidl::Error::NotNullable),
23170                Some(len) => len,
23171            };
23172            // Calling decoder.out_of_line_offset(0) is not allowed.
23173            if len == 0 {
23174                return Ok(());
23175            };
23176            depth.increment()?;
23177            let envelope_size = 8;
23178            let bytes_len = len * envelope_size;
23179            let offset = decoder.out_of_line_offset(bytes_len)?;
23180            // Decode the envelope for each type.
23181            let mut _next_ordinal_to_read = 0;
23182            let mut next_offset = offset;
23183            let end_offset = offset + bytes_len;
23184            _next_ordinal_to_read += 1;
23185            if next_offset >= end_offset {
23186                return Ok(());
23187            }
23188
23189            // Decode unknown envelopes for gaps in ordinals.
23190            while _next_ordinal_to_read < 1 {
23191                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23192                _next_ordinal_to_read += 1;
23193                next_offset += envelope_size;
23194            }
23195
23196            let next_out_of_line = decoder.next_out_of_line();
23197            let handles_before = decoder.remaining_handles();
23198            if let Some((inlined, num_bytes, num_handles)) =
23199                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23200            {
23201                let member_inline_size =
23202                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23203                if inlined != (member_inline_size <= 4) {
23204                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23205                }
23206                let inner_offset;
23207                let mut inner_depth = depth.clone();
23208                if inlined {
23209                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23210                    inner_offset = next_offset;
23211                } else {
23212                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23213                    inner_depth.increment()?;
23214                }
23215                let val_ref = self.is_append.get_or_insert_with(|| {
23216                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
23217                });
23218                fidl::decode!(
23219                    bool,
23220                    fidl::encoding::DefaultFuchsiaResourceDialect,
23221                    val_ref,
23222                    decoder,
23223                    inner_offset,
23224                    inner_depth
23225                )?;
23226                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23227                {
23228                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23229                }
23230                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23231                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23232                }
23233            }
23234
23235            next_offset += envelope_size;
23236            _next_ordinal_to_read += 1;
23237            if next_offset >= end_offset {
23238                return Ok(());
23239            }
23240
23241            // Decode unknown envelopes for gaps in ordinals.
23242            while _next_ordinal_to_read < 2 {
23243                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23244                _next_ordinal_to_read += 1;
23245                next_offset += envelope_size;
23246            }
23247
23248            let next_out_of_line = decoder.next_out_of_line();
23249            let handles_before = decoder.remaining_handles();
23250            if let Some((inlined, num_bytes, num_handles)) =
23251                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23252            {
23253                let member_inline_size = <fidl::encoding::HandleType<
23254                    fidl::Event,
23255                    { fidl::ObjectType::EVENT.into_raw() },
23256                    2147483648,
23257                > as fidl::encoding::TypeMarker>::inline_size(
23258                    decoder.context
23259                );
23260                if inlined != (member_inline_size <= 4) {
23261                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23262                }
23263                let inner_offset;
23264                let mut inner_depth = depth.clone();
23265                if inlined {
23266                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23267                    inner_offset = next_offset;
23268                } else {
23269                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23270                    inner_depth.increment()?;
23271                }
23272                let val_ref =
23273                self.observer.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
23274                fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
23275                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23276                {
23277                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23278                }
23279                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23280                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23281                }
23282            }
23283
23284            next_offset += envelope_size;
23285            _next_ordinal_to_read += 1;
23286            if next_offset >= end_offset {
23287                return Ok(());
23288            }
23289
23290            // Decode unknown envelopes for gaps in ordinals.
23291            while _next_ordinal_to_read < 3 {
23292                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23293                _next_ordinal_to_read += 1;
23294                next_offset += envelope_size;
23295            }
23296
23297            let next_out_of_line = decoder.next_out_of_line();
23298            let handles_before = decoder.remaining_handles();
23299            if let Some((inlined, num_bytes, num_handles)) =
23300                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23301            {
23302                let member_inline_size = <fidl::encoding::HandleType<
23303                    fidl::Stream,
23304                    { fidl::ObjectType::STREAM.into_raw() },
23305                    2147483648,
23306                > as fidl::encoding::TypeMarker>::inline_size(
23307                    decoder.context
23308                );
23309                if inlined != (member_inline_size <= 4) {
23310                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23311                }
23312                let inner_offset;
23313                let mut inner_depth = depth.clone();
23314                if inlined {
23315                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23316                    inner_offset = next_offset;
23317                } else {
23318                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23319                    inner_depth.increment()?;
23320                }
23321                let val_ref =
23322                self.stream.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
23323                fidl::decode!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
23324                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23325                {
23326                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23327                }
23328                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23329                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23330                }
23331            }
23332
23333            next_offset += envelope_size;
23334            _next_ordinal_to_read += 1;
23335            if next_offset >= end_offset {
23336                return Ok(());
23337            }
23338
23339            // Decode unknown envelopes for gaps in ordinals.
23340            while _next_ordinal_to_read < 4 {
23341                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23342                _next_ordinal_to_read += 1;
23343                next_offset += envelope_size;
23344            }
23345
23346            let next_out_of_line = decoder.next_out_of_line();
23347            let handles_before = decoder.remaining_handles();
23348            if let Some((inlined, num_bytes, num_handles)) =
23349                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23350            {
23351                let member_inline_size =
23352                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23353                if inlined != (member_inline_size <= 4) {
23354                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23355                }
23356                let inner_offset;
23357                let mut inner_depth = depth.clone();
23358                if inlined {
23359                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23360                    inner_offset = next_offset;
23361                } else {
23362                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23363                    inner_depth.increment()?;
23364                }
23365                let val_ref = self.attributes.get_or_insert_with(|| {
23366                    fidl::new_empty!(NodeAttributes2, fidl::encoding::DefaultFuchsiaResourceDialect)
23367                });
23368                fidl::decode!(
23369                    NodeAttributes2,
23370                    fidl::encoding::DefaultFuchsiaResourceDialect,
23371                    val_ref,
23372                    decoder,
23373                    inner_offset,
23374                    inner_depth
23375                )?;
23376                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23377                {
23378                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23379                }
23380                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23381                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23382                }
23383            }
23384
23385            next_offset += envelope_size;
23386
23387            // Decode the remaining unknown envelopes.
23388            while next_offset < end_offset {
23389                _next_ordinal_to_read += 1;
23390                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23391                next_offset += envelope_size;
23392            }
23393
23394            Ok(())
23395        }
23396    }
23397
23398    impl fidl::encoding::ResourceTypeMarker for ExtendedAttributeValue {
23399        type Borrowed<'a> = &'a mut Self;
23400        fn take_or_borrow<'a>(
23401            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23402        ) -> Self::Borrowed<'a> {
23403            value
23404        }
23405    }
23406
23407    unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeValue {
23408        type Owned = Self;
23409
23410        #[inline(always)]
23411        fn inline_align(_context: fidl::encoding::Context) -> usize {
23412            8
23413        }
23414
23415        #[inline(always)]
23416        fn inline_size(_context: fidl::encoding::Context) -> usize {
23417            16
23418        }
23419    }
23420
23421    unsafe impl
23422        fidl::encoding::Encode<
23423            ExtendedAttributeValue,
23424            fidl::encoding::DefaultFuchsiaResourceDialect,
23425        > for &mut ExtendedAttributeValue
23426    {
23427        #[inline]
23428        unsafe fn encode(
23429            self,
23430            encoder: &mut fidl::encoding::Encoder<
23431                '_,
23432                fidl::encoding::DefaultFuchsiaResourceDialect,
23433            >,
23434            offset: usize,
23435            _depth: fidl::encoding::Depth,
23436        ) -> fidl::Result<()> {
23437            encoder.debug_check_bounds::<ExtendedAttributeValue>(offset);
23438            encoder.write_num::<u64>(self.ordinal(), offset);
23439            match self {
23440                ExtendedAttributeValue::Bytes(ref val) => fidl::encoding::encode_in_envelope::<
23441                    fidl::encoding::Vector<u8, 32768>,
23442                    fidl::encoding::DefaultFuchsiaResourceDialect,
23443                >(
23444                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::ValueTypeMarker>::borrow(
23445                        val,
23446                    ),
23447                    encoder,
23448                    offset + 8,
23449                    _depth,
23450                ),
23451                ExtendedAttributeValue::Buffer(ref mut val) => {
23452                    fidl::encoding::encode_in_envelope::<
23453                        fidl::encoding::HandleType<
23454                            fidl::Vmo,
23455                            { fidl::ObjectType::VMO.into_raw() },
23456                            2147483648,
23457                        >,
23458                        fidl::encoding::DefaultFuchsiaResourceDialect,
23459                    >(
23460                        <fidl::encoding::HandleType<
23461                            fidl::Vmo,
23462                            { fidl::ObjectType::VMO.into_raw() },
23463                            2147483648,
23464                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
23465                            val
23466                        ),
23467                        encoder,
23468                        offset + 8,
23469                        _depth,
23470                    )
23471                }
23472                ExtendedAttributeValue::__SourceBreaking { .. } => {
23473                    Err(fidl::Error::UnknownUnionTag)
23474                }
23475            }
23476        }
23477    }
23478
23479    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23480        for ExtendedAttributeValue
23481    {
23482        #[inline(always)]
23483        fn new_empty() -> Self {
23484            Self::__SourceBreaking { unknown_ordinal: 0 }
23485        }
23486
23487        #[inline]
23488        unsafe fn decode(
23489            &mut self,
23490            decoder: &mut fidl::encoding::Decoder<
23491                '_,
23492                fidl::encoding::DefaultFuchsiaResourceDialect,
23493            >,
23494            offset: usize,
23495            mut depth: fidl::encoding::Depth,
23496        ) -> fidl::Result<()> {
23497            decoder.debug_check_bounds::<Self>(offset);
23498            #[allow(unused_variables)]
23499            let next_out_of_line = decoder.next_out_of_line();
23500            let handles_before = decoder.remaining_handles();
23501            let (ordinal, inlined, num_bytes, num_handles) =
23502                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23503
23504            let member_inline_size = match ordinal {
23505                1 => {
23506                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::TypeMarker>::inline_size(
23507                        decoder.context,
23508                    )
23509                }
23510                2 => <fidl::encoding::HandleType<
23511                    fidl::Vmo,
23512                    { fidl::ObjectType::VMO.into_raw() },
23513                    2147483648,
23514                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23515                0 => return Err(fidl::Error::UnknownUnionTag),
23516                _ => num_bytes as usize,
23517            };
23518
23519            if inlined != (member_inline_size <= 4) {
23520                return Err(fidl::Error::InvalidInlineBitInEnvelope);
23521            }
23522            let _inner_offset;
23523            if inlined {
23524                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23525                _inner_offset = offset + 8;
23526            } else {
23527                depth.increment()?;
23528                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23529            }
23530            match ordinal {
23531                1 => {
23532                    #[allow(irrefutable_let_patterns)]
23533                    if let ExtendedAttributeValue::Bytes(_) = self {
23534                        // Do nothing, read the value into the object
23535                    } else {
23536                        // Initialize `self` to the right variant
23537                        *self = ExtendedAttributeValue::Bytes(
23538                            fidl::new_empty!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect),
23539                        );
23540                    }
23541                    #[allow(irrefutable_let_patterns)]
23542                    if let ExtendedAttributeValue::Bytes(ref mut val) = self {
23543                        fidl::decode!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
23544                    } else {
23545                        unreachable!()
23546                    }
23547                }
23548                2 => {
23549                    #[allow(irrefutable_let_patterns)]
23550                    if let ExtendedAttributeValue::Buffer(_) = self {
23551                        // Do nothing, read the value into the object
23552                    } else {
23553                        // Initialize `self` to the right variant
23554                        *self = ExtendedAttributeValue::Buffer(
23555                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
23556                        );
23557                    }
23558                    #[allow(irrefutable_let_patterns)]
23559                    if let ExtendedAttributeValue::Buffer(ref mut val) = self {
23560                        fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
23561                    } else {
23562                        unreachable!()
23563                    }
23564                }
23565                #[allow(deprecated)]
23566                ordinal => {
23567                    for _ in 0..num_handles {
23568                        decoder.drop_next_handle()?;
23569                    }
23570                    *self = ExtendedAttributeValue::__SourceBreaking { unknown_ordinal: ordinal };
23571                }
23572            }
23573            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23574                return Err(fidl::Error::InvalidNumBytesInEnvelope);
23575            }
23576            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23577                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23578            }
23579            Ok(())
23580        }
23581    }
23582
23583    impl fidl::encoding::ResourceTypeMarker for NodeInfoDeprecated {
23584        type Borrowed<'a> = &'a mut Self;
23585        fn take_or_borrow<'a>(
23586            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23587        ) -> Self::Borrowed<'a> {
23588            value
23589        }
23590    }
23591
23592    unsafe impl fidl::encoding::TypeMarker for NodeInfoDeprecated {
23593        type Owned = Self;
23594
23595        #[inline(always)]
23596        fn inline_align(_context: fidl::encoding::Context) -> usize {
23597            8
23598        }
23599
23600        #[inline(always)]
23601        fn inline_size(_context: fidl::encoding::Context) -> usize {
23602            16
23603        }
23604    }
23605
23606    unsafe impl
23607        fidl::encoding::Encode<NodeInfoDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>
23608        for &mut NodeInfoDeprecated
23609    {
23610        #[inline]
23611        unsafe fn encode(
23612            self,
23613            encoder: &mut fidl::encoding::Encoder<
23614                '_,
23615                fidl::encoding::DefaultFuchsiaResourceDialect,
23616            >,
23617            offset: usize,
23618            _depth: fidl::encoding::Depth,
23619        ) -> fidl::Result<()> {
23620            encoder.debug_check_bounds::<NodeInfoDeprecated>(offset);
23621            encoder.write_num::<u64>(self.ordinal(), offset);
23622            match self {
23623                NodeInfoDeprecated::Service(ref val) => fidl::encoding::encode_in_envelope::<
23624                    Service,
23625                    fidl::encoding::DefaultFuchsiaResourceDialect,
23626                >(
23627                    <Service as fidl::encoding::ValueTypeMarker>::borrow(val),
23628                    encoder,
23629                    offset + 8,
23630                    _depth,
23631                ),
23632                NodeInfoDeprecated::File(ref mut val) => fidl::encoding::encode_in_envelope::<
23633                    FileObject,
23634                    fidl::encoding::DefaultFuchsiaResourceDialect,
23635                >(
23636                    <FileObject as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
23637                    encoder,
23638                    offset + 8,
23639                    _depth,
23640                ),
23641                NodeInfoDeprecated::Directory(ref val) => fidl::encoding::encode_in_envelope::<
23642                    DirectoryObject,
23643                    fidl::encoding::DefaultFuchsiaResourceDialect,
23644                >(
23645                    <DirectoryObject as fidl::encoding::ValueTypeMarker>::borrow(val),
23646                    encoder,
23647                    offset + 8,
23648                    _depth,
23649                ),
23650                NodeInfoDeprecated::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
23651                    SymlinkObject,
23652                    fidl::encoding::DefaultFuchsiaResourceDialect,
23653                >(
23654                    <SymlinkObject as fidl::encoding::ValueTypeMarker>::borrow(val),
23655                    encoder,
23656                    offset + 8,
23657                    _depth,
23658                ),
23659            }
23660        }
23661    }
23662
23663    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23664        for NodeInfoDeprecated
23665    {
23666        #[inline(always)]
23667        fn new_empty() -> Self {
23668            Self::Service(fidl::new_empty!(Service, fidl::encoding::DefaultFuchsiaResourceDialect))
23669        }
23670
23671        #[inline]
23672        unsafe fn decode(
23673            &mut self,
23674            decoder: &mut fidl::encoding::Decoder<
23675                '_,
23676                fidl::encoding::DefaultFuchsiaResourceDialect,
23677            >,
23678            offset: usize,
23679            mut depth: fidl::encoding::Depth,
23680        ) -> fidl::Result<()> {
23681            decoder.debug_check_bounds::<Self>(offset);
23682            #[allow(unused_variables)]
23683            let next_out_of_line = decoder.next_out_of_line();
23684            let handles_before = decoder.remaining_handles();
23685            let (ordinal, inlined, num_bytes, num_handles) =
23686                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23687
23688            let member_inline_size = match ordinal {
23689                1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23690                2 => <FileObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23691                3 => <DirectoryObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23692                4 => <SymlinkObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23693                _ => return Err(fidl::Error::UnknownUnionTag),
23694            };
23695
23696            if inlined != (member_inline_size <= 4) {
23697                return Err(fidl::Error::InvalidInlineBitInEnvelope);
23698            }
23699            let _inner_offset;
23700            if inlined {
23701                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23702                _inner_offset = offset + 8;
23703            } else {
23704                depth.increment()?;
23705                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23706            }
23707            match ordinal {
23708                1 => {
23709                    #[allow(irrefutable_let_patterns)]
23710                    if let NodeInfoDeprecated::Service(_) = self {
23711                        // Do nothing, read the value into the object
23712                    } else {
23713                        // Initialize `self` to the right variant
23714                        *self = NodeInfoDeprecated::Service(fidl::new_empty!(
23715                            Service,
23716                            fidl::encoding::DefaultFuchsiaResourceDialect
23717                        ));
23718                    }
23719                    #[allow(irrefutable_let_patterns)]
23720                    if let NodeInfoDeprecated::Service(ref mut val) = self {
23721                        fidl::decode!(
23722                            Service,
23723                            fidl::encoding::DefaultFuchsiaResourceDialect,
23724                            val,
23725                            decoder,
23726                            _inner_offset,
23727                            depth
23728                        )?;
23729                    } else {
23730                        unreachable!()
23731                    }
23732                }
23733                2 => {
23734                    #[allow(irrefutable_let_patterns)]
23735                    if let NodeInfoDeprecated::File(_) = self {
23736                        // Do nothing, read the value into the object
23737                    } else {
23738                        // Initialize `self` to the right variant
23739                        *self = NodeInfoDeprecated::File(fidl::new_empty!(
23740                            FileObject,
23741                            fidl::encoding::DefaultFuchsiaResourceDialect
23742                        ));
23743                    }
23744                    #[allow(irrefutable_let_patterns)]
23745                    if let NodeInfoDeprecated::File(ref mut val) = self {
23746                        fidl::decode!(
23747                            FileObject,
23748                            fidl::encoding::DefaultFuchsiaResourceDialect,
23749                            val,
23750                            decoder,
23751                            _inner_offset,
23752                            depth
23753                        )?;
23754                    } else {
23755                        unreachable!()
23756                    }
23757                }
23758                3 => {
23759                    #[allow(irrefutable_let_patterns)]
23760                    if let NodeInfoDeprecated::Directory(_) = self {
23761                        // Do nothing, read the value into the object
23762                    } else {
23763                        // Initialize `self` to the right variant
23764                        *self = NodeInfoDeprecated::Directory(fidl::new_empty!(
23765                            DirectoryObject,
23766                            fidl::encoding::DefaultFuchsiaResourceDialect
23767                        ));
23768                    }
23769                    #[allow(irrefutable_let_patterns)]
23770                    if let NodeInfoDeprecated::Directory(ref mut val) = self {
23771                        fidl::decode!(
23772                            DirectoryObject,
23773                            fidl::encoding::DefaultFuchsiaResourceDialect,
23774                            val,
23775                            decoder,
23776                            _inner_offset,
23777                            depth
23778                        )?;
23779                    } else {
23780                        unreachable!()
23781                    }
23782                }
23783                4 => {
23784                    #[allow(irrefutable_let_patterns)]
23785                    if let NodeInfoDeprecated::Symlink(_) = self {
23786                        // Do nothing, read the value into the object
23787                    } else {
23788                        // Initialize `self` to the right variant
23789                        *self = NodeInfoDeprecated::Symlink(fidl::new_empty!(
23790                            SymlinkObject,
23791                            fidl::encoding::DefaultFuchsiaResourceDialect
23792                        ));
23793                    }
23794                    #[allow(irrefutable_let_patterns)]
23795                    if let NodeInfoDeprecated::Symlink(ref mut val) = self {
23796                        fidl::decode!(
23797                            SymlinkObject,
23798                            fidl::encoding::DefaultFuchsiaResourceDialect,
23799                            val,
23800                            decoder,
23801                            _inner_offset,
23802                            depth
23803                        )?;
23804                    } else {
23805                        unreachable!()
23806                    }
23807                }
23808                ordinal => panic!("unexpected ordinal {:?}", ordinal),
23809            }
23810            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23811                return Err(fidl::Error::InvalidNumBytesInEnvelope);
23812            }
23813            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23814                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23815            }
23816            Ok(())
23817        }
23818    }
23819
23820    impl fidl::encoding::ResourceTypeMarker for Representation {
23821        type Borrowed<'a> = &'a mut Self;
23822        fn take_or_borrow<'a>(
23823            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23824        ) -> Self::Borrowed<'a> {
23825            value
23826        }
23827    }
23828
23829    unsafe impl fidl::encoding::TypeMarker for Representation {
23830        type Owned = Self;
23831
23832        #[inline(always)]
23833        fn inline_align(_context: fidl::encoding::Context) -> usize {
23834            8
23835        }
23836
23837        #[inline(always)]
23838        fn inline_size(_context: fidl::encoding::Context) -> usize {
23839            16
23840        }
23841    }
23842
23843    unsafe impl
23844        fidl::encoding::Encode<Representation, fidl::encoding::DefaultFuchsiaResourceDialect>
23845        for &mut Representation
23846    {
23847        #[inline]
23848        unsafe fn encode(
23849            self,
23850            encoder: &mut fidl::encoding::Encoder<
23851                '_,
23852                fidl::encoding::DefaultFuchsiaResourceDialect,
23853            >,
23854            offset: usize,
23855            _depth: fidl::encoding::Depth,
23856        ) -> fidl::Result<()> {
23857            encoder.debug_check_bounds::<Representation>(offset);
23858            encoder.write_num::<u64>(self.ordinal(), offset);
23859            match self {
23860                Representation::Node(ref val) => fidl::encoding::encode_in_envelope::<
23861                    NodeInfo,
23862                    fidl::encoding::DefaultFuchsiaResourceDialect,
23863                >(
23864                    <NodeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
23865                    encoder,
23866                    offset + 8,
23867                    _depth,
23868                ),
23869                Representation::Directory(ref val) => fidl::encoding::encode_in_envelope::<
23870                    DirectoryInfo,
23871                    fidl::encoding::DefaultFuchsiaResourceDialect,
23872                >(
23873                    <DirectoryInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
23874                    encoder,
23875                    offset + 8,
23876                    _depth,
23877                ),
23878                Representation::File(ref mut val) => fidl::encoding::encode_in_envelope::<
23879                    FileInfo,
23880                    fidl::encoding::DefaultFuchsiaResourceDialect,
23881                >(
23882                    <FileInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
23883                    encoder,
23884                    offset + 8,
23885                    _depth,
23886                ),
23887                Representation::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
23888                    SymlinkInfo,
23889                    fidl::encoding::DefaultFuchsiaResourceDialect,
23890                >(
23891                    <SymlinkInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
23892                    encoder,
23893                    offset + 8,
23894                    _depth,
23895                ),
23896                Representation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
23897            }
23898        }
23899    }
23900
23901    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23902        for Representation
23903    {
23904        #[inline(always)]
23905        fn new_empty() -> Self {
23906            Self::__SourceBreaking { unknown_ordinal: 0 }
23907        }
23908
23909        #[inline]
23910        unsafe fn decode(
23911            &mut self,
23912            decoder: &mut fidl::encoding::Decoder<
23913                '_,
23914                fidl::encoding::DefaultFuchsiaResourceDialect,
23915            >,
23916            offset: usize,
23917            mut depth: fidl::encoding::Depth,
23918        ) -> fidl::Result<()> {
23919            decoder.debug_check_bounds::<Self>(offset);
23920            #[allow(unused_variables)]
23921            let next_out_of_line = decoder.next_out_of_line();
23922            let handles_before = decoder.remaining_handles();
23923            let (ordinal, inlined, num_bytes, num_handles) =
23924                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23925
23926            let member_inline_size = match ordinal {
23927                1 => <NodeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23928                2 => <DirectoryInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23929                3 => <FileInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23930                4 => <SymlinkInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23931                0 => return Err(fidl::Error::UnknownUnionTag),
23932                _ => num_bytes as usize,
23933            };
23934
23935            if inlined != (member_inline_size <= 4) {
23936                return Err(fidl::Error::InvalidInlineBitInEnvelope);
23937            }
23938            let _inner_offset;
23939            if inlined {
23940                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23941                _inner_offset = offset + 8;
23942            } else {
23943                depth.increment()?;
23944                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23945            }
23946            match ordinal {
23947                1 => {
23948                    #[allow(irrefutable_let_patterns)]
23949                    if let Representation::Node(_) = self {
23950                        // Do nothing, read the value into the object
23951                    } else {
23952                        // Initialize `self` to the right variant
23953                        *self = Representation::Node(fidl::new_empty!(
23954                            NodeInfo,
23955                            fidl::encoding::DefaultFuchsiaResourceDialect
23956                        ));
23957                    }
23958                    #[allow(irrefutable_let_patterns)]
23959                    if let Representation::Node(ref mut val) = self {
23960                        fidl::decode!(
23961                            NodeInfo,
23962                            fidl::encoding::DefaultFuchsiaResourceDialect,
23963                            val,
23964                            decoder,
23965                            _inner_offset,
23966                            depth
23967                        )?;
23968                    } else {
23969                        unreachable!()
23970                    }
23971                }
23972                2 => {
23973                    #[allow(irrefutable_let_patterns)]
23974                    if let Representation::Directory(_) = self {
23975                        // Do nothing, read the value into the object
23976                    } else {
23977                        // Initialize `self` to the right variant
23978                        *self = Representation::Directory(fidl::new_empty!(
23979                            DirectoryInfo,
23980                            fidl::encoding::DefaultFuchsiaResourceDialect
23981                        ));
23982                    }
23983                    #[allow(irrefutable_let_patterns)]
23984                    if let Representation::Directory(ref mut val) = self {
23985                        fidl::decode!(
23986                            DirectoryInfo,
23987                            fidl::encoding::DefaultFuchsiaResourceDialect,
23988                            val,
23989                            decoder,
23990                            _inner_offset,
23991                            depth
23992                        )?;
23993                    } else {
23994                        unreachable!()
23995                    }
23996                }
23997                3 => {
23998                    #[allow(irrefutable_let_patterns)]
23999                    if let Representation::File(_) = self {
24000                        // Do nothing, read the value into the object
24001                    } else {
24002                        // Initialize `self` to the right variant
24003                        *self = Representation::File(fidl::new_empty!(
24004                            FileInfo,
24005                            fidl::encoding::DefaultFuchsiaResourceDialect
24006                        ));
24007                    }
24008                    #[allow(irrefutable_let_patterns)]
24009                    if let Representation::File(ref mut val) = self {
24010                        fidl::decode!(
24011                            FileInfo,
24012                            fidl::encoding::DefaultFuchsiaResourceDialect,
24013                            val,
24014                            decoder,
24015                            _inner_offset,
24016                            depth
24017                        )?;
24018                    } else {
24019                        unreachable!()
24020                    }
24021                }
24022                4 => {
24023                    #[allow(irrefutable_let_patterns)]
24024                    if let Representation::Symlink(_) = self {
24025                        // Do nothing, read the value into the object
24026                    } else {
24027                        // Initialize `self` to the right variant
24028                        *self = Representation::Symlink(fidl::new_empty!(
24029                            SymlinkInfo,
24030                            fidl::encoding::DefaultFuchsiaResourceDialect
24031                        ));
24032                    }
24033                    #[allow(irrefutable_let_patterns)]
24034                    if let Representation::Symlink(ref mut val) = self {
24035                        fidl::decode!(
24036                            SymlinkInfo,
24037                            fidl::encoding::DefaultFuchsiaResourceDialect,
24038                            val,
24039                            decoder,
24040                            _inner_offset,
24041                            depth
24042                        )?;
24043                    } else {
24044                        unreachable!()
24045                    }
24046                }
24047                #[allow(deprecated)]
24048                ordinal => {
24049                    for _ in 0..num_handles {
24050                        decoder.drop_next_handle()?;
24051                    }
24052                    *self = Representation::__SourceBreaking { unknown_ordinal: ordinal };
24053                }
24054            }
24055            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24056                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24057            }
24058            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24059                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24060            }
24061            Ok(())
24062        }
24063    }
24064}