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#[derive(Debug, Clone)]
500pub struct AdvisoryLockingProxy {
501    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
502}
503
504impl fidl::endpoints::Proxy for AdvisoryLockingProxy {
505    type Protocol = AdvisoryLockingMarker;
506
507    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
508        Self::new(inner)
509    }
510
511    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
512        self.client.into_channel().map_err(|client| Self { client })
513    }
514
515    fn as_channel(&self) -> &::fidl::AsyncChannel {
516        self.client.as_channel()
517    }
518}
519
520impl AdvisoryLockingProxy {
521    /// Create a new Proxy for fuchsia.io/AdvisoryLocking.
522    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
523        let protocol_name = <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
524        Self { client: fidl::client::Client::new(channel, protocol_name) }
525    }
526
527    /// Get a Stream of events from the remote end of the protocol.
528    ///
529    /// # Panics
530    ///
531    /// Panics if the event stream was already taken.
532    pub fn take_event_stream(&self) -> AdvisoryLockingEventStream {
533        AdvisoryLockingEventStream { event_receiver: self.client.take_event_receiver() }
534    }
535
536    /// Acquires an advisory lock on the underlying file.
537    ///
538    /// The lock lasts until either this connection is closed or
539    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
540    /// explicitly.
541    ///
542    /// Advisory locks are purely advisory. They do not prevent actual read or
543    /// write operations from occurring on the file, either through this
544    /// connection or through other connections.
545    ///
546    /// This method requires the following rights:
547    ///
548    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
549    /// * [`Rights.WRITE_BYTES`] if `request.type` is
550    ///   [`AdvisoryLockType.WRITE`].
551    ///
552    /// # Errors
553    ///
554    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
555    ///   example, another connection might hold a conflicting lock type.
556    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
557    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
558    ///   to acquire the given type of lock.
559    pub fn r#advisory_lock(
560        &self,
561        mut request: &AdvisoryLockRequest,
562    ) -> fidl::client::QueryResponseFut<
563        AdvisoryLockingAdvisoryLockResult,
564        fidl::encoding::DefaultFuchsiaResourceDialect,
565    > {
566        AdvisoryLockingProxyInterface::r#advisory_lock(self, request)
567    }
568}
569
570impl AdvisoryLockingProxyInterface for AdvisoryLockingProxy {
571    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
572        AdvisoryLockingAdvisoryLockResult,
573        fidl::encoding::DefaultFuchsiaResourceDialect,
574    >;
575    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
576        fn _decode(
577            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
578        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
579            let _response = fidl::client::decode_transaction_body::<
580                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
581                fidl::encoding::DefaultFuchsiaResourceDialect,
582                0x6ee9c0ad53ec87aa,
583            >(_buf?)?;
584            Ok(_response.map(|x| x))
585        }
586        self.client.send_query_and_decode::<
587            AdvisoryLockingAdvisoryLockRequest,
588            AdvisoryLockingAdvisoryLockResult,
589        >(
590            (request,),
591            0x6ee9c0ad53ec87aa,
592            fidl::encoding::DynamicFlags::empty(),
593            _decode,
594        )
595    }
596}
597
598pub struct AdvisoryLockingEventStream {
599    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
600}
601
602impl std::marker::Unpin for AdvisoryLockingEventStream {}
603
604impl futures::stream::FusedStream for AdvisoryLockingEventStream {
605    fn is_terminated(&self) -> bool {
606        self.event_receiver.is_terminated()
607    }
608}
609
610impl futures::Stream for AdvisoryLockingEventStream {
611    type Item = Result<AdvisoryLockingEvent, fidl::Error>;
612
613    fn poll_next(
614        mut self: std::pin::Pin<&mut Self>,
615        cx: &mut std::task::Context<'_>,
616    ) -> std::task::Poll<Option<Self::Item>> {
617        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
618            &mut self.event_receiver,
619            cx
620        )?) {
621            Some(buf) => std::task::Poll::Ready(Some(AdvisoryLockingEvent::decode(buf))),
622            None => std::task::Poll::Ready(None),
623        }
624    }
625}
626
627#[derive(Debug)]
628pub enum AdvisoryLockingEvent {}
629
630impl AdvisoryLockingEvent {
631    /// Decodes a message buffer as a [`AdvisoryLockingEvent`].
632    fn decode(
633        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
634    ) -> Result<AdvisoryLockingEvent, fidl::Error> {
635        let (bytes, _handles) = buf.split_mut();
636        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
637        debug_assert_eq!(tx_header.tx_id, 0);
638        match tx_header.ordinal {
639            _ => Err(fidl::Error::UnknownOrdinal {
640                ordinal: tx_header.ordinal,
641                protocol_name:
642                    <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
643            }),
644        }
645    }
646}
647
648/// A Stream of incoming requests for fuchsia.io/AdvisoryLocking.
649pub struct AdvisoryLockingRequestStream {
650    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
651    is_terminated: bool,
652}
653
654impl std::marker::Unpin for AdvisoryLockingRequestStream {}
655
656impl futures::stream::FusedStream for AdvisoryLockingRequestStream {
657    fn is_terminated(&self) -> bool {
658        self.is_terminated
659    }
660}
661
662impl fidl::endpoints::RequestStream for AdvisoryLockingRequestStream {
663    type Protocol = AdvisoryLockingMarker;
664    type ControlHandle = AdvisoryLockingControlHandle;
665
666    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
667        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
668    }
669
670    fn control_handle(&self) -> Self::ControlHandle {
671        AdvisoryLockingControlHandle { inner: self.inner.clone() }
672    }
673
674    fn into_inner(
675        self,
676    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
677    {
678        (self.inner, self.is_terminated)
679    }
680
681    fn from_inner(
682        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
683        is_terminated: bool,
684    ) -> Self {
685        Self { inner, is_terminated }
686    }
687}
688
689impl futures::Stream for AdvisoryLockingRequestStream {
690    type Item = Result<AdvisoryLockingRequest, fidl::Error>;
691
692    fn poll_next(
693        mut self: std::pin::Pin<&mut Self>,
694        cx: &mut std::task::Context<'_>,
695    ) -> std::task::Poll<Option<Self::Item>> {
696        let this = &mut *self;
697        if this.inner.check_shutdown(cx) {
698            this.is_terminated = true;
699            return std::task::Poll::Ready(None);
700        }
701        if this.is_terminated {
702            panic!("polled AdvisoryLockingRequestStream after completion");
703        }
704        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
705            |bytes, handles| {
706                match this.inner.channel().read_etc(cx, bytes, handles) {
707                    std::task::Poll::Ready(Ok(())) => {}
708                    std::task::Poll::Pending => return std::task::Poll::Pending,
709                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
710                        this.is_terminated = true;
711                        return std::task::Poll::Ready(None);
712                    }
713                    std::task::Poll::Ready(Err(e)) => {
714                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
715                            e.into(),
716                        ))))
717                    }
718                }
719
720                // A message has been received from the channel
721                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
722
723                std::task::Poll::Ready(Some(match header.ordinal {
724                    0x6ee9c0ad53ec87aa => {
725                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
726                        let mut req = fidl::new_empty!(
727                            AdvisoryLockingAdvisoryLockRequest,
728                            fidl::encoding::DefaultFuchsiaResourceDialect
729                        );
730                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
731                        let control_handle =
732                            AdvisoryLockingControlHandle { inner: this.inner.clone() };
733                        Ok(AdvisoryLockingRequest::AdvisoryLock {
734                            request: req.request,
735
736                            responder: AdvisoryLockingAdvisoryLockResponder {
737                                control_handle: std::mem::ManuallyDrop::new(control_handle),
738                                tx_id: header.tx_id,
739                            },
740                        })
741                    }
742                    _ => Err(fidl::Error::UnknownOrdinal {
743                        ordinal: header.ordinal,
744                        protocol_name:
745                            <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
746                    }),
747                }))
748            },
749        )
750    }
751}
752
753/// Advisory locking protocol.
754///
755/// This protocol is intended to be composed into the |File| protocol to
756/// provide support for advisory locking.
757///
758/// Advisory locks are purely advisory. They do not prevent actual read or
759/// write operations from occurring on the file, either through this
760/// connection or through other connections.
761///
762/// These primitives are designed to support the flock() and fcntl(),
763/// specifically F_SETLK, F_SETLKW, and F_GETLK, functionality that code
764/// running on Fuchsia expects from other operating systems.
765#[derive(Debug)]
766pub enum AdvisoryLockingRequest {
767    /// Acquires an advisory lock on the underlying file.
768    ///
769    /// The lock lasts until either this connection is closed or
770    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
771    /// explicitly.
772    ///
773    /// Advisory locks are purely advisory. They do not prevent actual read or
774    /// write operations from occurring on the file, either through this
775    /// connection or through other connections.
776    ///
777    /// This method requires the following rights:
778    ///
779    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
780    /// * [`Rights.WRITE_BYTES`] if `request.type` is
781    ///   [`AdvisoryLockType.WRITE`].
782    ///
783    /// # Errors
784    ///
785    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
786    ///   example, another connection might hold a conflicting lock type.
787    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
788    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
789    ///   to acquire the given type of lock.
790    AdvisoryLock { request: AdvisoryLockRequest, responder: AdvisoryLockingAdvisoryLockResponder },
791}
792
793impl AdvisoryLockingRequest {
794    #[allow(irrefutable_let_patterns)]
795    pub fn into_advisory_lock(
796        self,
797    ) -> Option<(AdvisoryLockRequest, AdvisoryLockingAdvisoryLockResponder)> {
798        if let AdvisoryLockingRequest::AdvisoryLock { request, responder } = self {
799            Some((request, responder))
800        } else {
801            None
802        }
803    }
804
805    /// Name of the method defined in FIDL
806    pub fn method_name(&self) -> &'static str {
807        match *self {
808            AdvisoryLockingRequest::AdvisoryLock { .. } => "advisory_lock",
809        }
810    }
811}
812
813#[derive(Debug, Clone)]
814pub struct AdvisoryLockingControlHandle {
815    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
816}
817
818impl fidl::endpoints::ControlHandle for AdvisoryLockingControlHandle {
819    fn shutdown(&self) {
820        self.inner.shutdown()
821    }
822    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
823        self.inner.shutdown_with_epitaph(status)
824    }
825
826    fn is_closed(&self) -> bool {
827        self.inner.channel().is_closed()
828    }
829    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
830        self.inner.channel().on_closed()
831    }
832
833    #[cfg(target_os = "fuchsia")]
834    fn signal_peer(
835        &self,
836        clear_mask: zx::Signals,
837        set_mask: zx::Signals,
838    ) -> Result<(), zx_status::Status> {
839        use fidl::Peered;
840        self.inner.channel().signal_peer(clear_mask, set_mask)
841    }
842}
843
844impl AdvisoryLockingControlHandle {}
845
846#[must_use = "FIDL methods require a response to be sent"]
847#[derive(Debug)]
848pub struct AdvisoryLockingAdvisoryLockResponder {
849    control_handle: std::mem::ManuallyDrop<AdvisoryLockingControlHandle>,
850    tx_id: u32,
851}
852
853/// Set the the channel to be shutdown (see [`AdvisoryLockingControlHandle::shutdown`])
854/// if the responder is dropped without sending a response, so that the client
855/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
856impl std::ops::Drop for AdvisoryLockingAdvisoryLockResponder {
857    fn drop(&mut self) {
858        self.control_handle.shutdown();
859        // Safety: drops once, never accessed again
860        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
861    }
862}
863
864impl fidl::endpoints::Responder for AdvisoryLockingAdvisoryLockResponder {
865    type ControlHandle = AdvisoryLockingControlHandle;
866
867    fn control_handle(&self) -> &AdvisoryLockingControlHandle {
868        &self.control_handle
869    }
870
871    fn drop_without_shutdown(mut self) {
872        // Safety: drops once, never accessed again due to mem::forget
873        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
874        // Prevent Drop from running (which would shut down the channel)
875        std::mem::forget(self);
876    }
877}
878
879impl AdvisoryLockingAdvisoryLockResponder {
880    /// Sends a response to the FIDL transaction.
881    ///
882    /// Sets the channel to shutdown if an error occurs.
883    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
884        let _result = self.send_raw(result);
885        if _result.is_err() {
886            self.control_handle.shutdown();
887        }
888        self.drop_without_shutdown();
889        _result
890    }
891
892    /// Similar to "send" but does not shutdown the channel if an error occurs.
893    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
894        let _result = self.send_raw(result);
895        self.drop_without_shutdown();
896        _result
897    }
898
899    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
900        self.control_handle
901            .inner
902            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
903                result,
904                self.tx_id,
905                0x6ee9c0ad53ec87aa,
906                fidl::encoding::DynamicFlags::empty(),
907            )
908    }
909}
910
911#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
912pub struct DirectoryMarker;
913
914impl fidl::endpoints::ProtocolMarker for DirectoryMarker {
915    type Proxy = DirectoryProxy;
916    type RequestStream = DirectoryRequestStream;
917    #[cfg(target_os = "fuchsia")]
918    type SynchronousProxy = DirectorySynchronousProxy;
919
920    const DEBUG_NAME: &'static str = "fuchsia.io.Directory";
921}
922impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryMarker {}
923pub type DirectoryUnlinkResult = Result<(), i32>;
924pub type DirectoryRenameResult = Result<(), i32>;
925pub type DirectoryCreateSymlinkResult = Result<(), i32>;
926
927pub trait DirectoryProxyInterface: Send + Sync {
928    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
929        + Send;
930    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
931    fn r#clone(
932        &self,
933        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
934    ) -> Result<(), fidl::Error>;
935    type CloseResponseFut: std::future::Future<
936            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
937        > + Send;
938    fn r#close(&self) -> Self::CloseResponseFut;
939    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
940    fn r#query(&self) -> Self::QueryResponseFut;
941    fn r#deprecated_clone(
942        &self,
943        flags: OpenFlags,
944        object: fidl::endpoints::ServerEnd<NodeMarker>,
945    ) -> Result<(), fidl::Error>;
946    type GetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
947        + Send;
948    fn r#get_attr(&self) -> Self::GetAttrResponseFut;
949    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
950    fn r#deprecated_set_attr(
951        &self,
952        flags: NodeAttributeFlags,
953        attributes: &NodeAttributes,
954    ) -> Self::DeprecatedSetAttrResponseFut;
955    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
956        + Send;
957    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
958    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
959        + Send;
960    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
961    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
962        + Send;
963    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
964    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
965        + Send;
966    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
967    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
968        + Send;
969    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
970    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
971        + Send;
972    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
973    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
974        + Send;
975    fn r#update_attributes(
976        &self,
977        payload: &MutableNodeAttributes,
978    ) -> Self::UpdateAttributesResponseFut;
979    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
980    fn r#sync(&self) -> Self::SyncResponseFut;
981    fn r#list_extended_attributes(
982        &self,
983        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
984    ) -> Result<(), fidl::Error>;
985    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
986        + Send;
987    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
988    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
989        + Send;
990    fn r#set_extended_attribute(
991        &self,
992        name: &[u8],
993        value: ExtendedAttributeValue,
994        mode: SetExtendedAttributeMode,
995    ) -> Self::SetExtendedAttributeResponseFut;
996    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
997        + Send;
998    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
999    fn r#deprecated_open(
1000        &self,
1001        flags: OpenFlags,
1002        mode: ModeType,
1003        path: &str,
1004        object: fidl::endpoints::ServerEnd<NodeMarker>,
1005    ) -> Result<(), fidl::Error>;
1006    fn r#open(
1007        &self,
1008        path: &str,
1009        flags: Flags,
1010        options: &Options,
1011        object: fidl::Channel,
1012    ) -> Result<(), fidl::Error>;
1013    type ReadDirentsResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>), fidl::Error>>
1014        + Send;
1015    fn r#read_dirents(&self, max_bytes: u64) -> Self::ReadDirentsResponseFut;
1016    type RewindResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1017    fn r#rewind(&self) -> Self::RewindResponseFut;
1018    type GetTokenResponseFut: std::future::Future<Output = Result<(i32, Option<fidl::Handle>), fidl::Error>>
1019        + Send;
1020    fn r#get_token(&self) -> Self::GetTokenResponseFut;
1021    type LinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1022    fn r#link(&self, src: &str, dst_parent_token: fidl::Handle, dst: &str)
1023        -> Self::LinkResponseFut;
1024    type UnlinkResponseFut: std::future::Future<Output = Result<DirectoryUnlinkResult, fidl::Error>>
1025        + Send;
1026    fn r#unlink(&self, name: &str, options: &UnlinkOptions) -> Self::UnlinkResponseFut;
1027    type RenameResponseFut: std::future::Future<Output = Result<DirectoryRenameResult, fidl::Error>>
1028        + Send;
1029    fn r#rename(
1030        &self,
1031        src: &str,
1032        dst_parent_token: fidl::Event,
1033        dst: &str,
1034    ) -> Self::RenameResponseFut;
1035    type CreateSymlinkResponseFut: std::future::Future<Output = Result<DirectoryCreateSymlinkResult, fidl::Error>>
1036        + Send;
1037    fn r#create_symlink(
1038        &self,
1039        name: &str,
1040        target: &[u8],
1041        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1042    ) -> Self::CreateSymlinkResponseFut;
1043    type WatchResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1044    fn r#watch(
1045        &self,
1046        mask: WatchMask,
1047        options: u32,
1048        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1049    ) -> Self::WatchResponseFut;
1050}
1051#[derive(Debug)]
1052#[cfg(target_os = "fuchsia")]
1053pub struct DirectorySynchronousProxy {
1054    client: fidl::client::sync::Client,
1055}
1056
1057#[cfg(target_os = "fuchsia")]
1058impl fidl::endpoints::SynchronousProxy for DirectorySynchronousProxy {
1059    type Proxy = DirectoryProxy;
1060    type Protocol = DirectoryMarker;
1061
1062    fn from_channel(inner: fidl::Channel) -> Self {
1063        Self::new(inner)
1064    }
1065
1066    fn into_channel(self) -> fidl::Channel {
1067        self.client.into_channel()
1068    }
1069
1070    fn as_channel(&self) -> &fidl::Channel {
1071        self.client.as_channel()
1072    }
1073}
1074
1075#[cfg(target_os = "fuchsia")]
1076impl DirectorySynchronousProxy {
1077    pub fn new(channel: fidl::Channel) -> Self {
1078        let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1079        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1080    }
1081
1082    pub fn into_channel(self) -> fidl::Channel {
1083        self.client.into_channel()
1084    }
1085
1086    /// Waits until an event arrives and returns it. It is safe for other
1087    /// threads to make concurrent requests while waiting for an event.
1088    pub fn wait_for_event(
1089        &self,
1090        deadline: zx::MonotonicInstant,
1091    ) -> Result<DirectoryEvent, fidl::Error> {
1092        DirectoryEvent::decode(self.client.wait_for_event(deadline)?)
1093    }
1094
1095    /// Acquires an advisory lock on the underlying file.
1096    ///
1097    /// The lock lasts until either this connection is closed or
1098    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1099    /// explicitly.
1100    ///
1101    /// Advisory locks are purely advisory. They do not prevent actual read or
1102    /// write operations from occurring on the file, either through this
1103    /// connection or through other connections.
1104    ///
1105    /// This method requires the following rights:
1106    ///
1107    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1108    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1109    ///   [`AdvisoryLockType.WRITE`].
1110    ///
1111    /// # Errors
1112    ///
1113    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1114    ///   example, another connection might hold a conflicting lock type.
1115    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1116    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1117    ///   to acquire the given type of lock.
1118    pub fn r#advisory_lock(
1119        &self,
1120        mut request: &AdvisoryLockRequest,
1121        ___deadline: zx::MonotonicInstant,
1122    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
1123        let _response = self.client.send_query::<
1124            AdvisoryLockingAdvisoryLockRequest,
1125            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1126        >(
1127            (request,),
1128            0x6ee9c0ad53ec87aa,
1129            fidl::encoding::DynamicFlags::empty(),
1130            ___deadline,
1131        )?;
1132        Ok(_response.map(|x| x))
1133    }
1134
1135    pub fn r#clone(
1136        &self,
1137        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1138    ) -> Result<(), fidl::Error> {
1139        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
1140            (request,),
1141            0x20d8a7aba2168a79,
1142            fidl::encoding::DynamicFlags::empty(),
1143        )
1144    }
1145
1146    /// Terminates the connection.
1147    ///
1148    /// After calling `Close`, the client must not send any other requests.
1149    ///
1150    /// Servers, after sending the status response, should close the connection
1151    /// regardless of status and without sending an epitaph.
1152    ///
1153    /// Closing the client end of the channel should be semantically equivalent
1154    /// to calling `Close` without knowing when the close has completed or its
1155    /// status.
1156    pub fn r#close(
1157        &self,
1158        ___deadline: zx::MonotonicInstant,
1159    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
1160        let _response = self.client.send_query::<
1161            fidl::encoding::EmptyPayload,
1162            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1163        >(
1164            (),
1165            0x5ac5d459ad7f657e,
1166            fidl::encoding::DynamicFlags::empty(),
1167            ___deadline,
1168        )?;
1169        Ok(_response.map(|x| x))
1170    }
1171
1172    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
1173        let _response = self.client.send_query::<
1174            fidl::encoding::EmptyPayload,
1175            fidl_fuchsia_unknown::QueryableQueryResponse,
1176        >(
1177            (),
1178            0x2658edee9decfc06,
1179            fidl::encoding::DynamicFlags::empty(),
1180            ___deadline,
1181        )?;
1182        Ok(_response.protocol)
1183    }
1184
1185    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1186    pub fn r#deprecated_clone(
1187        &self,
1188        mut flags: OpenFlags,
1189        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1190    ) -> Result<(), fidl::Error> {
1191        self.client.send::<NodeDeprecatedCloneRequest>(
1192            (flags, object),
1193            0x5a61678f293ce16f,
1194            fidl::encoding::DynamicFlags::FLEXIBLE,
1195        )
1196    }
1197
1198    /// Acquires information about the node.
1199    ///
1200    /// This method does not require any rights.
1201    pub fn r#get_attr(
1202        &self,
1203        ___deadline: zx::MonotonicInstant,
1204    ) -> Result<(i32, NodeAttributes), fidl::Error> {
1205        let _response =
1206            self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetAttrResponse>(
1207                (),
1208                0x78985e216314dafd,
1209                fidl::encoding::DynamicFlags::empty(),
1210                ___deadline,
1211            )?;
1212        Ok((_response.s, _response.attributes))
1213    }
1214
1215    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1216    pub fn r#deprecated_set_attr(
1217        &self,
1218        mut flags: NodeAttributeFlags,
1219        mut attributes: &NodeAttributes,
1220        ___deadline: zx::MonotonicInstant,
1221    ) -> Result<i32, fidl::Error> {
1222        let _response =
1223            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
1224                (flags, attributes),
1225                0x4186c0f40d938f46,
1226                fidl::encoding::DynamicFlags::empty(),
1227                ___deadline,
1228            )?;
1229        Ok(_response.s)
1230    }
1231
1232    /// [DEPRECATED - Use new GetFlags method instead.]
1233    pub fn r#deprecated_get_flags(
1234        &self,
1235        ___deadline: zx::MonotonicInstant,
1236    ) -> Result<(i32, OpenFlags), fidl::Error> {
1237        let _response = self
1238            .client
1239            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
1240                (),
1241                0x5b88fffb8eda3aa1,
1242                fidl::encoding::DynamicFlags::empty(),
1243                ___deadline,
1244            )?;
1245        Ok((_response.s, _response.flags))
1246    }
1247
1248    /// [DEPRECATED - Use new SetFlags method instead.]
1249    pub fn r#deprecated_set_flags(
1250        &self,
1251        mut flags: OpenFlags,
1252        ___deadline: zx::MonotonicInstant,
1253    ) -> Result<i32, fidl::Error> {
1254        let _response = self
1255            .client
1256            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
1257                (flags,),
1258                0x5295b76c71fde733,
1259                fidl::encoding::DynamicFlags::empty(),
1260                ___deadline,
1261            )?;
1262        Ok(_response.s)
1263    }
1264
1265    /// Queries the flags that apply to this node after it has been opened/created. This method does
1266    /// not require any rights.
1267    ///
1268    /// Note that the final set of flags that apply to the connection may differ from those
1269    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1270    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1271    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1272    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1273    pub fn r#get_flags(
1274        &self,
1275        ___deadline: zx::MonotonicInstant,
1276    ) -> Result<NodeGetFlagsResult, fidl::Error> {
1277        let _response = self.client.send_query::<
1278            fidl::encoding::EmptyPayload,
1279            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
1280        >(
1281            (),
1282            0x176eb318f64ec23,
1283            fidl::encoding::DynamicFlags::FLEXIBLE,
1284            ___deadline,
1285        )?
1286        .into_result::<DirectoryMarker>("get_flags")?;
1287        Ok(_response.map(|x| x.flags))
1288    }
1289
1290    /// Sets the flags that apply to this node after it has been opened. This method does not
1291    /// require any rights.
1292    ///
1293    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1294    /// clear append mode.
1295    ///
1296    /// Errors:
1297    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1298    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1299    pub fn r#set_flags(
1300        &self,
1301        mut flags: Flags,
1302        ___deadline: zx::MonotonicInstant,
1303    ) -> Result<NodeSetFlagsResult, fidl::Error> {
1304        let _response = self.client.send_query::<
1305            NodeSetFlagsRequest,
1306            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1307        >(
1308            (flags,),
1309            0x55a8028685791ea8,
1310            fidl::encoding::DynamicFlags::FLEXIBLE,
1311            ___deadline,
1312        )?
1313        .into_result::<DirectoryMarker>("set_flags")?;
1314        Ok(_response.map(|x| x))
1315    }
1316
1317    /// Query the filesystem for filesystem-specific information.
1318    pub fn r#query_filesystem(
1319        &self,
1320        ___deadline: zx::MonotonicInstant,
1321    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
1322        let _response =
1323            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
1324                (),
1325                0x6f344a1c6b0a0610,
1326                fidl::encoding::DynamicFlags::empty(),
1327                ___deadline,
1328            )?;
1329        Ok((_response.s, _response.info))
1330    }
1331
1332    /// Acquires information about the node.
1333    ///
1334    /// The attributes of a node should be stable, independent of the
1335    /// specific protocol used to access it.
1336    ///
1337    /// If a particular attribute is not applicable or not supported,
1338    /// filesystems should leave the corresponding field absent.
1339    ///
1340    /// + `query` a bit-mask specifying which attributes to fetch. The server
1341    ///   should not return more than necessary.
1342    /// - `attributes` the returned attributes.
1343    ///
1344    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1345    pub fn r#get_attributes(
1346        &self,
1347        mut query: NodeAttributesQuery,
1348        ___deadline: zx::MonotonicInstant,
1349    ) -> Result<NodeGetAttributesResult, fidl::Error> {
1350        let _response = self.client.send_query::<
1351            NodeGetAttributesRequest,
1352            fidl::encoding::ResultType<NodeAttributes2, i32>,
1353        >(
1354            (query,),
1355            0x3d4396a638ea053b,
1356            fidl::encoding::DynamicFlags::empty(),
1357            ___deadline,
1358        )?;
1359        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
1360    }
1361
1362    /// Updates information about the node.
1363    ///
1364    /// + `attributes` the presence of a table field in `attributes` indicates
1365    /// the intent to update the corresponding attribute.
1366    ///
1367    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
1368    ///
1369    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1370    pub fn r#update_attributes(
1371        &self,
1372        mut payload: &MutableNodeAttributes,
1373        ___deadline: zx::MonotonicInstant,
1374    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
1375        let _response = self.client.send_query::<
1376            MutableNodeAttributes,
1377            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1378        >(
1379            payload,
1380            0x3308c1da5a89bf08,
1381            fidl::encoding::DynamicFlags::empty(),
1382            ___deadline,
1383        )?;
1384        Ok(_response.map(|x| x))
1385    }
1386
1387    /// Synchronizes updates to the node to the underlying media, if it exists.
1388    ///
1389    /// This method will return when the filesystem server has flushed the
1390    /// relevant updates to the underlying media, but does not guarantee the
1391    /// underlying media has persisted the information, nor that any information
1392    /// is committed to hardware. Clients may use `Sync` to ensure ordering
1393    /// between operations.
1394    ///
1395    /// This method does not require any rights.
1396    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
1397        let _response = self.client.send_query::<
1398            fidl::encoding::EmptyPayload,
1399            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1400        >(
1401            (),
1402            0x2c5c27ca0ab5dc49,
1403            fidl::encoding::DynamicFlags::empty(),
1404            ___deadline,
1405        )?;
1406        Ok(_response.map(|x| x))
1407    }
1408
1409    /// Creates an iterator over all the extended attribute names associated
1410    /// with this node. If an error occurs it is returned as an epitaph on the
1411    /// iterator request channel, and then the channel is closed.
1412    ///
1413    /// GetExtendedAttributes can be used with any of these names to retrieve
1414    /// the associated value.
1415    ///
1416    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1417    pub fn r#list_extended_attributes(
1418        &self,
1419        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
1420    ) -> Result<(), fidl::Error> {
1421        self.client.send::<NodeListExtendedAttributesRequest>(
1422            (iterator,),
1423            0x4b61033de007fcd0,
1424            fidl::encoding::DynamicFlags::empty(),
1425        )
1426    }
1427
1428    /// Get the value associated with the given attribute `name` for this node.
1429    ///
1430    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
1431    /// particular structure is imposed on them.
1432    ///
1433    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1434    pub fn r#get_extended_attribute(
1435        &self,
1436        mut name: &[u8],
1437        ___deadline: zx::MonotonicInstant,
1438    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
1439        let _response = self.client.send_query::<
1440            NodeGetExtendedAttributeRequest,
1441            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
1442        >(
1443            (name,),
1444            0x45ffa3ccfdeb76db,
1445            fidl::encoding::DynamicFlags::empty(),
1446            ___deadline,
1447        )?;
1448        Ok(_response.map(|x| x))
1449    }
1450
1451    /// Set the value for the given attribute `name` to `value` for this node.
1452    ///
1453    /// The attribute name may exist, in which case the attribute is updated.
1454    /// If the attribute doesn't exist, it is created. The name should have no
1455    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
1456    ///
1457    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1458    pub fn r#set_extended_attribute(
1459        &self,
1460        mut name: &[u8],
1461        mut value: ExtendedAttributeValue,
1462        mut mode: SetExtendedAttributeMode,
1463        ___deadline: zx::MonotonicInstant,
1464    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
1465        let _response = self.client.send_query::<
1466            NodeSetExtendedAttributeRequest,
1467            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1468        >(
1469            (name, &mut value, mode,),
1470            0x4a951362f681f23c,
1471            fidl::encoding::DynamicFlags::empty(),
1472            ___deadline,
1473        )?;
1474        Ok(_response.map(|x| x))
1475    }
1476
1477    /// Remove the specified extended attribute.
1478    ///
1479    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
1480    ///
1481    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1482    pub fn r#remove_extended_attribute(
1483        &self,
1484        mut name: &[u8],
1485        ___deadline: zx::MonotonicInstant,
1486    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
1487        let _response = self.client.send_query::<
1488            NodeRemoveExtendedAttributeRequest,
1489            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1490        >(
1491            (name,),
1492            0x7a0b9f3a9bf9032d,
1493            fidl::encoding::DynamicFlags::empty(),
1494            ___deadline,
1495        )?;
1496        Ok(_response.map(|x| x))
1497    }
1498
1499    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
1500    pub fn r#deprecated_open(
1501        &self,
1502        mut flags: OpenFlags,
1503        mut mode: ModeType,
1504        mut path: &str,
1505        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1506    ) -> Result<(), fidl::Error> {
1507        self.client.send::<DirectoryDeprecatedOpenRequest>(
1508            (flags, mode, path, object),
1509            0x2c5044561d685ec0,
1510            fidl::encoding::DynamicFlags::FLEXIBLE,
1511        )
1512    }
1513
1514    /// Open (or create) a node relative to this directory. Any errors are communicated via an
1515    /// epitaph sent on the `object` channel.
1516    ///
1517    /// Errors:
1518    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
1519    /// * See [`Flags`] for other errors which may be communicated based on `flags`
1520    pub fn r#open(
1521        &self,
1522        mut path: &str,
1523        mut flags: Flags,
1524        mut options: &Options,
1525        mut object: fidl::Channel,
1526    ) -> Result<(), fidl::Error> {
1527        self.client.send::<DirectoryOpenRequest>(
1528            (path, flags, options, object),
1529            0x568ddcb9a9cbb6d9,
1530            fidl::encoding::DynamicFlags::empty(),
1531        )
1532    }
1533
1534    /// Reads a collection of variably sized dirents into a buffer.
1535    /// The number of dirents in a directory may be very large: akin to
1536    /// calling read multiple times on a file, directories have a seek
1537    /// offset which is updated on subsequent calls to ReadDirents.
1538    /// Each call to ReadDirents will only return whole dirent structures,
1539    /// they will not get split across ReadDirent calls. When the seek
1540    /// offset reaches the end, `dirents` will be empty.
1541    ///
1542    /// These dirents are of the form:
1543    /// ```
1544    /// struct dirent {
1545    ///   // Describes the inode of the entry.
1546    ///   uint64 ino;
1547    ///   // Describes the length of the dirent name in bytes.
1548    ///   uint8 size;
1549    ///   // Describes the type of the entry. Aligned with the
1550    ///   // POSIX d_type values. Use `DirentType` constants.
1551    ///   uint8 type;
1552    ///   // Unterminated name of entry.
1553    ///   char name[0];
1554    /// }
1555    /// ```
1556    ///
1557    /// This method does not require any rights, since one could always probe for
1558    /// directory contents by triggering name conflicts during file creation.
1559    pub fn r#read_dirents(
1560        &self,
1561        mut max_bytes: u64,
1562        ___deadline: zx::MonotonicInstant,
1563    ) -> Result<(i32, Vec<u8>), fidl::Error> {
1564        let _response =
1565            self.client.send_query::<DirectoryReadDirentsRequest, DirectoryReadDirentsResponse>(
1566                (max_bytes,),
1567                0x3582806bf27faa0a,
1568                fidl::encoding::DynamicFlags::empty(),
1569                ___deadline,
1570            )?;
1571        Ok((_response.s, _response.dirents))
1572    }
1573
1574    /// Resets the directory seek offset.
1575    ///
1576    /// This method does not require any rights, similar to ReadDirents.
1577    pub fn r#rewind(&self, ___deadline: zx::MonotonicInstant) -> Result<i32, fidl::Error> {
1578        let _response =
1579            self.client.send_query::<fidl::encoding::EmptyPayload, DirectoryRewindResponse>(
1580                (),
1581                0x16b1202af0f34c71,
1582                fidl::encoding::DynamicFlags::empty(),
1583                ___deadline,
1584            )?;
1585        Ok(_response.s)
1586    }
1587
1588    /// Acquires a token to a Directory which can be used to identify access to it at a later point
1589    /// in time. The token will remain valid for as long as the connection requesting the token
1590    /// remains open.
1591    ///
1592    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1593    /// `ZX_ERR_BAD_HANDLE`.
1594    pub fn r#get_token(
1595        &self,
1596        ___deadline: zx::MonotonicInstant,
1597    ) -> Result<(i32, Option<fidl::Handle>), fidl::Error> {
1598        let _response =
1599            self.client.send_query::<fidl::encoding::EmptyPayload, DirectoryGetTokenResponse>(
1600                (),
1601                0x26ae9d18763c8655,
1602                fidl::encoding::DynamicFlags::empty(),
1603                ___deadline,
1604            )?;
1605        Ok((_response.s, _response.token))
1606    }
1607
1608    /// Creates a link to an object named src by the name dst, within a directory represented by
1609    /// token.
1610    ///
1611    /// `src` must be a resolved object name. Including "/" in the string will
1612    /// return `ZX_ERR_INVALID_ARGS`.
1613    ///
1614    /// `dst` must be a resolved object name. Including "/" in the string will
1615    /// return `ZX_ERR_INVALID_ARGS`.
1616    ///
1617    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
1618    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
1619    ///
1620    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
1621    /// there are two actors operating concurrently, and one actor performs a rename that affects
1622    /// the source within this directory, and the other does a link, each will appear to occur
1623    /// atomically in an unspecified order.
1624    pub fn r#link(
1625        &self,
1626        mut src: &str,
1627        mut dst_parent_token: fidl::Handle,
1628        mut dst: &str,
1629        ___deadline: zx::MonotonicInstant,
1630    ) -> Result<i32, fidl::Error> {
1631        let _response = self.client.send_query::<DirectoryLinkRequest, DirectoryLinkResponse>(
1632            (src, dst_parent_token, dst),
1633            0x740604c0c7c930e7,
1634            fidl::encoding::DynamicFlags::empty(),
1635            ___deadline,
1636        )?;
1637        Ok(_response.s)
1638    }
1639
1640    /// Removes a child node from the this directory's list of entries.
1641    ///
1642    /// Note: this does not guarantee that the underlying object is destroyed.
1643    /// Although the link will be removed from the containing directory,
1644    /// objects with multiple references (such as files which are still open)
1645    /// will not actually be destroyed until all references are closed.
1646    ///
1647    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
1648    ///   [`Rights.WRITE_BYTES`].
1649    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
1650    ///   support writing.
1651    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
1652    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
1653    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
1654    ///   containing a remote channel.
1655    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
1656    ///     something other than a directory was found.
1657    ///
1658    /// Other errors may be returned for filesystem-specific reasons.
1659    ///
1660    /// This method requires the following rights:
1661    ///
1662    /// * [`Rights.ENUMERATE`]
1663    /// * [`Rights.MODIFY_DIRECTORY`]
1664    pub fn r#unlink(
1665        &self,
1666        mut name: &str,
1667        mut options: &UnlinkOptions,
1668        ___deadline: zx::MonotonicInstant,
1669    ) -> Result<DirectoryUnlinkResult, fidl::Error> {
1670        let _response = self.client.send_query::<
1671            DirectoryUnlinkRequest,
1672            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1673        >(
1674            (name, options,),
1675            0x750a0326a78d7bed,
1676            fidl::encoding::DynamicFlags::empty(),
1677            ___deadline,
1678        )?;
1679        Ok(_response.map(|x| x))
1680    }
1681
1682    /// Renames a node named `src` to the name `dst`, in a directory represented
1683    /// by `dst_parent_token`.
1684    ///
1685    /// `src` and `dst` must be valid node names.
1686    /// See [`Name`] for what constitutes a valid name.
1687    ///
1688    /// This method requires the following rights on both the current connection, and the connection
1689    /// identified by `dst_parent_token`:
1690    ///
1691    /// * [`Rights.ENUMERATE`]
1692    /// * [`Rights.MODIFY_DIRECTORY`]
1693    ///
1694    /// The following requirements are necessary to avoid rights escalations.
1695    ///
1696    /// If the source and destination directory differ, the source directory must also have the
1697    /// maximal set of abilities supported for files, which would typically be
1698    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
1699    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
1700    /// right.
1701    ///
1702    /// If `src` refers to a directory, and differs from the destination directory, then the source
1703    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
1704    ///
1705    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
1706    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
1707    pub fn r#rename(
1708        &self,
1709        mut src: &str,
1710        mut dst_parent_token: fidl::Event,
1711        mut dst: &str,
1712        ___deadline: zx::MonotonicInstant,
1713    ) -> Result<DirectoryRenameResult, fidl::Error> {
1714        let _response = self.client.send_query::<
1715            DirectoryRenameRequest,
1716            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1717        >(
1718            (src, dst_parent_token, dst,),
1719            0x7060e7723b9928de,
1720            fidl::encoding::DynamicFlags::empty(),
1721            ___deadline,
1722        )?;
1723        Ok(_response.map(|x| x))
1724    }
1725
1726    /// Creates a symbolic link.
1727    ///
1728    /// `name` is the name to be given to the created symbolic link.
1729    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
1730    /// will perform no validation of `target` except for a server chosen maximum length.
1731    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
1732    /// on the successfully created node.
1733    ///
1734    /// * [`Rights.MODIFY_DIRECTORY`]
1735    ///
1736    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
1737    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
1738    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
1739    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
1740    pub fn r#create_symlink(
1741        &self,
1742        mut name: &str,
1743        mut target: &[u8],
1744        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1745        ___deadline: zx::MonotonicInstant,
1746    ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
1747        let _response = self.client.send_query::<
1748            DirectoryCreateSymlinkRequest,
1749            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1750        >(
1751            (name, target, connection,),
1752            0x21ce0f19ec043889,
1753            fidl::encoding::DynamicFlags::empty(),
1754            ___deadline,
1755        )?;
1756        Ok(_response.map(|x| x))
1757    }
1758
1759    /// Watches a directory, receiving events of added messages on the
1760    /// watcher request channel.
1761    ///
1762    /// Options must be zero; it is reserved.
1763    ///
1764    /// This method does not require any rights, similar to ReadDirents.
1765    pub fn r#watch(
1766        &self,
1767        mut mask: WatchMask,
1768        mut options: u32,
1769        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1770        ___deadline: zx::MonotonicInstant,
1771    ) -> Result<i32, fidl::Error> {
1772        let _response = self.client.send_query::<DirectoryWatchRequest, DirectoryWatchResponse>(
1773            (mask, options, watcher),
1774            0x5717193a59d66d91,
1775            fidl::encoding::DynamicFlags::empty(),
1776            ___deadline,
1777        )?;
1778        Ok(_response.s)
1779    }
1780}
1781
1782#[cfg(target_os = "fuchsia")]
1783impl From<DirectorySynchronousProxy> for zx::Handle {
1784    fn from(value: DirectorySynchronousProxy) -> Self {
1785        value.into_channel().into()
1786    }
1787}
1788
1789#[cfg(target_os = "fuchsia")]
1790impl From<fidl::Channel> for DirectorySynchronousProxy {
1791    fn from(value: fidl::Channel) -> Self {
1792        Self::new(value)
1793    }
1794}
1795
1796#[derive(Debug, Clone)]
1797pub struct DirectoryProxy {
1798    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1799}
1800
1801impl fidl::endpoints::Proxy for DirectoryProxy {
1802    type Protocol = DirectoryMarker;
1803
1804    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1805        Self::new(inner)
1806    }
1807
1808    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1809        self.client.into_channel().map_err(|client| Self { client })
1810    }
1811
1812    fn as_channel(&self) -> &::fidl::AsyncChannel {
1813        self.client.as_channel()
1814    }
1815}
1816
1817impl DirectoryProxy {
1818    /// Create a new Proxy for fuchsia.io/Directory.
1819    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1820        let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1821        Self { client: fidl::client::Client::new(channel, protocol_name) }
1822    }
1823
1824    /// Get a Stream of events from the remote end of the protocol.
1825    ///
1826    /// # Panics
1827    ///
1828    /// Panics if the event stream was already taken.
1829    pub fn take_event_stream(&self) -> DirectoryEventStream {
1830        DirectoryEventStream { event_receiver: self.client.take_event_receiver() }
1831    }
1832
1833    /// Acquires an advisory lock on the underlying file.
1834    ///
1835    /// The lock lasts until either this connection is closed or
1836    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1837    /// explicitly.
1838    ///
1839    /// Advisory locks are purely advisory. They do not prevent actual read or
1840    /// write operations from occurring on the file, either through this
1841    /// connection or through other connections.
1842    ///
1843    /// This method requires the following rights:
1844    ///
1845    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1846    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1847    ///   [`AdvisoryLockType.WRITE`].
1848    ///
1849    /// # Errors
1850    ///
1851    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1852    ///   example, another connection might hold a conflicting lock type.
1853    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1854    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1855    ///   to acquire the given type of lock.
1856    pub fn r#advisory_lock(
1857        &self,
1858        mut request: &AdvisoryLockRequest,
1859    ) -> fidl::client::QueryResponseFut<
1860        AdvisoryLockingAdvisoryLockResult,
1861        fidl::encoding::DefaultFuchsiaResourceDialect,
1862    > {
1863        DirectoryProxyInterface::r#advisory_lock(self, request)
1864    }
1865
1866    pub fn r#clone(
1867        &self,
1868        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1869    ) -> Result<(), fidl::Error> {
1870        DirectoryProxyInterface::r#clone(self, request)
1871    }
1872
1873    /// Terminates the connection.
1874    ///
1875    /// After calling `Close`, the client must not send any other requests.
1876    ///
1877    /// Servers, after sending the status response, should close the connection
1878    /// regardless of status and without sending an epitaph.
1879    ///
1880    /// Closing the client end of the channel should be semantically equivalent
1881    /// to calling `Close` without knowing when the close has completed or its
1882    /// status.
1883    pub fn r#close(
1884        &self,
1885    ) -> fidl::client::QueryResponseFut<
1886        fidl_fuchsia_unknown::CloseableCloseResult,
1887        fidl::encoding::DefaultFuchsiaResourceDialect,
1888    > {
1889        DirectoryProxyInterface::r#close(self)
1890    }
1891
1892    pub fn r#query(
1893        &self,
1894    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
1895    {
1896        DirectoryProxyInterface::r#query(self)
1897    }
1898
1899    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1900    pub fn r#deprecated_clone(
1901        &self,
1902        mut flags: OpenFlags,
1903        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1904    ) -> Result<(), fidl::Error> {
1905        DirectoryProxyInterface::r#deprecated_clone(self, flags, object)
1906    }
1907
1908    /// Acquires information about the node.
1909    ///
1910    /// This method does not require any rights.
1911    pub fn r#get_attr(
1912        &self,
1913    ) -> fidl::client::QueryResponseFut<
1914        (i32, NodeAttributes),
1915        fidl::encoding::DefaultFuchsiaResourceDialect,
1916    > {
1917        DirectoryProxyInterface::r#get_attr(self)
1918    }
1919
1920    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1921    pub fn r#deprecated_set_attr(
1922        &self,
1923        mut flags: NodeAttributeFlags,
1924        mut attributes: &NodeAttributes,
1925    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
1926        DirectoryProxyInterface::r#deprecated_set_attr(self, flags, attributes)
1927    }
1928
1929    /// [DEPRECATED - Use new GetFlags method instead.]
1930    pub fn r#deprecated_get_flags(
1931        &self,
1932    ) -> fidl::client::QueryResponseFut<
1933        (i32, OpenFlags),
1934        fidl::encoding::DefaultFuchsiaResourceDialect,
1935    > {
1936        DirectoryProxyInterface::r#deprecated_get_flags(self)
1937    }
1938
1939    /// [DEPRECATED - Use new SetFlags method instead.]
1940    pub fn r#deprecated_set_flags(
1941        &self,
1942        mut flags: OpenFlags,
1943    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
1944        DirectoryProxyInterface::r#deprecated_set_flags(self, flags)
1945    }
1946
1947    /// Queries the flags that apply to this node after it has been opened/created. This method does
1948    /// not require any rights.
1949    ///
1950    /// Note that the final set of flags that apply to the connection may differ from those
1951    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1952    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1953    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1954    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1955    pub fn r#get_flags(
1956        &self,
1957    ) -> fidl::client::QueryResponseFut<
1958        NodeGetFlagsResult,
1959        fidl::encoding::DefaultFuchsiaResourceDialect,
1960    > {
1961        DirectoryProxyInterface::r#get_flags(self)
1962    }
1963
1964    /// Sets the flags that apply to this node after it has been opened. This method does not
1965    /// require any rights.
1966    ///
1967    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1968    /// clear append mode.
1969    ///
1970    /// Errors:
1971    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1972    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1973    pub fn r#set_flags(
1974        &self,
1975        mut flags: Flags,
1976    ) -> fidl::client::QueryResponseFut<
1977        NodeSetFlagsResult,
1978        fidl::encoding::DefaultFuchsiaResourceDialect,
1979    > {
1980        DirectoryProxyInterface::r#set_flags(self, flags)
1981    }
1982
1983    /// Query the filesystem for filesystem-specific information.
1984    pub fn r#query_filesystem(
1985        &self,
1986    ) -> fidl::client::QueryResponseFut<
1987        (i32, Option<Box<FilesystemInfo>>),
1988        fidl::encoding::DefaultFuchsiaResourceDialect,
1989    > {
1990        DirectoryProxyInterface::r#query_filesystem(self)
1991    }
1992
1993    /// Acquires information about the node.
1994    ///
1995    /// The attributes of a node should be stable, independent of the
1996    /// specific protocol used to access it.
1997    ///
1998    /// If a particular attribute is not applicable or not supported,
1999    /// filesystems should leave the corresponding field absent.
2000    ///
2001    /// + `query` a bit-mask specifying which attributes to fetch. The server
2002    ///   should not return more than necessary.
2003    /// - `attributes` the returned attributes.
2004    ///
2005    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2006    pub fn r#get_attributes(
2007        &self,
2008        mut query: NodeAttributesQuery,
2009    ) -> fidl::client::QueryResponseFut<
2010        NodeGetAttributesResult,
2011        fidl::encoding::DefaultFuchsiaResourceDialect,
2012    > {
2013        DirectoryProxyInterface::r#get_attributes(self, query)
2014    }
2015
2016    /// Updates information about the node.
2017    ///
2018    /// + `attributes` the presence of a table field in `attributes` indicates
2019    /// the intent to update the corresponding attribute.
2020    ///
2021    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
2022    ///
2023    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2024    pub fn r#update_attributes(
2025        &self,
2026        mut payload: &MutableNodeAttributes,
2027    ) -> fidl::client::QueryResponseFut<
2028        NodeUpdateAttributesResult,
2029        fidl::encoding::DefaultFuchsiaResourceDialect,
2030    > {
2031        DirectoryProxyInterface::r#update_attributes(self, payload)
2032    }
2033
2034    /// Synchronizes updates to the node to the underlying media, if it exists.
2035    ///
2036    /// This method will return when the filesystem server has flushed the
2037    /// relevant updates to the underlying media, but does not guarantee the
2038    /// underlying media has persisted the information, nor that any information
2039    /// is committed to hardware. Clients may use `Sync` to ensure ordering
2040    /// between operations.
2041    ///
2042    /// This method does not require any rights.
2043    pub fn r#sync(
2044        &self,
2045    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
2046    {
2047        DirectoryProxyInterface::r#sync(self)
2048    }
2049
2050    /// Creates an iterator over all the extended attribute names associated
2051    /// with this node. If an error occurs it is returned as an epitaph on the
2052    /// iterator request channel, and then the channel is closed.
2053    ///
2054    /// GetExtendedAttributes can be used with any of these names to retrieve
2055    /// the associated value.
2056    ///
2057    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2058    pub fn r#list_extended_attributes(
2059        &self,
2060        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2061    ) -> Result<(), fidl::Error> {
2062        DirectoryProxyInterface::r#list_extended_attributes(self, iterator)
2063    }
2064
2065    /// Get the value associated with the given attribute `name` for this node.
2066    ///
2067    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
2068    /// particular structure is imposed on them.
2069    ///
2070    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2071    pub fn r#get_extended_attribute(
2072        &self,
2073        mut name: &[u8],
2074    ) -> fidl::client::QueryResponseFut<
2075        NodeGetExtendedAttributeResult,
2076        fidl::encoding::DefaultFuchsiaResourceDialect,
2077    > {
2078        DirectoryProxyInterface::r#get_extended_attribute(self, name)
2079    }
2080
2081    /// Set the value for the given attribute `name` to `value` for this node.
2082    ///
2083    /// The attribute name may exist, in which case the attribute is updated.
2084    /// If the attribute doesn't exist, it is created. The name should have no
2085    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
2086    ///
2087    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2088    pub fn r#set_extended_attribute(
2089        &self,
2090        mut name: &[u8],
2091        mut value: ExtendedAttributeValue,
2092        mut mode: SetExtendedAttributeMode,
2093    ) -> fidl::client::QueryResponseFut<
2094        NodeSetExtendedAttributeResult,
2095        fidl::encoding::DefaultFuchsiaResourceDialect,
2096    > {
2097        DirectoryProxyInterface::r#set_extended_attribute(self, name, value, mode)
2098    }
2099
2100    /// Remove the specified extended attribute.
2101    ///
2102    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
2103    ///
2104    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2105    pub fn r#remove_extended_attribute(
2106        &self,
2107        mut name: &[u8],
2108    ) -> fidl::client::QueryResponseFut<
2109        NodeRemoveExtendedAttributeResult,
2110        fidl::encoding::DefaultFuchsiaResourceDialect,
2111    > {
2112        DirectoryProxyInterface::r#remove_extended_attribute(self, name)
2113    }
2114
2115    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
2116    pub fn r#deprecated_open(
2117        &self,
2118        mut flags: OpenFlags,
2119        mut mode: ModeType,
2120        mut path: &str,
2121        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2122    ) -> Result<(), fidl::Error> {
2123        DirectoryProxyInterface::r#deprecated_open(self, flags, mode, path, object)
2124    }
2125
2126    /// Open (or create) a node relative to this directory. Any errors are communicated via an
2127    /// epitaph sent on the `object` channel.
2128    ///
2129    /// Errors:
2130    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
2131    /// * See [`Flags`] for other errors which may be communicated based on `flags`
2132    pub fn r#open(
2133        &self,
2134        mut path: &str,
2135        mut flags: Flags,
2136        mut options: &Options,
2137        mut object: fidl::Channel,
2138    ) -> Result<(), fidl::Error> {
2139        DirectoryProxyInterface::r#open(self, path, flags, options, object)
2140    }
2141
2142    /// Reads a collection of variably sized dirents into a buffer.
2143    /// The number of dirents in a directory may be very large: akin to
2144    /// calling read multiple times on a file, directories have a seek
2145    /// offset which is updated on subsequent calls to ReadDirents.
2146    /// Each call to ReadDirents will only return whole dirent structures,
2147    /// they will not get split across ReadDirent calls. When the seek
2148    /// offset reaches the end, `dirents` will be empty.
2149    ///
2150    /// These dirents are of the form:
2151    /// ```
2152    /// struct dirent {
2153    ///   // Describes the inode of the entry.
2154    ///   uint64 ino;
2155    ///   // Describes the length of the dirent name in bytes.
2156    ///   uint8 size;
2157    ///   // Describes the type of the entry. Aligned with the
2158    ///   // POSIX d_type values. Use `DirentType` constants.
2159    ///   uint8 type;
2160    ///   // Unterminated name of entry.
2161    ///   char name[0];
2162    /// }
2163    /// ```
2164    ///
2165    /// This method does not require any rights, since one could always probe for
2166    /// directory contents by triggering name conflicts during file creation.
2167    pub fn r#read_dirents(
2168        &self,
2169        mut max_bytes: u64,
2170    ) -> fidl::client::QueryResponseFut<(i32, Vec<u8>), fidl::encoding::DefaultFuchsiaResourceDialect>
2171    {
2172        DirectoryProxyInterface::r#read_dirents(self, max_bytes)
2173    }
2174
2175    /// Resets the directory seek offset.
2176    ///
2177    /// This method does not require any rights, similar to ReadDirents.
2178    pub fn r#rewind(
2179        &self,
2180    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2181        DirectoryProxyInterface::r#rewind(self)
2182    }
2183
2184    /// Acquires a token to a Directory which can be used to identify access to it at a later point
2185    /// in time. The token will remain valid for as long as the connection requesting the token
2186    /// remains open.
2187    ///
2188    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
2189    /// `ZX_ERR_BAD_HANDLE`.
2190    pub fn r#get_token(
2191        &self,
2192    ) -> fidl::client::QueryResponseFut<
2193        (i32, Option<fidl::Handle>),
2194        fidl::encoding::DefaultFuchsiaResourceDialect,
2195    > {
2196        DirectoryProxyInterface::r#get_token(self)
2197    }
2198
2199    /// Creates a link to an object named src by the name dst, within a directory represented by
2200    /// token.
2201    ///
2202    /// `src` must be a resolved object name. Including "/" in the string will
2203    /// return `ZX_ERR_INVALID_ARGS`.
2204    ///
2205    /// `dst` must be a resolved object name. Including "/" in the string will
2206    /// return `ZX_ERR_INVALID_ARGS`.
2207    ///
2208    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
2209    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
2210    ///
2211    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
2212    /// there are two actors operating concurrently, and one actor performs a rename that affects
2213    /// the source within this directory, and the other does a link, each will appear to occur
2214    /// atomically in an unspecified order.
2215    pub fn r#link(
2216        &self,
2217        mut src: &str,
2218        mut dst_parent_token: fidl::Handle,
2219        mut dst: &str,
2220    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2221        DirectoryProxyInterface::r#link(self, src, dst_parent_token, dst)
2222    }
2223
2224    /// Removes a child node from the this directory's list of entries.
2225    ///
2226    /// Note: this does not guarantee that the underlying object is destroyed.
2227    /// Although the link will be removed from the containing directory,
2228    /// objects with multiple references (such as files which are still open)
2229    /// will not actually be destroyed until all references are closed.
2230    ///
2231    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
2232    ///   [`Rights.WRITE_BYTES`].
2233    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
2234    ///   support writing.
2235    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
2236    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
2237    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
2238    ///   containing a remote channel.
2239    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
2240    ///     something other than a directory was found.
2241    ///
2242    /// Other errors may be returned for filesystem-specific reasons.
2243    ///
2244    /// This method requires the following rights:
2245    ///
2246    /// * [`Rights.ENUMERATE`]
2247    /// * [`Rights.MODIFY_DIRECTORY`]
2248    pub fn r#unlink(
2249        &self,
2250        mut name: &str,
2251        mut options: &UnlinkOptions,
2252    ) -> fidl::client::QueryResponseFut<
2253        DirectoryUnlinkResult,
2254        fidl::encoding::DefaultFuchsiaResourceDialect,
2255    > {
2256        DirectoryProxyInterface::r#unlink(self, name, options)
2257    }
2258
2259    /// Renames a node named `src` to the name `dst`, in a directory represented
2260    /// by `dst_parent_token`.
2261    ///
2262    /// `src` and `dst` must be valid node names.
2263    /// See [`Name`] for what constitutes a valid name.
2264    ///
2265    /// This method requires the following rights on both the current connection, and the connection
2266    /// identified by `dst_parent_token`:
2267    ///
2268    /// * [`Rights.ENUMERATE`]
2269    /// * [`Rights.MODIFY_DIRECTORY`]
2270    ///
2271    /// The following requirements are necessary to avoid rights escalations.
2272    ///
2273    /// If the source and destination directory differ, the source directory must also have the
2274    /// maximal set of abilities supported for files, which would typically be
2275    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
2276    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
2277    /// right.
2278    ///
2279    /// If `src` refers to a directory, and differs from the destination directory, then the source
2280    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
2281    ///
2282    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
2283    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
2284    pub fn r#rename(
2285        &self,
2286        mut src: &str,
2287        mut dst_parent_token: fidl::Event,
2288        mut dst: &str,
2289    ) -> fidl::client::QueryResponseFut<
2290        DirectoryRenameResult,
2291        fidl::encoding::DefaultFuchsiaResourceDialect,
2292    > {
2293        DirectoryProxyInterface::r#rename(self, src, dst_parent_token, dst)
2294    }
2295
2296    /// Creates a symbolic link.
2297    ///
2298    /// `name` is the name to be given to the created symbolic link.
2299    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
2300    /// will perform no validation of `target` except for a server chosen maximum length.
2301    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
2302    /// on the successfully created node.
2303    ///
2304    /// * [`Rights.MODIFY_DIRECTORY`]
2305    ///
2306    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
2307    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
2308    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
2309    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
2310    pub fn r#create_symlink(
2311        &self,
2312        mut name: &str,
2313        mut target: &[u8],
2314        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
2315    ) -> fidl::client::QueryResponseFut<
2316        DirectoryCreateSymlinkResult,
2317        fidl::encoding::DefaultFuchsiaResourceDialect,
2318    > {
2319        DirectoryProxyInterface::r#create_symlink(self, name, target, connection)
2320    }
2321
2322    /// Watches a directory, receiving events of added messages on the
2323    /// watcher request channel.
2324    ///
2325    /// Options must be zero; it is reserved.
2326    ///
2327    /// This method does not require any rights, similar to ReadDirents.
2328    pub fn r#watch(
2329        &self,
2330        mut mask: WatchMask,
2331        mut options: u32,
2332        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
2333    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2334        DirectoryProxyInterface::r#watch(self, mask, options, watcher)
2335    }
2336}
2337
2338impl DirectoryProxyInterface for DirectoryProxy {
2339    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
2340        AdvisoryLockingAdvisoryLockResult,
2341        fidl::encoding::DefaultFuchsiaResourceDialect,
2342    >;
2343    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
2344        fn _decode(
2345            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2346        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
2347            let _response = fidl::client::decode_transaction_body::<
2348                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2349                fidl::encoding::DefaultFuchsiaResourceDialect,
2350                0x6ee9c0ad53ec87aa,
2351            >(_buf?)?;
2352            Ok(_response.map(|x| x))
2353        }
2354        self.client.send_query_and_decode::<
2355            AdvisoryLockingAdvisoryLockRequest,
2356            AdvisoryLockingAdvisoryLockResult,
2357        >(
2358            (request,),
2359            0x6ee9c0ad53ec87aa,
2360            fidl::encoding::DynamicFlags::empty(),
2361            _decode,
2362        )
2363    }
2364
2365    fn r#clone(
2366        &self,
2367        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
2368    ) -> Result<(), fidl::Error> {
2369        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
2370            (request,),
2371            0x20d8a7aba2168a79,
2372            fidl::encoding::DynamicFlags::empty(),
2373        )
2374    }
2375
2376    type CloseResponseFut = fidl::client::QueryResponseFut<
2377        fidl_fuchsia_unknown::CloseableCloseResult,
2378        fidl::encoding::DefaultFuchsiaResourceDialect,
2379    >;
2380    fn r#close(&self) -> Self::CloseResponseFut {
2381        fn _decode(
2382            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2383        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
2384            let _response = fidl::client::decode_transaction_body::<
2385                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2386                fidl::encoding::DefaultFuchsiaResourceDialect,
2387                0x5ac5d459ad7f657e,
2388            >(_buf?)?;
2389            Ok(_response.map(|x| x))
2390        }
2391        self.client.send_query_and_decode::<
2392            fidl::encoding::EmptyPayload,
2393            fidl_fuchsia_unknown::CloseableCloseResult,
2394        >(
2395            (),
2396            0x5ac5d459ad7f657e,
2397            fidl::encoding::DynamicFlags::empty(),
2398            _decode,
2399        )
2400    }
2401
2402    type QueryResponseFut =
2403        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2404    fn r#query(&self) -> Self::QueryResponseFut {
2405        fn _decode(
2406            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2407        ) -> Result<Vec<u8>, fidl::Error> {
2408            let _response = fidl::client::decode_transaction_body::<
2409                fidl_fuchsia_unknown::QueryableQueryResponse,
2410                fidl::encoding::DefaultFuchsiaResourceDialect,
2411                0x2658edee9decfc06,
2412            >(_buf?)?;
2413            Ok(_response.protocol)
2414        }
2415        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
2416            (),
2417            0x2658edee9decfc06,
2418            fidl::encoding::DynamicFlags::empty(),
2419            _decode,
2420        )
2421    }
2422
2423    fn r#deprecated_clone(
2424        &self,
2425        mut flags: OpenFlags,
2426        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2427    ) -> Result<(), fidl::Error> {
2428        self.client.send::<NodeDeprecatedCloneRequest>(
2429            (flags, object),
2430            0x5a61678f293ce16f,
2431            fidl::encoding::DynamicFlags::FLEXIBLE,
2432        )
2433    }
2434
2435    type GetAttrResponseFut = fidl::client::QueryResponseFut<
2436        (i32, NodeAttributes),
2437        fidl::encoding::DefaultFuchsiaResourceDialect,
2438    >;
2439    fn r#get_attr(&self) -> Self::GetAttrResponseFut {
2440        fn _decode(
2441            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2442        ) -> Result<(i32, NodeAttributes), fidl::Error> {
2443            let _response = fidl::client::decode_transaction_body::<
2444                NodeGetAttrResponse,
2445                fidl::encoding::DefaultFuchsiaResourceDialect,
2446                0x78985e216314dafd,
2447            >(_buf?)?;
2448            Ok((_response.s, _response.attributes))
2449        }
2450        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
2451            (),
2452            0x78985e216314dafd,
2453            fidl::encoding::DynamicFlags::empty(),
2454            _decode,
2455        )
2456    }
2457
2458    type DeprecatedSetAttrResponseFut =
2459        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2460    fn r#deprecated_set_attr(
2461        &self,
2462        mut flags: NodeAttributeFlags,
2463        mut attributes: &NodeAttributes,
2464    ) -> Self::DeprecatedSetAttrResponseFut {
2465        fn _decode(
2466            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2467        ) -> Result<i32, fidl::Error> {
2468            let _response = fidl::client::decode_transaction_body::<
2469                NodeDeprecatedSetAttrResponse,
2470                fidl::encoding::DefaultFuchsiaResourceDialect,
2471                0x4186c0f40d938f46,
2472            >(_buf?)?;
2473            Ok(_response.s)
2474        }
2475        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
2476            (flags, attributes),
2477            0x4186c0f40d938f46,
2478            fidl::encoding::DynamicFlags::empty(),
2479            _decode,
2480        )
2481    }
2482
2483    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
2484        (i32, OpenFlags),
2485        fidl::encoding::DefaultFuchsiaResourceDialect,
2486    >;
2487    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
2488        fn _decode(
2489            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2490        ) -> Result<(i32, OpenFlags), fidl::Error> {
2491            let _response = fidl::client::decode_transaction_body::<
2492                NodeDeprecatedGetFlagsResponse,
2493                fidl::encoding::DefaultFuchsiaResourceDialect,
2494                0x5b88fffb8eda3aa1,
2495            >(_buf?)?;
2496            Ok((_response.s, _response.flags))
2497        }
2498        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
2499            (),
2500            0x5b88fffb8eda3aa1,
2501            fidl::encoding::DynamicFlags::empty(),
2502            _decode,
2503        )
2504    }
2505
2506    type DeprecatedSetFlagsResponseFut =
2507        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2508    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
2509        fn _decode(
2510            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2511        ) -> Result<i32, fidl::Error> {
2512            let _response = fidl::client::decode_transaction_body::<
2513                NodeDeprecatedSetFlagsResponse,
2514                fidl::encoding::DefaultFuchsiaResourceDialect,
2515                0x5295b76c71fde733,
2516            >(_buf?)?;
2517            Ok(_response.s)
2518        }
2519        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
2520            (flags,),
2521            0x5295b76c71fde733,
2522            fidl::encoding::DynamicFlags::empty(),
2523            _decode,
2524        )
2525    }
2526
2527    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
2528        NodeGetFlagsResult,
2529        fidl::encoding::DefaultFuchsiaResourceDialect,
2530    >;
2531    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
2532        fn _decode(
2533            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2534        ) -> Result<NodeGetFlagsResult, fidl::Error> {
2535            let _response = fidl::client::decode_transaction_body::<
2536                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
2537                fidl::encoding::DefaultFuchsiaResourceDialect,
2538                0x176eb318f64ec23,
2539            >(_buf?)?
2540            .into_result::<DirectoryMarker>("get_flags")?;
2541            Ok(_response.map(|x| x.flags))
2542        }
2543        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
2544            (),
2545            0x176eb318f64ec23,
2546            fidl::encoding::DynamicFlags::FLEXIBLE,
2547            _decode,
2548        )
2549    }
2550
2551    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
2552        NodeSetFlagsResult,
2553        fidl::encoding::DefaultFuchsiaResourceDialect,
2554    >;
2555    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
2556        fn _decode(
2557            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2558        ) -> Result<NodeSetFlagsResult, fidl::Error> {
2559            let _response = fidl::client::decode_transaction_body::<
2560                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2561                fidl::encoding::DefaultFuchsiaResourceDialect,
2562                0x55a8028685791ea8,
2563            >(_buf?)?
2564            .into_result::<DirectoryMarker>("set_flags")?;
2565            Ok(_response.map(|x| x))
2566        }
2567        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
2568            (flags,),
2569            0x55a8028685791ea8,
2570            fidl::encoding::DynamicFlags::FLEXIBLE,
2571            _decode,
2572        )
2573    }
2574
2575    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
2576        (i32, Option<Box<FilesystemInfo>>),
2577        fidl::encoding::DefaultFuchsiaResourceDialect,
2578    >;
2579    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
2580        fn _decode(
2581            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2582        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
2583            let _response = fidl::client::decode_transaction_body::<
2584                NodeQueryFilesystemResponse,
2585                fidl::encoding::DefaultFuchsiaResourceDialect,
2586                0x6f344a1c6b0a0610,
2587            >(_buf?)?;
2588            Ok((_response.s, _response.info))
2589        }
2590        self.client.send_query_and_decode::<
2591            fidl::encoding::EmptyPayload,
2592            (i32, Option<Box<FilesystemInfo>>),
2593        >(
2594            (),
2595            0x6f344a1c6b0a0610,
2596            fidl::encoding::DynamicFlags::empty(),
2597            _decode,
2598        )
2599    }
2600
2601    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
2602        NodeGetAttributesResult,
2603        fidl::encoding::DefaultFuchsiaResourceDialect,
2604    >;
2605    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
2606        fn _decode(
2607            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2608        ) -> Result<NodeGetAttributesResult, fidl::Error> {
2609            let _response = fidl::client::decode_transaction_body::<
2610                fidl::encoding::ResultType<NodeAttributes2, i32>,
2611                fidl::encoding::DefaultFuchsiaResourceDialect,
2612                0x3d4396a638ea053b,
2613            >(_buf?)?;
2614            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
2615        }
2616        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
2617            (query,),
2618            0x3d4396a638ea053b,
2619            fidl::encoding::DynamicFlags::empty(),
2620            _decode,
2621        )
2622    }
2623
2624    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
2625        NodeUpdateAttributesResult,
2626        fidl::encoding::DefaultFuchsiaResourceDialect,
2627    >;
2628    fn r#update_attributes(
2629        &self,
2630        mut payload: &MutableNodeAttributes,
2631    ) -> Self::UpdateAttributesResponseFut {
2632        fn _decode(
2633            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2634        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
2635            let _response = fidl::client::decode_transaction_body::<
2636                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2637                fidl::encoding::DefaultFuchsiaResourceDialect,
2638                0x3308c1da5a89bf08,
2639            >(_buf?)?;
2640            Ok(_response.map(|x| x))
2641        }
2642        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
2643            payload,
2644            0x3308c1da5a89bf08,
2645            fidl::encoding::DynamicFlags::empty(),
2646            _decode,
2647        )
2648    }
2649
2650    type SyncResponseFut = fidl::client::QueryResponseFut<
2651        NodeSyncResult,
2652        fidl::encoding::DefaultFuchsiaResourceDialect,
2653    >;
2654    fn r#sync(&self) -> Self::SyncResponseFut {
2655        fn _decode(
2656            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2657        ) -> Result<NodeSyncResult, fidl::Error> {
2658            let _response = fidl::client::decode_transaction_body::<
2659                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2660                fidl::encoding::DefaultFuchsiaResourceDialect,
2661                0x2c5c27ca0ab5dc49,
2662            >(_buf?)?;
2663            Ok(_response.map(|x| x))
2664        }
2665        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
2666            (),
2667            0x2c5c27ca0ab5dc49,
2668            fidl::encoding::DynamicFlags::empty(),
2669            _decode,
2670        )
2671    }
2672
2673    fn r#list_extended_attributes(
2674        &self,
2675        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2676    ) -> Result<(), fidl::Error> {
2677        self.client.send::<NodeListExtendedAttributesRequest>(
2678            (iterator,),
2679            0x4b61033de007fcd0,
2680            fidl::encoding::DynamicFlags::empty(),
2681        )
2682    }
2683
2684    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2685        NodeGetExtendedAttributeResult,
2686        fidl::encoding::DefaultFuchsiaResourceDialect,
2687    >;
2688    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
2689        fn _decode(
2690            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2691        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
2692            let _response = fidl::client::decode_transaction_body::<
2693                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
2694                fidl::encoding::DefaultFuchsiaResourceDialect,
2695                0x45ffa3ccfdeb76db,
2696            >(_buf?)?;
2697            Ok(_response.map(|x| x))
2698        }
2699        self.client.send_query_and_decode::<
2700            NodeGetExtendedAttributeRequest,
2701            NodeGetExtendedAttributeResult,
2702        >(
2703            (name,),
2704            0x45ffa3ccfdeb76db,
2705            fidl::encoding::DynamicFlags::empty(),
2706            _decode,
2707        )
2708    }
2709
2710    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2711        NodeSetExtendedAttributeResult,
2712        fidl::encoding::DefaultFuchsiaResourceDialect,
2713    >;
2714    fn r#set_extended_attribute(
2715        &self,
2716        mut name: &[u8],
2717        mut value: ExtendedAttributeValue,
2718        mut mode: SetExtendedAttributeMode,
2719    ) -> Self::SetExtendedAttributeResponseFut {
2720        fn _decode(
2721            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2722        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
2723            let _response = fidl::client::decode_transaction_body::<
2724                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2725                fidl::encoding::DefaultFuchsiaResourceDialect,
2726                0x4a951362f681f23c,
2727            >(_buf?)?;
2728            Ok(_response.map(|x| x))
2729        }
2730        self.client.send_query_and_decode::<
2731            NodeSetExtendedAttributeRequest,
2732            NodeSetExtendedAttributeResult,
2733        >(
2734            (name, &mut value, mode,),
2735            0x4a951362f681f23c,
2736            fidl::encoding::DynamicFlags::empty(),
2737            _decode,
2738        )
2739    }
2740
2741    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2742        NodeRemoveExtendedAttributeResult,
2743        fidl::encoding::DefaultFuchsiaResourceDialect,
2744    >;
2745    fn r#remove_extended_attribute(
2746        &self,
2747        mut name: &[u8],
2748    ) -> Self::RemoveExtendedAttributeResponseFut {
2749        fn _decode(
2750            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2751        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
2752            let _response = fidl::client::decode_transaction_body::<
2753                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2754                fidl::encoding::DefaultFuchsiaResourceDialect,
2755                0x7a0b9f3a9bf9032d,
2756            >(_buf?)?;
2757            Ok(_response.map(|x| x))
2758        }
2759        self.client.send_query_and_decode::<
2760            NodeRemoveExtendedAttributeRequest,
2761            NodeRemoveExtendedAttributeResult,
2762        >(
2763            (name,),
2764            0x7a0b9f3a9bf9032d,
2765            fidl::encoding::DynamicFlags::empty(),
2766            _decode,
2767        )
2768    }
2769
2770    fn r#deprecated_open(
2771        &self,
2772        mut flags: OpenFlags,
2773        mut mode: ModeType,
2774        mut path: &str,
2775        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2776    ) -> Result<(), fidl::Error> {
2777        self.client.send::<DirectoryDeprecatedOpenRequest>(
2778            (flags, mode, path, object),
2779            0x2c5044561d685ec0,
2780            fidl::encoding::DynamicFlags::FLEXIBLE,
2781        )
2782    }
2783
2784    fn r#open(
2785        &self,
2786        mut path: &str,
2787        mut flags: Flags,
2788        mut options: &Options,
2789        mut object: fidl::Channel,
2790    ) -> Result<(), fidl::Error> {
2791        self.client.send::<DirectoryOpenRequest>(
2792            (path, flags, options, object),
2793            0x568ddcb9a9cbb6d9,
2794            fidl::encoding::DynamicFlags::empty(),
2795        )
2796    }
2797
2798    type ReadDirentsResponseFut = fidl::client::QueryResponseFut<
2799        (i32, Vec<u8>),
2800        fidl::encoding::DefaultFuchsiaResourceDialect,
2801    >;
2802    fn r#read_dirents(&self, mut max_bytes: u64) -> Self::ReadDirentsResponseFut {
2803        fn _decode(
2804            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2805        ) -> Result<(i32, Vec<u8>), fidl::Error> {
2806            let _response = fidl::client::decode_transaction_body::<
2807                DirectoryReadDirentsResponse,
2808                fidl::encoding::DefaultFuchsiaResourceDialect,
2809                0x3582806bf27faa0a,
2810            >(_buf?)?;
2811            Ok((_response.s, _response.dirents))
2812        }
2813        self.client.send_query_and_decode::<DirectoryReadDirentsRequest, (i32, Vec<u8>)>(
2814            (max_bytes,),
2815            0x3582806bf27faa0a,
2816            fidl::encoding::DynamicFlags::empty(),
2817            _decode,
2818        )
2819    }
2820
2821    type RewindResponseFut =
2822        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2823    fn r#rewind(&self) -> Self::RewindResponseFut {
2824        fn _decode(
2825            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2826        ) -> Result<i32, fidl::Error> {
2827            let _response = fidl::client::decode_transaction_body::<
2828                DirectoryRewindResponse,
2829                fidl::encoding::DefaultFuchsiaResourceDialect,
2830                0x16b1202af0f34c71,
2831            >(_buf?)?;
2832            Ok(_response.s)
2833        }
2834        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
2835            (),
2836            0x16b1202af0f34c71,
2837            fidl::encoding::DynamicFlags::empty(),
2838            _decode,
2839        )
2840    }
2841
2842    type GetTokenResponseFut = fidl::client::QueryResponseFut<
2843        (i32, Option<fidl::Handle>),
2844        fidl::encoding::DefaultFuchsiaResourceDialect,
2845    >;
2846    fn r#get_token(&self) -> Self::GetTokenResponseFut {
2847        fn _decode(
2848            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2849        ) -> Result<(i32, Option<fidl::Handle>), fidl::Error> {
2850            let _response = fidl::client::decode_transaction_body::<
2851                DirectoryGetTokenResponse,
2852                fidl::encoding::DefaultFuchsiaResourceDialect,
2853                0x26ae9d18763c8655,
2854            >(_buf?)?;
2855            Ok((_response.s, _response.token))
2856        }
2857        self.client
2858            .send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, Option<fidl::Handle>)>(
2859                (),
2860                0x26ae9d18763c8655,
2861                fidl::encoding::DynamicFlags::empty(),
2862                _decode,
2863            )
2864    }
2865
2866    type LinkResponseFut =
2867        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2868    fn r#link(
2869        &self,
2870        mut src: &str,
2871        mut dst_parent_token: fidl::Handle,
2872        mut dst: &str,
2873    ) -> Self::LinkResponseFut {
2874        fn _decode(
2875            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2876        ) -> Result<i32, fidl::Error> {
2877            let _response = fidl::client::decode_transaction_body::<
2878                DirectoryLinkResponse,
2879                fidl::encoding::DefaultFuchsiaResourceDialect,
2880                0x740604c0c7c930e7,
2881            >(_buf?)?;
2882            Ok(_response.s)
2883        }
2884        self.client.send_query_and_decode::<DirectoryLinkRequest, i32>(
2885            (src, dst_parent_token, dst),
2886            0x740604c0c7c930e7,
2887            fidl::encoding::DynamicFlags::empty(),
2888            _decode,
2889        )
2890    }
2891
2892    type UnlinkResponseFut = fidl::client::QueryResponseFut<
2893        DirectoryUnlinkResult,
2894        fidl::encoding::DefaultFuchsiaResourceDialect,
2895    >;
2896    fn r#unlink(&self, mut name: &str, mut options: &UnlinkOptions) -> Self::UnlinkResponseFut {
2897        fn _decode(
2898            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2899        ) -> Result<DirectoryUnlinkResult, fidl::Error> {
2900            let _response = fidl::client::decode_transaction_body::<
2901                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2902                fidl::encoding::DefaultFuchsiaResourceDialect,
2903                0x750a0326a78d7bed,
2904            >(_buf?)?;
2905            Ok(_response.map(|x| x))
2906        }
2907        self.client.send_query_and_decode::<DirectoryUnlinkRequest, DirectoryUnlinkResult>(
2908            (name, options),
2909            0x750a0326a78d7bed,
2910            fidl::encoding::DynamicFlags::empty(),
2911            _decode,
2912        )
2913    }
2914
2915    type RenameResponseFut = fidl::client::QueryResponseFut<
2916        DirectoryRenameResult,
2917        fidl::encoding::DefaultFuchsiaResourceDialect,
2918    >;
2919    fn r#rename(
2920        &self,
2921        mut src: &str,
2922        mut dst_parent_token: fidl::Event,
2923        mut dst: &str,
2924    ) -> Self::RenameResponseFut {
2925        fn _decode(
2926            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2927        ) -> Result<DirectoryRenameResult, fidl::Error> {
2928            let _response = fidl::client::decode_transaction_body::<
2929                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2930                fidl::encoding::DefaultFuchsiaResourceDialect,
2931                0x7060e7723b9928de,
2932            >(_buf?)?;
2933            Ok(_response.map(|x| x))
2934        }
2935        self.client.send_query_and_decode::<DirectoryRenameRequest, DirectoryRenameResult>(
2936            (src, dst_parent_token, dst),
2937            0x7060e7723b9928de,
2938            fidl::encoding::DynamicFlags::empty(),
2939            _decode,
2940        )
2941    }
2942
2943    type CreateSymlinkResponseFut = fidl::client::QueryResponseFut<
2944        DirectoryCreateSymlinkResult,
2945        fidl::encoding::DefaultFuchsiaResourceDialect,
2946    >;
2947    fn r#create_symlink(
2948        &self,
2949        mut name: &str,
2950        mut target: &[u8],
2951        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
2952    ) -> Self::CreateSymlinkResponseFut {
2953        fn _decode(
2954            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2955        ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
2956            let _response = fidl::client::decode_transaction_body::<
2957                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2958                fidl::encoding::DefaultFuchsiaResourceDialect,
2959                0x21ce0f19ec043889,
2960            >(_buf?)?;
2961            Ok(_response.map(|x| x))
2962        }
2963        self.client
2964            .send_query_and_decode::<DirectoryCreateSymlinkRequest, DirectoryCreateSymlinkResult>(
2965                (name, target, connection),
2966                0x21ce0f19ec043889,
2967                fidl::encoding::DynamicFlags::empty(),
2968                _decode,
2969            )
2970    }
2971
2972    type WatchResponseFut =
2973        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2974    fn r#watch(
2975        &self,
2976        mut mask: WatchMask,
2977        mut options: u32,
2978        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
2979    ) -> Self::WatchResponseFut {
2980        fn _decode(
2981            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2982        ) -> Result<i32, fidl::Error> {
2983            let _response = fidl::client::decode_transaction_body::<
2984                DirectoryWatchResponse,
2985                fidl::encoding::DefaultFuchsiaResourceDialect,
2986                0x5717193a59d66d91,
2987            >(_buf?)?;
2988            Ok(_response.s)
2989        }
2990        self.client.send_query_and_decode::<DirectoryWatchRequest, i32>(
2991            (mask, options, watcher),
2992            0x5717193a59d66d91,
2993            fidl::encoding::DynamicFlags::empty(),
2994            _decode,
2995        )
2996    }
2997}
2998
2999pub struct DirectoryEventStream {
3000    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3001}
3002
3003impl std::marker::Unpin for DirectoryEventStream {}
3004
3005impl futures::stream::FusedStream for DirectoryEventStream {
3006    fn is_terminated(&self) -> bool {
3007        self.event_receiver.is_terminated()
3008    }
3009}
3010
3011impl futures::Stream for DirectoryEventStream {
3012    type Item = Result<DirectoryEvent, fidl::Error>;
3013
3014    fn poll_next(
3015        mut self: std::pin::Pin<&mut Self>,
3016        cx: &mut std::task::Context<'_>,
3017    ) -> std::task::Poll<Option<Self::Item>> {
3018        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3019            &mut self.event_receiver,
3020            cx
3021        )?) {
3022            Some(buf) => std::task::Poll::Ready(Some(DirectoryEvent::decode(buf))),
3023            None => std::task::Poll::Ready(None),
3024        }
3025    }
3026}
3027
3028#[derive(Debug)]
3029pub enum DirectoryEvent {
3030    OnOpen_ {
3031        s: i32,
3032        info: Option<Box<NodeInfoDeprecated>>,
3033    },
3034    OnRepresentation {
3035        payload: Representation,
3036    },
3037    #[non_exhaustive]
3038    _UnknownEvent {
3039        /// Ordinal of the event that was sent.
3040        ordinal: u64,
3041    },
3042}
3043
3044impl DirectoryEvent {
3045    #[allow(irrefutable_let_patterns)]
3046    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
3047        if let DirectoryEvent::OnOpen_ { s, info } = self {
3048            Some((s, info))
3049        } else {
3050            None
3051        }
3052    }
3053    #[allow(irrefutable_let_patterns)]
3054    pub fn into_on_representation(self) -> Option<Representation> {
3055        if let DirectoryEvent::OnRepresentation { payload } = self {
3056            Some((payload))
3057        } else {
3058            None
3059        }
3060    }
3061
3062    /// Decodes a message buffer as a [`DirectoryEvent`].
3063    fn decode(
3064        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3065    ) -> Result<DirectoryEvent, fidl::Error> {
3066        let (bytes, _handles) = buf.split_mut();
3067        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3068        debug_assert_eq!(tx_header.tx_id, 0);
3069        match tx_header.ordinal {
3070            0x7fc7bbb1dbfd1972 => {
3071                let mut out = fidl::new_empty!(
3072                    NodeOnOpenRequest,
3073                    fidl::encoding::DefaultFuchsiaResourceDialect
3074                );
3075                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3076                Ok((DirectoryEvent::OnOpen_ { s: out.s, info: out.info }))
3077            }
3078            0x5cb40567d80a510c => {
3079                let mut out =
3080                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
3081                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
3082                Ok((DirectoryEvent::OnRepresentation { payload: out }))
3083            }
3084            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3085                Ok(DirectoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3086            }
3087            _ => Err(fidl::Error::UnknownOrdinal {
3088                ordinal: tx_header.ordinal,
3089                protocol_name: <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3090            }),
3091        }
3092    }
3093}
3094
3095/// A Stream of incoming requests for fuchsia.io/Directory.
3096pub struct DirectoryRequestStream {
3097    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3098    is_terminated: bool,
3099}
3100
3101impl std::marker::Unpin for DirectoryRequestStream {}
3102
3103impl futures::stream::FusedStream for DirectoryRequestStream {
3104    fn is_terminated(&self) -> bool {
3105        self.is_terminated
3106    }
3107}
3108
3109impl fidl::endpoints::RequestStream for DirectoryRequestStream {
3110    type Protocol = DirectoryMarker;
3111    type ControlHandle = DirectoryControlHandle;
3112
3113    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3114        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3115    }
3116
3117    fn control_handle(&self) -> Self::ControlHandle {
3118        DirectoryControlHandle { inner: self.inner.clone() }
3119    }
3120
3121    fn into_inner(
3122        self,
3123    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3124    {
3125        (self.inner, self.is_terminated)
3126    }
3127
3128    fn from_inner(
3129        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3130        is_terminated: bool,
3131    ) -> Self {
3132        Self { inner, is_terminated }
3133    }
3134}
3135
3136impl futures::Stream for DirectoryRequestStream {
3137    type Item = Result<DirectoryRequest, fidl::Error>;
3138
3139    fn poll_next(
3140        mut self: std::pin::Pin<&mut Self>,
3141        cx: &mut std::task::Context<'_>,
3142    ) -> std::task::Poll<Option<Self::Item>> {
3143        let this = &mut *self;
3144        if this.inner.check_shutdown(cx) {
3145            this.is_terminated = true;
3146            return std::task::Poll::Ready(None);
3147        }
3148        if this.is_terminated {
3149            panic!("polled DirectoryRequestStream after completion");
3150        }
3151        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3152            |bytes, handles| {
3153                match this.inner.channel().read_etc(cx, bytes, handles) {
3154                    std::task::Poll::Ready(Ok(())) => {}
3155                    std::task::Poll::Pending => return std::task::Poll::Pending,
3156                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3157                        this.is_terminated = true;
3158                        return std::task::Poll::Ready(None);
3159                    }
3160                    std::task::Poll::Ready(Err(e)) => {
3161                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3162                            e.into(),
3163                        ))))
3164                    }
3165                }
3166
3167                // A message has been received from the channel
3168                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3169
3170                std::task::Poll::Ready(Some(match header.ordinal {
3171                    0x6ee9c0ad53ec87aa => {
3172                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3173                        let mut req = fidl::new_empty!(
3174                            AdvisoryLockingAdvisoryLockRequest,
3175                            fidl::encoding::DefaultFuchsiaResourceDialect
3176                        );
3177                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
3178                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3179                        Ok(DirectoryRequest::AdvisoryLock {
3180                            request: req.request,
3181
3182                            responder: DirectoryAdvisoryLockResponder {
3183                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3184                                tx_id: header.tx_id,
3185                            },
3186                        })
3187                    }
3188                    0x20d8a7aba2168a79 => {
3189                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3190                        let mut req = fidl::new_empty!(
3191                            fidl_fuchsia_unknown::CloneableCloneRequest,
3192                            fidl::encoding::DefaultFuchsiaResourceDialect
3193                        );
3194                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3195                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3196                        Ok(DirectoryRequest::Clone { request: req.request, control_handle })
3197                    }
3198                    0x5ac5d459ad7f657e => {
3199                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3200                        let mut req = fidl::new_empty!(
3201                            fidl::encoding::EmptyPayload,
3202                            fidl::encoding::DefaultFuchsiaResourceDialect
3203                        );
3204                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3205                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3206                        Ok(DirectoryRequest::Close {
3207                            responder: DirectoryCloseResponder {
3208                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3209                                tx_id: header.tx_id,
3210                            },
3211                        })
3212                    }
3213                    0x2658edee9decfc06 => {
3214                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3215                        let mut req = fidl::new_empty!(
3216                            fidl::encoding::EmptyPayload,
3217                            fidl::encoding::DefaultFuchsiaResourceDialect
3218                        );
3219                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3220                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3221                        Ok(DirectoryRequest::Query {
3222                            responder: DirectoryQueryResponder {
3223                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3224                                tx_id: header.tx_id,
3225                            },
3226                        })
3227                    }
3228                    0x5a61678f293ce16f => {
3229                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3230                        let mut req = fidl::new_empty!(
3231                            NodeDeprecatedCloneRequest,
3232                            fidl::encoding::DefaultFuchsiaResourceDialect
3233                        );
3234                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3235                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3236                        Ok(DirectoryRequest::DeprecatedClone {
3237                            flags: req.flags,
3238                            object: req.object,
3239
3240                            control_handle,
3241                        })
3242                    }
3243                    0x78985e216314dafd => {
3244                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3245                        let mut req = fidl::new_empty!(
3246                            fidl::encoding::EmptyPayload,
3247                            fidl::encoding::DefaultFuchsiaResourceDialect
3248                        );
3249                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3250                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3251                        Ok(DirectoryRequest::GetAttr {
3252                            responder: DirectoryGetAttrResponder {
3253                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3254                                tx_id: header.tx_id,
3255                            },
3256                        })
3257                    }
3258                    0x4186c0f40d938f46 => {
3259                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3260                        let mut req = fidl::new_empty!(
3261                            NodeDeprecatedSetAttrRequest,
3262                            fidl::encoding::DefaultFuchsiaResourceDialect
3263                        );
3264                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
3265                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3266                        Ok(DirectoryRequest::DeprecatedSetAttr {
3267                            flags: req.flags,
3268                            attributes: req.attributes,
3269
3270                            responder: DirectoryDeprecatedSetAttrResponder {
3271                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3272                                tx_id: header.tx_id,
3273                            },
3274                        })
3275                    }
3276                    0x5b88fffb8eda3aa1 => {
3277                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3278                        let mut req = fidl::new_empty!(
3279                            fidl::encoding::EmptyPayload,
3280                            fidl::encoding::DefaultFuchsiaResourceDialect
3281                        );
3282                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3283                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3284                        Ok(DirectoryRequest::DeprecatedGetFlags {
3285                            responder: DirectoryDeprecatedGetFlagsResponder {
3286                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3287                                tx_id: header.tx_id,
3288                            },
3289                        })
3290                    }
3291                    0x5295b76c71fde733 => {
3292                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3293                        let mut req = fidl::new_empty!(
3294                            NodeDeprecatedSetFlagsRequest,
3295                            fidl::encoding::DefaultFuchsiaResourceDialect
3296                        );
3297                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3298                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3299                        Ok(DirectoryRequest::DeprecatedSetFlags {
3300                            flags: req.flags,
3301
3302                            responder: DirectoryDeprecatedSetFlagsResponder {
3303                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3304                                tx_id: header.tx_id,
3305                            },
3306                        })
3307                    }
3308                    0x176eb318f64ec23 => {
3309                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3310                        let mut req = fidl::new_empty!(
3311                            fidl::encoding::EmptyPayload,
3312                            fidl::encoding::DefaultFuchsiaResourceDialect
3313                        );
3314                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3315                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3316                        Ok(DirectoryRequest::GetFlags {
3317                            responder: DirectoryGetFlagsResponder {
3318                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3319                                tx_id: header.tx_id,
3320                            },
3321                        })
3322                    }
3323                    0x55a8028685791ea8 => {
3324                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3325                        let mut req = fidl::new_empty!(
3326                            NodeSetFlagsRequest,
3327                            fidl::encoding::DefaultFuchsiaResourceDialect
3328                        );
3329                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3330                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3331                        Ok(DirectoryRequest::SetFlags {
3332                            flags: req.flags,
3333
3334                            responder: DirectorySetFlagsResponder {
3335                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3336                                tx_id: header.tx_id,
3337                            },
3338                        })
3339                    }
3340                    0x6f344a1c6b0a0610 => {
3341                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3342                        let mut req = fidl::new_empty!(
3343                            fidl::encoding::EmptyPayload,
3344                            fidl::encoding::DefaultFuchsiaResourceDialect
3345                        );
3346                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3347                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3348                        Ok(DirectoryRequest::QueryFilesystem {
3349                            responder: DirectoryQueryFilesystemResponder {
3350                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3351                                tx_id: header.tx_id,
3352                            },
3353                        })
3354                    }
3355                    0x3d4396a638ea053b => {
3356                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3357                        let mut req = fidl::new_empty!(
3358                            NodeGetAttributesRequest,
3359                            fidl::encoding::DefaultFuchsiaResourceDialect
3360                        );
3361                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3362                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3363                        Ok(DirectoryRequest::GetAttributes {
3364                            query: req.query,
3365
3366                            responder: DirectoryGetAttributesResponder {
3367                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3368                                tx_id: header.tx_id,
3369                            },
3370                        })
3371                    }
3372                    0x3308c1da5a89bf08 => {
3373                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3374                        let mut req = fidl::new_empty!(
3375                            MutableNodeAttributes,
3376                            fidl::encoding::DefaultFuchsiaResourceDialect
3377                        );
3378                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
3379                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3380                        Ok(DirectoryRequest::UpdateAttributes {
3381                            payload: req,
3382                            responder: DirectoryUpdateAttributesResponder {
3383                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3384                                tx_id: header.tx_id,
3385                            },
3386                        })
3387                    }
3388                    0x2c5c27ca0ab5dc49 => {
3389                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3390                        let mut req = fidl::new_empty!(
3391                            fidl::encoding::EmptyPayload,
3392                            fidl::encoding::DefaultFuchsiaResourceDialect
3393                        );
3394                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3395                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3396                        Ok(DirectoryRequest::Sync {
3397                            responder: DirectorySyncResponder {
3398                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3399                                tx_id: header.tx_id,
3400                            },
3401                        })
3402                    }
3403                    0x4b61033de007fcd0 => {
3404                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3405                        let mut req = fidl::new_empty!(
3406                            NodeListExtendedAttributesRequest,
3407                            fidl::encoding::DefaultFuchsiaResourceDialect
3408                        );
3409                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3410                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3411                        Ok(DirectoryRequest::ListExtendedAttributes {
3412                            iterator: req.iterator,
3413
3414                            control_handle,
3415                        })
3416                    }
3417                    0x45ffa3ccfdeb76db => {
3418                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3419                        let mut req = fidl::new_empty!(
3420                            NodeGetExtendedAttributeRequest,
3421                            fidl::encoding::DefaultFuchsiaResourceDialect
3422                        );
3423                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3424                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3425                        Ok(DirectoryRequest::GetExtendedAttribute {
3426                            name: req.name,
3427
3428                            responder: DirectoryGetExtendedAttributeResponder {
3429                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3430                                tx_id: header.tx_id,
3431                            },
3432                        })
3433                    }
3434                    0x4a951362f681f23c => {
3435                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3436                        let mut req = fidl::new_empty!(
3437                            NodeSetExtendedAttributeRequest,
3438                            fidl::encoding::DefaultFuchsiaResourceDialect
3439                        );
3440                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3441                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3442                        Ok(DirectoryRequest::SetExtendedAttribute {
3443                            name: req.name,
3444                            value: req.value,
3445                            mode: req.mode,
3446
3447                            responder: DirectorySetExtendedAttributeResponder {
3448                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3449                                tx_id: header.tx_id,
3450                            },
3451                        })
3452                    }
3453                    0x7a0b9f3a9bf9032d => {
3454                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3455                        let mut req = fidl::new_empty!(
3456                            NodeRemoveExtendedAttributeRequest,
3457                            fidl::encoding::DefaultFuchsiaResourceDialect
3458                        );
3459                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3460                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3461                        Ok(DirectoryRequest::RemoveExtendedAttribute {
3462                            name: req.name,
3463
3464                            responder: DirectoryRemoveExtendedAttributeResponder {
3465                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3466                                tx_id: header.tx_id,
3467                            },
3468                        })
3469                    }
3470                    0x2c5044561d685ec0 => {
3471                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3472                        let mut req = fidl::new_empty!(
3473                            DirectoryDeprecatedOpenRequest,
3474                            fidl::encoding::DefaultFuchsiaResourceDialect
3475                        );
3476                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryDeprecatedOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3477                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3478                        Ok(DirectoryRequest::DeprecatedOpen {
3479                            flags: req.flags,
3480                            mode: req.mode,
3481                            path: req.path,
3482                            object: req.object,
3483
3484                            control_handle,
3485                        })
3486                    }
3487                    0x568ddcb9a9cbb6d9 => {
3488                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3489                        let mut req = fidl::new_empty!(
3490                            DirectoryOpenRequest,
3491                            fidl::encoding::DefaultFuchsiaResourceDialect
3492                        );
3493                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3494                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3495                        Ok(DirectoryRequest::Open {
3496                            path: req.path,
3497                            flags: req.flags,
3498                            options: req.options,
3499                            object: req.object,
3500
3501                            control_handle,
3502                        })
3503                    }
3504                    0x3582806bf27faa0a => {
3505                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3506                        let mut req = fidl::new_empty!(
3507                            DirectoryReadDirentsRequest,
3508                            fidl::encoding::DefaultFuchsiaResourceDialect
3509                        );
3510                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryReadDirentsRequest>(&header, _body_bytes, handles, &mut req)?;
3511                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3512                        Ok(DirectoryRequest::ReadDirents {
3513                            max_bytes: req.max_bytes,
3514
3515                            responder: DirectoryReadDirentsResponder {
3516                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3517                                tx_id: header.tx_id,
3518                            },
3519                        })
3520                    }
3521                    0x16b1202af0f34c71 => {
3522                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3523                        let mut req = fidl::new_empty!(
3524                            fidl::encoding::EmptyPayload,
3525                            fidl::encoding::DefaultFuchsiaResourceDialect
3526                        );
3527                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3528                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3529                        Ok(DirectoryRequest::Rewind {
3530                            responder: DirectoryRewindResponder {
3531                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3532                                tx_id: header.tx_id,
3533                            },
3534                        })
3535                    }
3536                    0x26ae9d18763c8655 => {
3537                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3538                        let mut req = fidl::new_empty!(
3539                            fidl::encoding::EmptyPayload,
3540                            fidl::encoding::DefaultFuchsiaResourceDialect
3541                        );
3542                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3543                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3544                        Ok(DirectoryRequest::GetToken {
3545                            responder: DirectoryGetTokenResponder {
3546                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3547                                tx_id: header.tx_id,
3548                            },
3549                        })
3550                    }
3551                    0x740604c0c7c930e7 => {
3552                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3553                        let mut req = fidl::new_empty!(
3554                            DirectoryLinkRequest,
3555                            fidl::encoding::DefaultFuchsiaResourceDialect
3556                        );
3557                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryLinkRequest>(&header, _body_bytes, handles, &mut req)?;
3558                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3559                        Ok(DirectoryRequest::Link {
3560                            src: req.src,
3561                            dst_parent_token: req.dst_parent_token,
3562                            dst: req.dst,
3563
3564                            responder: DirectoryLinkResponder {
3565                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3566                                tx_id: header.tx_id,
3567                            },
3568                        })
3569                    }
3570                    0x750a0326a78d7bed => {
3571                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3572                        let mut req = fidl::new_empty!(
3573                            DirectoryUnlinkRequest,
3574                            fidl::encoding::DefaultFuchsiaResourceDialect
3575                        );
3576                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryUnlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3577                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3578                        Ok(DirectoryRequest::Unlink {
3579                            name: req.name,
3580                            options: req.options,
3581
3582                            responder: DirectoryUnlinkResponder {
3583                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3584                                tx_id: header.tx_id,
3585                            },
3586                        })
3587                    }
3588                    0x7060e7723b9928de => {
3589                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3590                        let mut req = fidl::new_empty!(
3591                            DirectoryRenameRequest,
3592                            fidl::encoding::DefaultFuchsiaResourceDialect
3593                        );
3594                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryRenameRequest>(&header, _body_bytes, handles, &mut req)?;
3595                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3596                        Ok(DirectoryRequest::Rename {
3597                            src: req.src,
3598                            dst_parent_token: req.dst_parent_token,
3599                            dst: req.dst,
3600
3601                            responder: DirectoryRenameResponder {
3602                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3603                                tx_id: header.tx_id,
3604                            },
3605                        })
3606                    }
3607                    0x21ce0f19ec043889 => {
3608                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3609                        let mut req = fidl::new_empty!(
3610                            DirectoryCreateSymlinkRequest,
3611                            fidl::encoding::DefaultFuchsiaResourceDialect
3612                        );
3613                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryCreateSymlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3614                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3615                        Ok(DirectoryRequest::CreateSymlink {
3616                            name: req.name,
3617                            target: req.target,
3618                            connection: req.connection,
3619
3620                            responder: DirectoryCreateSymlinkResponder {
3621                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3622                                tx_id: header.tx_id,
3623                            },
3624                        })
3625                    }
3626                    0x5717193a59d66d91 => {
3627                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3628                        let mut req = fidl::new_empty!(
3629                            DirectoryWatchRequest,
3630                            fidl::encoding::DefaultFuchsiaResourceDialect
3631                        );
3632                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryWatchRequest>(&header, _body_bytes, handles, &mut req)?;
3633                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3634                        Ok(DirectoryRequest::Watch {
3635                            mask: req.mask,
3636                            options: req.options,
3637                            watcher: req.watcher,
3638
3639                            responder: DirectoryWatchResponder {
3640                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3641                                tx_id: header.tx_id,
3642                            },
3643                        })
3644                    }
3645                    _ if header.tx_id == 0
3646                        && header
3647                            .dynamic_flags()
3648                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3649                    {
3650                        Ok(DirectoryRequest::_UnknownMethod {
3651                            ordinal: header.ordinal,
3652                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3653                            method_type: fidl::MethodType::OneWay,
3654                        })
3655                    }
3656                    _ if header
3657                        .dynamic_flags()
3658                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3659                    {
3660                        this.inner.send_framework_err(
3661                            fidl::encoding::FrameworkErr::UnknownMethod,
3662                            header.tx_id,
3663                            header.ordinal,
3664                            header.dynamic_flags(),
3665                            (bytes, handles),
3666                        )?;
3667                        Ok(DirectoryRequest::_UnknownMethod {
3668                            ordinal: header.ordinal,
3669                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3670                            method_type: fidl::MethodType::TwoWay,
3671                        })
3672                    }
3673                    _ => Err(fidl::Error::UnknownOrdinal {
3674                        ordinal: header.ordinal,
3675                        protocol_name:
3676                            <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3677                    }),
3678                }))
3679            },
3680        )
3681    }
3682}
3683
3684/// Directory defines a node which is capable of containing other Objects.
3685#[derive(Debug)]
3686pub enum DirectoryRequest {
3687    /// Acquires an advisory lock on the underlying file.
3688    ///
3689    /// The lock lasts until either this connection is closed or
3690    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
3691    /// explicitly.
3692    ///
3693    /// Advisory locks are purely advisory. They do not prevent actual read or
3694    /// write operations from occurring on the file, either through this
3695    /// connection or through other connections.
3696    ///
3697    /// This method requires the following rights:
3698    ///
3699    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
3700    /// * [`Rights.WRITE_BYTES`] if `request.type` is
3701    ///   [`AdvisoryLockType.WRITE`].
3702    ///
3703    /// # Errors
3704    ///
3705    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
3706    ///   example, another connection might hold a conflicting lock type.
3707    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
3708    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
3709    ///   to acquire the given type of lock.
3710    AdvisoryLock {
3711        request: AdvisoryLockRequest,
3712        responder: DirectoryAdvisoryLockResponder,
3713    },
3714    Clone {
3715        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
3716        control_handle: DirectoryControlHandle,
3717    },
3718    /// Terminates the connection.
3719    ///
3720    /// After calling `Close`, the client must not send any other requests.
3721    ///
3722    /// Servers, after sending the status response, should close the connection
3723    /// regardless of status and without sending an epitaph.
3724    ///
3725    /// Closing the client end of the channel should be semantically equivalent
3726    /// to calling `Close` without knowing when the close has completed or its
3727    /// status.
3728    Close {
3729        responder: DirectoryCloseResponder,
3730    },
3731    Query {
3732        responder: DirectoryQueryResponder,
3733    },
3734    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
3735    DeprecatedClone {
3736        flags: OpenFlags,
3737        object: fidl::endpoints::ServerEnd<NodeMarker>,
3738        control_handle: DirectoryControlHandle,
3739    },
3740    /// Acquires information about the node.
3741    ///
3742    /// This method does not require any rights.
3743    GetAttr {
3744        responder: DirectoryGetAttrResponder,
3745    },
3746    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
3747    DeprecatedSetAttr {
3748        flags: NodeAttributeFlags,
3749        attributes: NodeAttributes,
3750        responder: DirectoryDeprecatedSetAttrResponder,
3751    },
3752    /// [DEPRECATED - Use new GetFlags method instead.]
3753    DeprecatedGetFlags {
3754        responder: DirectoryDeprecatedGetFlagsResponder,
3755    },
3756    /// [DEPRECATED - Use new SetFlags method instead.]
3757    DeprecatedSetFlags {
3758        flags: OpenFlags,
3759        responder: DirectoryDeprecatedSetFlagsResponder,
3760    },
3761    /// Queries the flags that apply to this node after it has been opened/created. This method does
3762    /// not require any rights.
3763    ///
3764    /// Note that the final set of flags that apply to the connection may differ from those
3765    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
3766    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
3767    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
3768    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
3769    GetFlags {
3770        responder: DirectoryGetFlagsResponder,
3771    },
3772    /// Sets the flags that apply to this node after it has been opened. This method does not
3773    /// require any rights.
3774    ///
3775    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
3776    /// clear append mode.
3777    ///
3778    /// Errors:
3779    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
3780    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
3781    SetFlags {
3782        flags: Flags,
3783        responder: DirectorySetFlagsResponder,
3784    },
3785    /// Query the filesystem for filesystem-specific information.
3786    QueryFilesystem {
3787        responder: DirectoryQueryFilesystemResponder,
3788    },
3789    /// Acquires information about the node.
3790    ///
3791    /// The attributes of a node should be stable, independent of the
3792    /// specific protocol used to access it.
3793    ///
3794    /// If a particular attribute is not applicable or not supported,
3795    /// filesystems should leave the corresponding field absent.
3796    ///
3797    /// + `query` a bit-mask specifying which attributes to fetch. The server
3798    ///   should not return more than necessary.
3799    /// - `attributes` the returned attributes.
3800    ///
3801    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3802    GetAttributes {
3803        query: NodeAttributesQuery,
3804        responder: DirectoryGetAttributesResponder,
3805    },
3806    /// Updates information about the node.
3807    ///
3808    /// + `attributes` the presence of a table field in `attributes` indicates
3809    /// the intent to update the corresponding attribute.
3810    ///
3811    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
3812    ///
3813    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3814    UpdateAttributes {
3815        payload: MutableNodeAttributes,
3816        responder: DirectoryUpdateAttributesResponder,
3817    },
3818    /// Synchronizes updates to the node to the underlying media, if it exists.
3819    ///
3820    /// This method will return when the filesystem server has flushed the
3821    /// relevant updates to the underlying media, but does not guarantee the
3822    /// underlying media has persisted the information, nor that any information
3823    /// is committed to hardware. Clients may use `Sync` to ensure ordering
3824    /// between operations.
3825    ///
3826    /// This method does not require any rights.
3827    Sync {
3828        responder: DirectorySyncResponder,
3829    },
3830    /// Creates an iterator over all the extended attribute names associated
3831    /// with this node. If an error occurs it is returned as an epitaph on the
3832    /// iterator request channel, and then the channel is closed.
3833    ///
3834    /// GetExtendedAttributes can be used with any of these names to retrieve
3835    /// the associated value.
3836    ///
3837    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3838    ListExtendedAttributes {
3839        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
3840        control_handle: DirectoryControlHandle,
3841    },
3842    /// Get the value associated with the given attribute `name` for this node.
3843    ///
3844    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
3845    /// particular structure is imposed on them.
3846    ///
3847    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3848    GetExtendedAttribute {
3849        name: Vec<u8>,
3850        responder: DirectoryGetExtendedAttributeResponder,
3851    },
3852    /// Set the value for the given attribute `name` to `value` for this node.
3853    ///
3854    /// The attribute name may exist, in which case the attribute is updated.
3855    /// If the attribute doesn't exist, it is created. The name should have no
3856    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
3857    ///
3858    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3859    SetExtendedAttribute {
3860        name: Vec<u8>,
3861        value: ExtendedAttributeValue,
3862        mode: SetExtendedAttributeMode,
3863        responder: DirectorySetExtendedAttributeResponder,
3864    },
3865    /// Remove the specified extended attribute.
3866    ///
3867    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
3868    ///
3869    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3870    RemoveExtendedAttribute {
3871        name: Vec<u8>,
3872        responder: DirectoryRemoveExtendedAttributeResponder,
3873    },
3874    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
3875    DeprecatedOpen {
3876        flags: OpenFlags,
3877        mode: ModeType,
3878        path: String,
3879        object: fidl::endpoints::ServerEnd<NodeMarker>,
3880        control_handle: DirectoryControlHandle,
3881    },
3882    /// Open (or create) a node relative to this directory. Any errors are communicated via an
3883    /// epitaph sent on the `object` channel.
3884    ///
3885    /// Errors:
3886    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
3887    /// * See [`Flags`] for other errors which may be communicated based on `flags`
3888    Open {
3889        path: String,
3890        flags: Flags,
3891        options: Options,
3892        object: fidl::Channel,
3893        control_handle: DirectoryControlHandle,
3894    },
3895    /// Reads a collection of variably sized dirents into a buffer.
3896    /// The number of dirents in a directory may be very large: akin to
3897    /// calling read multiple times on a file, directories have a seek
3898    /// offset which is updated on subsequent calls to ReadDirents.
3899    /// Each call to ReadDirents will only return whole dirent structures,
3900    /// they will not get split across ReadDirent calls. When the seek
3901    /// offset reaches the end, `dirents` will be empty.
3902    ///
3903    /// These dirents are of the form:
3904    /// ```
3905    /// struct dirent {
3906    ///   // Describes the inode of the entry.
3907    ///   uint64 ino;
3908    ///   // Describes the length of the dirent name in bytes.
3909    ///   uint8 size;
3910    ///   // Describes the type of the entry. Aligned with the
3911    ///   // POSIX d_type values. Use `DirentType` constants.
3912    ///   uint8 type;
3913    ///   // Unterminated name of entry.
3914    ///   char name[0];
3915    /// }
3916    /// ```
3917    ///
3918    /// This method does not require any rights, since one could always probe for
3919    /// directory contents by triggering name conflicts during file creation.
3920    ReadDirents {
3921        max_bytes: u64,
3922        responder: DirectoryReadDirentsResponder,
3923    },
3924    /// Resets the directory seek offset.
3925    ///
3926    /// This method does not require any rights, similar to ReadDirents.
3927    Rewind {
3928        responder: DirectoryRewindResponder,
3929    },
3930    /// Acquires a token to a Directory which can be used to identify access to it at a later point
3931    /// in time. The token will remain valid for as long as the connection requesting the token
3932    /// remains open.
3933    ///
3934    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
3935    /// `ZX_ERR_BAD_HANDLE`.
3936    GetToken {
3937        responder: DirectoryGetTokenResponder,
3938    },
3939    /// Creates a link to an object named src by the name dst, within a directory represented by
3940    /// token.
3941    ///
3942    /// `src` must be a resolved object name. Including "/" in the string will
3943    /// return `ZX_ERR_INVALID_ARGS`.
3944    ///
3945    /// `dst` must be a resolved object name. Including "/" in the string will
3946    /// return `ZX_ERR_INVALID_ARGS`.
3947    ///
3948    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
3949    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
3950    ///
3951    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
3952    /// there are two actors operating concurrently, and one actor performs a rename that affects
3953    /// the source within this directory, and the other does a link, each will appear to occur
3954    /// atomically in an unspecified order.
3955    Link {
3956        src: String,
3957        dst_parent_token: fidl::Handle,
3958        dst: String,
3959        responder: DirectoryLinkResponder,
3960    },
3961    /// Removes a child node from the this directory's list of entries.
3962    ///
3963    /// Note: this does not guarantee that the underlying object is destroyed.
3964    /// Although the link will be removed from the containing directory,
3965    /// objects with multiple references (such as files which are still open)
3966    /// will not actually be destroyed until all references are closed.
3967    ///
3968    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
3969    ///   [`Rights.WRITE_BYTES`].
3970    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
3971    ///   support writing.
3972    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
3973    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
3974    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
3975    ///   containing a remote channel.
3976    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
3977    ///     something other than a directory was found.
3978    ///
3979    /// Other errors may be returned for filesystem-specific reasons.
3980    ///
3981    /// This method requires the following rights:
3982    ///
3983    /// * [`Rights.ENUMERATE`]
3984    /// * [`Rights.MODIFY_DIRECTORY`]
3985    Unlink {
3986        name: String,
3987        options: UnlinkOptions,
3988        responder: DirectoryUnlinkResponder,
3989    },
3990    /// Renames a node named `src` to the name `dst`, in a directory represented
3991    /// by `dst_parent_token`.
3992    ///
3993    /// `src` and `dst` must be valid node names.
3994    /// See [`Name`] for what constitutes a valid name.
3995    ///
3996    /// This method requires the following rights on both the current connection, and the connection
3997    /// identified by `dst_parent_token`:
3998    ///
3999    /// * [`Rights.ENUMERATE`]
4000    /// * [`Rights.MODIFY_DIRECTORY`]
4001    ///
4002    /// The following requirements are necessary to avoid rights escalations.
4003    ///
4004    /// If the source and destination directory differ, the source directory must also have the
4005    /// maximal set of abilities supported for files, which would typically be
4006    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
4007    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
4008    /// right.
4009    ///
4010    /// If `src` refers to a directory, and differs from the destination directory, then the source
4011    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
4012    ///
4013    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
4014    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
4015    Rename {
4016        src: String,
4017        dst_parent_token: fidl::Event,
4018        dst: String,
4019        responder: DirectoryRenameResponder,
4020    },
4021    /// Creates a symbolic link.
4022    ///
4023    /// `name` is the name to be given to the created symbolic link.
4024    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
4025    /// will perform no validation of `target` except for a server chosen maximum length.
4026    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
4027    /// on the successfully created node.
4028    ///
4029    /// * [`Rights.MODIFY_DIRECTORY`]
4030    ///
4031    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
4032    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
4033    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
4034    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
4035    CreateSymlink {
4036        name: String,
4037        target: Vec<u8>,
4038        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4039        responder: DirectoryCreateSymlinkResponder,
4040    },
4041    /// Watches a directory, receiving events of added messages on the
4042    /// watcher request channel.
4043    ///
4044    /// Options must be zero; it is reserved.
4045    ///
4046    /// This method does not require any rights, similar to ReadDirents.
4047    Watch {
4048        mask: WatchMask,
4049        options: u32,
4050        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4051        responder: DirectoryWatchResponder,
4052    },
4053    /// An interaction was received which does not match any known method.
4054    #[non_exhaustive]
4055    _UnknownMethod {
4056        /// Ordinal of the method that was called.
4057        ordinal: u64,
4058        control_handle: DirectoryControlHandle,
4059        method_type: fidl::MethodType,
4060    },
4061}
4062
4063impl DirectoryRequest {
4064    #[allow(irrefutable_let_patterns)]
4065    pub fn into_advisory_lock(
4066        self,
4067    ) -> Option<(AdvisoryLockRequest, DirectoryAdvisoryLockResponder)> {
4068        if let DirectoryRequest::AdvisoryLock { request, responder } = self {
4069            Some((request, responder))
4070        } else {
4071            None
4072        }
4073    }
4074
4075    #[allow(irrefutable_let_patterns)]
4076    pub fn into_clone(
4077        self,
4078    ) -> Option<(
4079        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
4080        DirectoryControlHandle,
4081    )> {
4082        if let DirectoryRequest::Clone { request, control_handle } = self {
4083            Some((request, control_handle))
4084        } else {
4085            None
4086        }
4087    }
4088
4089    #[allow(irrefutable_let_patterns)]
4090    pub fn into_close(self) -> Option<(DirectoryCloseResponder)> {
4091        if let DirectoryRequest::Close { responder } = self {
4092            Some((responder))
4093        } else {
4094            None
4095        }
4096    }
4097
4098    #[allow(irrefutable_let_patterns)]
4099    pub fn into_query(self) -> Option<(DirectoryQueryResponder)> {
4100        if let DirectoryRequest::Query { responder } = self {
4101            Some((responder))
4102        } else {
4103            None
4104        }
4105    }
4106
4107    #[allow(irrefutable_let_patterns)]
4108    pub fn into_deprecated_clone(
4109        self,
4110    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, DirectoryControlHandle)> {
4111        if let DirectoryRequest::DeprecatedClone { flags, object, control_handle } = self {
4112            Some((flags, object, control_handle))
4113        } else {
4114            None
4115        }
4116    }
4117
4118    #[allow(irrefutable_let_patterns)]
4119    pub fn into_get_attr(self) -> Option<(DirectoryGetAttrResponder)> {
4120        if let DirectoryRequest::GetAttr { responder } = self {
4121            Some((responder))
4122        } else {
4123            None
4124        }
4125    }
4126
4127    #[allow(irrefutable_let_patterns)]
4128    pub fn into_deprecated_set_attr(
4129        self,
4130    ) -> Option<(NodeAttributeFlags, NodeAttributes, DirectoryDeprecatedSetAttrResponder)> {
4131        if let DirectoryRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
4132            Some((flags, attributes, responder))
4133        } else {
4134            None
4135        }
4136    }
4137
4138    #[allow(irrefutable_let_patterns)]
4139    pub fn into_deprecated_get_flags(self) -> Option<(DirectoryDeprecatedGetFlagsResponder)> {
4140        if let DirectoryRequest::DeprecatedGetFlags { responder } = self {
4141            Some((responder))
4142        } else {
4143            None
4144        }
4145    }
4146
4147    #[allow(irrefutable_let_patterns)]
4148    pub fn into_deprecated_set_flags(
4149        self,
4150    ) -> Option<(OpenFlags, DirectoryDeprecatedSetFlagsResponder)> {
4151        if let DirectoryRequest::DeprecatedSetFlags { flags, responder } = self {
4152            Some((flags, responder))
4153        } else {
4154            None
4155        }
4156    }
4157
4158    #[allow(irrefutable_let_patterns)]
4159    pub fn into_get_flags(self) -> Option<(DirectoryGetFlagsResponder)> {
4160        if let DirectoryRequest::GetFlags { responder } = self {
4161            Some((responder))
4162        } else {
4163            None
4164        }
4165    }
4166
4167    #[allow(irrefutable_let_patterns)]
4168    pub fn into_set_flags(self) -> Option<(Flags, DirectorySetFlagsResponder)> {
4169        if let DirectoryRequest::SetFlags { flags, responder } = self {
4170            Some((flags, responder))
4171        } else {
4172            None
4173        }
4174    }
4175
4176    #[allow(irrefutable_let_patterns)]
4177    pub fn into_query_filesystem(self) -> Option<(DirectoryQueryFilesystemResponder)> {
4178        if let DirectoryRequest::QueryFilesystem { responder } = self {
4179            Some((responder))
4180        } else {
4181            None
4182        }
4183    }
4184
4185    #[allow(irrefutable_let_patterns)]
4186    pub fn into_get_attributes(
4187        self,
4188    ) -> Option<(NodeAttributesQuery, DirectoryGetAttributesResponder)> {
4189        if let DirectoryRequest::GetAttributes { query, responder } = self {
4190            Some((query, responder))
4191        } else {
4192            None
4193        }
4194    }
4195
4196    #[allow(irrefutable_let_patterns)]
4197    pub fn into_update_attributes(
4198        self,
4199    ) -> Option<(MutableNodeAttributes, DirectoryUpdateAttributesResponder)> {
4200        if let DirectoryRequest::UpdateAttributes { payload, responder } = self {
4201            Some((payload, responder))
4202        } else {
4203            None
4204        }
4205    }
4206
4207    #[allow(irrefutable_let_patterns)]
4208    pub fn into_sync(self) -> Option<(DirectorySyncResponder)> {
4209        if let DirectoryRequest::Sync { responder } = self {
4210            Some((responder))
4211        } else {
4212            None
4213        }
4214    }
4215
4216    #[allow(irrefutable_let_patterns)]
4217    pub fn into_list_extended_attributes(
4218        self,
4219    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, DirectoryControlHandle)>
4220    {
4221        if let DirectoryRequest::ListExtendedAttributes { iterator, control_handle } = self {
4222            Some((iterator, control_handle))
4223        } else {
4224            None
4225        }
4226    }
4227
4228    #[allow(irrefutable_let_patterns)]
4229    pub fn into_get_extended_attribute(
4230        self,
4231    ) -> Option<(Vec<u8>, DirectoryGetExtendedAttributeResponder)> {
4232        if let DirectoryRequest::GetExtendedAttribute { name, responder } = self {
4233            Some((name, responder))
4234        } else {
4235            None
4236        }
4237    }
4238
4239    #[allow(irrefutable_let_patterns)]
4240    pub fn into_set_extended_attribute(
4241        self,
4242    ) -> Option<(
4243        Vec<u8>,
4244        ExtendedAttributeValue,
4245        SetExtendedAttributeMode,
4246        DirectorySetExtendedAttributeResponder,
4247    )> {
4248        if let DirectoryRequest::SetExtendedAttribute { name, value, mode, responder } = self {
4249            Some((name, value, mode, responder))
4250        } else {
4251            None
4252        }
4253    }
4254
4255    #[allow(irrefutable_let_patterns)]
4256    pub fn into_remove_extended_attribute(
4257        self,
4258    ) -> Option<(Vec<u8>, DirectoryRemoveExtendedAttributeResponder)> {
4259        if let DirectoryRequest::RemoveExtendedAttribute { name, responder } = self {
4260            Some((name, responder))
4261        } else {
4262            None
4263        }
4264    }
4265
4266    #[allow(irrefutable_let_patterns)]
4267    pub fn into_deprecated_open(
4268        self,
4269    ) -> Option<(
4270        OpenFlags,
4271        ModeType,
4272        String,
4273        fidl::endpoints::ServerEnd<NodeMarker>,
4274        DirectoryControlHandle,
4275    )> {
4276        if let DirectoryRequest::DeprecatedOpen { flags, mode, path, object, control_handle } = self
4277        {
4278            Some((flags, mode, path, object, control_handle))
4279        } else {
4280            None
4281        }
4282    }
4283
4284    #[allow(irrefutable_let_patterns)]
4285    pub fn into_open(
4286        self,
4287    ) -> Option<(String, Flags, Options, fidl::Channel, DirectoryControlHandle)> {
4288        if let DirectoryRequest::Open { path, flags, options, object, control_handle } = self {
4289            Some((path, flags, options, object, control_handle))
4290        } else {
4291            None
4292        }
4293    }
4294
4295    #[allow(irrefutable_let_patterns)]
4296    pub fn into_read_dirents(self) -> Option<(u64, DirectoryReadDirentsResponder)> {
4297        if let DirectoryRequest::ReadDirents { max_bytes, responder } = self {
4298            Some((max_bytes, responder))
4299        } else {
4300            None
4301        }
4302    }
4303
4304    #[allow(irrefutable_let_patterns)]
4305    pub fn into_rewind(self) -> Option<(DirectoryRewindResponder)> {
4306        if let DirectoryRequest::Rewind { responder } = self {
4307            Some((responder))
4308        } else {
4309            None
4310        }
4311    }
4312
4313    #[allow(irrefutable_let_patterns)]
4314    pub fn into_get_token(self) -> Option<(DirectoryGetTokenResponder)> {
4315        if let DirectoryRequest::GetToken { responder } = self {
4316            Some((responder))
4317        } else {
4318            None
4319        }
4320    }
4321
4322    #[allow(irrefutable_let_patterns)]
4323    pub fn into_link(self) -> Option<(String, fidl::Handle, String, DirectoryLinkResponder)> {
4324        if let DirectoryRequest::Link { src, dst_parent_token, dst, responder } = self {
4325            Some((src, dst_parent_token, dst, responder))
4326        } else {
4327            None
4328        }
4329    }
4330
4331    #[allow(irrefutable_let_patterns)]
4332    pub fn into_unlink(self) -> Option<(String, UnlinkOptions, DirectoryUnlinkResponder)> {
4333        if let DirectoryRequest::Unlink { name, options, responder } = self {
4334            Some((name, options, responder))
4335        } else {
4336            None
4337        }
4338    }
4339
4340    #[allow(irrefutable_let_patterns)]
4341    pub fn into_rename(self) -> Option<(String, fidl::Event, String, DirectoryRenameResponder)> {
4342        if let DirectoryRequest::Rename { src, dst_parent_token, dst, responder } = self {
4343            Some((src, dst_parent_token, dst, responder))
4344        } else {
4345            None
4346        }
4347    }
4348
4349    #[allow(irrefutable_let_patterns)]
4350    pub fn into_create_symlink(
4351        self,
4352    ) -> Option<(
4353        String,
4354        Vec<u8>,
4355        Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4356        DirectoryCreateSymlinkResponder,
4357    )> {
4358        if let DirectoryRequest::CreateSymlink { name, target, connection, responder } = self {
4359            Some((name, target, connection, responder))
4360        } else {
4361            None
4362        }
4363    }
4364
4365    #[allow(irrefutable_let_patterns)]
4366    pub fn into_watch(
4367        self,
4368    ) -> Option<(
4369        WatchMask,
4370        u32,
4371        fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4372        DirectoryWatchResponder,
4373    )> {
4374        if let DirectoryRequest::Watch { mask, options, watcher, responder } = self {
4375            Some((mask, options, watcher, responder))
4376        } else {
4377            None
4378        }
4379    }
4380
4381    /// Name of the method defined in FIDL
4382    pub fn method_name(&self) -> &'static str {
4383        match *self {
4384            DirectoryRequest::AdvisoryLock { .. } => "advisory_lock",
4385            DirectoryRequest::Clone { .. } => "clone",
4386            DirectoryRequest::Close { .. } => "close",
4387            DirectoryRequest::Query { .. } => "query",
4388            DirectoryRequest::DeprecatedClone { .. } => "deprecated_clone",
4389            DirectoryRequest::GetAttr { .. } => "get_attr",
4390            DirectoryRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
4391            DirectoryRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
4392            DirectoryRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
4393            DirectoryRequest::GetFlags { .. } => "get_flags",
4394            DirectoryRequest::SetFlags { .. } => "set_flags",
4395            DirectoryRequest::QueryFilesystem { .. } => "query_filesystem",
4396            DirectoryRequest::GetAttributes { .. } => "get_attributes",
4397            DirectoryRequest::UpdateAttributes { .. } => "update_attributes",
4398            DirectoryRequest::Sync { .. } => "sync",
4399            DirectoryRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
4400            DirectoryRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
4401            DirectoryRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
4402            DirectoryRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
4403            DirectoryRequest::DeprecatedOpen { .. } => "deprecated_open",
4404            DirectoryRequest::Open { .. } => "open",
4405            DirectoryRequest::ReadDirents { .. } => "read_dirents",
4406            DirectoryRequest::Rewind { .. } => "rewind",
4407            DirectoryRequest::GetToken { .. } => "get_token",
4408            DirectoryRequest::Link { .. } => "link",
4409            DirectoryRequest::Unlink { .. } => "unlink",
4410            DirectoryRequest::Rename { .. } => "rename",
4411            DirectoryRequest::CreateSymlink { .. } => "create_symlink",
4412            DirectoryRequest::Watch { .. } => "watch",
4413            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4414                "unknown one-way method"
4415            }
4416            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4417                "unknown two-way method"
4418            }
4419        }
4420    }
4421}
4422
4423#[derive(Debug, Clone)]
4424pub struct DirectoryControlHandle {
4425    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4426}
4427
4428impl fidl::endpoints::ControlHandle for DirectoryControlHandle {
4429    fn shutdown(&self) {
4430        self.inner.shutdown()
4431    }
4432    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4433        self.inner.shutdown_with_epitaph(status)
4434    }
4435
4436    fn is_closed(&self) -> bool {
4437        self.inner.channel().is_closed()
4438    }
4439    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4440        self.inner.channel().on_closed()
4441    }
4442
4443    #[cfg(target_os = "fuchsia")]
4444    fn signal_peer(
4445        &self,
4446        clear_mask: zx::Signals,
4447        set_mask: zx::Signals,
4448    ) -> Result<(), zx_status::Status> {
4449        use fidl::Peered;
4450        self.inner.channel().signal_peer(clear_mask, set_mask)
4451    }
4452}
4453
4454impl DirectoryControlHandle {
4455    pub fn send_on_open_(
4456        &self,
4457        mut s: i32,
4458        mut info: Option<NodeInfoDeprecated>,
4459    ) -> Result<(), fidl::Error> {
4460        self.inner.send::<NodeOnOpenRequest>(
4461            (s, info.as_mut()),
4462            0,
4463            0x7fc7bbb1dbfd1972,
4464            fidl::encoding::DynamicFlags::empty(),
4465        )
4466    }
4467
4468    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
4469        self.inner.send::<Representation>(
4470            &mut payload,
4471            0,
4472            0x5cb40567d80a510c,
4473            fidl::encoding::DynamicFlags::empty(),
4474        )
4475    }
4476}
4477
4478#[must_use = "FIDL methods require a response to be sent"]
4479#[derive(Debug)]
4480pub struct DirectoryAdvisoryLockResponder {
4481    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4482    tx_id: u32,
4483}
4484
4485/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4486/// if the responder is dropped without sending a response, so that the client
4487/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4488impl std::ops::Drop for DirectoryAdvisoryLockResponder {
4489    fn drop(&mut self) {
4490        self.control_handle.shutdown();
4491        // Safety: drops once, never accessed again
4492        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4493    }
4494}
4495
4496impl fidl::endpoints::Responder for DirectoryAdvisoryLockResponder {
4497    type ControlHandle = DirectoryControlHandle;
4498
4499    fn control_handle(&self) -> &DirectoryControlHandle {
4500        &self.control_handle
4501    }
4502
4503    fn drop_without_shutdown(mut self) {
4504        // Safety: drops once, never accessed again due to mem::forget
4505        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4506        // Prevent Drop from running (which would shut down the channel)
4507        std::mem::forget(self);
4508    }
4509}
4510
4511impl DirectoryAdvisoryLockResponder {
4512    /// Sends a response to the FIDL transaction.
4513    ///
4514    /// Sets the channel to shutdown if an error occurs.
4515    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4516        let _result = self.send_raw(result);
4517        if _result.is_err() {
4518            self.control_handle.shutdown();
4519        }
4520        self.drop_without_shutdown();
4521        _result
4522    }
4523
4524    /// Similar to "send" but does not shutdown the channel if an error occurs.
4525    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4526        let _result = self.send_raw(result);
4527        self.drop_without_shutdown();
4528        _result
4529    }
4530
4531    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4532        self.control_handle
4533            .inner
4534            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4535                result,
4536                self.tx_id,
4537                0x6ee9c0ad53ec87aa,
4538                fidl::encoding::DynamicFlags::empty(),
4539            )
4540    }
4541}
4542
4543#[must_use = "FIDL methods require a response to be sent"]
4544#[derive(Debug)]
4545pub struct DirectoryCloseResponder {
4546    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4547    tx_id: u32,
4548}
4549
4550/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4551/// if the responder is dropped without sending a response, so that the client
4552/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4553impl std::ops::Drop for DirectoryCloseResponder {
4554    fn drop(&mut self) {
4555        self.control_handle.shutdown();
4556        // Safety: drops once, never accessed again
4557        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4558    }
4559}
4560
4561impl fidl::endpoints::Responder for DirectoryCloseResponder {
4562    type ControlHandle = DirectoryControlHandle;
4563
4564    fn control_handle(&self) -> &DirectoryControlHandle {
4565        &self.control_handle
4566    }
4567
4568    fn drop_without_shutdown(mut self) {
4569        // Safety: drops once, never accessed again due to mem::forget
4570        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4571        // Prevent Drop from running (which would shut down the channel)
4572        std::mem::forget(self);
4573    }
4574}
4575
4576impl DirectoryCloseResponder {
4577    /// Sends a response to the FIDL transaction.
4578    ///
4579    /// Sets the channel to shutdown if an error occurs.
4580    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4581        let _result = self.send_raw(result);
4582        if _result.is_err() {
4583            self.control_handle.shutdown();
4584        }
4585        self.drop_without_shutdown();
4586        _result
4587    }
4588
4589    /// Similar to "send" but does not shutdown the channel if an error occurs.
4590    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4591        let _result = self.send_raw(result);
4592        self.drop_without_shutdown();
4593        _result
4594    }
4595
4596    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4597        self.control_handle
4598            .inner
4599            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4600                result,
4601                self.tx_id,
4602                0x5ac5d459ad7f657e,
4603                fidl::encoding::DynamicFlags::empty(),
4604            )
4605    }
4606}
4607
4608#[must_use = "FIDL methods require a response to be sent"]
4609#[derive(Debug)]
4610pub struct DirectoryQueryResponder {
4611    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4612    tx_id: u32,
4613}
4614
4615/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4616/// if the responder is dropped without sending a response, so that the client
4617/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4618impl std::ops::Drop for DirectoryQueryResponder {
4619    fn drop(&mut self) {
4620        self.control_handle.shutdown();
4621        // Safety: drops once, never accessed again
4622        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4623    }
4624}
4625
4626impl fidl::endpoints::Responder for DirectoryQueryResponder {
4627    type ControlHandle = DirectoryControlHandle;
4628
4629    fn control_handle(&self) -> &DirectoryControlHandle {
4630        &self.control_handle
4631    }
4632
4633    fn drop_without_shutdown(mut self) {
4634        // Safety: drops once, never accessed again due to mem::forget
4635        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4636        // Prevent Drop from running (which would shut down the channel)
4637        std::mem::forget(self);
4638    }
4639}
4640
4641impl DirectoryQueryResponder {
4642    /// Sends a response to the FIDL transaction.
4643    ///
4644    /// Sets the channel to shutdown if an error occurs.
4645    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4646        let _result = self.send_raw(protocol);
4647        if _result.is_err() {
4648            self.control_handle.shutdown();
4649        }
4650        self.drop_without_shutdown();
4651        _result
4652    }
4653
4654    /// Similar to "send" but does not shutdown the channel if an error occurs.
4655    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4656        let _result = self.send_raw(protocol);
4657        self.drop_without_shutdown();
4658        _result
4659    }
4660
4661    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4662        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
4663            (protocol,),
4664            self.tx_id,
4665            0x2658edee9decfc06,
4666            fidl::encoding::DynamicFlags::empty(),
4667        )
4668    }
4669}
4670
4671#[must_use = "FIDL methods require a response to be sent"]
4672#[derive(Debug)]
4673pub struct DirectoryGetAttrResponder {
4674    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4675    tx_id: u32,
4676}
4677
4678/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4679/// if the responder is dropped without sending a response, so that the client
4680/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4681impl std::ops::Drop for DirectoryGetAttrResponder {
4682    fn drop(&mut self) {
4683        self.control_handle.shutdown();
4684        // Safety: drops once, never accessed again
4685        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4686    }
4687}
4688
4689impl fidl::endpoints::Responder for DirectoryGetAttrResponder {
4690    type ControlHandle = DirectoryControlHandle;
4691
4692    fn control_handle(&self) -> &DirectoryControlHandle {
4693        &self.control_handle
4694    }
4695
4696    fn drop_without_shutdown(mut self) {
4697        // Safety: drops once, never accessed again due to mem::forget
4698        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4699        // Prevent Drop from running (which would shut down the channel)
4700        std::mem::forget(self);
4701    }
4702}
4703
4704impl DirectoryGetAttrResponder {
4705    /// Sends a response to the FIDL transaction.
4706    ///
4707    /// Sets the channel to shutdown if an error occurs.
4708    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4709        let _result = self.send_raw(s, attributes);
4710        if _result.is_err() {
4711            self.control_handle.shutdown();
4712        }
4713        self.drop_without_shutdown();
4714        _result
4715    }
4716
4717    /// Similar to "send" but does not shutdown the channel if an error occurs.
4718    pub fn send_no_shutdown_on_err(
4719        self,
4720        mut s: i32,
4721        mut attributes: &NodeAttributes,
4722    ) -> Result<(), fidl::Error> {
4723        let _result = self.send_raw(s, attributes);
4724        self.drop_without_shutdown();
4725        _result
4726    }
4727
4728    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4729        self.control_handle.inner.send::<NodeGetAttrResponse>(
4730            (s, attributes),
4731            self.tx_id,
4732            0x78985e216314dafd,
4733            fidl::encoding::DynamicFlags::empty(),
4734        )
4735    }
4736}
4737
4738#[must_use = "FIDL methods require a response to be sent"]
4739#[derive(Debug)]
4740pub struct DirectoryDeprecatedSetAttrResponder {
4741    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4742    tx_id: u32,
4743}
4744
4745/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4746/// if the responder is dropped without sending a response, so that the client
4747/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4748impl std::ops::Drop for DirectoryDeprecatedSetAttrResponder {
4749    fn drop(&mut self) {
4750        self.control_handle.shutdown();
4751        // Safety: drops once, never accessed again
4752        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4753    }
4754}
4755
4756impl fidl::endpoints::Responder for DirectoryDeprecatedSetAttrResponder {
4757    type ControlHandle = DirectoryControlHandle;
4758
4759    fn control_handle(&self) -> &DirectoryControlHandle {
4760        &self.control_handle
4761    }
4762
4763    fn drop_without_shutdown(mut self) {
4764        // Safety: drops once, never accessed again due to mem::forget
4765        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4766        // Prevent Drop from running (which would shut down the channel)
4767        std::mem::forget(self);
4768    }
4769}
4770
4771impl DirectoryDeprecatedSetAttrResponder {
4772    /// Sends a response to the FIDL transaction.
4773    ///
4774    /// Sets the channel to shutdown if an error occurs.
4775    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4776        let _result = self.send_raw(s);
4777        if _result.is_err() {
4778            self.control_handle.shutdown();
4779        }
4780        self.drop_without_shutdown();
4781        _result
4782    }
4783
4784    /// Similar to "send" but does not shutdown the channel if an error occurs.
4785    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4786        let _result = self.send_raw(s);
4787        self.drop_without_shutdown();
4788        _result
4789    }
4790
4791    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4792        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
4793            (s,),
4794            self.tx_id,
4795            0x4186c0f40d938f46,
4796            fidl::encoding::DynamicFlags::empty(),
4797        )
4798    }
4799}
4800
4801#[must_use = "FIDL methods require a response to be sent"]
4802#[derive(Debug)]
4803pub struct DirectoryDeprecatedGetFlagsResponder {
4804    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4805    tx_id: u32,
4806}
4807
4808/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4809/// if the responder is dropped without sending a response, so that the client
4810/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4811impl std::ops::Drop for DirectoryDeprecatedGetFlagsResponder {
4812    fn drop(&mut self) {
4813        self.control_handle.shutdown();
4814        // Safety: drops once, never accessed again
4815        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4816    }
4817}
4818
4819impl fidl::endpoints::Responder for DirectoryDeprecatedGetFlagsResponder {
4820    type ControlHandle = DirectoryControlHandle;
4821
4822    fn control_handle(&self) -> &DirectoryControlHandle {
4823        &self.control_handle
4824    }
4825
4826    fn drop_without_shutdown(mut self) {
4827        // Safety: drops once, never accessed again due to mem::forget
4828        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4829        // Prevent Drop from running (which would shut down the channel)
4830        std::mem::forget(self);
4831    }
4832}
4833
4834impl DirectoryDeprecatedGetFlagsResponder {
4835    /// Sends a response to the FIDL transaction.
4836    ///
4837    /// Sets the channel to shutdown if an error occurs.
4838    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4839        let _result = self.send_raw(s, flags);
4840        if _result.is_err() {
4841            self.control_handle.shutdown();
4842        }
4843        self.drop_without_shutdown();
4844        _result
4845    }
4846
4847    /// Similar to "send" but does not shutdown the channel if an error occurs.
4848    pub fn send_no_shutdown_on_err(
4849        self,
4850        mut s: i32,
4851        mut flags: OpenFlags,
4852    ) -> Result<(), fidl::Error> {
4853        let _result = self.send_raw(s, flags);
4854        self.drop_without_shutdown();
4855        _result
4856    }
4857
4858    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4859        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
4860            (s, flags),
4861            self.tx_id,
4862            0x5b88fffb8eda3aa1,
4863            fidl::encoding::DynamicFlags::empty(),
4864        )
4865    }
4866}
4867
4868#[must_use = "FIDL methods require a response to be sent"]
4869#[derive(Debug)]
4870pub struct DirectoryDeprecatedSetFlagsResponder {
4871    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4872    tx_id: u32,
4873}
4874
4875/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4876/// if the responder is dropped without sending a response, so that the client
4877/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4878impl std::ops::Drop for DirectoryDeprecatedSetFlagsResponder {
4879    fn drop(&mut self) {
4880        self.control_handle.shutdown();
4881        // Safety: drops once, never accessed again
4882        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4883    }
4884}
4885
4886impl fidl::endpoints::Responder for DirectoryDeprecatedSetFlagsResponder {
4887    type ControlHandle = DirectoryControlHandle;
4888
4889    fn control_handle(&self) -> &DirectoryControlHandle {
4890        &self.control_handle
4891    }
4892
4893    fn drop_without_shutdown(mut self) {
4894        // Safety: drops once, never accessed again due to mem::forget
4895        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4896        // Prevent Drop from running (which would shut down the channel)
4897        std::mem::forget(self);
4898    }
4899}
4900
4901impl DirectoryDeprecatedSetFlagsResponder {
4902    /// Sends a response to the FIDL transaction.
4903    ///
4904    /// Sets the channel to shutdown if an error occurs.
4905    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4906        let _result = self.send_raw(s);
4907        if _result.is_err() {
4908            self.control_handle.shutdown();
4909        }
4910        self.drop_without_shutdown();
4911        _result
4912    }
4913
4914    /// Similar to "send" but does not shutdown the channel if an error occurs.
4915    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4916        let _result = self.send_raw(s);
4917        self.drop_without_shutdown();
4918        _result
4919    }
4920
4921    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4922        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
4923            (s,),
4924            self.tx_id,
4925            0x5295b76c71fde733,
4926            fidl::encoding::DynamicFlags::empty(),
4927        )
4928    }
4929}
4930
4931#[must_use = "FIDL methods require a response to be sent"]
4932#[derive(Debug)]
4933pub struct DirectoryGetFlagsResponder {
4934    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4935    tx_id: u32,
4936}
4937
4938/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4939/// if the responder is dropped without sending a response, so that the client
4940/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4941impl std::ops::Drop for DirectoryGetFlagsResponder {
4942    fn drop(&mut self) {
4943        self.control_handle.shutdown();
4944        // Safety: drops once, never accessed again
4945        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4946    }
4947}
4948
4949impl fidl::endpoints::Responder for DirectoryGetFlagsResponder {
4950    type ControlHandle = DirectoryControlHandle;
4951
4952    fn control_handle(&self) -> &DirectoryControlHandle {
4953        &self.control_handle
4954    }
4955
4956    fn drop_without_shutdown(mut self) {
4957        // Safety: drops once, never accessed again due to mem::forget
4958        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4959        // Prevent Drop from running (which would shut down the channel)
4960        std::mem::forget(self);
4961    }
4962}
4963
4964impl DirectoryGetFlagsResponder {
4965    /// Sends a response to the FIDL transaction.
4966    ///
4967    /// Sets the channel to shutdown if an error occurs.
4968    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4969        let _result = self.send_raw(result);
4970        if _result.is_err() {
4971            self.control_handle.shutdown();
4972        }
4973        self.drop_without_shutdown();
4974        _result
4975    }
4976
4977    /// Similar to "send" but does not shutdown the channel if an error occurs.
4978    pub fn send_no_shutdown_on_err(
4979        self,
4980        mut result: Result<Flags, i32>,
4981    ) -> Result<(), fidl::Error> {
4982        let _result = self.send_raw(result);
4983        self.drop_without_shutdown();
4984        _result
4985    }
4986
4987    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4988        self.control_handle
4989            .inner
4990            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
4991                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
4992                self.tx_id,
4993                0x176eb318f64ec23,
4994                fidl::encoding::DynamicFlags::FLEXIBLE,
4995            )
4996    }
4997}
4998
4999#[must_use = "FIDL methods require a response to be sent"]
5000#[derive(Debug)]
5001pub struct DirectorySetFlagsResponder {
5002    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5003    tx_id: u32,
5004}
5005
5006/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5007/// if the responder is dropped without sending a response, so that the client
5008/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5009impl std::ops::Drop for DirectorySetFlagsResponder {
5010    fn drop(&mut self) {
5011        self.control_handle.shutdown();
5012        // Safety: drops once, never accessed again
5013        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5014    }
5015}
5016
5017impl fidl::endpoints::Responder for DirectorySetFlagsResponder {
5018    type ControlHandle = DirectoryControlHandle;
5019
5020    fn control_handle(&self) -> &DirectoryControlHandle {
5021        &self.control_handle
5022    }
5023
5024    fn drop_without_shutdown(mut self) {
5025        // Safety: drops once, never accessed again due to mem::forget
5026        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5027        // Prevent Drop from running (which would shut down the channel)
5028        std::mem::forget(self);
5029    }
5030}
5031
5032impl DirectorySetFlagsResponder {
5033    /// Sends a response to the FIDL transaction.
5034    ///
5035    /// Sets the channel to shutdown if an error occurs.
5036    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5037        let _result = self.send_raw(result);
5038        if _result.is_err() {
5039            self.control_handle.shutdown();
5040        }
5041        self.drop_without_shutdown();
5042        _result
5043    }
5044
5045    /// Similar to "send" but does not shutdown the channel if an error occurs.
5046    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5047        let _result = self.send_raw(result);
5048        self.drop_without_shutdown();
5049        _result
5050    }
5051
5052    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5053        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5054            fidl::encoding::EmptyStruct,
5055            i32,
5056        >>(
5057            fidl::encoding::FlexibleResult::new(result),
5058            self.tx_id,
5059            0x55a8028685791ea8,
5060            fidl::encoding::DynamicFlags::FLEXIBLE,
5061        )
5062    }
5063}
5064
5065#[must_use = "FIDL methods require a response to be sent"]
5066#[derive(Debug)]
5067pub struct DirectoryQueryFilesystemResponder {
5068    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5069    tx_id: u32,
5070}
5071
5072/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5073/// if the responder is dropped without sending a response, so that the client
5074/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5075impl std::ops::Drop for DirectoryQueryFilesystemResponder {
5076    fn drop(&mut self) {
5077        self.control_handle.shutdown();
5078        // Safety: drops once, never accessed again
5079        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5080    }
5081}
5082
5083impl fidl::endpoints::Responder for DirectoryQueryFilesystemResponder {
5084    type ControlHandle = DirectoryControlHandle;
5085
5086    fn control_handle(&self) -> &DirectoryControlHandle {
5087        &self.control_handle
5088    }
5089
5090    fn drop_without_shutdown(mut self) {
5091        // Safety: drops once, never accessed again due to mem::forget
5092        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5093        // Prevent Drop from running (which would shut down the channel)
5094        std::mem::forget(self);
5095    }
5096}
5097
5098impl DirectoryQueryFilesystemResponder {
5099    /// Sends a response to the FIDL transaction.
5100    ///
5101    /// Sets the channel to shutdown if an error occurs.
5102    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5103        let _result = self.send_raw(s, info);
5104        if _result.is_err() {
5105            self.control_handle.shutdown();
5106        }
5107        self.drop_without_shutdown();
5108        _result
5109    }
5110
5111    /// Similar to "send" but does not shutdown the channel if an error occurs.
5112    pub fn send_no_shutdown_on_err(
5113        self,
5114        mut s: i32,
5115        mut info: Option<&FilesystemInfo>,
5116    ) -> Result<(), fidl::Error> {
5117        let _result = self.send_raw(s, info);
5118        self.drop_without_shutdown();
5119        _result
5120    }
5121
5122    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5123        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
5124            (s, info),
5125            self.tx_id,
5126            0x6f344a1c6b0a0610,
5127            fidl::encoding::DynamicFlags::empty(),
5128        )
5129    }
5130}
5131
5132#[must_use = "FIDL methods require a response to be sent"]
5133#[derive(Debug)]
5134pub struct DirectoryGetAttributesResponder {
5135    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5136    tx_id: u32,
5137}
5138
5139/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5140/// if the responder is dropped without sending a response, so that the client
5141/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5142impl std::ops::Drop for DirectoryGetAttributesResponder {
5143    fn drop(&mut self) {
5144        self.control_handle.shutdown();
5145        // Safety: drops once, never accessed again
5146        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5147    }
5148}
5149
5150impl fidl::endpoints::Responder for DirectoryGetAttributesResponder {
5151    type ControlHandle = DirectoryControlHandle;
5152
5153    fn control_handle(&self) -> &DirectoryControlHandle {
5154        &self.control_handle
5155    }
5156
5157    fn drop_without_shutdown(mut self) {
5158        // Safety: drops once, never accessed again due to mem::forget
5159        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5160        // Prevent Drop from running (which would shut down the channel)
5161        std::mem::forget(self);
5162    }
5163}
5164
5165impl DirectoryGetAttributesResponder {
5166    /// Sends a response to the FIDL transaction.
5167    ///
5168    /// Sets the channel to shutdown if an error occurs.
5169    pub fn send(
5170        self,
5171        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5172    ) -> Result<(), fidl::Error> {
5173        let _result = self.send_raw(result);
5174        if _result.is_err() {
5175            self.control_handle.shutdown();
5176        }
5177        self.drop_without_shutdown();
5178        _result
5179    }
5180
5181    /// Similar to "send" but does not shutdown the channel if an error occurs.
5182    pub fn send_no_shutdown_on_err(
5183        self,
5184        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5185    ) -> Result<(), fidl::Error> {
5186        let _result = self.send_raw(result);
5187        self.drop_without_shutdown();
5188        _result
5189    }
5190
5191    fn send_raw(
5192        &self,
5193        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5194    ) -> Result<(), fidl::Error> {
5195        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
5196            result,
5197            self.tx_id,
5198            0x3d4396a638ea053b,
5199            fidl::encoding::DynamicFlags::empty(),
5200        )
5201    }
5202}
5203
5204#[must_use = "FIDL methods require a response to be sent"]
5205#[derive(Debug)]
5206pub struct DirectoryUpdateAttributesResponder {
5207    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5208    tx_id: u32,
5209}
5210
5211/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5212/// if the responder is dropped without sending a response, so that the client
5213/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5214impl std::ops::Drop for DirectoryUpdateAttributesResponder {
5215    fn drop(&mut self) {
5216        self.control_handle.shutdown();
5217        // Safety: drops once, never accessed again
5218        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5219    }
5220}
5221
5222impl fidl::endpoints::Responder for DirectoryUpdateAttributesResponder {
5223    type ControlHandle = DirectoryControlHandle;
5224
5225    fn control_handle(&self) -> &DirectoryControlHandle {
5226        &self.control_handle
5227    }
5228
5229    fn drop_without_shutdown(mut self) {
5230        // Safety: drops once, never accessed again due to mem::forget
5231        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5232        // Prevent Drop from running (which would shut down the channel)
5233        std::mem::forget(self);
5234    }
5235}
5236
5237impl DirectoryUpdateAttributesResponder {
5238    /// Sends a response to the FIDL transaction.
5239    ///
5240    /// Sets the channel to shutdown if an error occurs.
5241    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5242        let _result = self.send_raw(result);
5243        if _result.is_err() {
5244            self.control_handle.shutdown();
5245        }
5246        self.drop_without_shutdown();
5247        _result
5248    }
5249
5250    /// Similar to "send" but does not shutdown the channel if an error occurs.
5251    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5252        let _result = self.send_raw(result);
5253        self.drop_without_shutdown();
5254        _result
5255    }
5256
5257    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5258        self.control_handle
5259            .inner
5260            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5261                result,
5262                self.tx_id,
5263                0x3308c1da5a89bf08,
5264                fidl::encoding::DynamicFlags::empty(),
5265            )
5266    }
5267}
5268
5269#[must_use = "FIDL methods require a response to be sent"]
5270#[derive(Debug)]
5271pub struct DirectorySyncResponder {
5272    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5273    tx_id: u32,
5274}
5275
5276/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5277/// if the responder is dropped without sending a response, so that the client
5278/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5279impl std::ops::Drop for DirectorySyncResponder {
5280    fn drop(&mut self) {
5281        self.control_handle.shutdown();
5282        // Safety: drops once, never accessed again
5283        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5284    }
5285}
5286
5287impl fidl::endpoints::Responder for DirectorySyncResponder {
5288    type ControlHandle = DirectoryControlHandle;
5289
5290    fn control_handle(&self) -> &DirectoryControlHandle {
5291        &self.control_handle
5292    }
5293
5294    fn drop_without_shutdown(mut self) {
5295        // Safety: drops once, never accessed again due to mem::forget
5296        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5297        // Prevent Drop from running (which would shut down the channel)
5298        std::mem::forget(self);
5299    }
5300}
5301
5302impl DirectorySyncResponder {
5303    /// Sends a response to the FIDL transaction.
5304    ///
5305    /// Sets the channel to shutdown if an error occurs.
5306    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5307        let _result = self.send_raw(result);
5308        if _result.is_err() {
5309            self.control_handle.shutdown();
5310        }
5311        self.drop_without_shutdown();
5312        _result
5313    }
5314
5315    /// Similar to "send" but does not shutdown the channel if an error occurs.
5316    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5317        let _result = self.send_raw(result);
5318        self.drop_without_shutdown();
5319        _result
5320    }
5321
5322    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5323        self.control_handle
5324            .inner
5325            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5326                result,
5327                self.tx_id,
5328                0x2c5c27ca0ab5dc49,
5329                fidl::encoding::DynamicFlags::empty(),
5330            )
5331    }
5332}
5333
5334#[must_use = "FIDL methods require a response to be sent"]
5335#[derive(Debug)]
5336pub struct DirectoryGetExtendedAttributeResponder {
5337    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5338    tx_id: u32,
5339}
5340
5341/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5342/// if the responder is dropped without sending a response, so that the client
5343/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5344impl std::ops::Drop for DirectoryGetExtendedAttributeResponder {
5345    fn drop(&mut self) {
5346        self.control_handle.shutdown();
5347        // Safety: drops once, never accessed again
5348        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5349    }
5350}
5351
5352impl fidl::endpoints::Responder for DirectoryGetExtendedAttributeResponder {
5353    type ControlHandle = DirectoryControlHandle;
5354
5355    fn control_handle(&self) -> &DirectoryControlHandle {
5356        &self.control_handle
5357    }
5358
5359    fn drop_without_shutdown(mut self) {
5360        // Safety: drops once, never accessed again due to mem::forget
5361        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5362        // Prevent Drop from running (which would shut down the channel)
5363        std::mem::forget(self);
5364    }
5365}
5366
5367impl DirectoryGetExtendedAttributeResponder {
5368    /// Sends a response to the FIDL transaction.
5369    ///
5370    /// Sets the channel to shutdown if an error occurs.
5371    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5372        let _result = self.send_raw(result);
5373        if _result.is_err() {
5374            self.control_handle.shutdown();
5375        }
5376        self.drop_without_shutdown();
5377        _result
5378    }
5379
5380    /// Similar to "send" but does not shutdown the channel if an error occurs.
5381    pub fn send_no_shutdown_on_err(
5382        self,
5383        mut result: Result<ExtendedAttributeValue, i32>,
5384    ) -> Result<(), fidl::Error> {
5385        let _result = self.send_raw(result);
5386        self.drop_without_shutdown();
5387        _result
5388    }
5389
5390    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5391        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
5392            result.as_mut().map_err(|e| *e),
5393            self.tx_id,
5394            0x45ffa3ccfdeb76db,
5395            fidl::encoding::DynamicFlags::empty(),
5396        )
5397    }
5398}
5399
5400#[must_use = "FIDL methods require a response to be sent"]
5401#[derive(Debug)]
5402pub struct DirectorySetExtendedAttributeResponder {
5403    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5404    tx_id: u32,
5405}
5406
5407/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5408/// if the responder is dropped without sending a response, so that the client
5409/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5410impl std::ops::Drop for DirectorySetExtendedAttributeResponder {
5411    fn drop(&mut self) {
5412        self.control_handle.shutdown();
5413        // Safety: drops once, never accessed again
5414        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5415    }
5416}
5417
5418impl fidl::endpoints::Responder for DirectorySetExtendedAttributeResponder {
5419    type ControlHandle = DirectoryControlHandle;
5420
5421    fn control_handle(&self) -> &DirectoryControlHandle {
5422        &self.control_handle
5423    }
5424
5425    fn drop_without_shutdown(mut self) {
5426        // Safety: drops once, never accessed again due to mem::forget
5427        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5428        // Prevent Drop from running (which would shut down the channel)
5429        std::mem::forget(self);
5430    }
5431}
5432
5433impl DirectorySetExtendedAttributeResponder {
5434    /// Sends a response to the FIDL transaction.
5435    ///
5436    /// Sets the channel to shutdown if an error occurs.
5437    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5438        let _result = self.send_raw(result);
5439        if _result.is_err() {
5440            self.control_handle.shutdown();
5441        }
5442        self.drop_without_shutdown();
5443        _result
5444    }
5445
5446    /// Similar to "send" but does not shutdown the channel if an error occurs.
5447    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5448        let _result = self.send_raw(result);
5449        self.drop_without_shutdown();
5450        _result
5451    }
5452
5453    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5454        self.control_handle
5455            .inner
5456            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5457                result,
5458                self.tx_id,
5459                0x4a951362f681f23c,
5460                fidl::encoding::DynamicFlags::empty(),
5461            )
5462    }
5463}
5464
5465#[must_use = "FIDL methods require a response to be sent"]
5466#[derive(Debug)]
5467pub struct DirectoryRemoveExtendedAttributeResponder {
5468    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5469    tx_id: u32,
5470}
5471
5472/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5473/// if the responder is dropped without sending a response, so that the client
5474/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5475impl std::ops::Drop for DirectoryRemoveExtendedAttributeResponder {
5476    fn drop(&mut self) {
5477        self.control_handle.shutdown();
5478        // Safety: drops once, never accessed again
5479        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5480    }
5481}
5482
5483impl fidl::endpoints::Responder for DirectoryRemoveExtendedAttributeResponder {
5484    type ControlHandle = DirectoryControlHandle;
5485
5486    fn control_handle(&self) -> &DirectoryControlHandle {
5487        &self.control_handle
5488    }
5489
5490    fn drop_without_shutdown(mut self) {
5491        // Safety: drops once, never accessed again due to mem::forget
5492        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5493        // Prevent Drop from running (which would shut down the channel)
5494        std::mem::forget(self);
5495    }
5496}
5497
5498impl DirectoryRemoveExtendedAttributeResponder {
5499    /// Sends a response to the FIDL transaction.
5500    ///
5501    /// Sets the channel to shutdown if an error occurs.
5502    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5503        let _result = self.send_raw(result);
5504        if _result.is_err() {
5505            self.control_handle.shutdown();
5506        }
5507        self.drop_without_shutdown();
5508        _result
5509    }
5510
5511    /// Similar to "send" but does not shutdown the channel if an error occurs.
5512    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5513        let _result = self.send_raw(result);
5514        self.drop_without_shutdown();
5515        _result
5516    }
5517
5518    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5519        self.control_handle
5520            .inner
5521            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5522                result,
5523                self.tx_id,
5524                0x7a0b9f3a9bf9032d,
5525                fidl::encoding::DynamicFlags::empty(),
5526            )
5527    }
5528}
5529
5530#[must_use = "FIDL methods require a response to be sent"]
5531#[derive(Debug)]
5532pub struct DirectoryReadDirentsResponder {
5533    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5534    tx_id: u32,
5535}
5536
5537/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5538/// if the responder is dropped without sending a response, so that the client
5539/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5540impl std::ops::Drop for DirectoryReadDirentsResponder {
5541    fn drop(&mut self) {
5542        self.control_handle.shutdown();
5543        // Safety: drops once, never accessed again
5544        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5545    }
5546}
5547
5548impl fidl::endpoints::Responder for DirectoryReadDirentsResponder {
5549    type ControlHandle = DirectoryControlHandle;
5550
5551    fn control_handle(&self) -> &DirectoryControlHandle {
5552        &self.control_handle
5553    }
5554
5555    fn drop_without_shutdown(mut self) {
5556        // Safety: drops once, never accessed again due to mem::forget
5557        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5558        // Prevent Drop from running (which would shut down the channel)
5559        std::mem::forget(self);
5560    }
5561}
5562
5563impl DirectoryReadDirentsResponder {
5564    /// Sends a response to the FIDL transaction.
5565    ///
5566    /// Sets the channel to shutdown if an error occurs.
5567    pub fn send(self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5568        let _result = self.send_raw(s, dirents);
5569        if _result.is_err() {
5570            self.control_handle.shutdown();
5571        }
5572        self.drop_without_shutdown();
5573        _result
5574    }
5575
5576    /// Similar to "send" but does not shutdown the channel if an error occurs.
5577    pub fn send_no_shutdown_on_err(
5578        self,
5579        mut s: i32,
5580        mut dirents: &[u8],
5581    ) -> Result<(), fidl::Error> {
5582        let _result = self.send_raw(s, dirents);
5583        self.drop_without_shutdown();
5584        _result
5585    }
5586
5587    fn send_raw(&self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5588        self.control_handle.inner.send::<DirectoryReadDirentsResponse>(
5589            (s, dirents),
5590            self.tx_id,
5591            0x3582806bf27faa0a,
5592            fidl::encoding::DynamicFlags::empty(),
5593        )
5594    }
5595}
5596
5597#[must_use = "FIDL methods require a response to be sent"]
5598#[derive(Debug)]
5599pub struct DirectoryRewindResponder {
5600    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5601    tx_id: u32,
5602}
5603
5604/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5605/// if the responder is dropped without sending a response, so that the client
5606/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5607impl std::ops::Drop for DirectoryRewindResponder {
5608    fn drop(&mut self) {
5609        self.control_handle.shutdown();
5610        // Safety: drops once, never accessed again
5611        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5612    }
5613}
5614
5615impl fidl::endpoints::Responder for DirectoryRewindResponder {
5616    type ControlHandle = DirectoryControlHandle;
5617
5618    fn control_handle(&self) -> &DirectoryControlHandle {
5619        &self.control_handle
5620    }
5621
5622    fn drop_without_shutdown(mut self) {
5623        // Safety: drops once, never accessed again due to mem::forget
5624        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5625        // Prevent Drop from running (which would shut down the channel)
5626        std::mem::forget(self);
5627    }
5628}
5629
5630impl DirectoryRewindResponder {
5631    /// Sends a response to the FIDL transaction.
5632    ///
5633    /// Sets the channel to shutdown if an error occurs.
5634    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5635        let _result = self.send_raw(s);
5636        if _result.is_err() {
5637            self.control_handle.shutdown();
5638        }
5639        self.drop_without_shutdown();
5640        _result
5641    }
5642
5643    /// Similar to "send" but does not shutdown the channel if an error occurs.
5644    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5645        let _result = self.send_raw(s);
5646        self.drop_without_shutdown();
5647        _result
5648    }
5649
5650    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5651        self.control_handle.inner.send::<DirectoryRewindResponse>(
5652            (s,),
5653            self.tx_id,
5654            0x16b1202af0f34c71,
5655            fidl::encoding::DynamicFlags::empty(),
5656        )
5657    }
5658}
5659
5660#[must_use = "FIDL methods require a response to be sent"]
5661#[derive(Debug)]
5662pub struct DirectoryGetTokenResponder {
5663    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5664    tx_id: u32,
5665}
5666
5667/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5668/// if the responder is dropped without sending a response, so that the client
5669/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5670impl std::ops::Drop for DirectoryGetTokenResponder {
5671    fn drop(&mut self) {
5672        self.control_handle.shutdown();
5673        // Safety: drops once, never accessed again
5674        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5675    }
5676}
5677
5678impl fidl::endpoints::Responder for DirectoryGetTokenResponder {
5679    type ControlHandle = DirectoryControlHandle;
5680
5681    fn control_handle(&self) -> &DirectoryControlHandle {
5682        &self.control_handle
5683    }
5684
5685    fn drop_without_shutdown(mut self) {
5686        // Safety: drops once, never accessed again due to mem::forget
5687        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5688        // Prevent Drop from running (which would shut down the channel)
5689        std::mem::forget(self);
5690    }
5691}
5692
5693impl DirectoryGetTokenResponder {
5694    /// Sends a response to the FIDL transaction.
5695    ///
5696    /// Sets the channel to shutdown if an error occurs.
5697    pub fn send(self, mut s: i32, mut token: Option<fidl::Handle>) -> Result<(), fidl::Error> {
5698        let _result = self.send_raw(s, token);
5699        if _result.is_err() {
5700            self.control_handle.shutdown();
5701        }
5702        self.drop_without_shutdown();
5703        _result
5704    }
5705
5706    /// Similar to "send" but does not shutdown the channel if an error occurs.
5707    pub fn send_no_shutdown_on_err(
5708        self,
5709        mut s: i32,
5710        mut token: Option<fidl::Handle>,
5711    ) -> Result<(), fidl::Error> {
5712        let _result = self.send_raw(s, token);
5713        self.drop_without_shutdown();
5714        _result
5715    }
5716
5717    fn send_raw(&self, mut s: i32, mut token: Option<fidl::Handle>) -> Result<(), fidl::Error> {
5718        self.control_handle.inner.send::<DirectoryGetTokenResponse>(
5719            (s, token),
5720            self.tx_id,
5721            0x26ae9d18763c8655,
5722            fidl::encoding::DynamicFlags::empty(),
5723        )
5724    }
5725}
5726
5727#[must_use = "FIDL methods require a response to be sent"]
5728#[derive(Debug)]
5729pub struct DirectoryLinkResponder {
5730    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5731    tx_id: u32,
5732}
5733
5734/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5735/// if the responder is dropped without sending a response, so that the client
5736/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5737impl std::ops::Drop for DirectoryLinkResponder {
5738    fn drop(&mut self) {
5739        self.control_handle.shutdown();
5740        // Safety: drops once, never accessed again
5741        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5742    }
5743}
5744
5745impl fidl::endpoints::Responder for DirectoryLinkResponder {
5746    type ControlHandle = DirectoryControlHandle;
5747
5748    fn control_handle(&self) -> &DirectoryControlHandle {
5749        &self.control_handle
5750    }
5751
5752    fn drop_without_shutdown(mut self) {
5753        // Safety: drops once, never accessed again due to mem::forget
5754        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5755        // Prevent Drop from running (which would shut down the channel)
5756        std::mem::forget(self);
5757    }
5758}
5759
5760impl DirectoryLinkResponder {
5761    /// Sends a response to the FIDL transaction.
5762    ///
5763    /// Sets the channel to shutdown if an error occurs.
5764    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5765        let _result = self.send_raw(s);
5766        if _result.is_err() {
5767            self.control_handle.shutdown();
5768        }
5769        self.drop_without_shutdown();
5770        _result
5771    }
5772
5773    /// Similar to "send" but does not shutdown the channel if an error occurs.
5774    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5775        let _result = self.send_raw(s);
5776        self.drop_without_shutdown();
5777        _result
5778    }
5779
5780    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5781        self.control_handle.inner.send::<DirectoryLinkResponse>(
5782            (s,),
5783            self.tx_id,
5784            0x740604c0c7c930e7,
5785            fidl::encoding::DynamicFlags::empty(),
5786        )
5787    }
5788}
5789
5790#[must_use = "FIDL methods require a response to be sent"]
5791#[derive(Debug)]
5792pub struct DirectoryUnlinkResponder {
5793    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5794    tx_id: u32,
5795}
5796
5797/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5798/// if the responder is dropped without sending a response, so that the client
5799/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5800impl std::ops::Drop for DirectoryUnlinkResponder {
5801    fn drop(&mut self) {
5802        self.control_handle.shutdown();
5803        // Safety: drops once, never accessed again
5804        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5805    }
5806}
5807
5808impl fidl::endpoints::Responder for DirectoryUnlinkResponder {
5809    type ControlHandle = DirectoryControlHandle;
5810
5811    fn control_handle(&self) -> &DirectoryControlHandle {
5812        &self.control_handle
5813    }
5814
5815    fn drop_without_shutdown(mut self) {
5816        // Safety: drops once, never accessed again due to mem::forget
5817        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5818        // Prevent Drop from running (which would shut down the channel)
5819        std::mem::forget(self);
5820    }
5821}
5822
5823impl DirectoryUnlinkResponder {
5824    /// Sends a response to the FIDL transaction.
5825    ///
5826    /// Sets the channel to shutdown if an error occurs.
5827    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5828        let _result = self.send_raw(result);
5829        if _result.is_err() {
5830            self.control_handle.shutdown();
5831        }
5832        self.drop_without_shutdown();
5833        _result
5834    }
5835
5836    /// Similar to "send" but does not shutdown the channel if an error occurs.
5837    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5838        let _result = self.send_raw(result);
5839        self.drop_without_shutdown();
5840        _result
5841    }
5842
5843    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5844        self.control_handle
5845            .inner
5846            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5847                result,
5848                self.tx_id,
5849                0x750a0326a78d7bed,
5850                fidl::encoding::DynamicFlags::empty(),
5851            )
5852    }
5853}
5854
5855#[must_use = "FIDL methods require a response to be sent"]
5856#[derive(Debug)]
5857pub struct DirectoryRenameResponder {
5858    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5859    tx_id: u32,
5860}
5861
5862/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5863/// if the responder is dropped without sending a response, so that the client
5864/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5865impl std::ops::Drop for DirectoryRenameResponder {
5866    fn drop(&mut self) {
5867        self.control_handle.shutdown();
5868        // Safety: drops once, never accessed again
5869        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5870    }
5871}
5872
5873impl fidl::endpoints::Responder for DirectoryRenameResponder {
5874    type ControlHandle = DirectoryControlHandle;
5875
5876    fn control_handle(&self) -> &DirectoryControlHandle {
5877        &self.control_handle
5878    }
5879
5880    fn drop_without_shutdown(mut self) {
5881        // Safety: drops once, never accessed again due to mem::forget
5882        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5883        // Prevent Drop from running (which would shut down the channel)
5884        std::mem::forget(self);
5885    }
5886}
5887
5888impl DirectoryRenameResponder {
5889    /// Sends a response to the FIDL transaction.
5890    ///
5891    /// Sets the channel to shutdown if an error occurs.
5892    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5893        let _result = self.send_raw(result);
5894        if _result.is_err() {
5895            self.control_handle.shutdown();
5896        }
5897        self.drop_without_shutdown();
5898        _result
5899    }
5900
5901    /// Similar to "send" but does not shutdown the channel if an error occurs.
5902    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5903        let _result = self.send_raw(result);
5904        self.drop_without_shutdown();
5905        _result
5906    }
5907
5908    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5909        self.control_handle
5910            .inner
5911            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5912                result,
5913                self.tx_id,
5914                0x7060e7723b9928de,
5915                fidl::encoding::DynamicFlags::empty(),
5916            )
5917    }
5918}
5919
5920#[must_use = "FIDL methods require a response to be sent"]
5921#[derive(Debug)]
5922pub struct DirectoryCreateSymlinkResponder {
5923    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5924    tx_id: u32,
5925}
5926
5927/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5928/// if the responder is dropped without sending a response, so that the client
5929/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5930impl std::ops::Drop for DirectoryCreateSymlinkResponder {
5931    fn drop(&mut self) {
5932        self.control_handle.shutdown();
5933        // Safety: drops once, never accessed again
5934        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5935    }
5936}
5937
5938impl fidl::endpoints::Responder for DirectoryCreateSymlinkResponder {
5939    type ControlHandle = DirectoryControlHandle;
5940
5941    fn control_handle(&self) -> &DirectoryControlHandle {
5942        &self.control_handle
5943    }
5944
5945    fn drop_without_shutdown(mut self) {
5946        // Safety: drops once, never accessed again due to mem::forget
5947        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5948        // Prevent Drop from running (which would shut down the channel)
5949        std::mem::forget(self);
5950    }
5951}
5952
5953impl DirectoryCreateSymlinkResponder {
5954    /// Sends a response to the FIDL transaction.
5955    ///
5956    /// Sets the channel to shutdown if an error occurs.
5957    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5958        let _result = self.send_raw(result);
5959        if _result.is_err() {
5960            self.control_handle.shutdown();
5961        }
5962        self.drop_without_shutdown();
5963        _result
5964    }
5965
5966    /// Similar to "send" but does not shutdown the channel if an error occurs.
5967    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5968        let _result = self.send_raw(result);
5969        self.drop_without_shutdown();
5970        _result
5971    }
5972
5973    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5974        self.control_handle
5975            .inner
5976            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5977                result,
5978                self.tx_id,
5979                0x21ce0f19ec043889,
5980                fidl::encoding::DynamicFlags::empty(),
5981            )
5982    }
5983}
5984
5985#[must_use = "FIDL methods require a response to be sent"]
5986#[derive(Debug)]
5987pub struct DirectoryWatchResponder {
5988    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5989    tx_id: u32,
5990}
5991
5992/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5993/// if the responder is dropped without sending a response, so that the client
5994/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5995impl std::ops::Drop for DirectoryWatchResponder {
5996    fn drop(&mut self) {
5997        self.control_handle.shutdown();
5998        // Safety: drops once, never accessed again
5999        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6000    }
6001}
6002
6003impl fidl::endpoints::Responder for DirectoryWatchResponder {
6004    type ControlHandle = DirectoryControlHandle;
6005
6006    fn control_handle(&self) -> &DirectoryControlHandle {
6007        &self.control_handle
6008    }
6009
6010    fn drop_without_shutdown(mut self) {
6011        // Safety: drops once, never accessed again due to mem::forget
6012        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6013        // Prevent Drop from running (which would shut down the channel)
6014        std::mem::forget(self);
6015    }
6016}
6017
6018impl DirectoryWatchResponder {
6019    /// Sends a response to the FIDL transaction.
6020    ///
6021    /// Sets the channel to shutdown if an error occurs.
6022    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
6023        let _result = self.send_raw(s);
6024        if _result.is_err() {
6025            self.control_handle.shutdown();
6026        }
6027        self.drop_without_shutdown();
6028        _result
6029    }
6030
6031    /// Similar to "send" but does not shutdown the channel if an error occurs.
6032    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
6033        let _result = self.send_raw(s);
6034        self.drop_without_shutdown();
6035        _result
6036    }
6037
6038    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
6039        self.control_handle.inner.send::<DirectoryWatchResponse>(
6040            (s,),
6041            self.tx_id,
6042            0x5717193a59d66d91,
6043            fidl::encoding::DynamicFlags::empty(),
6044        )
6045    }
6046}
6047
6048#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6049pub struct DirectoryWatcherMarker;
6050
6051impl fidl::endpoints::ProtocolMarker for DirectoryWatcherMarker {
6052    type Proxy = DirectoryWatcherProxy;
6053    type RequestStream = DirectoryWatcherRequestStream;
6054    #[cfg(target_os = "fuchsia")]
6055    type SynchronousProxy = DirectoryWatcherSynchronousProxy;
6056
6057    const DEBUG_NAME: &'static str = "(anonymous) DirectoryWatcher";
6058}
6059
6060pub trait DirectoryWatcherProxyInterface: Send + Sync {}
6061#[derive(Debug)]
6062#[cfg(target_os = "fuchsia")]
6063pub struct DirectoryWatcherSynchronousProxy {
6064    client: fidl::client::sync::Client,
6065}
6066
6067#[cfg(target_os = "fuchsia")]
6068impl fidl::endpoints::SynchronousProxy for DirectoryWatcherSynchronousProxy {
6069    type Proxy = DirectoryWatcherProxy;
6070    type Protocol = DirectoryWatcherMarker;
6071
6072    fn from_channel(inner: fidl::Channel) -> Self {
6073        Self::new(inner)
6074    }
6075
6076    fn into_channel(self) -> fidl::Channel {
6077        self.client.into_channel()
6078    }
6079
6080    fn as_channel(&self) -> &fidl::Channel {
6081        self.client.as_channel()
6082    }
6083}
6084
6085#[cfg(target_os = "fuchsia")]
6086impl DirectoryWatcherSynchronousProxy {
6087    pub fn new(channel: fidl::Channel) -> Self {
6088        let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6089        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6090    }
6091
6092    pub fn into_channel(self) -> fidl::Channel {
6093        self.client.into_channel()
6094    }
6095
6096    /// Waits until an event arrives and returns it. It is safe for other
6097    /// threads to make concurrent requests while waiting for an event.
6098    pub fn wait_for_event(
6099        &self,
6100        deadline: zx::MonotonicInstant,
6101    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6102        DirectoryWatcherEvent::decode(self.client.wait_for_event(deadline)?)
6103    }
6104}
6105
6106#[cfg(target_os = "fuchsia")]
6107impl From<DirectoryWatcherSynchronousProxy> for zx::Handle {
6108    fn from(value: DirectoryWatcherSynchronousProxy) -> Self {
6109        value.into_channel().into()
6110    }
6111}
6112
6113#[cfg(target_os = "fuchsia")]
6114impl From<fidl::Channel> for DirectoryWatcherSynchronousProxy {
6115    fn from(value: fidl::Channel) -> Self {
6116        Self::new(value)
6117    }
6118}
6119
6120#[derive(Debug, Clone)]
6121pub struct DirectoryWatcherProxy {
6122    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6123}
6124
6125impl fidl::endpoints::Proxy for DirectoryWatcherProxy {
6126    type Protocol = DirectoryWatcherMarker;
6127
6128    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6129        Self::new(inner)
6130    }
6131
6132    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6133        self.client.into_channel().map_err(|client| Self { client })
6134    }
6135
6136    fn as_channel(&self) -> &::fidl::AsyncChannel {
6137        self.client.as_channel()
6138    }
6139}
6140
6141impl DirectoryWatcherProxy {
6142    /// Create a new Proxy for fuchsia.io/DirectoryWatcher.
6143    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6144        let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6145        Self { client: fidl::client::Client::new(channel, protocol_name) }
6146    }
6147
6148    /// Get a Stream of events from the remote end of the protocol.
6149    ///
6150    /// # Panics
6151    ///
6152    /// Panics if the event stream was already taken.
6153    pub fn take_event_stream(&self) -> DirectoryWatcherEventStream {
6154        DirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
6155    }
6156}
6157
6158impl DirectoryWatcherProxyInterface for DirectoryWatcherProxy {}
6159
6160pub struct DirectoryWatcherEventStream {
6161    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6162}
6163
6164impl std::marker::Unpin for DirectoryWatcherEventStream {}
6165
6166impl futures::stream::FusedStream for DirectoryWatcherEventStream {
6167    fn is_terminated(&self) -> bool {
6168        self.event_receiver.is_terminated()
6169    }
6170}
6171
6172impl futures::Stream for DirectoryWatcherEventStream {
6173    type Item = Result<DirectoryWatcherEvent, fidl::Error>;
6174
6175    fn poll_next(
6176        mut self: std::pin::Pin<&mut Self>,
6177        cx: &mut std::task::Context<'_>,
6178    ) -> std::task::Poll<Option<Self::Item>> {
6179        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6180            &mut self.event_receiver,
6181            cx
6182        )?) {
6183            Some(buf) => std::task::Poll::Ready(Some(DirectoryWatcherEvent::decode(buf))),
6184            None => std::task::Poll::Ready(None),
6185        }
6186    }
6187}
6188
6189#[derive(Debug)]
6190pub enum DirectoryWatcherEvent {}
6191
6192impl DirectoryWatcherEvent {
6193    /// Decodes a message buffer as a [`DirectoryWatcherEvent`].
6194    fn decode(
6195        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6196    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6197        let (bytes, _handles) = buf.split_mut();
6198        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6199        debug_assert_eq!(tx_header.tx_id, 0);
6200        match tx_header.ordinal {
6201            _ => Err(fidl::Error::UnknownOrdinal {
6202                ordinal: tx_header.ordinal,
6203                protocol_name:
6204                    <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6205            }),
6206        }
6207    }
6208}
6209
6210/// A Stream of incoming requests for fuchsia.io/DirectoryWatcher.
6211pub struct DirectoryWatcherRequestStream {
6212    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6213    is_terminated: bool,
6214}
6215
6216impl std::marker::Unpin for DirectoryWatcherRequestStream {}
6217
6218impl futures::stream::FusedStream for DirectoryWatcherRequestStream {
6219    fn is_terminated(&self) -> bool {
6220        self.is_terminated
6221    }
6222}
6223
6224impl fidl::endpoints::RequestStream for DirectoryWatcherRequestStream {
6225    type Protocol = DirectoryWatcherMarker;
6226    type ControlHandle = DirectoryWatcherControlHandle;
6227
6228    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6229        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6230    }
6231
6232    fn control_handle(&self) -> Self::ControlHandle {
6233        DirectoryWatcherControlHandle { inner: self.inner.clone() }
6234    }
6235
6236    fn into_inner(
6237        self,
6238    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6239    {
6240        (self.inner, self.is_terminated)
6241    }
6242
6243    fn from_inner(
6244        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6245        is_terminated: bool,
6246    ) -> Self {
6247        Self { inner, is_terminated }
6248    }
6249}
6250
6251impl futures::Stream for DirectoryWatcherRequestStream {
6252    type Item = Result<DirectoryWatcherRequest, fidl::Error>;
6253
6254    fn poll_next(
6255        mut self: std::pin::Pin<&mut Self>,
6256        cx: &mut std::task::Context<'_>,
6257    ) -> std::task::Poll<Option<Self::Item>> {
6258        let this = &mut *self;
6259        if this.inner.check_shutdown(cx) {
6260            this.is_terminated = true;
6261            return std::task::Poll::Ready(None);
6262        }
6263        if this.is_terminated {
6264            panic!("polled DirectoryWatcherRequestStream after completion");
6265        }
6266        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6267            |bytes, handles| {
6268                match this.inner.channel().read_etc(cx, bytes, handles) {
6269                    std::task::Poll::Ready(Ok(())) => {}
6270                    std::task::Poll::Pending => return std::task::Poll::Pending,
6271                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6272                        this.is_terminated = true;
6273                        return std::task::Poll::Ready(None);
6274                    }
6275                    std::task::Poll::Ready(Err(e)) => {
6276                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6277                            e.into(),
6278                        ))))
6279                    }
6280                }
6281
6282                // A message has been received from the channel
6283                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6284
6285                std::task::Poll::Ready(Some(match header.ordinal {
6286                    _ => Err(fidl::Error::UnknownOrdinal {
6287                        ordinal: header.ordinal,
6288                        protocol_name:
6289                            <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6290                    }),
6291                }))
6292            },
6293        )
6294    }
6295}
6296
6297/// DirectoryWatcher transmits messages from a filesystem server
6298/// about events happening in the filesystem. Clients can register
6299/// new watchers using the `Directory.Watch` method, where they can
6300/// filter which events they want to receive notifications for.
6301///
6302/// The DirectoryWatcher will send messages of the form:
6303/// ```
6304/// struct {
6305///   uint8 event;
6306///   uint8 len;
6307///   char name[];
6308/// };
6309/// ```
6310/// Where names are NOT null-terminated. The name is the relative
6311/// path to the entry the event is refering to. It will be empty if
6312/// the event isn't referencing a particular entry (e.g. for the
6313/// `IDLE` event).
6314#[derive(Debug)]
6315pub enum DirectoryWatcherRequest {}
6316
6317impl DirectoryWatcherRequest {
6318    /// Name of the method defined in FIDL
6319    pub fn method_name(&self) -> &'static str {
6320        match *self {}
6321    }
6322}
6323
6324#[derive(Debug, Clone)]
6325pub struct DirectoryWatcherControlHandle {
6326    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6327}
6328
6329impl fidl::endpoints::ControlHandle for DirectoryWatcherControlHandle {
6330    fn shutdown(&self) {
6331        self.inner.shutdown()
6332    }
6333    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6334        self.inner.shutdown_with_epitaph(status)
6335    }
6336
6337    fn is_closed(&self) -> bool {
6338        self.inner.channel().is_closed()
6339    }
6340    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6341        self.inner.channel().on_closed()
6342    }
6343
6344    #[cfg(target_os = "fuchsia")]
6345    fn signal_peer(
6346        &self,
6347        clear_mask: zx::Signals,
6348        set_mask: zx::Signals,
6349    ) -> Result<(), zx_status::Status> {
6350        use fidl::Peered;
6351        self.inner.channel().signal_peer(clear_mask, set_mask)
6352    }
6353}
6354
6355impl DirectoryWatcherControlHandle {}
6356
6357#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6358pub struct ExtendedAttributeIteratorMarker;
6359
6360impl fidl::endpoints::ProtocolMarker for ExtendedAttributeIteratorMarker {
6361    type Proxy = ExtendedAttributeIteratorProxy;
6362    type RequestStream = ExtendedAttributeIteratorRequestStream;
6363    #[cfg(target_os = "fuchsia")]
6364    type SynchronousProxy = ExtendedAttributeIteratorSynchronousProxy;
6365
6366    const DEBUG_NAME: &'static str = "(anonymous) ExtendedAttributeIterator";
6367}
6368pub type ExtendedAttributeIteratorGetNextResult = Result<(Vec<Vec<u8>>, bool), i32>;
6369
6370pub trait ExtendedAttributeIteratorProxyInterface: Send + Sync {
6371    type GetNextResponseFut: std::future::Future<Output = Result<ExtendedAttributeIteratorGetNextResult, fidl::Error>>
6372        + Send;
6373    fn r#get_next(&self) -> Self::GetNextResponseFut;
6374}
6375#[derive(Debug)]
6376#[cfg(target_os = "fuchsia")]
6377pub struct ExtendedAttributeIteratorSynchronousProxy {
6378    client: fidl::client::sync::Client,
6379}
6380
6381#[cfg(target_os = "fuchsia")]
6382impl fidl::endpoints::SynchronousProxy for ExtendedAttributeIteratorSynchronousProxy {
6383    type Proxy = ExtendedAttributeIteratorProxy;
6384    type Protocol = ExtendedAttributeIteratorMarker;
6385
6386    fn from_channel(inner: fidl::Channel) -> Self {
6387        Self::new(inner)
6388    }
6389
6390    fn into_channel(self) -> fidl::Channel {
6391        self.client.into_channel()
6392    }
6393
6394    fn as_channel(&self) -> &fidl::Channel {
6395        self.client.as_channel()
6396    }
6397}
6398
6399#[cfg(target_os = "fuchsia")]
6400impl ExtendedAttributeIteratorSynchronousProxy {
6401    pub fn new(channel: fidl::Channel) -> Self {
6402        let protocol_name =
6403            <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6404        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6405    }
6406
6407    pub fn into_channel(self) -> fidl::Channel {
6408        self.client.into_channel()
6409    }
6410
6411    /// Waits until an event arrives and returns it. It is safe for other
6412    /// threads to make concurrent requests while waiting for an event.
6413    pub fn wait_for_event(
6414        &self,
6415        deadline: zx::MonotonicInstant,
6416    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6417        ExtendedAttributeIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6418    }
6419
6420    /// Get the next chunk of extended attribute names. If this is the last
6421    /// chunk, last will be true, and the channel will be closed after the
6422    /// call.
6423    pub fn r#get_next(
6424        &self,
6425        ___deadline: zx::MonotonicInstant,
6426    ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6427        let _response = self.client.send_query::<
6428            fidl::encoding::EmptyPayload,
6429            fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6430        >(
6431            (),
6432            0x3ba664a1c2e45a7,
6433            fidl::encoding::DynamicFlags::empty(),
6434            ___deadline,
6435        )?;
6436        Ok(_response.map(|x| (x.attributes, x.last)))
6437    }
6438}
6439
6440#[cfg(target_os = "fuchsia")]
6441impl From<ExtendedAttributeIteratorSynchronousProxy> for zx::Handle {
6442    fn from(value: ExtendedAttributeIteratorSynchronousProxy) -> Self {
6443        value.into_channel().into()
6444    }
6445}
6446
6447#[cfg(target_os = "fuchsia")]
6448impl From<fidl::Channel> for ExtendedAttributeIteratorSynchronousProxy {
6449    fn from(value: fidl::Channel) -> Self {
6450        Self::new(value)
6451    }
6452}
6453
6454#[derive(Debug, Clone)]
6455pub struct ExtendedAttributeIteratorProxy {
6456    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6457}
6458
6459impl fidl::endpoints::Proxy for ExtendedAttributeIteratorProxy {
6460    type Protocol = ExtendedAttributeIteratorMarker;
6461
6462    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6463        Self::new(inner)
6464    }
6465
6466    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6467        self.client.into_channel().map_err(|client| Self { client })
6468    }
6469
6470    fn as_channel(&self) -> &::fidl::AsyncChannel {
6471        self.client.as_channel()
6472    }
6473}
6474
6475impl ExtendedAttributeIteratorProxy {
6476    /// Create a new Proxy for fuchsia.io/ExtendedAttributeIterator.
6477    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6478        let protocol_name =
6479            <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6480        Self { client: fidl::client::Client::new(channel, protocol_name) }
6481    }
6482
6483    /// Get a Stream of events from the remote end of the protocol.
6484    ///
6485    /// # Panics
6486    ///
6487    /// Panics if the event stream was already taken.
6488    pub fn take_event_stream(&self) -> ExtendedAttributeIteratorEventStream {
6489        ExtendedAttributeIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6490    }
6491
6492    /// Get the next chunk of extended attribute names. If this is the last
6493    /// chunk, last will be true, and the channel will be closed after the
6494    /// call.
6495    pub fn r#get_next(
6496        &self,
6497    ) -> fidl::client::QueryResponseFut<
6498        ExtendedAttributeIteratorGetNextResult,
6499        fidl::encoding::DefaultFuchsiaResourceDialect,
6500    > {
6501        ExtendedAttributeIteratorProxyInterface::r#get_next(self)
6502    }
6503}
6504
6505impl ExtendedAttributeIteratorProxyInterface for ExtendedAttributeIteratorProxy {
6506    type GetNextResponseFut = fidl::client::QueryResponseFut<
6507        ExtendedAttributeIteratorGetNextResult,
6508        fidl::encoding::DefaultFuchsiaResourceDialect,
6509    >;
6510    fn r#get_next(&self) -> Self::GetNextResponseFut {
6511        fn _decode(
6512            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6513        ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6514            let _response = fidl::client::decode_transaction_body::<
6515                fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6516                fidl::encoding::DefaultFuchsiaResourceDialect,
6517                0x3ba664a1c2e45a7,
6518            >(_buf?)?;
6519            Ok(_response.map(|x| (x.attributes, x.last)))
6520        }
6521        self.client.send_query_and_decode::<
6522            fidl::encoding::EmptyPayload,
6523            ExtendedAttributeIteratorGetNextResult,
6524        >(
6525            (),
6526            0x3ba664a1c2e45a7,
6527            fidl::encoding::DynamicFlags::empty(),
6528            _decode,
6529        )
6530    }
6531}
6532
6533pub struct ExtendedAttributeIteratorEventStream {
6534    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6535}
6536
6537impl std::marker::Unpin for ExtendedAttributeIteratorEventStream {}
6538
6539impl futures::stream::FusedStream for ExtendedAttributeIteratorEventStream {
6540    fn is_terminated(&self) -> bool {
6541        self.event_receiver.is_terminated()
6542    }
6543}
6544
6545impl futures::Stream for ExtendedAttributeIteratorEventStream {
6546    type Item = Result<ExtendedAttributeIteratorEvent, fidl::Error>;
6547
6548    fn poll_next(
6549        mut self: std::pin::Pin<&mut Self>,
6550        cx: &mut std::task::Context<'_>,
6551    ) -> std::task::Poll<Option<Self::Item>> {
6552        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6553            &mut self.event_receiver,
6554            cx
6555        )?) {
6556            Some(buf) => std::task::Poll::Ready(Some(ExtendedAttributeIteratorEvent::decode(buf))),
6557            None => std::task::Poll::Ready(None),
6558        }
6559    }
6560}
6561
6562#[derive(Debug)]
6563pub enum ExtendedAttributeIteratorEvent {}
6564
6565impl ExtendedAttributeIteratorEvent {
6566    /// Decodes a message buffer as a [`ExtendedAttributeIteratorEvent`].
6567    fn decode(
6568        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6569    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6570        let (bytes, _handles) = buf.split_mut();
6571        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6572        debug_assert_eq!(tx_header.tx_id, 0);
6573        match tx_header.ordinal {
6574            _ => Err(fidl::Error::UnknownOrdinal {
6575                ordinal: tx_header.ordinal,
6576                protocol_name:
6577                    <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6578            }),
6579        }
6580    }
6581}
6582
6583/// A Stream of incoming requests for fuchsia.io/ExtendedAttributeIterator.
6584pub struct ExtendedAttributeIteratorRequestStream {
6585    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6586    is_terminated: bool,
6587}
6588
6589impl std::marker::Unpin for ExtendedAttributeIteratorRequestStream {}
6590
6591impl futures::stream::FusedStream for ExtendedAttributeIteratorRequestStream {
6592    fn is_terminated(&self) -> bool {
6593        self.is_terminated
6594    }
6595}
6596
6597impl fidl::endpoints::RequestStream for ExtendedAttributeIteratorRequestStream {
6598    type Protocol = ExtendedAttributeIteratorMarker;
6599    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6600
6601    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6602        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6603    }
6604
6605    fn control_handle(&self) -> Self::ControlHandle {
6606        ExtendedAttributeIteratorControlHandle { inner: self.inner.clone() }
6607    }
6608
6609    fn into_inner(
6610        self,
6611    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6612    {
6613        (self.inner, self.is_terminated)
6614    }
6615
6616    fn from_inner(
6617        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6618        is_terminated: bool,
6619    ) -> Self {
6620        Self { inner, is_terminated }
6621    }
6622}
6623
6624impl futures::Stream for ExtendedAttributeIteratorRequestStream {
6625    type Item = Result<ExtendedAttributeIteratorRequest, fidl::Error>;
6626
6627    fn poll_next(
6628        mut self: std::pin::Pin<&mut Self>,
6629        cx: &mut std::task::Context<'_>,
6630    ) -> std::task::Poll<Option<Self::Item>> {
6631        let this = &mut *self;
6632        if this.inner.check_shutdown(cx) {
6633            this.is_terminated = true;
6634            return std::task::Poll::Ready(None);
6635        }
6636        if this.is_terminated {
6637            panic!("polled ExtendedAttributeIteratorRequestStream after completion");
6638        }
6639        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6640            |bytes, handles| {
6641                match this.inner.channel().read_etc(cx, bytes, handles) {
6642                    std::task::Poll::Ready(Ok(())) => {}
6643                    std::task::Poll::Pending => return std::task::Poll::Pending,
6644                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6645                        this.is_terminated = true;
6646                        return std::task::Poll::Ready(None);
6647                    }
6648                    std::task::Poll::Ready(Err(e)) => {
6649                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6650                            e.into(),
6651                        ))))
6652                    }
6653                }
6654
6655                // A message has been received from the channel
6656                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6657
6658                std::task::Poll::Ready(Some(match header.ordinal {
6659                0x3ba664a1c2e45a7 => {
6660                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6661                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6662                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6663                    let control_handle = ExtendedAttributeIteratorControlHandle {
6664                        inner: this.inner.clone(),
6665                    };
6666                    Ok(ExtendedAttributeIteratorRequest::GetNext {
6667                        responder: ExtendedAttributeIteratorGetNextResponder {
6668                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6669                            tx_id: header.tx_id,
6670                        },
6671                    })
6672                }
6673                _ => Err(fidl::Error::UnknownOrdinal {
6674                    ordinal: header.ordinal,
6675                    protocol_name: <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6676                }),
6677            }))
6678            },
6679        )
6680    }
6681}
6682
6683#[derive(Debug)]
6684pub enum ExtendedAttributeIteratorRequest {
6685    /// Get the next chunk of extended attribute names. If this is the last
6686    /// chunk, last will be true, and the channel will be closed after the
6687    /// call.
6688    GetNext { responder: ExtendedAttributeIteratorGetNextResponder },
6689}
6690
6691impl ExtendedAttributeIteratorRequest {
6692    #[allow(irrefutable_let_patterns)]
6693    pub fn into_get_next(self) -> Option<(ExtendedAttributeIteratorGetNextResponder)> {
6694        if let ExtendedAttributeIteratorRequest::GetNext { responder } = self {
6695            Some((responder))
6696        } else {
6697            None
6698        }
6699    }
6700
6701    /// Name of the method defined in FIDL
6702    pub fn method_name(&self) -> &'static str {
6703        match *self {
6704            ExtendedAttributeIteratorRequest::GetNext { .. } => "get_next",
6705        }
6706    }
6707}
6708
6709#[derive(Debug, Clone)]
6710pub struct ExtendedAttributeIteratorControlHandle {
6711    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6712}
6713
6714impl fidl::endpoints::ControlHandle for ExtendedAttributeIteratorControlHandle {
6715    fn shutdown(&self) {
6716        self.inner.shutdown()
6717    }
6718    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6719        self.inner.shutdown_with_epitaph(status)
6720    }
6721
6722    fn is_closed(&self) -> bool {
6723        self.inner.channel().is_closed()
6724    }
6725    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6726        self.inner.channel().on_closed()
6727    }
6728
6729    #[cfg(target_os = "fuchsia")]
6730    fn signal_peer(
6731        &self,
6732        clear_mask: zx::Signals,
6733        set_mask: zx::Signals,
6734    ) -> Result<(), zx_status::Status> {
6735        use fidl::Peered;
6736        self.inner.channel().signal_peer(clear_mask, set_mask)
6737    }
6738}
6739
6740impl ExtendedAttributeIteratorControlHandle {}
6741
6742#[must_use = "FIDL methods require a response to be sent"]
6743#[derive(Debug)]
6744pub struct ExtendedAttributeIteratorGetNextResponder {
6745    control_handle: std::mem::ManuallyDrop<ExtendedAttributeIteratorControlHandle>,
6746    tx_id: u32,
6747}
6748
6749/// Set the the channel to be shutdown (see [`ExtendedAttributeIteratorControlHandle::shutdown`])
6750/// if the responder is dropped without sending a response, so that the client
6751/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6752impl std::ops::Drop for ExtendedAttributeIteratorGetNextResponder {
6753    fn drop(&mut self) {
6754        self.control_handle.shutdown();
6755        // Safety: drops once, never accessed again
6756        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6757    }
6758}
6759
6760impl fidl::endpoints::Responder for ExtendedAttributeIteratorGetNextResponder {
6761    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6762
6763    fn control_handle(&self) -> &ExtendedAttributeIteratorControlHandle {
6764        &self.control_handle
6765    }
6766
6767    fn drop_without_shutdown(mut self) {
6768        // Safety: drops once, never accessed again due to mem::forget
6769        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6770        // Prevent Drop from running (which would shut down the channel)
6771        std::mem::forget(self);
6772    }
6773}
6774
6775impl ExtendedAttributeIteratorGetNextResponder {
6776    /// Sends a response to the FIDL transaction.
6777    ///
6778    /// Sets the channel to shutdown if an error occurs.
6779    pub fn send(self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6780        let _result = self.send_raw(result);
6781        if _result.is_err() {
6782            self.control_handle.shutdown();
6783        }
6784        self.drop_without_shutdown();
6785        _result
6786    }
6787
6788    /// Similar to "send" but does not shutdown the channel if an error occurs.
6789    pub fn send_no_shutdown_on_err(
6790        self,
6791        mut result: Result<(&[Vec<u8>], bool), i32>,
6792    ) -> Result<(), fidl::Error> {
6793        let _result = self.send_raw(result);
6794        self.drop_without_shutdown();
6795        _result
6796    }
6797
6798    fn send_raw(&self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6799        self.control_handle.inner.send::<fidl::encoding::ResultType<
6800            ExtendedAttributeIteratorGetNextResponse,
6801            i32,
6802        >>(
6803            result,
6804            self.tx_id,
6805            0x3ba664a1c2e45a7,
6806            fidl::encoding::DynamicFlags::empty(),
6807        )
6808    }
6809}
6810
6811#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6812pub struct FileMarker;
6813
6814impl fidl::endpoints::ProtocolMarker for FileMarker {
6815    type Proxy = FileProxy;
6816    type RequestStream = FileRequestStream;
6817    #[cfg(target_os = "fuchsia")]
6818    type SynchronousProxy = FileSynchronousProxy;
6819
6820    const DEBUG_NAME: &'static str = "fuchsia.io.File";
6821}
6822impl fidl::endpoints::DiscoverableProtocolMarker for FileMarker {}
6823pub type FileSeekResult = Result<u64, i32>;
6824pub type FileReadAtResult = Result<Vec<u8>, i32>;
6825pub type FileWriteAtResult = Result<u64, i32>;
6826pub type FileResizeResult = Result<(), i32>;
6827pub type FileGetBackingMemoryResult = Result<fidl::Vmo, i32>;
6828pub type FileAllocateResult = Result<(), i32>;
6829pub type FileEnableVerityResult = Result<(), i32>;
6830
6831pub trait FileProxyInterface: Send + Sync {
6832    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
6833        + Send;
6834    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
6835    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
6836        + Send;
6837    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
6838    fn r#clone(
6839        &self,
6840        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
6841    ) -> Result<(), fidl::Error>;
6842    type CloseResponseFut: std::future::Future<
6843            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
6844        > + Send;
6845    fn r#close(&self) -> Self::CloseResponseFut;
6846    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
6847    fn r#query(&self) -> Self::QueryResponseFut;
6848    fn r#deprecated_clone(
6849        &self,
6850        flags: OpenFlags,
6851        object: fidl::endpoints::ServerEnd<NodeMarker>,
6852    ) -> Result<(), fidl::Error>;
6853    type GetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
6854        + Send;
6855    fn r#get_attr(&self) -> Self::GetAttrResponseFut;
6856    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
6857    fn r#deprecated_set_attr(
6858        &self,
6859        flags: NodeAttributeFlags,
6860        attributes: &NodeAttributes,
6861    ) -> Self::DeprecatedSetAttrResponseFut;
6862    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
6863        + Send;
6864    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
6865    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
6866        + Send;
6867    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
6868    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
6869        + Send;
6870    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
6871    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
6872        + Send;
6873    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
6874    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
6875        + Send;
6876    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
6877    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
6878        + Send;
6879    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
6880    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
6881        + Send;
6882    fn r#update_attributes(
6883        &self,
6884        payload: &MutableNodeAttributes,
6885    ) -> Self::UpdateAttributesResponseFut;
6886    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
6887    fn r#sync(&self) -> Self::SyncResponseFut;
6888    fn r#list_extended_attributes(
6889        &self,
6890        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
6891    ) -> Result<(), fidl::Error>;
6892    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
6893        + Send;
6894    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
6895    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
6896        + Send;
6897    fn r#set_extended_attribute(
6898        &self,
6899        name: &[u8],
6900        value: ExtendedAttributeValue,
6901        mode: SetExtendedAttributeMode,
6902    ) -> Self::SetExtendedAttributeResponseFut;
6903    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
6904        + Send;
6905    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
6906    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
6907        + Send;
6908    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
6909    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
6910        + Send;
6911    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
6912    type DescribeResponseFut: std::future::Future<Output = Result<FileInfo, fidl::Error>> + Send;
6913    fn r#describe(&self) -> Self::DescribeResponseFut;
6914    type SeekResponseFut: std::future::Future<Output = Result<FileSeekResult, fidl::Error>> + Send;
6915    fn r#seek(&self, origin: SeekOrigin, offset: i64) -> Self::SeekResponseFut;
6916    type ReadAtResponseFut: std::future::Future<Output = Result<FileReadAtResult, fidl::Error>>
6917        + Send;
6918    fn r#read_at(&self, count: u64, offset: u64) -> Self::ReadAtResponseFut;
6919    type WriteAtResponseFut: std::future::Future<Output = Result<FileWriteAtResult, fidl::Error>>
6920        + Send;
6921    fn r#write_at(&self, data: &[u8], offset: u64) -> Self::WriteAtResponseFut;
6922    type ResizeResponseFut: std::future::Future<Output = Result<FileResizeResult, fidl::Error>>
6923        + Send;
6924    fn r#resize(&self, length: u64) -> Self::ResizeResponseFut;
6925    type GetBackingMemoryResponseFut: std::future::Future<Output = Result<FileGetBackingMemoryResult, fidl::Error>>
6926        + Send;
6927    fn r#get_backing_memory(&self, flags: VmoFlags) -> Self::GetBackingMemoryResponseFut;
6928    type AllocateResponseFut: std::future::Future<Output = Result<FileAllocateResult, fidl::Error>>
6929        + Send;
6930    fn r#allocate(&self, offset: u64, length: u64, mode: AllocateMode)
6931        -> Self::AllocateResponseFut;
6932    type EnableVerityResponseFut: std::future::Future<Output = Result<FileEnableVerityResult, fidl::Error>>
6933        + Send;
6934    fn r#enable_verity(&self, options: &VerificationOptions) -> Self::EnableVerityResponseFut;
6935}
6936#[derive(Debug)]
6937#[cfg(target_os = "fuchsia")]
6938pub struct FileSynchronousProxy {
6939    client: fidl::client::sync::Client,
6940}
6941
6942#[cfg(target_os = "fuchsia")]
6943impl fidl::endpoints::SynchronousProxy for FileSynchronousProxy {
6944    type Proxy = FileProxy;
6945    type Protocol = FileMarker;
6946
6947    fn from_channel(inner: fidl::Channel) -> Self {
6948        Self::new(inner)
6949    }
6950
6951    fn into_channel(self) -> fidl::Channel {
6952        self.client.into_channel()
6953    }
6954
6955    fn as_channel(&self) -> &fidl::Channel {
6956        self.client.as_channel()
6957    }
6958}
6959
6960#[cfg(target_os = "fuchsia")]
6961impl FileSynchronousProxy {
6962    pub fn new(channel: fidl::Channel) -> Self {
6963        let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6964        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6965    }
6966
6967    pub fn into_channel(self) -> fidl::Channel {
6968        self.client.into_channel()
6969    }
6970
6971    /// Waits until an event arrives and returns it. It is safe for other
6972    /// threads to make concurrent requests while waiting for an event.
6973    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<FileEvent, fidl::Error> {
6974        FileEvent::decode(self.client.wait_for_event(deadline)?)
6975    }
6976
6977    /// Acquires an advisory lock on the underlying file.
6978    ///
6979    /// The lock lasts until either this connection is closed or
6980    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
6981    /// explicitly.
6982    ///
6983    /// Advisory locks are purely advisory. They do not prevent actual read or
6984    /// write operations from occurring on the file, either through this
6985    /// connection or through other connections.
6986    ///
6987    /// This method requires the following rights:
6988    ///
6989    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
6990    /// * [`Rights.WRITE_BYTES`] if `request.type` is
6991    ///   [`AdvisoryLockType.WRITE`].
6992    ///
6993    /// # Errors
6994    ///
6995    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
6996    ///   example, another connection might hold a conflicting lock type.
6997    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
6998    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
6999    ///   to acquire the given type of lock.
7000    pub fn r#advisory_lock(
7001        &self,
7002        mut request: &AdvisoryLockRequest,
7003        ___deadline: zx::MonotonicInstant,
7004    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
7005        let _response = self.client.send_query::<
7006            AdvisoryLockingAdvisoryLockRequest,
7007            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7008        >(
7009            (request,),
7010            0x6ee9c0ad53ec87aa,
7011            fidl::encoding::DynamicFlags::empty(),
7012            ___deadline,
7013        )?;
7014        Ok(_response.map(|x| x))
7015    }
7016
7017    /// Creates a link to this this object with name `dst` in the directory represented by
7018    /// `dst_parent_token`.
7019    ///
7020    /// `dst` must be a resolved object name. Including "/" in the string will return
7021    /// `ZX_ERR_INVALID_ARGS`.
7022    ///
7023    /// This method requires the maximal set of rights supported by the filesystem for this object.
7024    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7025    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7026    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7027    /// `ZX_ERR_ACCESS_DENIED`.
7028    ///
7029    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7030    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7031    ///
7032    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7033    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7034    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7035    ///
7036    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7037    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7038    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7039    pub fn r#link_into(
7040        &self,
7041        mut dst_parent_token: fidl::Event,
7042        mut dst: &str,
7043        ___deadline: zx::MonotonicInstant,
7044    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
7045        let _response = self.client.send_query::<
7046            LinkableLinkIntoRequest,
7047            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7048        >(
7049            (dst_parent_token, dst,),
7050            0x54f3949246a03e74,
7051            fidl::encoding::DynamicFlags::empty(),
7052            ___deadline,
7053        )?;
7054        Ok(_response.map(|x| x))
7055    }
7056
7057    pub fn r#clone(
7058        &self,
7059        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7060    ) -> Result<(), fidl::Error> {
7061        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
7062            (request,),
7063            0x20d8a7aba2168a79,
7064            fidl::encoding::DynamicFlags::empty(),
7065        )
7066    }
7067
7068    /// Terminates the connection.
7069    ///
7070    /// After calling `Close`, the client must not send any other requests.
7071    ///
7072    /// Servers, after sending the status response, should close the connection
7073    /// regardless of status and without sending an epitaph.
7074    ///
7075    /// Closing the client end of the channel should be semantically equivalent
7076    /// to calling `Close` without knowing when the close has completed or its
7077    /// status.
7078    pub fn r#close(
7079        &self,
7080        ___deadline: zx::MonotonicInstant,
7081    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
7082        let _response = self.client.send_query::<
7083            fidl::encoding::EmptyPayload,
7084            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7085        >(
7086            (),
7087            0x5ac5d459ad7f657e,
7088            fidl::encoding::DynamicFlags::empty(),
7089            ___deadline,
7090        )?;
7091        Ok(_response.map(|x| x))
7092    }
7093
7094    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
7095        let _response = self.client.send_query::<
7096            fidl::encoding::EmptyPayload,
7097            fidl_fuchsia_unknown::QueryableQueryResponse,
7098        >(
7099            (),
7100            0x2658edee9decfc06,
7101            fidl::encoding::DynamicFlags::empty(),
7102            ___deadline,
7103        )?;
7104        Ok(_response.protocol)
7105    }
7106
7107    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7108    pub fn r#deprecated_clone(
7109        &self,
7110        mut flags: OpenFlags,
7111        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
7112    ) -> Result<(), fidl::Error> {
7113        self.client.send::<NodeDeprecatedCloneRequest>(
7114            (flags, object),
7115            0x5a61678f293ce16f,
7116            fidl::encoding::DynamicFlags::FLEXIBLE,
7117        )
7118    }
7119
7120    /// Acquires information about the node.
7121    ///
7122    /// This method does not require any rights.
7123    pub fn r#get_attr(
7124        &self,
7125        ___deadline: zx::MonotonicInstant,
7126    ) -> Result<(i32, NodeAttributes), fidl::Error> {
7127        let _response =
7128            self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetAttrResponse>(
7129                (),
7130                0x78985e216314dafd,
7131                fidl::encoding::DynamicFlags::empty(),
7132                ___deadline,
7133            )?;
7134        Ok((_response.s, _response.attributes))
7135    }
7136
7137    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7138    pub fn r#deprecated_set_attr(
7139        &self,
7140        mut flags: NodeAttributeFlags,
7141        mut attributes: &NodeAttributes,
7142        ___deadline: zx::MonotonicInstant,
7143    ) -> Result<i32, fidl::Error> {
7144        let _response =
7145            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
7146                (flags, attributes),
7147                0x4186c0f40d938f46,
7148                fidl::encoding::DynamicFlags::empty(),
7149                ___deadline,
7150            )?;
7151        Ok(_response.s)
7152    }
7153
7154    /// [DEPRECATED - Use new GetFlags method instead.]
7155    pub fn r#deprecated_get_flags(
7156        &self,
7157        ___deadline: zx::MonotonicInstant,
7158    ) -> Result<(i32, OpenFlags), fidl::Error> {
7159        let _response = self
7160            .client
7161            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
7162                (),
7163                0x5b88fffb8eda3aa1,
7164                fidl::encoding::DynamicFlags::empty(),
7165                ___deadline,
7166            )?;
7167        Ok((_response.s, _response.flags))
7168    }
7169
7170    /// [DEPRECATED - Use new SetFlags method instead.]
7171    pub fn r#deprecated_set_flags(
7172        &self,
7173        mut flags: OpenFlags,
7174        ___deadline: zx::MonotonicInstant,
7175    ) -> Result<i32, fidl::Error> {
7176        let _response = self
7177            .client
7178            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
7179                (flags,),
7180                0x5295b76c71fde733,
7181                fidl::encoding::DynamicFlags::empty(),
7182                ___deadline,
7183            )?;
7184        Ok(_response.s)
7185    }
7186
7187    /// Queries the flags that apply to this node after it has been opened/created. This method does
7188    /// not require any rights.
7189    ///
7190    /// Note that the final set of flags that apply to the connection may differ from those
7191    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
7192    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
7193    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
7194    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
7195    pub fn r#get_flags(
7196        &self,
7197        ___deadline: zx::MonotonicInstant,
7198    ) -> Result<NodeGetFlagsResult, fidl::Error> {
7199        let _response = self.client.send_query::<
7200            fidl::encoding::EmptyPayload,
7201            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
7202        >(
7203            (),
7204            0x176eb318f64ec23,
7205            fidl::encoding::DynamicFlags::FLEXIBLE,
7206            ___deadline,
7207        )?
7208        .into_result::<FileMarker>("get_flags")?;
7209        Ok(_response.map(|x| x.flags))
7210    }
7211
7212    /// Sets the flags that apply to this node after it has been opened. This method does not
7213    /// require any rights.
7214    ///
7215    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
7216    /// clear append mode.
7217    ///
7218    /// Errors:
7219    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
7220    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
7221    pub fn r#set_flags(
7222        &self,
7223        mut flags: Flags,
7224        ___deadline: zx::MonotonicInstant,
7225    ) -> Result<NodeSetFlagsResult, fidl::Error> {
7226        let _response = self.client.send_query::<
7227            NodeSetFlagsRequest,
7228            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7229        >(
7230            (flags,),
7231            0x55a8028685791ea8,
7232            fidl::encoding::DynamicFlags::FLEXIBLE,
7233            ___deadline,
7234        )?
7235        .into_result::<FileMarker>("set_flags")?;
7236        Ok(_response.map(|x| x))
7237    }
7238
7239    /// Query the filesystem for filesystem-specific information.
7240    pub fn r#query_filesystem(
7241        &self,
7242        ___deadline: zx::MonotonicInstant,
7243    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
7244        let _response =
7245            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
7246                (),
7247                0x6f344a1c6b0a0610,
7248                fidl::encoding::DynamicFlags::empty(),
7249                ___deadline,
7250            )?;
7251        Ok((_response.s, _response.info))
7252    }
7253
7254    /// Acquires information about the node.
7255    ///
7256    /// The attributes of a node should be stable, independent of the
7257    /// specific protocol used to access it.
7258    ///
7259    /// If a particular attribute is not applicable or not supported,
7260    /// filesystems should leave the corresponding field absent.
7261    ///
7262    /// + `query` a bit-mask specifying which attributes to fetch. The server
7263    ///   should not return more than necessary.
7264    /// - `attributes` the returned attributes.
7265    ///
7266    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7267    pub fn r#get_attributes(
7268        &self,
7269        mut query: NodeAttributesQuery,
7270        ___deadline: zx::MonotonicInstant,
7271    ) -> Result<NodeGetAttributesResult, fidl::Error> {
7272        let _response = self.client.send_query::<
7273            NodeGetAttributesRequest,
7274            fidl::encoding::ResultType<NodeAttributes2, i32>,
7275        >(
7276            (query,),
7277            0x3d4396a638ea053b,
7278            fidl::encoding::DynamicFlags::empty(),
7279            ___deadline,
7280        )?;
7281        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
7282    }
7283
7284    /// Updates information about the node.
7285    ///
7286    /// + `attributes` the presence of a table field in `attributes` indicates
7287    /// the intent to update the corresponding attribute.
7288    ///
7289    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
7290    ///
7291    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7292    pub fn r#update_attributes(
7293        &self,
7294        mut payload: &MutableNodeAttributes,
7295        ___deadline: zx::MonotonicInstant,
7296    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
7297        let _response = self.client.send_query::<
7298            MutableNodeAttributes,
7299            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7300        >(
7301            payload,
7302            0x3308c1da5a89bf08,
7303            fidl::encoding::DynamicFlags::empty(),
7304            ___deadline,
7305        )?;
7306        Ok(_response.map(|x| x))
7307    }
7308
7309    /// Synchronizes updates to the node to the underlying media, if it exists.
7310    ///
7311    /// This method will return when the filesystem server has flushed the
7312    /// relevant updates to the underlying media, but does not guarantee the
7313    /// underlying media has persisted the information, nor that any information
7314    /// is committed to hardware. Clients may use `Sync` to ensure ordering
7315    /// between operations.
7316    ///
7317    /// This method does not require any rights.
7318    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
7319        let _response = self.client.send_query::<
7320            fidl::encoding::EmptyPayload,
7321            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7322        >(
7323            (),
7324            0x2c5c27ca0ab5dc49,
7325            fidl::encoding::DynamicFlags::empty(),
7326            ___deadline,
7327        )?;
7328        Ok(_response.map(|x| x))
7329    }
7330
7331    /// Creates an iterator over all the extended attribute names associated
7332    /// with this node. If an error occurs it is returned as an epitaph on the
7333    /// iterator request channel, and then the channel is closed.
7334    ///
7335    /// GetExtendedAttributes can be used with any of these names to retrieve
7336    /// the associated value.
7337    ///
7338    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7339    pub fn r#list_extended_attributes(
7340        &self,
7341        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
7342    ) -> Result<(), fidl::Error> {
7343        self.client.send::<NodeListExtendedAttributesRequest>(
7344            (iterator,),
7345            0x4b61033de007fcd0,
7346            fidl::encoding::DynamicFlags::empty(),
7347        )
7348    }
7349
7350    /// Get the value associated with the given attribute `name` for this node.
7351    ///
7352    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
7353    /// particular structure is imposed on them.
7354    ///
7355    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7356    pub fn r#get_extended_attribute(
7357        &self,
7358        mut name: &[u8],
7359        ___deadline: zx::MonotonicInstant,
7360    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
7361        let _response = self.client.send_query::<
7362            NodeGetExtendedAttributeRequest,
7363            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
7364        >(
7365            (name,),
7366            0x45ffa3ccfdeb76db,
7367            fidl::encoding::DynamicFlags::empty(),
7368            ___deadline,
7369        )?;
7370        Ok(_response.map(|x| x))
7371    }
7372
7373    /// Set the value for the given attribute `name` to `value` for this node.
7374    ///
7375    /// The attribute name may exist, in which case the attribute is updated.
7376    /// If the attribute doesn't exist, it is created. The name should have no
7377    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
7378    ///
7379    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7380    pub fn r#set_extended_attribute(
7381        &self,
7382        mut name: &[u8],
7383        mut value: ExtendedAttributeValue,
7384        mut mode: SetExtendedAttributeMode,
7385        ___deadline: zx::MonotonicInstant,
7386    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
7387        let _response = self.client.send_query::<
7388            NodeSetExtendedAttributeRequest,
7389            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7390        >(
7391            (name, &mut value, mode,),
7392            0x4a951362f681f23c,
7393            fidl::encoding::DynamicFlags::empty(),
7394            ___deadline,
7395        )?;
7396        Ok(_response.map(|x| x))
7397    }
7398
7399    /// Remove the specified extended attribute.
7400    ///
7401    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
7402    ///
7403    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7404    pub fn r#remove_extended_attribute(
7405        &self,
7406        mut name: &[u8],
7407        ___deadline: zx::MonotonicInstant,
7408    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
7409        let _response = self.client.send_query::<
7410            NodeRemoveExtendedAttributeRequest,
7411            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7412        >(
7413            (name,),
7414            0x7a0b9f3a9bf9032d,
7415            fidl::encoding::DynamicFlags::empty(),
7416            ___deadline,
7417        )?;
7418        Ok(_response.map(|x| x))
7419    }
7420
7421    /// Reads up to 'count' bytes at the seek offset.
7422    /// The seek offset is moved forward by the number of bytes read.
7423    ///
7424    /// ## Invariants
7425    ///
7426    /// * The returned `data.length` will never be greater than `count`.
7427    /// * If `data.length` is less than `count`, it means that the seek offset
7428    ///   has reached the end of file as part of this operation.
7429    /// * If `data.length` is zero while `count` is not, it means that the
7430    ///   seek offset is already at or beyond the end of file, and no data could
7431    ///   be read.
7432    /// * If `count` is zero, the server should perform all the checks ensuring
7433    ///   read access without actually read anything, and return an empty
7434    ///   `data` vector.
7435    ///
7436    /// This method requires the [`Rights.READ_BYTES`] right.
7437    ///
7438    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7439    pub fn r#read(
7440        &self,
7441        mut count: u64,
7442        ___deadline: zx::MonotonicInstant,
7443    ) -> Result<ReadableReadResult, fidl::Error> {
7444        let _response = self.client.send_query::<
7445            ReadableReadRequest,
7446            fidl::encoding::ResultType<ReadableReadResponse, i32>,
7447        >(
7448            (count,),
7449            0x57e419a298c8ede,
7450            fidl::encoding::DynamicFlags::empty(),
7451            ___deadline,
7452        )?;
7453        Ok(_response.map(|x| x.data))
7454    }
7455
7456    /// Writes data at the seek offset.
7457    /// The seek offset is moved forward by the number of bytes written.
7458    /// If the file is in append mode, the seek offset is first set to the end
7459    /// of the file, followed by the write, in one atomic step.
7460    ///
7461    /// The file size may grow if the seek offset plus `data.length` is beyond
7462    /// the current end of file.
7463    ///
7464    /// + request `data` the byte buffer to write to the file.
7465    /// - response `actual_count` the number of bytes written.
7466    ///
7467    /// ## Invariants
7468    ///
7469    /// * The returned `actual_count` will never be greater than `data.length`.
7470    /// * If the server is unable to write all the data due to e.g. not enough
7471    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7472    ///   could be written, an error is returned.
7473    /// * If `data.length` is zero, the server should perform all the checks
7474    ///   ensuring write access without mutating the file and return a
7475    ///   successful write of zero bytes.  The seek offset is still updated if
7476    ///   in append mode.
7477    ///
7478    /// This method requires the [`Rights.WRITE_BYTES`] right.
7479    pub fn r#write(
7480        &self,
7481        mut data: &[u8],
7482        ___deadline: zx::MonotonicInstant,
7483    ) -> Result<WritableWriteResult, fidl::Error> {
7484        let _response = self.client.send_query::<
7485            WritableWriteRequest,
7486            fidl::encoding::ResultType<WritableWriteResponse, i32>,
7487        >(
7488            (data,),
7489            0x6a31437832469f82,
7490            fidl::encoding::DynamicFlags::empty(),
7491            ___deadline,
7492        )?;
7493        Ok(_response.map(|x| x.actual_count))
7494    }
7495
7496    pub fn r#describe(&self, ___deadline: zx::MonotonicInstant) -> Result<FileInfo, fidl::Error> {
7497        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, FileInfo>(
7498            (),
7499            0x68b5ac00c62906bc,
7500            fidl::encoding::DynamicFlags::empty(),
7501            ___deadline,
7502        )?;
7503        Ok(_response)
7504    }
7505
7506    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
7507    /// will occur. The seek offset is specific to each file connection.
7508    ///
7509    /// + request `origin` the reference point where `offset` will be based on.
7510    /// + request `offset` the number of bytes to seek.
7511    /// - response `offset_from_start` the adjusted seek offset, from the start
7512    ///   of the file.
7513    ///
7514    /// This method does not require any rights.
7515    pub fn r#seek(
7516        &self,
7517        mut origin: SeekOrigin,
7518        mut offset: i64,
7519        ___deadline: zx::MonotonicInstant,
7520    ) -> Result<FileSeekResult, fidl::Error> {
7521        let _response = self
7522            .client
7523            .send_query::<FileSeekRequest, fidl::encoding::ResultType<FileSeekResponse, i32>>(
7524                (origin, offset),
7525                0x78079168162c5207,
7526                fidl::encoding::DynamicFlags::empty(),
7527                ___deadline,
7528            )?;
7529        Ok(_response.map(|x| x.offset_from_start))
7530    }
7531
7532    /// Reads up to 'count' bytes at the provided offset.
7533    /// Does not affect the seek offset.
7534    ///
7535    /// ## Invariants
7536    ///
7537    /// * The returned `data.length` will never be greater than `count`.
7538    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
7539    ///   the end of file as part of this operation.
7540    /// * If `data.length` is zero while `count` is not, it means that `offset`
7541    ///   is at or past the end of file, and no data can be read.
7542    /// * If `count` is zero, the server should perform all the checks ensuring
7543    ///   read access without actually reading anything, and return an empty
7544    ///   `data` vector.
7545    ///
7546    /// This method requires the [`Rights.READ_BYTES`] right.
7547    ///
7548    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7549    pub fn r#read_at(
7550        &self,
7551        mut count: u64,
7552        mut offset: u64,
7553        ___deadline: zx::MonotonicInstant,
7554    ) -> Result<FileReadAtResult, fidl::Error> {
7555        let _response = self
7556            .client
7557            .send_query::<FileReadAtRequest, fidl::encoding::ResultType<FileReadAtResponse, i32>>(
7558                (count, offset),
7559                0x1607a293a60d723e,
7560                fidl::encoding::DynamicFlags::empty(),
7561                ___deadline,
7562            )?;
7563        Ok(_response.map(|x| x.data))
7564    }
7565
7566    /// Writes data at the provided offset.
7567    /// Does not affect the seek offset.
7568    ///
7569    /// The file size may grow if `offset` plus `data.length` is past the
7570    /// current end of file.
7571    ///
7572    /// + request `data` the byte buffer to write to the file.
7573    /// + request `offset` the offset from start of the file to begin writing.
7574    /// - response `actual_count` the number of bytes written.
7575    ///
7576    /// ## Invariants
7577    ///
7578    /// * The returned `actual_count` will never be greater than `data.length`.
7579    /// * If the server is unable to write all the data due to e.g. not enough
7580    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7581    ///   could be written, an error is returned.
7582    /// * If `data.length` is zero, the server should perform all the checks
7583    ///   ensuring write access without mutating the file, and will return a
7584    ///   successful write of zero bytes.
7585    ///
7586    /// This method requires the [`Rights.WRITE_BYTES`] right.
7587    pub fn r#write_at(
7588        &self,
7589        mut data: &[u8],
7590        mut offset: u64,
7591        ___deadline: zx::MonotonicInstant,
7592    ) -> Result<FileWriteAtResult, fidl::Error> {
7593        let _response = self
7594            .client
7595            .send_query::<FileWriteAtRequest, fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
7596                (data, offset),
7597                0x793eefc0045e792b,
7598                fidl::encoding::DynamicFlags::empty(),
7599                ___deadline,
7600            )?;
7601        Ok(_response.map(|x| x.actual_count))
7602    }
7603
7604    /// Shrinks or grows the file size to 'length' bytes.
7605    ///
7606    /// If file size is reduced by this operation, the extra trailing data'
7607    /// is discarded.
7608    /// If file size is increased by this operation, the extended area appears
7609    /// as if it was zeroed.
7610    ///
7611    /// This method requires the [`Rights.WRITE_BYTES`] right.
7612    pub fn r#resize(
7613        &self,
7614        mut length: u64,
7615        ___deadline: zx::MonotonicInstant,
7616    ) -> Result<FileResizeResult, fidl::Error> {
7617        let _response = self.client.send_query::<
7618            FileResizeRequest,
7619            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7620        >(
7621            (length,),
7622            0x2b80825f0535743a,
7623            fidl::encoding::DynamicFlags::empty(),
7624            ___deadline,
7625        )?;
7626        Ok(_response.map(|x| x))
7627    }
7628
7629    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
7630    /// with the requested access rights.
7631    ///
7632    /// Implementations are not required to implement files backed by VMOs so
7633    /// this request may fail. Additionally, implementations may only support
7634    /// a certain subset of the flags. Clients should be prepared with fallback
7635    /// behavior if this request fails.
7636    ///
7637    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
7638    /// implementation is free to choose the semantics of the returned VMO.
7639    ///
7640    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
7641    /// - response `vmo` the requested [`zx.Handle:VMO`].
7642    /// * error a [`zx.Status`] value indicating the failure.
7643    ///
7644    /// This method requires the following rights:
7645    ///
7646    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
7647    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
7648    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
7649    pub fn r#get_backing_memory(
7650        &self,
7651        mut flags: VmoFlags,
7652        ___deadline: zx::MonotonicInstant,
7653    ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
7654        let _response = self.client.send_query::<
7655            FileGetBackingMemoryRequest,
7656            fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
7657        >(
7658            (flags,),
7659            0xa6a9e654cbf62b,
7660            fidl::encoding::DynamicFlags::empty(),
7661            ___deadline,
7662        )?;
7663        Ok(_response.map(|x| x.vmo))
7664    }
7665
7666    /// Pre-allocate on-disk space for this file.
7667    pub fn r#allocate(
7668        &self,
7669        mut offset: u64,
7670        mut length: u64,
7671        mut mode: AllocateMode,
7672        ___deadline: zx::MonotonicInstant,
7673    ) -> Result<FileAllocateResult, fidl::Error> {
7674        let _response = self.client.send_query::<
7675            FileAllocateRequest,
7676            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7677        >(
7678            (offset, length, mode,),
7679            0x77fa0c330b57fd2e,
7680            fidl::encoding::DynamicFlags::FLEXIBLE,
7681            ___deadline,
7682        )?
7683        .into_result::<FileMarker>("allocate")?;
7684        Ok(_response.map(|x| x))
7685    }
7686
7687    /// Enables verification for the file (permanently) which involves computing a merkle tree for
7688    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
7689    /// captured. Future reads will be verified against the computed merkle tree and writes will be
7690    /// rejected. This method can take some time to complete as it depends on the size of the file.
7691    /// This method can be aborted by closing the connection that this method was issued on.
7692    ///
7693    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7694    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
7695    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
7696    /// Also returns any error that might arise from reading the file, or from flushing the file,
7697    /// such as `ZX_ERR_IO`.
7698    pub fn r#enable_verity(
7699        &self,
7700        mut options: &VerificationOptions,
7701        ___deadline: zx::MonotonicInstant,
7702    ) -> Result<FileEnableVerityResult, fidl::Error> {
7703        let _response = self.client.send_query::<
7704            FileEnableVerityRequest,
7705            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7706        >(
7707            (options,),
7708            0x2c421ec3faaeb8bb,
7709            fidl::encoding::DynamicFlags::FLEXIBLE,
7710            ___deadline,
7711        )?
7712        .into_result::<FileMarker>("enable_verity")?;
7713        Ok(_response.map(|x| x))
7714    }
7715}
7716
7717#[cfg(target_os = "fuchsia")]
7718impl From<FileSynchronousProxy> for zx::Handle {
7719    fn from(value: FileSynchronousProxy) -> Self {
7720        value.into_channel().into()
7721    }
7722}
7723
7724#[cfg(target_os = "fuchsia")]
7725impl From<fidl::Channel> for FileSynchronousProxy {
7726    fn from(value: fidl::Channel) -> Self {
7727        Self::new(value)
7728    }
7729}
7730
7731#[derive(Debug, Clone)]
7732pub struct FileProxy {
7733    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7734}
7735
7736impl fidl::endpoints::Proxy for FileProxy {
7737    type Protocol = FileMarker;
7738
7739    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7740        Self::new(inner)
7741    }
7742
7743    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7744        self.client.into_channel().map_err(|client| Self { client })
7745    }
7746
7747    fn as_channel(&self) -> &::fidl::AsyncChannel {
7748        self.client.as_channel()
7749    }
7750}
7751
7752impl FileProxy {
7753    /// Create a new Proxy for fuchsia.io/File.
7754    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7755        let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7756        Self { client: fidl::client::Client::new(channel, protocol_name) }
7757    }
7758
7759    /// Get a Stream of events from the remote end of the protocol.
7760    ///
7761    /// # Panics
7762    ///
7763    /// Panics if the event stream was already taken.
7764    pub fn take_event_stream(&self) -> FileEventStream {
7765        FileEventStream { event_receiver: self.client.take_event_receiver() }
7766    }
7767
7768    /// Acquires an advisory lock on the underlying file.
7769    ///
7770    /// The lock lasts until either this connection is closed or
7771    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7772    /// explicitly.
7773    ///
7774    /// Advisory locks are purely advisory. They do not prevent actual read or
7775    /// write operations from occurring on the file, either through this
7776    /// connection or through other connections.
7777    ///
7778    /// This method requires the following rights:
7779    ///
7780    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7781    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7782    ///   [`AdvisoryLockType.WRITE`].
7783    ///
7784    /// # Errors
7785    ///
7786    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7787    ///   example, another connection might hold a conflicting lock type.
7788    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7789    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7790    ///   to acquire the given type of lock.
7791    pub fn r#advisory_lock(
7792        &self,
7793        mut request: &AdvisoryLockRequest,
7794    ) -> fidl::client::QueryResponseFut<
7795        AdvisoryLockingAdvisoryLockResult,
7796        fidl::encoding::DefaultFuchsiaResourceDialect,
7797    > {
7798        FileProxyInterface::r#advisory_lock(self, request)
7799    }
7800
7801    /// Creates a link to this this object with name `dst` in the directory represented by
7802    /// `dst_parent_token`.
7803    ///
7804    /// `dst` must be a resolved object name. Including "/" in the string will return
7805    /// `ZX_ERR_INVALID_ARGS`.
7806    ///
7807    /// This method requires the maximal set of rights supported by the filesystem for this object.
7808    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7809    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7810    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7811    /// `ZX_ERR_ACCESS_DENIED`.
7812    ///
7813    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7814    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7815    ///
7816    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7817    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7818    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7819    ///
7820    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7821    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7822    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7823    pub fn r#link_into(
7824        &self,
7825        mut dst_parent_token: fidl::Event,
7826        mut dst: &str,
7827    ) -> fidl::client::QueryResponseFut<
7828        LinkableLinkIntoResult,
7829        fidl::encoding::DefaultFuchsiaResourceDialect,
7830    > {
7831        FileProxyInterface::r#link_into(self, dst_parent_token, dst)
7832    }
7833
7834    pub fn r#clone(
7835        &self,
7836        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7837    ) -> Result<(), fidl::Error> {
7838        FileProxyInterface::r#clone(self, request)
7839    }
7840
7841    /// Terminates the connection.
7842    ///
7843    /// After calling `Close`, the client must not send any other requests.
7844    ///
7845    /// Servers, after sending the status response, should close the connection
7846    /// regardless of status and without sending an epitaph.
7847    ///
7848    /// Closing the client end of the channel should be semantically equivalent
7849    /// to calling `Close` without knowing when the close has completed or its
7850    /// status.
7851    pub fn r#close(
7852        &self,
7853    ) -> fidl::client::QueryResponseFut<
7854        fidl_fuchsia_unknown::CloseableCloseResult,
7855        fidl::encoding::DefaultFuchsiaResourceDialect,
7856    > {
7857        FileProxyInterface::r#close(self)
7858    }
7859
7860    pub fn r#query(
7861        &self,
7862    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
7863    {
7864        FileProxyInterface::r#query(self)
7865    }
7866
7867    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7868    pub fn r#deprecated_clone(
7869        &self,
7870        mut flags: OpenFlags,
7871        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
7872    ) -> Result<(), fidl::Error> {
7873        FileProxyInterface::r#deprecated_clone(self, flags, object)
7874    }
7875
7876    /// Acquires information about the node.
7877    ///
7878    /// This method does not require any rights.
7879    pub fn r#get_attr(
7880        &self,
7881    ) -> fidl::client::QueryResponseFut<
7882        (i32, NodeAttributes),
7883        fidl::encoding::DefaultFuchsiaResourceDialect,
7884    > {
7885        FileProxyInterface::r#get_attr(self)
7886    }
7887
7888    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7889    pub fn r#deprecated_set_attr(
7890        &self,
7891        mut flags: NodeAttributeFlags,
7892        mut attributes: &NodeAttributes,
7893    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
7894        FileProxyInterface::r#deprecated_set_attr(self, flags, attributes)
7895    }
7896
7897    /// [DEPRECATED - Use new GetFlags method instead.]
7898    pub fn r#deprecated_get_flags(
7899        &self,
7900    ) -> fidl::client::QueryResponseFut<
7901        (i32, OpenFlags),
7902        fidl::encoding::DefaultFuchsiaResourceDialect,
7903    > {
7904        FileProxyInterface::r#deprecated_get_flags(self)
7905    }
7906
7907    /// [DEPRECATED - Use new SetFlags method instead.]
7908    pub fn r#deprecated_set_flags(
7909        &self,
7910        mut flags: OpenFlags,
7911    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
7912        FileProxyInterface::r#deprecated_set_flags(self, flags)
7913    }
7914
7915    /// Queries the flags that apply to this node after it has been opened/created. This method does
7916    /// not require any rights.
7917    ///
7918    /// Note that the final set of flags that apply to the connection may differ from those
7919    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
7920    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
7921    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
7922    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
7923    pub fn r#get_flags(
7924        &self,
7925    ) -> fidl::client::QueryResponseFut<
7926        NodeGetFlagsResult,
7927        fidl::encoding::DefaultFuchsiaResourceDialect,
7928    > {
7929        FileProxyInterface::r#get_flags(self)
7930    }
7931
7932    /// Sets the flags that apply to this node after it has been opened. This method does not
7933    /// require any rights.
7934    ///
7935    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
7936    /// clear append mode.
7937    ///
7938    /// Errors:
7939    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
7940    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
7941    pub fn r#set_flags(
7942        &self,
7943        mut flags: Flags,
7944    ) -> fidl::client::QueryResponseFut<
7945        NodeSetFlagsResult,
7946        fidl::encoding::DefaultFuchsiaResourceDialect,
7947    > {
7948        FileProxyInterface::r#set_flags(self, flags)
7949    }
7950
7951    /// Query the filesystem for filesystem-specific information.
7952    pub fn r#query_filesystem(
7953        &self,
7954    ) -> fidl::client::QueryResponseFut<
7955        (i32, Option<Box<FilesystemInfo>>),
7956        fidl::encoding::DefaultFuchsiaResourceDialect,
7957    > {
7958        FileProxyInterface::r#query_filesystem(self)
7959    }
7960
7961    /// Acquires information about the node.
7962    ///
7963    /// The attributes of a node should be stable, independent of the
7964    /// specific protocol used to access it.
7965    ///
7966    /// If a particular attribute is not applicable or not supported,
7967    /// filesystems should leave the corresponding field absent.
7968    ///
7969    /// + `query` a bit-mask specifying which attributes to fetch. The server
7970    ///   should not return more than necessary.
7971    /// - `attributes` the returned attributes.
7972    ///
7973    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7974    pub fn r#get_attributes(
7975        &self,
7976        mut query: NodeAttributesQuery,
7977    ) -> fidl::client::QueryResponseFut<
7978        NodeGetAttributesResult,
7979        fidl::encoding::DefaultFuchsiaResourceDialect,
7980    > {
7981        FileProxyInterface::r#get_attributes(self, query)
7982    }
7983
7984    /// Updates information about the node.
7985    ///
7986    /// + `attributes` the presence of a table field in `attributes` indicates
7987    /// the intent to update the corresponding attribute.
7988    ///
7989    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
7990    ///
7991    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7992    pub fn r#update_attributes(
7993        &self,
7994        mut payload: &MutableNodeAttributes,
7995    ) -> fidl::client::QueryResponseFut<
7996        NodeUpdateAttributesResult,
7997        fidl::encoding::DefaultFuchsiaResourceDialect,
7998    > {
7999        FileProxyInterface::r#update_attributes(self, payload)
8000    }
8001
8002    /// Synchronizes updates to the node to the underlying media, if it exists.
8003    ///
8004    /// This method will return when the filesystem server has flushed the
8005    /// relevant updates to the underlying media, but does not guarantee the
8006    /// underlying media has persisted the information, nor that any information
8007    /// is committed to hardware. Clients may use `Sync` to ensure ordering
8008    /// between operations.
8009    ///
8010    /// This method does not require any rights.
8011    pub fn r#sync(
8012        &self,
8013    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8014    {
8015        FileProxyInterface::r#sync(self)
8016    }
8017
8018    /// Creates an iterator over all the extended attribute names associated
8019    /// with this node. If an error occurs it is returned as an epitaph on the
8020    /// iterator request channel, and then the channel is closed.
8021    ///
8022    /// GetExtendedAttributes can be used with any of these names to retrieve
8023    /// the associated value.
8024    ///
8025    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8026    pub fn r#list_extended_attributes(
8027        &self,
8028        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8029    ) -> Result<(), fidl::Error> {
8030        FileProxyInterface::r#list_extended_attributes(self, iterator)
8031    }
8032
8033    /// Get the value associated with the given attribute `name` for this node.
8034    ///
8035    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
8036    /// particular structure is imposed on them.
8037    ///
8038    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8039    pub fn r#get_extended_attribute(
8040        &self,
8041        mut name: &[u8],
8042    ) -> fidl::client::QueryResponseFut<
8043        NodeGetExtendedAttributeResult,
8044        fidl::encoding::DefaultFuchsiaResourceDialect,
8045    > {
8046        FileProxyInterface::r#get_extended_attribute(self, name)
8047    }
8048
8049    /// Set the value for the given attribute `name` to `value` for this node.
8050    ///
8051    /// The attribute name may exist, in which case the attribute is updated.
8052    /// If the attribute doesn't exist, it is created. The name should have no
8053    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
8054    ///
8055    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8056    pub fn r#set_extended_attribute(
8057        &self,
8058        mut name: &[u8],
8059        mut value: ExtendedAttributeValue,
8060        mut mode: SetExtendedAttributeMode,
8061    ) -> fidl::client::QueryResponseFut<
8062        NodeSetExtendedAttributeResult,
8063        fidl::encoding::DefaultFuchsiaResourceDialect,
8064    > {
8065        FileProxyInterface::r#set_extended_attribute(self, name, value, mode)
8066    }
8067
8068    /// Remove the specified extended attribute.
8069    ///
8070    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
8071    ///
8072    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8073    pub fn r#remove_extended_attribute(
8074        &self,
8075        mut name: &[u8],
8076    ) -> fidl::client::QueryResponseFut<
8077        NodeRemoveExtendedAttributeResult,
8078        fidl::encoding::DefaultFuchsiaResourceDialect,
8079    > {
8080        FileProxyInterface::r#remove_extended_attribute(self, name)
8081    }
8082
8083    /// Reads up to 'count' bytes at the seek offset.
8084    /// The seek offset is moved forward by the number of bytes read.
8085    ///
8086    /// ## Invariants
8087    ///
8088    /// * The returned `data.length` will never be greater than `count`.
8089    /// * If `data.length` is less than `count`, it means that the seek offset
8090    ///   has reached the end of file as part of this operation.
8091    /// * If `data.length` is zero while `count` is not, it means that the
8092    ///   seek offset is already at or beyond the end of file, and no data could
8093    ///   be read.
8094    /// * If `count` is zero, the server should perform all the checks ensuring
8095    ///   read access without actually read anything, and return an empty
8096    ///   `data` vector.
8097    ///
8098    /// This method requires the [`Rights.READ_BYTES`] right.
8099    ///
8100    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8101    pub fn r#read(
8102        &self,
8103        mut count: u64,
8104    ) -> fidl::client::QueryResponseFut<
8105        ReadableReadResult,
8106        fidl::encoding::DefaultFuchsiaResourceDialect,
8107    > {
8108        FileProxyInterface::r#read(self, count)
8109    }
8110
8111    /// Writes data at the seek offset.
8112    /// The seek offset is moved forward by the number of bytes written.
8113    /// If the file is in append mode, the seek offset is first set to the end
8114    /// of the file, followed by the write, in one atomic step.
8115    ///
8116    /// The file size may grow if the seek offset plus `data.length` is beyond
8117    /// the current end of file.
8118    ///
8119    /// + request `data` the byte buffer to write to the file.
8120    /// - response `actual_count` the number of bytes written.
8121    ///
8122    /// ## Invariants
8123    ///
8124    /// * The returned `actual_count` will never be greater than `data.length`.
8125    /// * If the server is unable to write all the data due to e.g. not enough
8126    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8127    ///   could be written, an error is returned.
8128    /// * If `data.length` is zero, the server should perform all the checks
8129    ///   ensuring write access without mutating the file and return a
8130    ///   successful write of zero bytes.  The seek offset is still updated if
8131    ///   in append mode.
8132    ///
8133    /// This method requires the [`Rights.WRITE_BYTES`] right.
8134    pub fn r#write(
8135        &self,
8136        mut data: &[u8],
8137    ) -> fidl::client::QueryResponseFut<
8138        WritableWriteResult,
8139        fidl::encoding::DefaultFuchsiaResourceDialect,
8140    > {
8141        FileProxyInterface::r#write(self, data)
8142    }
8143
8144    pub fn r#describe(
8145        &self,
8146    ) -> fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
8147    {
8148        FileProxyInterface::r#describe(self)
8149    }
8150
8151    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
8152    /// will occur. The seek offset is specific to each file connection.
8153    ///
8154    /// + request `origin` the reference point where `offset` will be based on.
8155    /// + request `offset` the number of bytes to seek.
8156    /// - response `offset_from_start` the adjusted seek offset, from the start
8157    ///   of the file.
8158    ///
8159    /// This method does not require any rights.
8160    pub fn r#seek(
8161        &self,
8162        mut origin: SeekOrigin,
8163        mut offset: i64,
8164    ) -> fidl::client::QueryResponseFut<FileSeekResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8165    {
8166        FileProxyInterface::r#seek(self, origin, offset)
8167    }
8168
8169    /// Reads up to 'count' bytes at the provided offset.
8170    /// Does not affect the seek offset.
8171    ///
8172    /// ## Invariants
8173    ///
8174    /// * The returned `data.length` will never be greater than `count`.
8175    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
8176    ///   the end of file as part of this operation.
8177    /// * If `data.length` is zero while `count` is not, it means that `offset`
8178    ///   is at or past the end of file, and no data can be read.
8179    /// * If `count` is zero, the server should perform all the checks ensuring
8180    ///   read access without actually reading anything, and return an empty
8181    ///   `data` vector.
8182    ///
8183    /// This method requires the [`Rights.READ_BYTES`] right.
8184    ///
8185    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8186    pub fn r#read_at(
8187        &self,
8188        mut count: u64,
8189        mut offset: u64,
8190    ) -> fidl::client::QueryResponseFut<
8191        FileReadAtResult,
8192        fidl::encoding::DefaultFuchsiaResourceDialect,
8193    > {
8194        FileProxyInterface::r#read_at(self, count, offset)
8195    }
8196
8197    /// Writes data at the provided offset.
8198    /// Does not affect the seek offset.
8199    ///
8200    /// The file size may grow if `offset` plus `data.length` is past the
8201    /// current end of file.
8202    ///
8203    /// + request `data` the byte buffer to write to the file.
8204    /// + request `offset` the offset from start of the file to begin writing.
8205    /// - response `actual_count` the number of bytes written.
8206    ///
8207    /// ## Invariants
8208    ///
8209    /// * The returned `actual_count` will never be greater than `data.length`.
8210    /// * If the server is unable to write all the data due to e.g. not enough
8211    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8212    ///   could be written, an error is returned.
8213    /// * If `data.length` is zero, the server should perform all the checks
8214    ///   ensuring write access without mutating the file, and will return a
8215    ///   successful write of zero bytes.
8216    ///
8217    /// This method requires the [`Rights.WRITE_BYTES`] right.
8218    pub fn r#write_at(
8219        &self,
8220        mut data: &[u8],
8221        mut offset: u64,
8222    ) -> fidl::client::QueryResponseFut<
8223        FileWriteAtResult,
8224        fidl::encoding::DefaultFuchsiaResourceDialect,
8225    > {
8226        FileProxyInterface::r#write_at(self, data, offset)
8227    }
8228
8229    /// Shrinks or grows the file size to 'length' bytes.
8230    ///
8231    /// If file size is reduced by this operation, the extra trailing data'
8232    /// is discarded.
8233    /// If file size is increased by this operation, the extended area appears
8234    /// as if it was zeroed.
8235    ///
8236    /// This method requires the [`Rights.WRITE_BYTES`] right.
8237    pub fn r#resize(
8238        &self,
8239        mut length: u64,
8240    ) -> fidl::client::QueryResponseFut<
8241        FileResizeResult,
8242        fidl::encoding::DefaultFuchsiaResourceDialect,
8243    > {
8244        FileProxyInterface::r#resize(self, length)
8245    }
8246
8247    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
8248    /// with the requested access rights.
8249    ///
8250    /// Implementations are not required to implement files backed by VMOs so
8251    /// this request may fail. Additionally, implementations may only support
8252    /// a certain subset of the flags. Clients should be prepared with fallback
8253    /// behavior if this request fails.
8254    ///
8255    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
8256    /// implementation is free to choose the semantics of the returned VMO.
8257    ///
8258    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
8259    /// - response `vmo` the requested [`zx.Handle:VMO`].
8260    /// * error a [`zx.Status`] value indicating the failure.
8261    ///
8262    /// This method requires the following rights:
8263    ///
8264    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
8265    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
8266    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
8267    pub fn r#get_backing_memory(
8268        &self,
8269        mut flags: VmoFlags,
8270    ) -> fidl::client::QueryResponseFut<
8271        FileGetBackingMemoryResult,
8272        fidl::encoding::DefaultFuchsiaResourceDialect,
8273    > {
8274        FileProxyInterface::r#get_backing_memory(self, flags)
8275    }
8276
8277    /// Pre-allocate on-disk space for this file.
8278    pub fn r#allocate(
8279        &self,
8280        mut offset: u64,
8281        mut length: u64,
8282        mut mode: AllocateMode,
8283    ) -> fidl::client::QueryResponseFut<
8284        FileAllocateResult,
8285        fidl::encoding::DefaultFuchsiaResourceDialect,
8286    > {
8287        FileProxyInterface::r#allocate(self, offset, length, mode)
8288    }
8289
8290    /// Enables verification for the file (permanently) which involves computing a merkle tree for
8291    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
8292    /// captured. Future reads will be verified against the computed merkle tree and writes will be
8293    /// rejected. This method can take some time to complete as it depends on the size of the file.
8294    /// This method can be aborted by closing the connection that this method was issued on.
8295    ///
8296    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8297    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
8298    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
8299    /// Also returns any error that might arise from reading the file, or from flushing the file,
8300    /// such as `ZX_ERR_IO`.
8301    pub fn r#enable_verity(
8302        &self,
8303        mut options: &VerificationOptions,
8304    ) -> fidl::client::QueryResponseFut<
8305        FileEnableVerityResult,
8306        fidl::encoding::DefaultFuchsiaResourceDialect,
8307    > {
8308        FileProxyInterface::r#enable_verity(self, options)
8309    }
8310}
8311
8312impl FileProxyInterface for FileProxy {
8313    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
8314        AdvisoryLockingAdvisoryLockResult,
8315        fidl::encoding::DefaultFuchsiaResourceDialect,
8316    >;
8317    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
8318        fn _decode(
8319            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8320        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
8321            let _response = fidl::client::decode_transaction_body::<
8322                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8323                fidl::encoding::DefaultFuchsiaResourceDialect,
8324                0x6ee9c0ad53ec87aa,
8325            >(_buf?)?;
8326            Ok(_response.map(|x| x))
8327        }
8328        self.client.send_query_and_decode::<
8329            AdvisoryLockingAdvisoryLockRequest,
8330            AdvisoryLockingAdvisoryLockResult,
8331        >(
8332            (request,),
8333            0x6ee9c0ad53ec87aa,
8334            fidl::encoding::DynamicFlags::empty(),
8335            _decode,
8336        )
8337    }
8338
8339    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
8340        LinkableLinkIntoResult,
8341        fidl::encoding::DefaultFuchsiaResourceDialect,
8342    >;
8343    fn r#link_into(
8344        &self,
8345        mut dst_parent_token: fidl::Event,
8346        mut dst: &str,
8347    ) -> Self::LinkIntoResponseFut {
8348        fn _decode(
8349            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8350        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
8351            let _response = fidl::client::decode_transaction_body::<
8352                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8353                fidl::encoding::DefaultFuchsiaResourceDialect,
8354                0x54f3949246a03e74,
8355            >(_buf?)?;
8356            Ok(_response.map(|x| x))
8357        }
8358        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
8359            (dst_parent_token, dst),
8360            0x54f3949246a03e74,
8361            fidl::encoding::DynamicFlags::empty(),
8362            _decode,
8363        )
8364    }
8365
8366    fn r#clone(
8367        &self,
8368        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8369    ) -> Result<(), fidl::Error> {
8370        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
8371            (request,),
8372            0x20d8a7aba2168a79,
8373            fidl::encoding::DynamicFlags::empty(),
8374        )
8375    }
8376
8377    type CloseResponseFut = fidl::client::QueryResponseFut<
8378        fidl_fuchsia_unknown::CloseableCloseResult,
8379        fidl::encoding::DefaultFuchsiaResourceDialect,
8380    >;
8381    fn r#close(&self) -> Self::CloseResponseFut {
8382        fn _decode(
8383            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8384        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
8385            let _response = fidl::client::decode_transaction_body::<
8386                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8387                fidl::encoding::DefaultFuchsiaResourceDialect,
8388                0x5ac5d459ad7f657e,
8389            >(_buf?)?;
8390            Ok(_response.map(|x| x))
8391        }
8392        self.client.send_query_and_decode::<
8393            fidl::encoding::EmptyPayload,
8394            fidl_fuchsia_unknown::CloseableCloseResult,
8395        >(
8396            (),
8397            0x5ac5d459ad7f657e,
8398            fidl::encoding::DynamicFlags::empty(),
8399            _decode,
8400        )
8401    }
8402
8403    type QueryResponseFut =
8404        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
8405    fn r#query(&self) -> Self::QueryResponseFut {
8406        fn _decode(
8407            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8408        ) -> Result<Vec<u8>, fidl::Error> {
8409            let _response = fidl::client::decode_transaction_body::<
8410                fidl_fuchsia_unknown::QueryableQueryResponse,
8411                fidl::encoding::DefaultFuchsiaResourceDialect,
8412                0x2658edee9decfc06,
8413            >(_buf?)?;
8414            Ok(_response.protocol)
8415        }
8416        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
8417            (),
8418            0x2658edee9decfc06,
8419            fidl::encoding::DynamicFlags::empty(),
8420            _decode,
8421        )
8422    }
8423
8424    fn r#deprecated_clone(
8425        &self,
8426        mut flags: OpenFlags,
8427        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
8428    ) -> Result<(), fidl::Error> {
8429        self.client.send::<NodeDeprecatedCloneRequest>(
8430            (flags, object),
8431            0x5a61678f293ce16f,
8432            fidl::encoding::DynamicFlags::FLEXIBLE,
8433        )
8434    }
8435
8436    type GetAttrResponseFut = fidl::client::QueryResponseFut<
8437        (i32, NodeAttributes),
8438        fidl::encoding::DefaultFuchsiaResourceDialect,
8439    >;
8440    fn r#get_attr(&self) -> Self::GetAttrResponseFut {
8441        fn _decode(
8442            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8443        ) -> Result<(i32, NodeAttributes), fidl::Error> {
8444            let _response = fidl::client::decode_transaction_body::<
8445                NodeGetAttrResponse,
8446                fidl::encoding::DefaultFuchsiaResourceDialect,
8447                0x78985e216314dafd,
8448            >(_buf?)?;
8449            Ok((_response.s, _response.attributes))
8450        }
8451        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
8452            (),
8453            0x78985e216314dafd,
8454            fidl::encoding::DynamicFlags::empty(),
8455            _decode,
8456        )
8457    }
8458
8459    type DeprecatedSetAttrResponseFut =
8460        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8461    fn r#deprecated_set_attr(
8462        &self,
8463        mut flags: NodeAttributeFlags,
8464        mut attributes: &NodeAttributes,
8465    ) -> Self::DeprecatedSetAttrResponseFut {
8466        fn _decode(
8467            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8468        ) -> Result<i32, fidl::Error> {
8469            let _response = fidl::client::decode_transaction_body::<
8470                NodeDeprecatedSetAttrResponse,
8471                fidl::encoding::DefaultFuchsiaResourceDialect,
8472                0x4186c0f40d938f46,
8473            >(_buf?)?;
8474            Ok(_response.s)
8475        }
8476        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
8477            (flags, attributes),
8478            0x4186c0f40d938f46,
8479            fidl::encoding::DynamicFlags::empty(),
8480            _decode,
8481        )
8482    }
8483
8484    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
8485        (i32, OpenFlags),
8486        fidl::encoding::DefaultFuchsiaResourceDialect,
8487    >;
8488    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
8489        fn _decode(
8490            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8491        ) -> Result<(i32, OpenFlags), fidl::Error> {
8492            let _response = fidl::client::decode_transaction_body::<
8493                NodeDeprecatedGetFlagsResponse,
8494                fidl::encoding::DefaultFuchsiaResourceDialect,
8495                0x5b88fffb8eda3aa1,
8496            >(_buf?)?;
8497            Ok((_response.s, _response.flags))
8498        }
8499        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
8500            (),
8501            0x5b88fffb8eda3aa1,
8502            fidl::encoding::DynamicFlags::empty(),
8503            _decode,
8504        )
8505    }
8506
8507    type DeprecatedSetFlagsResponseFut =
8508        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8509    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
8510        fn _decode(
8511            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8512        ) -> Result<i32, fidl::Error> {
8513            let _response = fidl::client::decode_transaction_body::<
8514                NodeDeprecatedSetFlagsResponse,
8515                fidl::encoding::DefaultFuchsiaResourceDialect,
8516                0x5295b76c71fde733,
8517            >(_buf?)?;
8518            Ok(_response.s)
8519        }
8520        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
8521            (flags,),
8522            0x5295b76c71fde733,
8523            fidl::encoding::DynamicFlags::empty(),
8524            _decode,
8525        )
8526    }
8527
8528    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
8529        NodeGetFlagsResult,
8530        fidl::encoding::DefaultFuchsiaResourceDialect,
8531    >;
8532    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
8533        fn _decode(
8534            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8535        ) -> Result<NodeGetFlagsResult, fidl::Error> {
8536            let _response = fidl::client::decode_transaction_body::<
8537                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
8538                fidl::encoding::DefaultFuchsiaResourceDialect,
8539                0x176eb318f64ec23,
8540            >(_buf?)?
8541            .into_result::<FileMarker>("get_flags")?;
8542            Ok(_response.map(|x| x.flags))
8543        }
8544        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
8545            (),
8546            0x176eb318f64ec23,
8547            fidl::encoding::DynamicFlags::FLEXIBLE,
8548            _decode,
8549        )
8550    }
8551
8552    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
8553        NodeSetFlagsResult,
8554        fidl::encoding::DefaultFuchsiaResourceDialect,
8555    >;
8556    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
8557        fn _decode(
8558            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8559        ) -> Result<NodeSetFlagsResult, fidl::Error> {
8560            let _response = fidl::client::decode_transaction_body::<
8561                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
8562                fidl::encoding::DefaultFuchsiaResourceDialect,
8563                0x55a8028685791ea8,
8564            >(_buf?)?
8565            .into_result::<FileMarker>("set_flags")?;
8566            Ok(_response.map(|x| x))
8567        }
8568        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
8569            (flags,),
8570            0x55a8028685791ea8,
8571            fidl::encoding::DynamicFlags::FLEXIBLE,
8572            _decode,
8573        )
8574    }
8575
8576    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
8577        (i32, Option<Box<FilesystemInfo>>),
8578        fidl::encoding::DefaultFuchsiaResourceDialect,
8579    >;
8580    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
8581        fn _decode(
8582            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8583        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
8584            let _response = fidl::client::decode_transaction_body::<
8585                NodeQueryFilesystemResponse,
8586                fidl::encoding::DefaultFuchsiaResourceDialect,
8587                0x6f344a1c6b0a0610,
8588            >(_buf?)?;
8589            Ok((_response.s, _response.info))
8590        }
8591        self.client.send_query_and_decode::<
8592            fidl::encoding::EmptyPayload,
8593            (i32, Option<Box<FilesystemInfo>>),
8594        >(
8595            (),
8596            0x6f344a1c6b0a0610,
8597            fidl::encoding::DynamicFlags::empty(),
8598            _decode,
8599        )
8600    }
8601
8602    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
8603        NodeGetAttributesResult,
8604        fidl::encoding::DefaultFuchsiaResourceDialect,
8605    >;
8606    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
8607        fn _decode(
8608            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8609        ) -> Result<NodeGetAttributesResult, fidl::Error> {
8610            let _response = fidl::client::decode_transaction_body::<
8611                fidl::encoding::ResultType<NodeAttributes2, i32>,
8612                fidl::encoding::DefaultFuchsiaResourceDialect,
8613                0x3d4396a638ea053b,
8614            >(_buf?)?;
8615            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
8616        }
8617        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
8618            (query,),
8619            0x3d4396a638ea053b,
8620            fidl::encoding::DynamicFlags::empty(),
8621            _decode,
8622        )
8623    }
8624
8625    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
8626        NodeUpdateAttributesResult,
8627        fidl::encoding::DefaultFuchsiaResourceDialect,
8628    >;
8629    fn r#update_attributes(
8630        &self,
8631        mut payload: &MutableNodeAttributes,
8632    ) -> Self::UpdateAttributesResponseFut {
8633        fn _decode(
8634            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8635        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
8636            let _response = fidl::client::decode_transaction_body::<
8637                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8638                fidl::encoding::DefaultFuchsiaResourceDialect,
8639                0x3308c1da5a89bf08,
8640            >(_buf?)?;
8641            Ok(_response.map(|x| x))
8642        }
8643        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
8644            payload,
8645            0x3308c1da5a89bf08,
8646            fidl::encoding::DynamicFlags::empty(),
8647            _decode,
8648        )
8649    }
8650
8651    type SyncResponseFut = fidl::client::QueryResponseFut<
8652        NodeSyncResult,
8653        fidl::encoding::DefaultFuchsiaResourceDialect,
8654    >;
8655    fn r#sync(&self) -> Self::SyncResponseFut {
8656        fn _decode(
8657            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8658        ) -> Result<NodeSyncResult, fidl::Error> {
8659            let _response = fidl::client::decode_transaction_body::<
8660                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8661                fidl::encoding::DefaultFuchsiaResourceDialect,
8662                0x2c5c27ca0ab5dc49,
8663            >(_buf?)?;
8664            Ok(_response.map(|x| x))
8665        }
8666        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
8667            (),
8668            0x2c5c27ca0ab5dc49,
8669            fidl::encoding::DynamicFlags::empty(),
8670            _decode,
8671        )
8672    }
8673
8674    fn r#list_extended_attributes(
8675        &self,
8676        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8677    ) -> Result<(), fidl::Error> {
8678        self.client.send::<NodeListExtendedAttributesRequest>(
8679            (iterator,),
8680            0x4b61033de007fcd0,
8681            fidl::encoding::DynamicFlags::empty(),
8682        )
8683    }
8684
8685    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8686        NodeGetExtendedAttributeResult,
8687        fidl::encoding::DefaultFuchsiaResourceDialect,
8688    >;
8689    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
8690        fn _decode(
8691            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8692        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
8693            let _response = fidl::client::decode_transaction_body::<
8694                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
8695                fidl::encoding::DefaultFuchsiaResourceDialect,
8696                0x45ffa3ccfdeb76db,
8697            >(_buf?)?;
8698            Ok(_response.map(|x| x))
8699        }
8700        self.client.send_query_and_decode::<
8701            NodeGetExtendedAttributeRequest,
8702            NodeGetExtendedAttributeResult,
8703        >(
8704            (name,),
8705            0x45ffa3ccfdeb76db,
8706            fidl::encoding::DynamicFlags::empty(),
8707            _decode,
8708        )
8709    }
8710
8711    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8712        NodeSetExtendedAttributeResult,
8713        fidl::encoding::DefaultFuchsiaResourceDialect,
8714    >;
8715    fn r#set_extended_attribute(
8716        &self,
8717        mut name: &[u8],
8718        mut value: ExtendedAttributeValue,
8719        mut mode: SetExtendedAttributeMode,
8720    ) -> Self::SetExtendedAttributeResponseFut {
8721        fn _decode(
8722            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8723        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
8724            let _response = fidl::client::decode_transaction_body::<
8725                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8726                fidl::encoding::DefaultFuchsiaResourceDialect,
8727                0x4a951362f681f23c,
8728            >(_buf?)?;
8729            Ok(_response.map(|x| x))
8730        }
8731        self.client.send_query_and_decode::<
8732            NodeSetExtendedAttributeRequest,
8733            NodeSetExtendedAttributeResult,
8734        >(
8735            (name, &mut value, mode,),
8736            0x4a951362f681f23c,
8737            fidl::encoding::DynamicFlags::empty(),
8738            _decode,
8739        )
8740    }
8741
8742    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8743        NodeRemoveExtendedAttributeResult,
8744        fidl::encoding::DefaultFuchsiaResourceDialect,
8745    >;
8746    fn r#remove_extended_attribute(
8747        &self,
8748        mut name: &[u8],
8749    ) -> Self::RemoveExtendedAttributeResponseFut {
8750        fn _decode(
8751            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8752        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
8753            let _response = fidl::client::decode_transaction_body::<
8754                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8755                fidl::encoding::DefaultFuchsiaResourceDialect,
8756                0x7a0b9f3a9bf9032d,
8757            >(_buf?)?;
8758            Ok(_response.map(|x| x))
8759        }
8760        self.client.send_query_and_decode::<
8761            NodeRemoveExtendedAttributeRequest,
8762            NodeRemoveExtendedAttributeResult,
8763        >(
8764            (name,),
8765            0x7a0b9f3a9bf9032d,
8766            fidl::encoding::DynamicFlags::empty(),
8767            _decode,
8768        )
8769    }
8770
8771    type ReadResponseFut = fidl::client::QueryResponseFut<
8772        ReadableReadResult,
8773        fidl::encoding::DefaultFuchsiaResourceDialect,
8774    >;
8775    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
8776        fn _decode(
8777            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8778        ) -> Result<ReadableReadResult, fidl::Error> {
8779            let _response = fidl::client::decode_transaction_body::<
8780                fidl::encoding::ResultType<ReadableReadResponse, i32>,
8781                fidl::encoding::DefaultFuchsiaResourceDialect,
8782                0x57e419a298c8ede,
8783            >(_buf?)?;
8784            Ok(_response.map(|x| x.data))
8785        }
8786        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
8787            (count,),
8788            0x57e419a298c8ede,
8789            fidl::encoding::DynamicFlags::empty(),
8790            _decode,
8791        )
8792    }
8793
8794    type WriteResponseFut = fidl::client::QueryResponseFut<
8795        WritableWriteResult,
8796        fidl::encoding::DefaultFuchsiaResourceDialect,
8797    >;
8798    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
8799        fn _decode(
8800            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8801        ) -> Result<WritableWriteResult, fidl::Error> {
8802            let _response = fidl::client::decode_transaction_body::<
8803                fidl::encoding::ResultType<WritableWriteResponse, i32>,
8804                fidl::encoding::DefaultFuchsiaResourceDialect,
8805                0x6a31437832469f82,
8806            >(_buf?)?;
8807            Ok(_response.map(|x| x.actual_count))
8808        }
8809        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
8810            (data,),
8811            0x6a31437832469f82,
8812            fidl::encoding::DynamicFlags::empty(),
8813            _decode,
8814        )
8815    }
8816
8817    type DescribeResponseFut =
8818        fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
8819    fn r#describe(&self) -> Self::DescribeResponseFut {
8820        fn _decode(
8821            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8822        ) -> Result<FileInfo, fidl::Error> {
8823            let _response = fidl::client::decode_transaction_body::<
8824                FileInfo,
8825                fidl::encoding::DefaultFuchsiaResourceDialect,
8826                0x68b5ac00c62906bc,
8827            >(_buf?)?;
8828            Ok(_response)
8829        }
8830        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FileInfo>(
8831            (),
8832            0x68b5ac00c62906bc,
8833            fidl::encoding::DynamicFlags::empty(),
8834            _decode,
8835        )
8836    }
8837
8838    type SeekResponseFut = fidl::client::QueryResponseFut<
8839        FileSeekResult,
8840        fidl::encoding::DefaultFuchsiaResourceDialect,
8841    >;
8842    fn r#seek(&self, mut origin: SeekOrigin, mut offset: i64) -> Self::SeekResponseFut {
8843        fn _decode(
8844            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8845        ) -> Result<FileSeekResult, fidl::Error> {
8846            let _response = fidl::client::decode_transaction_body::<
8847                fidl::encoding::ResultType<FileSeekResponse, i32>,
8848                fidl::encoding::DefaultFuchsiaResourceDialect,
8849                0x78079168162c5207,
8850            >(_buf?)?;
8851            Ok(_response.map(|x| x.offset_from_start))
8852        }
8853        self.client.send_query_and_decode::<FileSeekRequest, FileSeekResult>(
8854            (origin, offset),
8855            0x78079168162c5207,
8856            fidl::encoding::DynamicFlags::empty(),
8857            _decode,
8858        )
8859    }
8860
8861    type ReadAtResponseFut = fidl::client::QueryResponseFut<
8862        FileReadAtResult,
8863        fidl::encoding::DefaultFuchsiaResourceDialect,
8864    >;
8865    fn r#read_at(&self, mut count: u64, mut offset: u64) -> Self::ReadAtResponseFut {
8866        fn _decode(
8867            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8868        ) -> Result<FileReadAtResult, fidl::Error> {
8869            let _response = fidl::client::decode_transaction_body::<
8870                fidl::encoding::ResultType<FileReadAtResponse, i32>,
8871                fidl::encoding::DefaultFuchsiaResourceDialect,
8872                0x1607a293a60d723e,
8873            >(_buf?)?;
8874            Ok(_response.map(|x| x.data))
8875        }
8876        self.client.send_query_and_decode::<FileReadAtRequest, FileReadAtResult>(
8877            (count, offset),
8878            0x1607a293a60d723e,
8879            fidl::encoding::DynamicFlags::empty(),
8880            _decode,
8881        )
8882    }
8883
8884    type WriteAtResponseFut = fidl::client::QueryResponseFut<
8885        FileWriteAtResult,
8886        fidl::encoding::DefaultFuchsiaResourceDialect,
8887    >;
8888    fn r#write_at(&self, mut data: &[u8], mut offset: u64) -> Self::WriteAtResponseFut {
8889        fn _decode(
8890            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8891        ) -> Result<FileWriteAtResult, fidl::Error> {
8892            let _response = fidl::client::decode_transaction_body::<
8893                fidl::encoding::ResultType<FileWriteAtResponse, i32>,
8894                fidl::encoding::DefaultFuchsiaResourceDialect,
8895                0x793eefc0045e792b,
8896            >(_buf?)?;
8897            Ok(_response.map(|x| x.actual_count))
8898        }
8899        self.client.send_query_and_decode::<FileWriteAtRequest, FileWriteAtResult>(
8900            (data, offset),
8901            0x793eefc0045e792b,
8902            fidl::encoding::DynamicFlags::empty(),
8903            _decode,
8904        )
8905    }
8906
8907    type ResizeResponseFut = fidl::client::QueryResponseFut<
8908        FileResizeResult,
8909        fidl::encoding::DefaultFuchsiaResourceDialect,
8910    >;
8911    fn r#resize(&self, mut length: u64) -> Self::ResizeResponseFut {
8912        fn _decode(
8913            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8914        ) -> Result<FileResizeResult, fidl::Error> {
8915            let _response = fidl::client::decode_transaction_body::<
8916                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8917                fidl::encoding::DefaultFuchsiaResourceDialect,
8918                0x2b80825f0535743a,
8919            >(_buf?)?;
8920            Ok(_response.map(|x| x))
8921        }
8922        self.client.send_query_and_decode::<FileResizeRequest, FileResizeResult>(
8923            (length,),
8924            0x2b80825f0535743a,
8925            fidl::encoding::DynamicFlags::empty(),
8926            _decode,
8927        )
8928    }
8929
8930    type GetBackingMemoryResponseFut = fidl::client::QueryResponseFut<
8931        FileGetBackingMemoryResult,
8932        fidl::encoding::DefaultFuchsiaResourceDialect,
8933    >;
8934    fn r#get_backing_memory(&self, mut flags: VmoFlags) -> Self::GetBackingMemoryResponseFut {
8935        fn _decode(
8936            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8937        ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
8938            let _response = fidl::client::decode_transaction_body::<
8939                fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
8940                fidl::encoding::DefaultFuchsiaResourceDialect,
8941                0xa6a9e654cbf62b,
8942            >(_buf?)?;
8943            Ok(_response.map(|x| x.vmo))
8944        }
8945        self.client
8946            .send_query_and_decode::<FileGetBackingMemoryRequest, FileGetBackingMemoryResult>(
8947                (flags,),
8948                0xa6a9e654cbf62b,
8949                fidl::encoding::DynamicFlags::empty(),
8950                _decode,
8951            )
8952    }
8953
8954    type AllocateResponseFut = fidl::client::QueryResponseFut<
8955        FileAllocateResult,
8956        fidl::encoding::DefaultFuchsiaResourceDialect,
8957    >;
8958    fn r#allocate(
8959        &self,
8960        mut offset: u64,
8961        mut length: u64,
8962        mut mode: AllocateMode,
8963    ) -> Self::AllocateResponseFut {
8964        fn _decode(
8965            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8966        ) -> Result<FileAllocateResult, fidl::Error> {
8967            let _response = fidl::client::decode_transaction_body::<
8968                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
8969                fidl::encoding::DefaultFuchsiaResourceDialect,
8970                0x77fa0c330b57fd2e,
8971            >(_buf?)?
8972            .into_result::<FileMarker>("allocate")?;
8973            Ok(_response.map(|x| x))
8974        }
8975        self.client.send_query_and_decode::<FileAllocateRequest, FileAllocateResult>(
8976            (offset, length, mode),
8977            0x77fa0c330b57fd2e,
8978            fidl::encoding::DynamicFlags::FLEXIBLE,
8979            _decode,
8980        )
8981    }
8982
8983    type EnableVerityResponseFut = fidl::client::QueryResponseFut<
8984        FileEnableVerityResult,
8985        fidl::encoding::DefaultFuchsiaResourceDialect,
8986    >;
8987    fn r#enable_verity(&self, mut options: &VerificationOptions) -> Self::EnableVerityResponseFut {
8988        fn _decode(
8989            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8990        ) -> Result<FileEnableVerityResult, fidl::Error> {
8991            let _response = fidl::client::decode_transaction_body::<
8992                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
8993                fidl::encoding::DefaultFuchsiaResourceDialect,
8994                0x2c421ec3faaeb8bb,
8995            >(_buf?)?
8996            .into_result::<FileMarker>("enable_verity")?;
8997            Ok(_response.map(|x| x))
8998        }
8999        self.client.send_query_and_decode::<FileEnableVerityRequest, FileEnableVerityResult>(
9000            (options,),
9001            0x2c421ec3faaeb8bb,
9002            fidl::encoding::DynamicFlags::FLEXIBLE,
9003            _decode,
9004        )
9005    }
9006}
9007
9008pub struct FileEventStream {
9009    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9010}
9011
9012impl std::marker::Unpin for FileEventStream {}
9013
9014impl futures::stream::FusedStream for FileEventStream {
9015    fn is_terminated(&self) -> bool {
9016        self.event_receiver.is_terminated()
9017    }
9018}
9019
9020impl futures::Stream for FileEventStream {
9021    type Item = Result<FileEvent, fidl::Error>;
9022
9023    fn poll_next(
9024        mut self: std::pin::Pin<&mut Self>,
9025        cx: &mut std::task::Context<'_>,
9026    ) -> std::task::Poll<Option<Self::Item>> {
9027        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9028            &mut self.event_receiver,
9029            cx
9030        )?) {
9031            Some(buf) => std::task::Poll::Ready(Some(FileEvent::decode(buf))),
9032            None => std::task::Poll::Ready(None),
9033        }
9034    }
9035}
9036
9037#[derive(Debug)]
9038pub enum FileEvent {
9039    OnOpen_ {
9040        s: i32,
9041        info: Option<Box<NodeInfoDeprecated>>,
9042    },
9043    OnRepresentation {
9044        payload: Representation,
9045    },
9046    #[non_exhaustive]
9047    _UnknownEvent {
9048        /// Ordinal of the event that was sent.
9049        ordinal: u64,
9050    },
9051}
9052
9053impl FileEvent {
9054    #[allow(irrefutable_let_patterns)]
9055    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
9056        if let FileEvent::OnOpen_ { s, info } = self {
9057            Some((s, info))
9058        } else {
9059            None
9060        }
9061    }
9062    #[allow(irrefutable_let_patterns)]
9063    pub fn into_on_representation(self) -> Option<Representation> {
9064        if let FileEvent::OnRepresentation { payload } = self {
9065            Some((payload))
9066        } else {
9067            None
9068        }
9069    }
9070
9071    /// Decodes a message buffer as a [`FileEvent`].
9072    fn decode(
9073        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9074    ) -> Result<FileEvent, fidl::Error> {
9075        let (bytes, _handles) = buf.split_mut();
9076        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9077        debug_assert_eq!(tx_header.tx_id, 0);
9078        match tx_header.ordinal {
9079            0x7fc7bbb1dbfd1972 => {
9080                let mut out = fidl::new_empty!(
9081                    NodeOnOpenRequest,
9082                    fidl::encoding::DefaultFuchsiaResourceDialect
9083                );
9084                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
9085                Ok((FileEvent::OnOpen_ { s: out.s, info: out.info }))
9086            }
9087            0x5cb40567d80a510c => {
9088                let mut out =
9089                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
9090                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
9091                Ok((FileEvent::OnRepresentation { payload: out }))
9092            }
9093            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9094                Ok(FileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9095            }
9096            _ => Err(fidl::Error::UnknownOrdinal {
9097                ordinal: tx_header.ordinal,
9098                protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9099            }),
9100        }
9101    }
9102}
9103
9104/// A Stream of incoming requests for fuchsia.io/File.
9105pub struct FileRequestStream {
9106    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9107    is_terminated: bool,
9108}
9109
9110impl std::marker::Unpin for FileRequestStream {}
9111
9112impl futures::stream::FusedStream for FileRequestStream {
9113    fn is_terminated(&self) -> bool {
9114        self.is_terminated
9115    }
9116}
9117
9118impl fidl::endpoints::RequestStream for FileRequestStream {
9119    type Protocol = FileMarker;
9120    type ControlHandle = FileControlHandle;
9121
9122    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9123        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9124    }
9125
9126    fn control_handle(&self) -> Self::ControlHandle {
9127        FileControlHandle { inner: self.inner.clone() }
9128    }
9129
9130    fn into_inner(
9131        self,
9132    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9133    {
9134        (self.inner, self.is_terminated)
9135    }
9136
9137    fn from_inner(
9138        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9139        is_terminated: bool,
9140    ) -> Self {
9141        Self { inner, is_terminated }
9142    }
9143}
9144
9145impl futures::Stream for FileRequestStream {
9146    type Item = Result<FileRequest, fidl::Error>;
9147
9148    fn poll_next(
9149        mut self: std::pin::Pin<&mut Self>,
9150        cx: &mut std::task::Context<'_>,
9151    ) -> std::task::Poll<Option<Self::Item>> {
9152        let this = &mut *self;
9153        if this.inner.check_shutdown(cx) {
9154            this.is_terminated = true;
9155            return std::task::Poll::Ready(None);
9156        }
9157        if this.is_terminated {
9158            panic!("polled FileRequestStream after completion");
9159        }
9160        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9161            |bytes, handles| {
9162                match this.inner.channel().read_etc(cx, bytes, handles) {
9163                    std::task::Poll::Ready(Ok(())) => {}
9164                    std::task::Poll::Pending => return std::task::Poll::Pending,
9165                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9166                        this.is_terminated = true;
9167                        return std::task::Poll::Ready(None);
9168                    }
9169                    std::task::Poll::Ready(Err(e)) => {
9170                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9171                            e.into(),
9172                        ))))
9173                    }
9174                }
9175
9176                // A message has been received from the channel
9177                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9178
9179                std::task::Poll::Ready(Some(match header.ordinal {
9180                    0x6ee9c0ad53ec87aa => {
9181                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9182                        let mut req = fidl::new_empty!(
9183                            AdvisoryLockingAdvisoryLockRequest,
9184                            fidl::encoding::DefaultFuchsiaResourceDialect
9185                        );
9186                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
9187                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9188                        Ok(FileRequest::AdvisoryLock {
9189                            request: req.request,
9190
9191                            responder: FileAdvisoryLockResponder {
9192                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9193                                tx_id: header.tx_id,
9194                            },
9195                        })
9196                    }
9197                    0x54f3949246a03e74 => {
9198                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9199                        let mut req = fidl::new_empty!(
9200                            LinkableLinkIntoRequest,
9201                            fidl::encoding::DefaultFuchsiaResourceDialect
9202                        );
9203                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
9204                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9205                        Ok(FileRequest::LinkInto {
9206                            dst_parent_token: req.dst_parent_token,
9207                            dst: req.dst,
9208
9209                            responder: FileLinkIntoResponder {
9210                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9211                                tx_id: header.tx_id,
9212                            },
9213                        })
9214                    }
9215                    0x20d8a7aba2168a79 => {
9216                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9217                        let mut req = fidl::new_empty!(
9218                            fidl_fuchsia_unknown::CloneableCloneRequest,
9219                            fidl::encoding::DefaultFuchsiaResourceDialect
9220                        );
9221                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9222                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9223                        Ok(FileRequest::Clone { request: req.request, control_handle })
9224                    }
9225                    0x5ac5d459ad7f657e => {
9226                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9227                        let mut req = fidl::new_empty!(
9228                            fidl::encoding::EmptyPayload,
9229                            fidl::encoding::DefaultFuchsiaResourceDialect
9230                        );
9231                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9232                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9233                        Ok(FileRequest::Close {
9234                            responder: FileCloseResponder {
9235                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9236                                tx_id: header.tx_id,
9237                            },
9238                        })
9239                    }
9240                    0x2658edee9decfc06 => {
9241                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9242                        let mut req = fidl::new_empty!(
9243                            fidl::encoding::EmptyPayload,
9244                            fidl::encoding::DefaultFuchsiaResourceDialect
9245                        );
9246                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9247                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9248                        Ok(FileRequest::Query {
9249                            responder: FileQueryResponder {
9250                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9251                                tx_id: header.tx_id,
9252                            },
9253                        })
9254                    }
9255                    0x5a61678f293ce16f => {
9256                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9257                        let mut req = fidl::new_empty!(
9258                            NodeDeprecatedCloneRequest,
9259                            fidl::encoding::DefaultFuchsiaResourceDialect
9260                        );
9261                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9262                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9263                        Ok(FileRequest::DeprecatedClone {
9264                            flags: req.flags,
9265                            object: req.object,
9266
9267                            control_handle,
9268                        })
9269                    }
9270                    0x78985e216314dafd => {
9271                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9272                        let mut req = fidl::new_empty!(
9273                            fidl::encoding::EmptyPayload,
9274                            fidl::encoding::DefaultFuchsiaResourceDialect
9275                        );
9276                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9277                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9278                        Ok(FileRequest::GetAttr {
9279                            responder: FileGetAttrResponder {
9280                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9281                                tx_id: header.tx_id,
9282                            },
9283                        })
9284                    }
9285                    0x4186c0f40d938f46 => {
9286                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9287                        let mut req = fidl::new_empty!(
9288                            NodeDeprecatedSetAttrRequest,
9289                            fidl::encoding::DefaultFuchsiaResourceDialect
9290                        );
9291                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
9292                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9293                        Ok(FileRequest::DeprecatedSetAttr {
9294                            flags: req.flags,
9295                            attributes: req.attributes,
9296
9297                            responder: FileDeprecatedSetAttrResponder {
9298                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9299                                tx_id: header.tx_id,
9300                            },
9301                        })
9302                    }
9303                    0x5b88fffb8eda3aa1 => {
9304                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9305                        let mut req = fidl::new_empty!(
9306                            fidl::encoding::EmptyPayload,
9307                            fidl::encoding::DefaultFuchsiaResourceDialect
9308                        );
9309                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9310                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9311                        Ok(FileRequest::DeprecatedGetFlags {
9312                            responder: FileDeprecatedGetFlagsResponder {
9313                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9314                                tx_id: header.tx_id,
9315                            },
9316                        })
9317                    }
9318                    0x5295b76c71fde733 => {
9319                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9320                        let mut req = fidl::new_empty!(
9321                            NodeDeprecatedSetFlagsRequest,
9322                            fidl::encoding::DefaultFuchsiaResourceDialect
9323                        );
9324                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9325                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9326                        Ok(FileRequest::DeprecatedSetFlags {
9327                            flags: req.flags,
9328
9329                            responder: FileDeprecatedSetFlagsResponder {
9330                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9331                                tx_id: header.tx_id,
9332                            },
9333                        })
9334                    }
9335                    0x176eb318f64ec23 => {
9336                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9337                        let mut req = fidl::new_empty!(
9338                            fidl::encoding::EmptyPayload,
9339                            fidl::encoding::DefaultFuchsiaResourceDialect
9340                        );
9341                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9342                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9343                        Ok(FileRequest::GetFlags {
9344                            responder: FileGetFlagsResponder {
9345                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9346                                tx_id: header.tx_id,
9347                            },
9348                        })
9349                    }
9350                    0x55a8028685791ea8 => {
9351                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9352                        let mut req = fidl::new_empty!(
9353                            NodeSetFlagsRequest,
9354                            fidl::encoding::DefaultFuchsiaResourceDialect
9355                        );
9356                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9357                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9358                        Ok(FileRequest::SetFlags {
9359                            flags: req.flags,
9360
9361                            responder: FileSetFlagsResponder {
9362                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9363                                tx_id: header.tx_id,
9364                            },
9365                        })
9366                    }
9367                    0x6f344a1c6b0a0610 => {
9368                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9369                        let mut req = fidl::new_empty!(
9370                            fidl::encoding::EmptyPayload,
9371                            fidl::encoding::DefaultFuchsiaResourceDialect
9372                        );
9373                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9374                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9375                        Ok(FileRequest::QueryFilesystem {
9376                            responder: FileQueryFilesystemResponder {
9377                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9378                                tx_id: header.tx_id,
9379                            },
9380                        })
9381                    }
9382                    0x3d4396a638ea053b => {
9383                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9384                        let mut req = fidl::new_empty!(
9385                            NodeGetAttributesRequest,
9386                            fidl::encoding::DefaultFuchsiaResourceDialect
9387                        );
9388                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9389                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9390                        Ok(FileRequest::GetAttributes {
9391                            query: req.query,
9392
9393                            responder: FileGetAttributesResponder {
9394                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9395                                tx_id: header.tx_id,
9396                            },
9397                        })
9398                    }
9399                    0x3308c1da5a89bf08 => {
9400                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9401                        let mut req = fidl::new_empty!(
9402                            MutableNodeAttributes,
9403                            fidl::encoding::DefaultFuchsiaResourceDialect
9404                        );
9405                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
9406                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9407                        Ok(FileRequest::UpdateAttributes {
9408                            payload: req,
9409                            responder: FileUpdateAttributesResponder {
9410                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9411                                tx_id: header.tx_id,
9412                            },
9413                        })
9414                    }
9415                    0x2c5c27ca0ab5dc49 => {
9416                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9417                        let mut req = fidl::new_empty!(
9418                            fidl::encoding::EmptyPayload,
9419                            fidl::encoding::DefaultFuchsiaResourceDialect
9420                        );
9421                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9422                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9423                        Ok(FileRequest::Sync {
9424                            responder: FileSyncResponder {
9425                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9426                                tx_id: header.tx_id,
9427                            },
9428                        })
9429                    }
9430                    0x4b61033de007fcd0 => {
9431                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9432                        let mut req = fidl::new_empty!(
9433                            NodeListExtendedAttributesRequest,
9434                            fidl::encoding::DefaultFuchsiaResourceDialect
9435                        );
9436                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9437                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9438                        Ok(FileRequest::ListExtendedAttributes {
9439                            iterator: req.iterator,
9440
9441                            control_handle,
9442                        })
9443                    }
9444                    0x45ffa3ccfdeb76db => {
9445                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9446                        let mut req = fidl::new_empty!(
9447                            NodeGetExtendedAttributeRequest,
9448                            fidl::encoding::DefaultFuchsiaResourceDialect
9449                        );
9450                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9451                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9452                        Ok(FileRequest::GetExtendedAttribute {
9453                            name: req.name,
9454
9455                            responder: FileGetExtendedAttributeResponder {
9456                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9457                                tx_id: header.tx_id,
9458                            },
9459                        })
9460                    }
9461                    0x4a951362f681f23c => {
9462                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9463                        let mut req = fidl::new_empty!(
9464                            NodeSetExtendedAttributeRequest,
9465                            fidl::encoding::DefaultFuchsiaResourceDialect
9466                        );
9467                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9468                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9469                        Ok(FileRequest::SetExtendedAttribute {
9470                            name: req.name,
9471                            value: req.value,
9472                            mode: req.mode,
9473
9474                            responder: FileSetExtendedAttributeResponder {
9475                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9476                                tx_id: header.tx_id,
9477                            },
9478                        })
9479                    }
9480                    0x7a0b9f3a9bf9032d => {
9481                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9482                        let mut req = fidl::new_empty!(
9483                            NodeRemoveExtendedAttributeRequest,
9484                            fidl::encoding::DefaultFuchsiaResourceDialect
9485                        );
9486                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9487                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9488                        Ok(FileRequest::RemoveExtendedAttribute {
9489                            name: req.name,
9490
9491                            responder: FileRemoveExtendedAttributeResponder {
9492                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9493                                tx_id: header.tx_id,
9494                            },
9495                        })
9496                    }
9497                    0x57e419a298c8ede => {
9498                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9499                        let mut req = fidl::new_empty!(
9500                            ReadableReadRequest,
9501                            fidl::encoding::DefaultFuchsiaResourceDialect
9502                        );
9503                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
9504                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9505                        Ok(FileRequest::Read {
9506                            count: req.count,
9507
9508                            responder: FileReadResponder {
9509                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9510                                tx_id: header.tx_id,
9511                            },
9512                        })
9513                    }
9514                    0x6a31437832469f82 => {
9515                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9516                        let mut req = fidl::new_empty!(
9517                            WritableWriteRequest,
9518                            fidl::encoding::DefaultFuchsiaResourceDialect
9519                        );
9520                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
9521                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9522                        Ok(FileRequest::Write {
9523                            data: req.data,
9524
9525                            responder: FileWriteResponder {
9526                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9527                                tx_id: header.tx_id,
9528                            },
9529                        })
9530                    }
9531                    0x68b5ac00c62906bc => {
9532                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9533                        let mut req = fidl::new_empty!(
9534                            fidl::encoding::EmptyPayload,
9535                            fidl::encoding::DefaultFuchsiaResourceDialect
9536                        );
9537                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9538                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9539                        Ok(FileRequest::Describe {
9540                            responder: FileDescribeResponder {
9541                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9542                                tx_id: header.tx_id,
9543                            },
9544                        })
9545                    }
9546                    0x78079168162c5207 => {
9547                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9548                        let mut req = fidl::new_empty!(
9549                            FileSeekRequest,
9550                            fidl::encoding::DefaultFuchsiaResourceDialect
9551                        );
9552                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileSeekRequest>(&header, _body_bytes, handles, &mut req)?;
9553                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9554                        Ok(FileRequest::Seek {
9555                            origin: req.origin,
9556                            offset: req.offset,
9557
9558                            responder: FileSeekResponder {
9559                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9560                                tx_id: header.tx_id,
9561                            },
9562                        })
9563                    }
9564                    0x1607a293a60d723e => {
9565                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9566                        let mut req = fidl::new_empty!(
9567                            FileReadAtRequest,
9568                            fidl::encoding::DefaultFuchsiaResourceDialect
9569                        );
9570                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileReadAtRequest>(&header, _body_bytes, handles, &mut req)?;
9571                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9572                        Ok(FileRequest::ReadAt {
9573                            count: req.count,
9574                            offset: req.offset,
9575
9576                            responder: FileReadAtResponder {
9577                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9578                                tx_id: header.tx_id,
9579                            },
9580                        })
9581                    }
9582                    0x793eefc0045e792b => {
9583                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9584                        let mut req = fidl::new_empty!(
9585                            FileWriteAtRequest,
9586                            fidl::encoding::DefaultFuchsiaResourceDialect
9587                        );
9588                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileWriteAtRequest>(&header, _body_bytes, handles, &mut req)?;
9589                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9590                        Ok(FileRequest::WriteAt {
9591                            data: req.data,
9592                            offset: req.offset,
9593
9594                            responder: FileWriteAtResponder {
9595                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9596                                tx_id: header.tx_id,
9597                            },
9598                        })
9599                    }
9600                    0x2b80825f0535743a => {
9601                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9602                        let mut req = fidl::new_empty!(
9603                            FileResizeRequest,
9604                            fidl::encoding::DefaultFuchsiaResourceDialect
9605                        );
9606                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileResizeRequest>(&header, _body_bytes, handles, &mut req)?;
9607                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9608                        Ok(FileRequest::Resize {
9609                            length: req.length,
9610
9611                            responder: FileResizeResponder {
9612                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9613                                tx_id: header.tx_id,
9614                            },
9615                        })
9616                    }
9617                    0xa6a9e654cbf62b => {
9618                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9619                        let mut req = fidl::new_empty!(
9620                            FileGetBackingMemoryRequest,
9621                            fidl::encoding::DefaultFuchsiaResourceDialect
9622                        );
9623                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileGetBackingMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
9624                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9625                        Ok(FileRequest::GetBackingMemory {
9626                            flags: req.flags,
9627
9628                            responder: FileGetBackingMemoryResponder {
9629                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9630                                tx_id: header.tx_id,
9631                            },
9632                        })
9633                    }
9634                    0x77fa0c330b57fd2e => {
9635                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9636                        let mut req = fidl::new_empty!(
9637                            FileAllocateRequest,
9638                            fidl::encoding::DefaultFuchsiaResourceDialect
9639                        );
9640                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileAllocateRequest>(&header, _body_bytes, handles, &mut req)?;
9641                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9642                        Ok(FileRequest::Allocate {
9643                            offset: req.offset,
9644                            length: req.length,
9645                            mode: req.mode,
9646
9647                            responder: FileAllocateResponder {
9648                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9649                                tx_id: header.tx_id,
9650                            },
9651                        })
9652                    }
9653                    0x2c421ec3faaeb8bb => {
9654                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9655                        let mut req = fidl::new_empty!(
9656                            FileEnableVerityRequest,
9657                            fidl::encoding::DefaultFuchsiaResourceDialect
9658                        );
9659                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileEnableVerityRequest>(&header, _body_bytes, handles, &mut req)?;
9660                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9661                        Ok(FileRequest::EnableVerity {
9662                            options: req.options,
9663
9664                            responder: FileEnableVerityResponder {
9665                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9666                                tx_id: header.tx_id,
9667                            },
9668                        })
9669                    }
9670                    _ if header.tx_id == 0
9671                        && header
9672                            .dynamic_flags()
9673                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9674                    {
9675                        Ok(FileRequest::_UnknownMethod {
9676                            ordinal: header.ordinal,
9677                            control_handle: FileControlHandle { inner: this.inner.clone() },
9678                            method_type: fidl::MethodType::OneWay,
9679                        })
9680                    }
9681                    _ if header
9682                        .dynamic_flags()
9683                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9684                    {
9685                        this.inner.send_framework_err(
9686                            fidl::encoding::FrameworkErr::UnknownMethod,
9687                            header.tx_id,
9688                            header.ordinal,
9689                            header.dynamic_flags(),
9690                            (bytes, handles),
9691                        )?;
9692                        Ok(FileRequest::_UnknownMethod {
9693                            ordinal: header.ordinal,
9694                            control_handle: FileControlHandle { inner: this.inner.clone() },
9695                            method_type: fidl::MethodType::TwoWay,
9696                        })
9697                    }
9698                    _ => Err(fidl::Error::UnknownOrdinal {
9699                        ordinal: header.ordinal,
9700                        protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9701                    }),
9702                }))
9703            },
9704        )
9705    }
9706}
9707
9708/// A [`Node`] which contains a sequence of bytes of definite length.
9709///
9710/// NOTE: cloned connections do not share their seek offset with their source
9711/// connection.
9712#[derive(Debug)]
9713pub enum FileRequest {
9714    /// Acquires an advisory lock on the underlying file.
9715    ///
9716    /// The lock lasts until either this connection is closed or
9717    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
9718    /// explicitly.
9719    ///
9720    /// Advisory locks are purely advisory. They do not prevent actual read or
9721    /// write operations from occurring on the file, either through this
9722    /// connection or through other connections.
9723    ///
9724    /// This method requires the following rights:
9725    ///
9726    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
9727    /// * [`Rights.WRITE_BYTES`] if `request.type` is
9728    ///   [`AdvisoryLockType.WRITE`].
9729    ///
9730    /// # Errors
9731    ///
9732    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
9733    ///   example, another connection might hold a conflicting lock type.
9734    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
9735    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
9736    ///   to acquire the given type of lock.
9737    AdvisoryLock {
9738        request: AdvisoryLockRequest,
9739        responder: FileAdvisoryLockResponder,
9740    },
9741    /// Creates a link to this this object with name `dst` in the directory represented by
9742    /// `dst_parent_token`.
9743    ///
9744    /// `dst` must be a resolved object name. Including "/" in the string will return
9745    /// `ZX_ERR_INVALID_ARGS`.
9746    ///
9747    /// This method requires the maximal set of rights supported by the filesystem for this object.
9748    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
9749    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
9750    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
9751    /// `ZX_ERR_ACCESS_DENIED`.
9752    ///
9753    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
9754    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
9755    ///
9756    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
9757    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
9758    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
9759    ///
9760    /// This method does not have the same atomicity properties has the `Directory::Link` method,
9761    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
9762    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
9763    LinkInto {
9764        dst_parent_token: fidl::Event,
9765        dst: String,
9766        responder: FileLinkIntoResponder,
9767    },
9768    Clone {
9769        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
9770        control_handle: FileControlHandle,
9771    },
9772    /// Terminates the connection.
9773    ///
9774    /// After calling `Close`, the client must not send any other requests.
9775    ///
9776    /// Servers, after sending the status response, should close the connection
9777    /// regardless of status and without sending an epitaph.
9778    ///
9779    /// Closing the client end of the channel should be semantically equivalent
9780    /// to calling `Close` without knowing when the close has completed or its
9781    /// status.
9782    Close {
9783        responder: FileCloseResponder,
9784    },
9785    Query {
9786        responder: FileQueryResponder,
9787    },
9788    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
9789    DeprecatedClone {
9790        flags: OpenFlags,
9791        object: fidl::endpoints::ServerEnd<NodeMarker>,
9792        control_handle: FileControlHandle,
9793    },
9794    /// Acquires information about the node.
9795    ///
9796    /// This method does not require any rights.
9797    GetAttr {
9798        responder: FileGetAttrResponder,
9799    },
9800    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
9801    DeprecatedSetAttr {
9802        flags: NodeAttributeFlags,
9803        attributes: NodeAttributes,
9804        responder: FileDeprecatedSetAttrResponder,
9805    },
9806    /// [DEPRECATED - Use new GetFlags method instead.]
9807    DeprecatedGetFlags {
9808        responder: FileDeprecatedGetFlagsResponder,
9809    },
9810    /// [DEPRECATED - Use new SetFlags method instead.]
9811    DeprecatedSetFlags {
9812        flags: OpenFlags,
9813        responder: FileDeprecatedSetFlagsResponder,
9814    },
9815    /// Queries the flags that apply to this node after it has been opened/created. This method does
9816    /// not require any rights.
9817    ///
9818    /// Note that the final set of flags that apply to the connection may differ from those
9819    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
9820    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
9821    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
9822    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
9823    GetFlags {
9824        responder: FileGetFlagsResponder,
9825    },
9826    /// Sets the flags that apply to this node after it has been opened. This method does not
9827    /// require any rights.
9828    ///
9829    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
9830    /// clear append mode.
9831    ///
9832    /// Errors:
9833    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
9834    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
9835    SetFlags {
9836        flags: Flags,
9837        responder: FileSetFlagsResponder,
9838    },
9839    /// Query the filesystem for filesystem-specific information.
9840    QueryFilesystem {
9841        responder: FileQueryFilesystemResponder,
9842    },
9843    /// Acquires information about the node.
9844    ///
9845    /// The attributes of a node should be stable, independent of the
9846    /// specific protocol used to access it.
9847    ///
9848    /// If a particular attribute is not applicable or not supported,
9849    /// filesystems should leave the corresponding field absent.
9850    ///
9851    /// + `query` a bit-mask specifying which attributes to fetch. The server
9852    ///   should not return more than necessary.
9853    /// - `attributes` the returned attributes.
9854    ///
9855    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9856    GetAttributes {
9857        query: NodeAttributesQuery,
9858        responder: FileGetAttributesResponder,
9859    },
9860    /// Updates information about the node.
9861    ///
9862    /// + `attributes` the presence of a table field in `attributes` indicates
9863    /// the intent to update the corresponding attribute.
9864    ///
9865    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
9866    ///
9867    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
9868    UpdateAttributes {
9869        payload: MutableNodeAttributes,
9870        responder: FileUpdateAttributesResponder,
9871    },
9872    /// Synchronizes updates to the node to the underlying media, if it exists.
9873    ///
9874    /// This method will return when the filesystem server has flushed the
9875    /// relevant updates to the underlying media, but does not guarantee the
9876    /// underlying media has persisted the information, nor that any information
9877    /// is committed to hardware. Clients may use `Sync` to ensure ordering
9878    /// between operations.
9879    ///
9880    /// This method does not require any rights.
9881    Sync {
9882        responder: FileSyncResponder,
9883    },
9884    /// Creates an iterator over all the extended attribute names associated
9885    /// with this node. If an error occurs it is returned as an epitaph on the
9886    /// iterator request channel, and then the channel is closed.
9887    ///
9888    /// GetExtendedAttributes can be used with any of these names to retrieve
9889    /// the associated value.
9890    ///
9891    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9892    ListExtendedAttributes {
9893        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
9894        control_handle: FileControlHandle,
9895    },
9896    /// Get the value associated with the given attribute `name` for this node.
9897    ///
9898    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
9899    /// particular structure is imposed on them.
9900    ///
9901    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9902    GetExtendedAttribute {
9903        name: Vec<u8>,
9904        responder: FileGetExtendedAttributeResponder,
9905    },
9906    /// Set the value for the given attribute `name` to `value` for this node.
9907    ///
9908    /// The attribute name may exist, in which case the attribute is updated.
9909    /// If the attribute doesn't exist, it is created. The name should have no
9910    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
9911    ///
9912    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
9913    SetExtendedAttribute {
9914        name: Vec<u8>,
9915        value: ExtendedAttributeValue,
9916        mode: SetExtendedAttributeMode,
9917        responder: FileSetExtendedAttributeResponder,
9918    },
9919    /// Remove the specified extended attribute.
9920    ///
9921    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
9922    ///
9923    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
9924    RemoveExtendedAttribute {
9925        name: Vec<u8>,
9926        responder: FileRemoveExtendedAttributeResponder,
9927    },
9928    /// Reads up to 'count' bytes at the seek offset.
9929    /// The seek offset is moved forward by the number of bytes read.
9930    ///
9931    /// ## Invariants
9932    ///
9933    /// * The returned `data.length` will never be greater than `count`.
9934    /// * If `data.length` is less than `count`, it means that the seek offset
9935    ///   has reached the end of file as part of this operation.
9936    /// * If `data.length` is zero while `count` is not, it means that the
9937    ///   seek offset is already at or beyond the end of file, and no data could
9938    ///   be read.
9939    /// * If `count` is zero, the server should perform all the checks ensuring
9940    ///   read access without actually read anything, and return an empty
9941    ///   `data` vector.
9942    ///
9943    /// This method requires the [`Rights.READ_BYTES`] right.
9944    ///
9945    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
9946    Read {
9947        count: u64,
9948        responder: FileReadResponder,
9949    },
9950    /// Writes data at the seek offset.
9951    /// The seek offset is moved forward by the number of bytes written.
9952    /// If the file is in append mode, the seek offset is first set to the end
9953    /// of the file, followed by the write, in one atomic step.
9954    ///
9955    /// The file size may grow if the seek offset plus `data.length` is beyond
9956    /// the current end of file.
9957    ///
9958    /// + request `data` the byte buffer to write to the file.
9959    /// - response `actual_count` the number of bytes written.
9960    ///
9961    /// ## Invariants
9962    ///
9963    /// * The returned `actual_count` will never be greater than `data.length`.
9964    /// * If the server is unable to write all the data due to e.g. not enough
9965    ///   space, `actual_count` may be less than `data.length`.  If no bytes
9966    ///   could be written, an error is returned.
9967    /// * If `data.length` is zero, the server should perform all the checks
9968    ///   ensuring write access without mutating the file and return a
9969    ///   successful write of zero bytes.  The seek offset is still updated if
9970    ///   in append mode.
9971    ///
9972    /// This method requires the [`Rights.WRITE_BYTES`] right.
9973    Write {
9974        data: Vec<u8>,
9975        responder: FileWriteResponder,
9976    },
9977    Describe {
9978        responder: FileDescribeResponder,
9979    },
9980    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
9981    /// will occur. The seek offset is specific to each file connection.
9982    ///
9983    /// + request `origin` the reference point where `offset` will be based on.
9984    /// + request `offset` the number of bytes to seek.
9985    /// - response `offset_from_start` the adjusted seek offset, from the start
9986    ///   of the file.
9987    ///
9988    /// This method does not require any rights.
9989    Seek {
9990        origin: SeekOrigin,
9991        offset: i64,
9992        responder: FileSeekResponder,
9993    },
9994    /// Reads up to 'count' bytes at the provided offset.
9995    /// Does not affect the seek offset.
9996    ///
9997    /// ## Invariants
9998    ///
9999    /// * The returned `data.length` will never be greater than `count`.
10000    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
10001    ///   the end of file as part of this operation.
10002    /// * If `data.length` is zero while `count` is not, it means that `offset`
10003    ///   is at or past the end of file, and no data can be read.
10004    /// * If `count` is zero, the server should perform all the checks ensuring
10005    ///   read access without actually reading anything, and return an empty
10006    ///   `data` vector.
10007    ///
10008    /// This method requires the [`Rights.READ_BYTES`] right.
10009    ///
10010    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
10011    ReadAt {
10012        count: u64,
10013        offset: u64,
10014        responder: FileReadAtResponder,
10015    },
10016    /// Writes data at the provided offset.
10017    /// Does not affect the seek offset.
10018    ///
10019    /// The file size may grow if `offset` plus `data.length` is past the
10020    /// current end of file.
10021    ///
10022    /// + request `data` the byte buffer to write to the file.
10023    /// + request `offset` the offset from start of the file to begin writing.
10024    /// - response `actual_count` the number of bytes written.
10025    ///
10026    /// ## Invariants
10027    ///
10028    /// * The returned `actual_count` will never be greater than `data.length`.
10029    /// * If the server is unable to write all the data due to e.g. not enough
10030    ///   space, `actual_count` may be less than `data.length`.  If no bytes
10031    ///   could be written, an error is returned.
10032    /// * If `data.length` is zero, the server should perform all the checks
10033    ///   ensuring write access without mutating the file, and will return a
10034    ///   successful write of zero bytes.
10035    ///
10036    /// This method requires the [`Rights.WRITE_BYTES`] right.
10037    WriteAt {
10038        data: Vec<u8>,
10039        offset: u64,
10040        responder: FileWriteAtResponder,
10041    },
10042    /// Shrinks or grows the file size to 'length' bytes.
10043    ///
10044    /// If file size is reduced by this operation, the extra trailing data'
10045    /// is discarded.
10046    /// If file size is increased by this operation, the extended area appears
10047    /// as if it was zeroed.
10048    ///
10049    /// This method requires the [`Rights.WRITE_BYTES`] right.
10050    Resize {
10051        length: u64,
10052        responder: FileResizeResponder,
10053    },
10054    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
10055    /// with the requested access rights.
10056    ///
10057    /// Implementations are not required to implement files backed by VMOs so
10058    /// this request may fail. Additionally, implementations may only support
10059    /// a certain subset of the flags. Clients should be prepared with fallback
10060    /// behavior if this request fails.
10061    ///
10062    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
10063    /// implementation is free to choose the semantics of the returned VMO.
10064    ///
10065    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
10066    /// - response `vmo` the requested [`zx.Handle:VMO`].
10067    /// * error a [`zx.Status`] value indicating the failure.
10068    ///
10069    /// This method requires the following rights:
10070    ///
10071    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
10072    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
10073    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
10074    GetBackingMemory {
10075        flags: VmoFlags,
10076        responder: FileGetBackingMemoryResponder,
10077    },
10078    /// Pre-allocate on-disk space for this file.
10079    Allocate {
10080        offset: u64,
10081        length: u64,
10082        mode: AllocateMode,
10083        responder: FileAllocateResponder,
10084    },
10085    /// Enables verification for the file (permanently) which involves computing a merkle tree for
10086    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
10087    /// captured. Future reads will be verified against the computed merkle tree and writes will be
10088    /// rejected. This method can take some time to complete as it depends on the size of the file.
10089    /// This method can be aborted by closing the connection that this method was issued on.
10090    ///
10091    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
10092    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
10093    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
10094    /// Also returns any error that might arise from reading the file, or from flushing the file,
10095    /// such as `ZX_ERR_IO`.
10096    EnableVerity {
10097        options: VerificationOptions,
10098        responder: FileEnableVerityResponder,
10099    },
10100    /// An interaction was received which does not match any known method.
10101    #[non_exhaustive]
10102    _UnknownMethod {
10103        /// Ordinal of the method that was called.
10104        ordinal: u64,
10105        control_handle: FileControlHandle,
10106        method_type: fidl::MethodType,
10107    },
10108}
10109
10110impl FileRequest {
10111    #[allow(irrefutable_let_patterns)]
10112    pub fn into_advisory_lock(self) -> Option<(AdvisoryLockRequest, FileAdvisoryLockResponder)> {
10113        if let FileRequest::AdvisoryLock { request, responder } = self {
10114            Some((request, responder))
10115        } else {
10116            None
10117        }
10118    }
10119
10120    #[allow(irrefutable_let_patterns)]
10121    pub fn into_link_into(self) -> Option<(fidl::Event, String, FileLinkIntoResponder)> {
10122        if let FileRequest::LinkInto { dst_parent_token, dst, responder } = self {
10123            Some((dst_parent_token, dst, responder))
10124        } else {
10125            None
10126        }
10127    }
10128
10129    #[allow(irrefutable_let_patterns)]
10130    pub fn into_clone(
10131        self,
10132    ) -> Option<(
10133        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10134        FileControlHandle,
10135    )> {
10136        if let FileRequest::Clone { request, control_handle } = self {
10137            Some((request, control_handle))
10138        } else {
10139            None
10140        }
10141    }
10142
10143    #[allow(irrefutable_let_patterns)]
10144    pub fn into_close(self) -> Option<(FileCloseResponder)> {
10145        if let FileRequest::Close { responder } = self {
10146            Some((responder))
10147        } else {
10148            None
10149        }
10150    }
10151
10152    #[allow(irrefutable_let_patterns)]
10153    pub fn into_query(self) -> Option<(FileQueryResponder)> {
10154        if let FileRequest::Query { responder } = self {
10155            Some((responder))
10156        } else {
10157            None
10158        }
10159    }
10160
10161    #[allow(irrefutable_let_patterns)]
10162    pub fn into_deprecated_clone(
10163        self,
10164    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, FileControlHandle)> {
10165        if let FileRequest::DeprecatedClone { flags, object, control_handle } = self {
10166            Some((flags, object, control_handle))
10167        } else {
10168            None
10169        }
10170    }
10171
10172    #[allow(irrefutable_let_patterns)]
10173    pub fn into_get_attr(self) -> Option<(FileGetAttrResponder)> {
10174        if let FileRequest::GetAttr { responder } = self {
10175            Some((responder))
10176        } else {
10177            None
10178        }
10179    }
10180
10181    #[allow(irrefutable_let_patterns)]
10182    pub fn into_deprecated_set_attr(
10183        self,
10184    ) -> Option<(NodeAttributeFlags, NodeAttributes, FileDeprecatedSetAttrResponder)> {
10185        if let FileRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
10186            Some((flags, attributes, responder))
10187        } else {
10188            None
10189        }
10190    }
10191
10192    #[allow(irrefutable_let_patterns)]
10193    pub fn into_deprecated_get_flags(self) -> Option<(FileDeprecatedGetFlagsResponder)> {
10194        if let FileRequest::DeprecatedGetFlags { responder } = self {
10195            Some((responder))
10196        } else {
10197            None
10198        }
10199    }
10200
10201    #[allow(irrefutable_let_patterns)]
10202    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, FileDeprecatedSetFlagsResponder)> {
10203        if let FileRequest::DeprecatedSetFlags { flags, responder } = self {
10204            Some((flags, responder))
10205        } else {
10206            None
10207        }
10208    }
10209
10210    #[allow(irrefutable_let_patterns)]
10211    pub fn into_get_flags(self) -> Option<(FileGetFlagsResponder)> {
10212        if let FileRequest::GetFlags { responder } = self {
10213            Some((responder))
10214        } else {
10215            None
10216        }
10217    }
10218
10219    #[allow(irrefutable_let_patterns)]
10220    pub fn into_set_flags(self) -> Option<(Flags, FileSetFlagsResponder)> {
10221        if let FileRequest::SetFlags { flags, responder } = self {
10222            Some((flags, responder))
10223        } else {
10224            None
10225        }
10226    }
10227
10228    #[allow(irrefutable_let_patterns)]
10229    pub fn into_query_filesystem(self) -> Option<(FileQueryFilesystemResponder)> {
10230        if let FileRequest::QueryFilesystem { responder } = self {
10231            Some((responder))
10232        } else {
10233            None
10234        }
10235    }
10236
10237    #[allow(irrefutable_let_patterns)]
10238    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, FileGetAttributesResponder)> {
10239        if let FileRequest::GetAttributes { query, responder } = self {
10240            Some((query, responder))
10241        } else {
10242            None
10243        }
10244    }
10245
10246    #[allow(irrefutable_let_patterns)]
10247    pub fn into_update_attributes(
10248        self,
10249    ) -> Option<(MutableNodeAttributes, FileUpdateAttributesResponder)> {
10250        if let FileRequest::UpdateAttributes { payload, responder } = self {
10251            Some((payload, responder))
10252        } else {
10253            None
10254        }
10255    }
10256
10257    #[allow(irrefutable_let_patterns)]
10258    pub fn into_sync(self) -> Option<(FileSyncResponder)> {
10259        if let FileRequest::Sync { responder } = self {
10260            Some((responder))
10261        } else {
10262            None
10263        }
10264    }
10265
10266    #[allow(irrefutable_let_patterns)]
10267    pub fn into_list_extended_attributes(
10268        self,
10269    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, FileControlHandle)>
10270    {
10271        if let FileRequest::ListExtendedAttributes { iterator, control_handle } = self {
10272            Some((iterator, control_handle))
10273        } else {
10274            None
10275        }
10276    }
10277
10278    #[allow(irrefutable_let_patterns)]
10279    pub fn into_get_extended_attribute(
10280        self,
10281    ) -> Option<(Vec<u8>, FileGetExtendedAttributeResponder)> {
10282        if let FileRequest::GetExtendedAttribute { name, responder } = self {
10283            Some((name, responder))
10284        } else {
10285            None
10286        }
10287    }
10288
10289    #[allow(irrefutable_let_patterns)]
10290    pub fn into_set_extended_attribute(
10291        self,
10292    ) -> Option<(
10293        Vec<u8>,
10294        ExtendedAttributeValue,
10295        SetExtendedAttributeMode,
10296        FileSetExtendedAttributeResponder,
10297    )> {
10298        if let FileRequest::SetExtendedAttribute { name, value, mode, responder } = self {
10299            Some((name, value, mode, responder))
10300        } else {
10301            None
10302        }
10303    }
10304
10305    #[allow(irrefutable_let_patterns)]
10306    pub fn into_remove_extended_attribute(
10307        self,
10308    ) -> Option<(Vec<u8>, FileRemoveExtendedAttributeResponder)> {
10309        if let FileRequest::RemoveExtendedAttribute { name, responder } = self {
10310            Some((name, responder))
10311        } else {
10312            None
10313        }
10314    }
10315
10316    #[allow(irrefutable_let_patterns)]
10317    pub fn into_read(self) -> Option<(u64, FileReadResponder)> {
10318        if let FileRequest::Read { count, responder } = self {
10319            Some((count, responder))
10320        } else {
10321            None
10322        }
10323    }
10324
10325    #[allow(irrefutable_let_patterns)]
10326    pub fn into_write(self) -> Option<(Vec<u8>, FileWriteResponder)> {
10327        if let FileRequest::Write { data, responder } = self {
10328            Some((data, responder))
10329        } else {
10330            None
10331        }
10332    }
10333
10334    #[allow(irrefutable_let_patterns)]
10335    pub fn into_describe(self) -> Option<(FileDescribeResponder)> {
10336        if let FileRequest::Describe { responder } = self {
10337            Some((responder))
10338        } else {
10339            None
10340        }
10341    }
10342
10343    #[allow(irrefutable_let_patterns)]
10344    pub fn into_seek(self) -> Option<(SeekOrigin, i64, FileSeekResponder)> {
10345        if let FileRequest::Seek { origin, offset, responder } = self {
10346            Some((origin, offset, responder))
10347        } else {
10348            None
10349        }
10350    }
10351
10352    #[allow(irrefutable_let_patterns)]
10353    pub fn into_read_at(self) -> Option<(u64, u64, FileReadAtResponder)> {
10354        if let FileRequest::ReadAt { count, offset, responder } = self {
10355            Some((count, offset, responder))
10356        } else {
10357            None
10358        }
10359    }
10360
10361    #[allow(irrefutable_let_patterns)]
10362    pub fn into_write_at(self) -> Option<(Vec<u8>, u64, FileWriteAtResponder)> {
10363        if let FileRequest::WriteAt { data, offset, responder } = self {
10364            Some((data, offset, responder))
10365        } else {
10366            None
10367        }
10368    }
10369
10370    #[allow(irrefutable_let_patterns)]
10371    pub fn into_resize(self) -> Option<(u64, FileResizeResponder)> {
10372        if let FileRequest::Resize { length, responder } = self {
10373            Some((length, responder))
10374        } else {
10375            None
10376        }
10377    }
10378
10379    #[allow(irrefutable_let_patterns)]
10380    pub fn into_get_backing_memory(self) -> Option<(VmoFlags, FileGetBackingMemoryResponder)> {
10381        if let FileRequest::GetBackingMemory { flags, responder } = self {
10382            Some((flags, responder))
10383        } else {
10384            None
10385        }
10386    }
10387
10388    #[allow(irrefutable_let_patterns)]
10389    pub fn into_allocate(self) -> Option<(u64, u64, AllocateMode, FileAllocateResponder)> {
10390        if let FileRequest::Allocate { offset, length, mode, responder } = self {
10391            Some((offset, length, mode, responder))
10392        } else {
10393            None
10394        }
10395    }
10396
10397    #[allow(irrefutable_let_patterns)]
10398    pub fn into_enable_verity(self) -> Option<(VerificationOptions, FileEnableVerityResponder)> {
10399        if let FileRequest::EnableVerity { options, responder } = self {
10400            Some((options, responder))
10401        } else {
10402            None
10403        }
10404    }
10405
10406    /// Name of the method defined in FIDL
10407    pub fn method_name(&self) -> &'static str {
10408        match *self {
10409            FileRequest::AdvisoryLock { .. } => "advisory_lock",
10410            FileRequest::LinkInto { .. } => "link_into",
10411            FileRequest::Clone { .. } => "clone",
10412            FileRequest::Close { .. } => "close",
10413            FileRequest::Query { .. } => "query",
10414            FileRequest::DeprecatedClone { .. } => "deprecated_clone",
10415            FileRequest::GetAttr { .. } => "get_attr",
10416            FileRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
10417            FileRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
10418            FileRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
10419            FileRequest::GetFlags { .. } => "get_flags",
10420            FileRequest::SetFlags { .. } => "set_flags",
10421            FileRequest::QueryFilesystem { .. } => "query_filesystem",
10422            FileRequest::GetAttributes { .. } => "get_attributes",
10423            FileRequest::UpdateAttributes { .. } => "update_attributes",
10424            FileRequest::Sync { .. } => "sync",
10425            FileRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
10426            FileRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
10427            FileRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
10428            FileRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
10429            FileRequest::Read { .. } => "read",
10430            FileRequest::Write { .. } => "write",
10431            FileRequest::Describe { .. } => "describe",
10432            FileRequest::Seek { .. } => "seek",
10433            FileRequest::ReadAt { .. } => "read_at",
10434            FileRequest::WriteAt { .. } => "write_at",
10435            FileRequest::Resize { .. } => "resize",
10436            FileRequest::GetBackingMemory { .. } => "get_backing_memory",
10437            FileRequest::Allocate { .. } => "allocate",
10438            FileRequest::EnableVerity { .. } => "enable_verity",
10439            FileRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10440                "unknown one-way method"
10441            }
10442            FileRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10443                "unknown two-way method"
10444            }
10445        }
10446    }
10447}
10448
10449#[derive(Debug, Clone)]
10450pub struct FileControlHandle {
10451    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10452}
10453
10454impl fidl::endpoints::ControlHandle for FileControlHandle {
10455    fn shutdown(&self) {
10456        self.inner.shutdown()
10457    }
10458    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10459        self.inner.shutdown_with_epitaph(status)
10460    }
10461
10462    fn is_closed(&self) -> bool {
10463        self.inner.channel().is_closed()
10464    }
10465    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10466        self.inner.channel().on_closed()
10467    }
10468
10469    #[cfg(target_os = "fuchsia")]
10470    fn signal_peer(
10471        &self,
10472        clear_mask: zx::Signals,
10473        set_mask: zx::Signals,
10474    ) -> Result<(), zx_status::Status> {
10475        use fidl::Peered;
10476        self.inner.channel().signal_peer(clear_mask, set_mask)
10477    }
10478}
10479
10480impl FileControlHandle {
10481    pub fn send_on_open_(
10482        &self,
10483        mut s: i32,
10484        mut info: Option<NodeInfoDeprecated>,
10485    ) -> Result<(), fidl::Error> {
10486        self.inner.send::<NodeOnOpenRequest>(
10487            (s, info.as_mut()),
10488            0,
10489            0x7fc7bbb1dbfd1972,
10490            fidl::encoding::DynamicFlags::empty(),
10491        )
10492    }
10493
10494    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
10495        self.inner.send::<Representation>(
10496            &mut payload,
10497            0,
10498            0x5cb40567d80a510c,
10499            fidl::encoding::DynamicFlags::empty(),
10500        )
10501    }
10502}
10503
10504#[must_use = "FIDL methods require a response to be sent"]
10505#[derive(Debug)]
10506pub struct FileAdvisoryLockResponder {
10507    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10508    tx_id: u32,
10509}
10510
10511/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10512/// if the responder is dropped without sending a response, so that the client
10513/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10514impl std::ops::Drop for FileAdvisoryLockResponder {
10515    fn drop(&mut self) {
10516        self.control_handle.shutdown();
10517        // Safety: drops once, never accessed again
10518        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10519    }
10520}
10521
10522impl fidl::endpoints::Responder for FileAdvisoryLockResponder {
10523    type ControlHandle = FileControlHandle;
10524
10525    fn control_handle(&self) -> &FileControlHandle {
10526        &self.control_handle
10527    }
10528
10529    fn drop_without_shutdown(mut self) {
10530        // Safety: drops once, never accessed again due to mem::forget
10531        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10532        // Prevent Drop from running (which would shut down the channel)
10533        std::mem::forget(self);
10534    }
10535}
10536
10537impl FileAdvisoryLockResponder {
10538    /// Sends a response to the FIDL transaction.
10539    ///
10540    /// Sets the channel to shutdown if an error occurs.
10541    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10542        let _result = self.send_raw(result);
10543        if _result.is_err() {
10544            self.control_handle.shutdown();
10545        }
10546        self.drop_without_shutdown();
10547        _result
10548    }
10549
10550    /// Similar to "send" but does not shutdown the channel if an error occurs.
10551    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10552        let _result = self.send_raw(result);
10553        self.drop_without_shutdown();
10554        _result
10555    }
10556
10557    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10558        self.control_handle
10559            .inner
10560            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10561                result,
10562                self.tx_id,
10563                0x6ee9c0ad53ec87aa,
10564                fidl::encoding::DynamicFlags::empty(),
10565            )
10566    }
10567}
10568
10569#[must_use = "FIDL methods require a response to be sent"]
10570#[derive(Debug)]
10571pub struct FileLinkIntoResponder {
10572    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10573    tx_id: u32,
10574}
10575
10576/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10577/// if the responder is dropped without sending a response, so that the client
10578/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10579impl std::ops::Drop for FileLinkIntoResponder {
10580    fn drop(&mut self) {
10581        self.control_handle.shutdown();
10582        // Safety: drops once, never accessed again
10583        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10584    }
10585}
10586
10587impl fidl::endpoints::Responder for FileLinkIntoResponder {
10588    type ControlHandle = FileControlHandle;
10589
10590    fn control_handle(&self) -> &FileControlHandle {
10591        &self.control_handle
10592    }
10593
10594    fn drop_without_shutdown(mut self) {
10595        // Safety: drops once, never accessed again due to mem::forget
10596        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10597        // Prevent Drop from running (which would shut down the channel)
10598        std::mem::forget(self);
10599    }
10600}
10601
10602impl FileLinkIntoResponder {
10603    /// Sends a response to the FIDL transaction.
10604    ///
10605    /// Sets the channel to shutdown if an error occurs.
10606    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10607        let _result = self.send_raw(result);
10608        if _result.is_err() {
10609            self.control_handle.shutdown();
10610        }
10611        self.drop_without_shutdown();
10612        _result
10613    }
10614
10615    /// Similar to "send" but does not shutdown the channel if an error occurs.
10616    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10617        let _result = self.send_raw(result);
10618        self.drop_without_shutdown();
10619        _result
10620    }
10621
10622    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10623        self.control_handle
10624            .inner
10625            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10626                result,
10627                self.tx_id,
10628                0x54f3949246a03e74,
10629                fidl::encoding::DynamicFlags::empty(),
10630            )
10631    }
10632}
10633
10634#[must_use = "FIDL methods require a response to be sent"]
10635#[derive(Debug)]
10636pub struct FileCloseResponder {
10637    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10638    tx_id: u32,
10639}
10640
10641/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10642/// if the responder is dropped without sending a response, so that the client
10643/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10644impl std::ops::Drop for FileCloseResponder {
10645    fn drop(&mut self) {
10646        self.control_handle.shutdown();
10647        // Safety: drops once, never accessed again
10648        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10649    }
10650}
10651
10652impl fidl::endpoints::Responder for FileCloseResponder {
10653    type ControlHandle = FileControlHandle;
10654
10655    fn control_handle(&self) -> &FileControlHandle {
10656        &self.control_handle
10657    }
10658
10659    fn drop_without_shutdown(mut self) {
10660        // Safety: drops once, never accessed again due to mem::forget
10661        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10662        // Prevent Drop from running (which would shut down the channel)
10663        std::mem::forget(self);
10664    }
10665}
10666
10667impl FileCloseResponder {
10668    /// Sends a response to the FIDL transaction.
10669    ///
10670    /// Sets the channel to shutdown if an error occurs.
10671    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10672        let _result = self.send_raw(result);
10673        if _result.is_err() {
10674            self.control_handle.shutdown();
10675        }
10676        self.drop_without_shutdown();
10677        _result
10678    }
10679
10680    /// Similar to "send" but does not shutdown the channel if an error occurs.
10681    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10682        let _result = self.send_raw(result);
10683        self.drop_without_shutdown();
10684        _result
10685    }
10686
10687    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10688        self.control_handle
10689            .inner
10690            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10691                result,
10692                self.tx_id,
10693                0x5ac5d459ad7f657e,
10694                fidl::encoding::DynamicFlags::empty(),
10695            )
10696    }
10697}
10698
10699#[must_use = "FIDL methods require a response to be sent"]
10700#[derive(Debug)]
10701pub struct FileQueryResponder {
10702    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10703    tx_id: u32,
10704}
10705
10706/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10707/// if the responder is dropped without sending a response, so that the client
10708/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10709impl std::ops::Drop for FileQueryResponder {
10710    fn drop(&mut self) {
10711        self.control_handle.shutdown();
10712        // Safety: drops once, never accessed again
10713        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10714    }
10715}
10716
10717impl fidl::endpoints::Responder for FileQueryResponder {
10718    type ControlHandle = FileControlHandle;
10719
10720    fn control_handle(&self) -> &FileControlHandle {
10721        &self.control_handle
10722    }
10723
10724    fn drop_without_shutdown(mut self) {
10725        // Safety: drops once, never accessed again due to mem::forget
10726        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10727        // Prevent Drop from running (which would shut down the channel)
10728        std::mem::forget(self);
10729    }
10730}
10731
10732impl FileQueryResponder {
10733    /// Sends a response to the FIDL transaction.
10734    ///
10735    /// Sets the channel to shutdown if an error occurs.
10736    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10737        let _result = self.send_raw(protocol);
10738        if _result.is_err() {
10739            self.control_handle.shutdown();
10740        }
10741        self.drop_without_shutdown();
10742        _result
10743    }
10744
10745    /// Similar to "send" but does not shutdown the channel if an error occurs.
10746    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10747        let _result = self.send_raw(protocol);
10748        self.drop_without_shutdown();
10749        _result
10750    }
10751
10752    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10753        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
10754            (protocol,),
10755            self.tx_id,
10756            0x2658edee9decfc06,
10757            fidl::encoding::DynamicFlags::empty(),
10758        )
10759    }
10760}
10761
10762#[must_use = "FIDL methods require a response to be sent"]
10763#[derive(Debug)]
10764pub struct FileGetAttrResponder {
10765    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10766    tx_id: u32,
10767}
10768
10769/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10770/// if the responder is dropped without sending a response, so that the client
10771/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10772impl std::ops::Drop for FileGetAttrResponder {
10773    fn drop(&mut self) {
10774        self.control_handle.shutdown();
10775        // Safety: drops once, never accessed again
10776        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10777    }
10778}
10779
10780impl fidl::endpoints::Responder for FileGetAttrResponder {
10781    type ControlHandle = FileControlHandle;
10782
10783    fn control_handle(&self) -> &FileControlHandle {
10784        &self.control_handle
10785    }
10786
10787    fn drop_without_shutdown(mut self) {
10788        // Safety: drops once, never accessed again due to mem::forget
10789        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10790        // Prevent Drop from running (which would shut down the channel)
10791        std::mem::forget(self);
10792    }
10793}
10794
10795impl FileGetAttrResponder {
10796    /// Sends a response to the FIDL transaction.
10797    ///
10798    /// Sets the channel to shutdown if an error occurs.
10799    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
10800        let _result = self.send_raw(s, attributes);
10801        if _result.is_err() {
10802            self.control_handle.shutdown();
10803        }
10804        self.drop_without_shutdown();
10805        _result
10806    }
10807
10808    /// Similar to "send" but does not shutdown the channel if an error occurs.
10809    pub fn send_no_shutdown_on_err(
10810        self,
10811        mut s: i32,
10812        mut attributes: &NodeAttributes,
10813    ) -> Result<(), fidl::Error> {
10814        let _result = self.send_raw(s, attributes);
10815        self.drop_without_shutdown();
10816        _result
10817    }
10818
10819    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
10820        self.control_handle.inner.send::<NodeGetAttrResponse>(
10821            (s, attributes),
10822            self.tx_id,
10823            0x78985e216314dafd,
10824            fidl::encoding::DynamicFlags::empty(),
10825        )
10826    }
10827}
10828
10829#[must_use = "FIDL methods require a response to be sent"]
10830#[derive(Debug)]
10831pub struct FileDeprecatedSetAttrResponder {
10832    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10833    tx_id: u32,
10834}
10835
10836/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10837/// if the responder is dropped without sending a response, so that the client
10838/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10839impl std::ops::Drop for FileDeprecatedSetAttrResponder {
10840    fn drop(&mut self) {
10841        self.control_handle.shutdown();
10842        // Safety: drops once, never accessed again
10843        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10844    }
10845}
10846
10847impl fidl::endpoints::Responder for FileDeprecatedSetAttrResponder {
10848    type ControlHandle = FileControlHandle;
10849
10850    fn control_handle(&self) -> &FileControlHandle {
10851        &self.control_handle
10852    }
10853
10854    fn drop_without_shutdown(mut self) {
10855        // Safety: drops once, never accessed again due to mem::forget
10856        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10857        // Prevent Drop from running (which would shut down the channel)
10858        std::mem::forget(self);
10859    }
10860}
10861
10862impl FileDeprecatedSetAttrResponder {
10863    /// Sends a response to the FIDL transaction.
10864    ///
10865    /// Sets the channel to shutdown if an error occurs.
10866    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
10867        let _result = self.send_raw(s);
10868        if _result.is_err() {
10869            self.control_handle.shutdown();
10870        }
10871        self.drop_without_shutdown();
10872        _result
10873    }
10874
10875    /// Similar to "send" but does not shutdown the channel if an error occurs.
10876    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
10877        let _result = self.send_raw(s);
10878        self.drop_without_shutdown();
10879        _result
10880    }
10881
10882    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
10883        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
10884            (s,),
10885            self.tx_id,
10886            0x4186c0f40d938f46,
10887            fidl::encoding::DynamicFlags::empty(),
10888        )
10889    }
10890}
10891
10892#[must_use = "FIDL methods require a response to be sent"]
10893#[derive(Debug)]
10894pub struct FileDeprecatedGetFlagsResponder {
10895    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10896    tx_id: u32,
10897}
10898
10899/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10900/// if the responder is dropped without sending a response, so that the client
10901/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10902impl std::ops::Drop for FileDeprecatedGetFlagsResponder {
10903    fn drop(&mut self) {
10904        self.control_handle.shutdown();
10905        // Safety: drops once, never accessed again
10906        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10907    }
10908}
10909
10910impl fidl::endpoints::Responder for FileDeprecatedGetFlagsResponder {
10911    type ControlHandle = FileControlHandle;
10912
10913    fn control_handle(&self) -> &FileControlHandle {
10914        &self.control_handle
10915    }
10916
10917    fn drop_without_shutdown(mut self) {
10918        // Safety: drops once, never accessed again due to mem::forget
10919        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10920        // Prevent Drop from running (which would shut down the channel)
10921        std::mem::forget(self);
10922    }
10923}
10924
10925impl FileDeprecatedGetFlagsResponder {
10926    /// Sends a response to the FIDL transaction.
10927    ///
10928    /// Sets the channel to shutdown if an error occurs.
10929    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
10930        let _result = self.send_raw(s, flags);
10931        if _result.is_err() {
10932            self.control_handle.shutdown();
10933        }
10934        self.drop_without_shutdown();
10935        _result
10936    }
10937
10938    /// Similar to "send" but does not shutdown the channel if an error occurs.
10939    pub fn send_no_shutdown_on_err(
10940        self,
10941        mut s: i32,
10942        mut flags: OpenFlags,
10943    ) -> Result<(), fidl::Error> {
10944        let _result = self.send_raw(s, flags);
10945        self.drop_without_shutdown();
10946        _result
10947    }
10948
10949    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
10950        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
10951            (s, flags),
10952            self.tx_id,
10953            0x5b88fffb8eda3aa1,
10954            fidl::encoding::DynamicFlags::empty(),
10955        )
10956    }
10957}
10958
10959#[must_use = "FIDL methods require a response to be sent"]
10960#[derive(Debug)]
10961pub struct FileDeprecatedSetFlagsResponder {
10962    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10963    tx_id: u32,
10964}
10965
10966/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10967/// if the responder is dropped without sending a response, so that the client
10968/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10969impl std::ops::Drop for FileDeprecatedSetFlagsResponder {
10970    fn drop(&mut self) {
10971        self.control_handle.shutdown();
10972        // Safety: drops once, never accessed again
10973        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10974    }
10975}
10976
10977impl fidl::endpoints::Responder for FileDeprecatedSetFlagsResponder {
10978    type ControlHandle = FileControlHandle;
10979
10980    fn control_handle(&self) -> &FileControlHandle {
10981        &self.control_handle
10982    }
10983
10984    fn drop_without_shutdown(mut self) {
10985        // Safety: drops once, never accessed again due to mem::forget
10986        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10987        // Prevent Drop from running (which would shut down the channel)
10988        std::mem::forget(self);
10989    }
10990}
10991
10992impl FileDeprecatedSetFlagsResponder {
10993    /// Sends a response to the FIDL transaction.
10994    ///
10995    /// Sets the channel to shutdown if an error occurs.
10996    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
10997        let _result = self.send_raw(s);
10998        if _result.is_err() {
10999            self.control_handle.shutdown();
11000        }
11001        self.drop_without_shutdown();
11002        _result
11003    }
11004
11005    /// Similar to "send" but does not shutdown the channel if an error occurs.
11006    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
11007        let _result = self.send_raw(s);
11008        self.drop_without_shutdown();
11009        _result
11010    }
11011
11012    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
11013        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
11014            (s,),
11015            self.tx_id,
11016            0x5295b76c71fde733,
11017            fidl::encoding::DynamicFlags::empty(),
11018        )
11019    }
11020}
11021
11022#[must_use = "FIDL methods require a response to be sent"]
11023#[derive(Debug)]
11024pub struct FileGetFlagsResponder {
11025    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11026    tx_id: u32,
11027}
11028
11029/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11030/// if the responder is dropped without sending a response, so that the client
11031/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11032impl std::ops::Drop for FileGetFlagsResponder {
11033    fn drop(&mut self) {
11034        self.control_handle.shutdown();
11035        // Safety: drops once, never accessed again
11036        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11037    }
11038}
11039
11040impl fidl::endpoints::Responder for FileGetFlagsResponder {
11041    type ControlHandle = FileControlHandle;
11042
11043    fn control_handle(&self) -> &FileControlHandle {
11044        &self.control_handle
11045    }
11046
11047    fn drop_without_shutdown(mut self) {
11048        // Safety: drops once, never accessed again due to mem::forget
11049        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11050        // Prevent Drop from running (which would shut down the channel)
11051        std::mem::forget(self);
11052    }
11053}
11054
11055impl FileGetFlagsResponder {
11056    /// Sends a response to the FIDL transaction.
11057    ///
11058    /// Sets the channel to shutdown if an error occurs.
11059    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11060        let _result = self.send_raw(result);
11061        if _result.is_err() {
11062            self.control_handle.shutdown();
11063        }
11064        self.drop_without_shutdown();
11065        _result
11066    }
11067
11068    /// Similar to "send" but does not shutdown the channel if an error occurs.
11069    pub fn send_no_shutdown_on_err(
11070        self,
11071        mut result: Result<Flags, i32>,
11072    ) -> Result<(), fidl::Error> {
11073        let _result = self.send_raw(result);
11074        self.drop_without_shutdown();
11075        _result
11076    }
11077
11078    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11079        self.control_handle
11080            .inner
11081            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
11082                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
11083                self.tx_id,
11084                0x176eb318f64ec23,
11085                fidl::encoding::DynamicFlags::FLEXIBLE,
11086            )
11087    }
11088}
11089
11090#[must_use = "FIDL methods require a response to be sent"]
11091#[derive(Debug)]
11092pub struct FileSetFlagsResponder {
11093    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11094    tx_id: u32,
11095}
11096
11097/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11098/// if the responder is dropped without sending a response, so that the client
11099/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11100impl std::ops::Drop for FileSetFlagsResponder {
11101    fn drop(&mut self) {
11102        self.control_handle.shutdown();
11103        // Safety: drops once, never accessed again
11104        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11105    }
11106}
11107
11108impl fidl::endpoints::Responder for FileSetFlagsResponder {
11109    type ControlHandle = FileControlHandle;
11110
11111    fn control_handle(&self) -> &FileControlHandle {
11112        &self.control_handle
11113    }
11114
11115    fn drop_without_shutdown(mut self) {
11116        // Safety: drops once, never accessed again due to mem::forget
11117        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11118        // Prevent Drop from running (which would shut down the channel)
11119        std::mem::forget(self);
11120    }
11121}
11122
11123impl FileSetFlagsResponder {
11124    /// Sends a response to the FIDL transaction.
11125    ///
11126    /// Sets the channel to shutdown if an error occurs.
11127    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11128        let _result = self.send_raw(result);
11129        if _result.is_err() {
11130            self.control_handle.shutdown();
11131        }
11132        self.drop_without_shutdown();
11133        _result
11134    }
11135
11136    /// Similar to "send" but does not shutdown the channel if an error occurs.
11137    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11138        let _result = self.send_raw(result);
11139        self.drop_without_shutdown();
11140        _result
11141    }
11142
11143    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11144        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11145            fidl::encoding::EmptyStruct,
11146            i32,
11147        >>(
11148            fidl::encoding::FlexibleResult::new(result),
11149            self.tx_id,
11150            0x55a8028685791ea8,
11151            fidl::encoding::DynamicFlags::FLEXIBLE,
11152        )
11153    }
11154}
11155
11156#[must_use = "FIDL methods require a response to be sent"]
11157#[derive(Debug)]
11158pub struct FileQueryFilesystemResponder {
11159    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11160    tx_id: u32,
11161}
11162
11163/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11164/// if the responder is dropped without sending a response, so that the client
11165/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11166impl std::ops::Drop for FileQueryFilesystemResponder {
11167    fn drop(&mut self) {
11168        self.control_handle.shutdown();
11169        // Safety: drops once, never accessed again
11170        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11171    }
11172}
11173
11174impl fidl::endpoints::Responder for FileQueryFilesystemResponder {
11175    type ControlHandle = FileControlHandle;
11176
11177    fn control_handle(&self) -> &FileControlHandle {
11178        &self.control_handle
11179    }
11180
11181    fn drop_without_shutdown(mut self) {
11182        // Safety: drops once, never accessed again due to mem::forget
11183        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11184        // Prevent Drop from running (which would shut down the channel)
11185        std::mem::forget(self);
11186    }
11187}
11188
11189impl FileQueryFilesystemResponder {
11190    /// Sends a response to the FIDL transaction.
11191    ///
11192    /// Sets the channel to shutdown if an error occurs.
11193    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11194        let _result = self.send_raw(s, info);
11195        if _result.is_err() {
11196            self.control_handle.shutdown();
11197        }
11198        self.drop_without_shutdown();
11199        _result
11200    }
11201
11202    /// Similar to "send" but does not shutdown the channel if an error occurs.
11203    pub fn send_no_shutdown_on_err(
11204        self,
11205        mut s: i32,
11206        mut info: Option<&FilesystemInfo>,
11207    ) -> Result<(), fidl::Error> {
11208        let _result = self.send_raw(s, info);
11209        self.drop_without_shutdown();
11210        _result
11211    }
11212
11213    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11214        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
11215            (s, info),
11216            self.tx_id,
11217            0x6f344a1c6b0a0610,
11218            fidl::encoding::DynamicFlags::empty(),
11219        )
11220    }
11221}
11222
11223#[must_use = "FIDL methods require a response to be sent"]
11224#[derive(Debug)]
11225pub struct FileGetAttributesResponder {
11226    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11227    tx_id: u32,
11228}
11229
11230/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11231/// if the responder is dropped without sending a response, so that the client
11232/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11233impl std::ops::Drop for FileGetAttributesResponder {
11234    fn drop(&mut self) {
11235        self.control_handle.shutdown();
11236        // Safety: drops once, never accessed again
11237        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11238    }
11239}
11240
11241impl fidl::endpoints::Responder for FileGetAttributesResponder {
11242    type ControlHandle = FileControlHandle;
11243
11244    fn control_handle(&self) -> &FileControlHandle {
11245        &self.control_handle
11246    }
11247
11248    fn drop_without_shutdown(mut self) {
11249        // Safety: drops once, never accessed again due to mem::forget
11250        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11251        // Prevent Drop from running (which would shut down the channel)
11252        std::mem::forget(self);
11253    }
11254}
11255
11256impl FileGetAttributesResponder {
11257    /// Sends a response to the FIDL transaction.
11258    ///
11259    /// Sets the channel to shutdown if an error occurs.
11260    pub fn send(
11261        self,
11262        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11263    ) -> Result<(), fidl::Error> {
11264        let _result = self.send_raw(result);
11265        if _result.is_err() {
11266            self.control_handle.shutdown();
11267        }
11268        self.drop_without_shutdown();
11269        _result
11270    }
11271
11272    /// Similar to "send" but does not shutdown the channel if an error occurs.
11273    pub fn send_no_shutdown_on_err(
11274        self,
11275        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11276    ) -> Result<(), fidl::Error> {
11277        let _result = self.send_raw(result);
11278        self.drop_without_shutdown();
11279        _result
11280    }
11281
11282    fn send_raw(
11283        &self,
11284        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11285    ) -> Result<(), fidl::Error> {
11286        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
11287            result,
11288            self.tx_id,
11289            0x3d4396a638ea053b,
11290            fidl::encoding::DynamicFlags::empty(),
11291        )
11292    }
11293}
11294
11295#[must_use = "FIDL methods require a response to be sent"]
11296#[derive(Debug)]
11297pub struct FileUpdateAttributesResponder {
11298    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11299    tx_id: u32,
11300}
11301
11302/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11303/// if the responder is dropped without sending a response, so that the client
11304/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11305impl std::ops::Drop for FileUpdateAttributesResponder {
11306    fn drop(&mut self) {
11307        self.control_handle.shutdown();
11308        // Safety: drops once, never accessed again
11309        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11310    }
11311}
11312
11313impl fidl::endpoints::Responder for FileUpdateAttributesResponder {
11314    type ControlHandle = FileControlHandle;
11315
11316    fn control_handle(&self) -> &FileControlHandle {
11317        &self.control_handle
11318    }
11319
11320    fn drop_without_shutdown(mut self) {
11321        // Safety: drops once, never accessed again due to mem::forget
11322        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11323        // Prevent Drop from running (which would shut down the channel)
11324        std::mem::forget(self);
11325    }
11326}
11327
11328impl FileUpdateAttributesResponder {
11329    /// Sends a response to the FIDL transaction.
11330    ///
11331    /// Sets the channel to shutdown if an error occurs.
11332    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11333        let _result = self.send_raw(result);
11334        if _result.is_err() {
11335            self.control_handle.shutdown();
11336        }
11337        self.drop_without_shutdown();
11338        _result
11339    }
11340
11341    /// Similar to "send" but does not shutdown the channel if an error occurs.
11342    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11343        let _result = self.send_raw(result);
11344        self.drop_without_shutdown();
11345        _result
11346    }
11347
11348    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11349        self.control_handle
11350            .inner
11351            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11352                result,
11353                self.tx_id,
11354                0x3308c1da5a89bf08,
11355                fidl::encoding::DynamicFlags::empty(),
11356            )
11357    }
11358}
11359
11360#[must_use = "FIDL methods require a response to be sent"]
11361#[derive(Debug)]
11362pub struct FileSyncResponder {
11363    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11364    tx_id: u32,
11365}
11366
11367/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11368/// if the responder is dropped without sending a response, so that the client
11369/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11370impl std::ops::Drop for FileSyncResponder {
11371    fn drop(&mut self) {
11372        self.control_handle.shutdown();
11373        // Safety: drops once, never accessed again
11374        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11375    }
11376}
11377
11378impl fidl::endpoints::Responder for FileSyncResponder {
11379    type ControlHandle = FileControlHandle;
11380
11381    fn control_handle(&self) -> &FileControlHandle {
11382        &self.control_handle
11383    }
11384
11385    fn drop_without_shutdown(mut self) {
11386        // Safety: drops once, never accessed again due to mem::forget
11387        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11388        // Prevent Drop from running (which would shut down the channel)
11389        std::mem::forget(self);
11390    }
11391}
11392
11393impl FileSyncResponder {
11394    /// Sends a response to the FIDL transaction.
11395    ///
11396    /// Sets the channel to shutdown if an error occurs.
11397    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11398        let _result = self.send_raw(result);
11399        if _result.is_err() {
11400            self.control_handle.shutdown();
11401        }
11402        self.drop_without_shutdown();
11403        _result
11404    }
11405
11406    /// Similar to "send" but does not shutdown the channel if an error occurs.
11407    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11408        let _result = self.send_raw(result);
11409        self.drop_without_shutdown();
11410        _result
11411    }
11412
11413    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11414        self.control_handle
11415            .inner
11416            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11417                result,
11418                self.tx_id,
11419                0x2c5c27ca0ab5dc49,
11420                fidl::encoding::DynamicFlags::empty(),
11421            )
11422    }
11423}
11424
11425#[must_use = "FIDL methods require a response to be sent"]
11426#[derive(Debug)]
11427pub struct FileGetExtendedAttributeResponder {
11428    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11429    tx_id: u32,
11430}
11431
11432/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11433/// if the responder is dropped without sending a response, so that the client
11434/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11435impl std::ops::Drop for FileGetExtendedAttributeResponder {
11436    fn drop(&mut self) {
11437        self.control_handle.shutdown();
11438        // Safety: drops once, never accessed again
11439        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11440    }
11441}
11442
11443impl fidl::endpoints::Responder for FileGetExtendedAttributeResponder {
11444    type ControlHandle = FileControlHandle;
11445
11446    fn control_handle(&self) -> &FileControlHandle {
11447        &self.control_handle
11448    }
11449
11450    fn drop_without_shutdown(mut self) {
11451        // Safety: drops once, never accessed again due to mem::forget
11452        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11453        // Prevent Drop from running (which would shut down the channel)
11454        std::mem::forget(self);
11455    }
11456}
11457
11458impl FileGetExtendedAttributeResponder {
11459    /// Sends a response to the FIDL transaction.
11460    ///
11461    /// Sets the channel to shutdown if an error occurs.
11462    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11463        let _result = self.send_raw(result);
11464        if _result.is_err() {
11465            self.control_handle.shutdown();
11466        }
11467        self.drop_without_shutdown();
11468        _result
11469    }
11470
11471    /// Similar to "send" but does not shutdown the channel if an error occurs.
11472    pub fn send_no_shutdown_on_err(
11473        self,
11474        mut result: Result<ExtendedAttributeValue, i32>,
11475    ) -> Result<(), fidl::Error> {
11476        let _result = self.send_raw(result);
11477        self.drop_without_shutdown();
11478        _result
11479    }
11480
11481    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11482        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
11483            result.as_mut().map_err(|e| *e),
11484            self.tx_id,
11485            0x45ffa3ccfdeb76db,
11486            fidl::encoding::DynamicFlags::empty(),
11487        )
11488    }
11489}
11490
11491#[must_use = "FIDL methods require a response to be sent"]
11492#[derive(Debug)]
11493pub struct FileSetExtendedAttributeResponder {
11494    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11495    tx_id: u32,
11496}
11497
11498/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11499/// if the responder is dropped without sending a response, so that the client
11500/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11501impl std::ops::Drop for FileSetExtendedAttributeResponder {
11502    fn drop(&mut self) {
11503        self.control_handle.shutdown();
11504        // Safety: drops once, never accessed again
11505        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11506    }
11507}
11508
11509impl fidl::endpoints::Responder for FileSetExtendedAttributeResponder {
11510    type ControlHandle = FileControlHandle;
11511
11512    fn control_handle(&self) -> &FileControlHandle {
11513        &self.control_handle
11514    }
11515
11516    fn drop_without_shutdown(mut self) {
11517        // Safety: drops once, never accessed again due to mem::forget
11518        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11519        // Prevent Drop from running (which would shut down the channel)
11520        std::mem::forget(self);
11521    }
11522}
11523
11524impl FileSetExtendedAttributeResponder {
11525    /// Sends a response to the FIDL transaction.
11526    ///
11527    /// Sets the channel to shutdown if an error occurs.
11528    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11529        let _result = self.send_raw(result);
11530        if _result.is_err() {
11531            self.control_handle.shutdown();
11532        }
11533        self.drop_without_shutdown();
11534        _result
11535    }
11536
11537    /// Similar to "send" but does not shutdown the channel if an error occurs.
11538    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11539        let _result = self.send_raw(result);
11540        self.drop_without_shutdown();
11541        _result
11542    }
11543
11544    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11545        self.control_handle
11546            .inner
11547            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11548                result,
11549                self.tx_id,
11550                0x4a951362f681f23c,
11551                fidl::encoding::DynamicFlags::empty(),
11552            )
11553    }
11554}
11555
11556#[must_use = "FIDL methods require a response to be sent"]
11557#[derive(Debug)]
11558pub struct FileRemoveExtendedAttributeResponder {
11559    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11560    tx_id: u32,
11561}
11562
11563/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11564/// if the responder is dropped without sending a response, so that the client
11565/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11566impl std::ops::Drop for FileRemoveExtendedAttributeResponder {
11567    fn drop(&mut self) {
11568        self.control_handle.shutdown();
11569        // Safety: drops once, never accessed again
11570        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11571    }
11572}
11573
11574impl fidl::endpoints::Responder for FileRemoveExtendedAttributeResponder {
11575    type ControlHandle = FileControlHandle;
11576
11577    fn control_handle(&self) -> &FileControlHandle {
11578        &self.control_handle
11579    }
11580
11581    fn drop_without_shutdown(mut self) {
11582        // Safety: drops once, never accessed again due to mem::forget
11583        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11584        // Prevent Drop from running (which would shut down the channel)
11585        std::mem::forget(self);
11586    }
11587}
11588
11589impl FileRemoveExtendedAttributeResponder {
11590    /// Sends a response to the FIDL transaction.
11591    ///
11592    /// Sets the channel to shutdown if an error occurs.
11593    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11594        let _result = self.send_raw(result);
11595        if _result.is_err() {
11596            self.control_handle.shutdown();
11597        }
11598        self.drop_without_shutdown();
11599        _result
11600    }
11601
11602    /// Similar to "send" but does not shutdown the channel if an error occurs.
11603    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11604        let _result = self.send_raw(result);
11605        self.drop_without_shutdown();
11606        _result
11607    }
11608
11609    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11610        self.control_handle
11611            .inner
11612            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11613                result,
11614                self.tx_id,
11615                0x7a0b9f3a9bf9032d,
11616                fidl::encoding::DynamicFlags::empty(),
11617            )
11618    }
11619}
11620
11621#[must_use = "FIDL methods require a response to be sent"]
11622#[derive(Debug)]
11623pub struct FileReadResponder {
11624    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11625    tx_id: u32,
11626}
11627
11628/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11629/// if the responder is dropped without sending a response, so that the client
11630/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11631impl std::ops::Drop for FileReadResponder {
11632    fn drop(&mut self) {
11633        self.control_handle.shutdown();
11634        // Safety: drops once, never accessed again
11635        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11636    }
11637}
11638
11639impl fidl::endpoints::Responder for FileReadResponder {
11640    type ControlHandle = FileControlHandle;
11641
11642    fn control_handle(&self) -> &FileControlHandle {
11643        &self.control_handle
11644    }
11645
11646    fn drop_without_shutdown(mut self) {
11647        // Safety: drops once, never accessed again due to mem::forget
11648        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11649        // Prevent Drop from running (which would shut down the channel)
11650        std::mem::forget(self);
11651    }
11652}
11653
11654impl FileReadResponder {
11655    /// Sends a response to the FIDL transaction.
11656    ///
11657    /// Sets the channel to shutdown if an error occurs.
11658    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11659        let _result = self.send_raw(result);
11660        if _result.is_err() {
11661            self.control_handle.shutdown();
11662        }
11663        self.drop_without_shutdown();
11664        _result
11665    }
11666
11667    /// Similar to "send" but does not shutdown the channel if an error occurs.
11668    pub fn send_no_shutdown_on_err(
11669        self,
11670        mut result: Result<&[u8], i32>,
11671    ) -> Result<(), fidl::Error> {
11672        let _result = self.send_raw(result);
11673        self.drop_without_shutdown();
11674        _result
11675    }
11676
11677    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11678        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
11679            result.map(|data| (data,)),
11680            self.tx_id,
11681            0x57e419a298c8ede,
11682            fidl::encoding::DynamicFlags::empty(),
11683        )
11684    }
11685}
11686
11687#[must_use = "FIDL methods require a response to be sent"]
11688#[derive(Debug)]
11689pub struct FileWriteResponder {
11690    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11691    tx_id: u32,
11692}
11693
11694/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11695/// if the responder is dropped without sending a response, so that the client
11696/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11697impl std::ops::Drop for FileWriteResponder {
11698    fn drop(&mut self) {
11699        self.control_handle.shutdown();
11700        // Safety: drops once, never accessed again
11701        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11702    }
11703}
11704
11705impl fidl::endpoints::Responder for FileWriteResponder {
11706    type ControlHandle = FileControlHandle;
11707
11708    fn control_handle(&self) -> &FileControlHandle {
11709        &self.control_handle
11710    }
11711
11712    fn drop_without_shutdown(mut self) {
11713        // Safety: drops once, never accessed again due to mem::forget
11714        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11715        // Prevent Drop from running (which would shut down the channel)
11716        std::mem::forget(self);
11717    }
11718}
11719
11720impl FileWriteResponder {
11721    /// Sends a response to the FIDL transaction.
11722    ///
11723    /// Sets the channel to shutdown if an error occurs.
11724    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11725        let _result = self.send_raw(result);
11726        if _result.is_err() {
11727            self.control_handle.shutdown();
11728        }
11729        self.drop_without_shutdown();
11730        _result
11731    }
11732
11733    /// Similar to "send" but does not shutdown the channel if an error occurs.
11734    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11735        let _result = self.send_raw(result);
11736        self.drop_without_shutdown();
11737        _result
11738    }
11739
11740    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11741        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
11742            result.map(|actual_count| (actual_count,)),
11743            self.tx_id,
11744            0x6a31437832469f82,
11745            fidl::encoding::DynamicFlags::empty(),
11746        )
11747    }
11748}
11749
11750#[must_use = "FIDL methods require a response to be sent"]
11751#[derive(Debug)]
11752pub struct FileDescribeResponder {
11753    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11754    tx_id: u32,
11755}
11756
11757/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11758/// if the responder is dropped without sending a response, so that the client
11759/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11760impl std::ops::Drop for FileDescribeResponder {
11761    fn drop(&mut self) {
11762        self.control_handle.shutdown();
11763        // Safety: drops once, never accessed again
11764        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11765    }
11766}
11767
11768impl fidl::endpoints::Responder for FileDescribeResponder {
11769    type ControlHandle = FileControlHandle;
11770
11771    fn control_handle(&self) -> &FileControlHandle {
11772        &self.control_handle
11773    }
11774
11775    fn drop_without_shutdown(mut self) {
11776        // Safety: drops once, never accessed again due to mem::forget
11777        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11778        // Prevent Drop from running (which would shut down the channel)
11779        std::mem::forget(self);
11780    }
11781}
11782
11783impl FileDescribeResponder {
11784    /// Sends a response to the FIDL transaction.
11785    ///
11786    /// Sets the channel to shutdown if an error occurs.
11787    pub fn send(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11788        let _result = self.send_raw(payload);
11789        if _result.is_err() {
11790            self.control_handle.shutdown();
11791        }
11792        self.drop_without_shutdown();
11793        _result
11794    }
11795
11796    /// Similar to "send" but does not shutdown the channel if an error occurs.
11797    pub fn send_no_shutdown_on_err(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11798        let _result = self.send_raw(payload);
11799        self.drop_without_shutdown();
11800        _result
11801    }
11802
11803    fn send_raw(&self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11804        self.control_handle.inner.send::<FileInfo>(
11805            &mut payload,
11806            self.tx_id,
11807            0x68b5ac00c62906bc,
11808            fidl::encoding::DynamicFlags::empty(),
11809        )
11810    }
11811}
11812
11813#[must_use = "FIDL methods require a response to be sent"]
11814#[derive(Debug)]
11815pub struct FileSeekResponder {
11816    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11817    tx_id: u32,
11818}
11819
11820/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11821/// if the responder is dropped without sending a response, so that the client
11822/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11823impl std::ops::Drop for FileSeekResponder {
11824    fn drop(&mut self) {
11825        self.control_handle.shutdown();
11826        // Safety: drops once, never accessed again
11827        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11828    }
11829}
11830
11831impl fidl::endpoints::Responder for FileSeekResponder {
11832    type ControlHandle = FileControlHandle;
11833
11834    fn control_handle(&self) -> &FileControlHandle {
11835        &self.control_handle
11836    }
11837
11838    fn drop_without_shutdown(mut self) {
11839        // Safety: drops once, never accessed again due to mem::forget
11840        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11841        // Prevent Drop from running (which would shut down the channel)
11842        std::mem::forget(self);
11843    }
11844}
11845
11846impl FileSeekResponder {
11847    /// Sends a response to the FIDL transaction.
11848    ///
11849    /// Sets the channel to shutdown if an error occurs.
11850    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11851        let _result = self.send_raw(result);
11852        if _result.is_err() {
11853            self.control_handle.shutdown();
11854        }
11855        self.drop_without_shutdown();
11856        _result
11857    }
11858
11859    /// Similar to "send" but does not shutdown the channel if an error occurs.
11860    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11861        let _result = self.send_raw(result);
11862        self.drop_without_shutdown();
11863        _result
11864    }
11865
11866    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11867        self.control_handle.inner.send::<fidl::encoding::ResultType<FileSeekResponse, i32>>(
11868            result.map(|offset_from_start| (offset_from_start,)),
11869            self.tx_id,
11870            0x78079168162c5207,
11871            fidl::encoding::DynamicFlags::empty(),
11872        )
11873    }
11874}
11875
11876#[must_use = "FIDL methods require a response to be sent"]
11877#[derive(Debug)]
11878pub struct FileReadAtResponder {
11879    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11880    tx_id: u32,
11881}
11882
11883/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11884/// if the responder is dropped without sending a response, so that the client
11885/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11886impl std::ops::Drop for FileReadAtResponder {
11887    fn drop(&mut self) {
11888        self.control_handle.shutdown();
11889        // Safety: drops once, never accessed again
11890        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11891    }
11892}
11893
11894impl fidl::endpoints::Responder for FileReadAtResponder {
11895    type ControlHandle = FileControlHandle;
11896
11897    fn control_handle(&self) -> &FileControlHandle {
11898        &self.control_handle
11899    }
11900
11901    fn drop_without_shutdown(mut self) {
11902        // Safety: drops once, never accessed again due to mem::forget
11903        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11904        // Prevent Drop from running (which would shut down the channel)
11905        std::mem::forget(self);
11906    }
11907}
11908
11909impl FileReadAtResponder {
11910    /// Sends a response to the FIDL transaction.
11911    ///
11912    /// Sets the channel to shutdown if an error occurs.
11913    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11914        let _result = self.send_raw(result);
11915        if _result.is_err() {
11916            self.control_handle.shutdown();
11917        }
11918        self.drop_without_shutdown();
11919        _result
11920    }
11921
11922    /// Similar to "send" but does not shutdown the channel if an error occurs.
11923    pub fn send_no_shutdown_on_err(
11924        self,
11925        mut result: Result<&[u8], i32>,
11926    ) -> Result<(), fidl::Error> {
11927        let _result = self.send_raw(result);
11928        self.drop_without_shutdown();
11929        _result
11930    }
11931
11932    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11933        self.control_handle.inner.send::<fidl::encoding::ResultType<FileReadAtResponse, i32>>(
11934            result.map(|data| (data,)),
11935            self.tx_id,
11936            0x1607a293a60d723e,
11937            fidl::encoding::DynamicFlags::empty(),
11938        )
11939    }
11940}
11941
11942#[must_use = "FIDL methods require a response to be sent"]
11943#[derive(Debug)]
11944pub struct FileWriteAtResponder {
11945    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11946    tx_id: u32,
11947}
11948
11949/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11950/// if the responder is dropped without sending a response, so that the client
11951/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11952impl std::ops::Drop for FileWriteAtResponder {
11953    fn drop(&mut self) {
11954        self.control_handle.shutdown();
11955        // Safety: drops once, never accessed again
11956        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11957    }
11958}
11959
11960impl fidl::endpoints::Responder for FileWriteAtResponder {
11961    type ControlHandle = FileControlHandle;
11962
11963    fn control_handle(&self) -> &FileControlHandle {
11964        &self.control_handle
11965    }
11966
11967    fn drop_without_shutdown(mut self) {
11968        // Safety: drops once, never accessed again due to mem::forget
11969        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11970        // Prevent Drop from running (which would shut down the channel)
11971        std::mem::forget(self);
11972    }
11973}
11974
11975impl FileWriteAtResponder {
11976    /// Sends a response to the FIDL transaction.
11977    ///
11978    /// Sets the channel to shutdown if an error occurs.
11979    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11980        let _result = self.send_raw(result);
11981        if _result.is_err() {
11982            self.control_handle.shutdown();
11983        }
11984        self.drop_without_shutdown();
11985        _result
11986    }
11987
11988    /// Similar to "send" but does not shutdown the channel if an error occurs.
11989    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11990        let _result = self.send_raw(result);
11991        self.drop_without_shutdown();
11992        _result
11993    }
11994
11995    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11996        self.control_handle.inner.send::<fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
11997            result.map(|actual_count| (actual_count,)),
11998            self.tx_id,
11999            0x793eefc0045e792b,
12000            fidl::encoding::DynamicFlags::empty(),
12001        )
12002    }
12003}
12004
12005#[must_use = "FIDL methods require a response to be sent"]
12006#[derive(Debug)]
12007pub struct FileResizeResponder {
12008    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12009    tx_id: u32,
12010}
12011
12012/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12013/// if the responder is dropped without sending a response, so that the client
12014/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12015impl std::ops::Drop for FileResizeResponder {
12016    fn drop(&mut self) {
12017        self.control_handle.shutdown();
12018        // Safety: drops once, never accessed again
12019        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12020    }
12021}
12022
12023impl fidl::endpoints::Responder for FileResizeResponder {
12024    type ControlHandle = FileControlHandle;
12025
12026    fn control_handle(&self) -> &FileControlHandle {
12027        &self.control_handle
12028    }
12029
12030    fn drop_without_shutdown(mut self) {
12031        // Safety: drops once, never accessed again due to mem::forget
12032        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12033        // Prevent Drop from running (which would shut down the channel)
12034        std::mem::forget(self);
12035    }
12036}
12037
12038impl FileResizeResponder {
12039    /// Sends a response to the FIDL transaction.
12040    ///
12041    /// Sets the channel to shutdown if an error occurs.
12042    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12043        let _result = self.send_raw(result);
12044        if _result.is_err() {
12045            self.control_handle.shutdown();
12046        }
12047        self.drop_without_shutdown();
12048        _result
12049    }
12050
12051    /// Similar to "send" but does not shutdown the channel if an error occurs.
12052    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12053        let _result = self.send_raw(result);
12054        self.drop_without_shutdown();
12055        _result
12056    }
12057
12058    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12059        self.control_handle
12060            .inner
12061            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12062                result,
12063                self.tx_id,
12064                0x2b80825f0535743a,
12065                fidl::encoding::DynamicFlags::empty(),
12066            )
12067    }
12068}
12069
12070#[must_use = "FIDL methods require a response to be sent"]
12071#[derive(Debug)]
12072pub struct FileGetBackingMemoryResponder {
12073    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12074    tx_id: u32,
12075}
12076
12077/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12078/// if the responder is dropped without sending a response, so that the client
12079/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12080impl std::ops::Drop for FileGetBackingMemoryResponder {
12081    fn drop(&mut self) {
12082        self.control_handle.shutdown();
12083        // Safety: drops once, never accessed again
12084        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12085    }
12086}
12087
12088impl fidl::endpoints::Responder for FileGetBackingMemoryResponder {
12089    type ControlHandle = FileControlHandle;
12090
12091    fn control_handle(&self) -> &FileControlHandle {
12092        &self.control_handle
12093    }
12094
12095    fn drop_without_shutdown(mut self) {
12096        // Safety: drops once, never accessed again due to mem::forget
12097        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12098        // Prevent Drop from running (which would shut down the channel)
12099        std::mem::forget(self);
12100    }
12101}
12102
12103impl FileGetBackingMemoryResponder {
12104    /// Sends a response to the FIDL transaction.
12105    ///
12106    /// Sets the channel to shutdown if an error occurs.
12107    pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12108        let _result = self.send_raw(result);
12109        if _result.is_err() {
12110            self.control_handle.shutdown();
12111        }
12112        self.drop_without_shutdown();
12113        _result
12114    }
12115
12116    /// Similar to "send" but does not shutdown the channel if an error occurs.
12117    pub fn send_no_shutdown_on_err(
12118        self,
12119        mut result: Result<fidl::Vmo, i32>,
12120    ) -> Result<(), fidl::Error> {
12121        let _result = self.send_raw(result);
12122        self.drop_without_shutdown();
12123        _result
12124    }
12125
12126    fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12127        self.control_handle
12128            .inner
12129            .send::<fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>>(
12130                result.map(|vmo| (vmo,)),
12131                self.tx_id,
12132                0xa6a9e654cbf62b,
12133                fidl::encoding::DynamicFlags::empty(),
12134            )
12135    }
12136}
12137
12138#[must_use = "FIDL methods require a response to be sent"]
12139#[derive(Debug)]
12140pub struct FileAllocateResponder {
12141    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12142    tx_id: u32,
12143}
12144
12145/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12146/// if the responder is dropped without sending a response, so that the client
12147/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12148impl std::ops::Drop for FileAllocateResponder {
12149    fn drop(&mut self) {
12150        self.control_handle.shutdown();
12151        // Safety: drops once, never accessed again
12152        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12153    }
12154}
12155
12156impl fidl::endpoints::Responder for FileAllocateResponder {
12157    type ControlHandle = FileControlHandle;
12158
12159    fn control_handle(&self) -> &FileControlHandle {
12160        &self.control_handle
12161    }
12162
12163    fn drop_without_shutdown(mut self) {
12164        // Safety: drops once, never accessed again due to mem::forget
12165        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12166        // Prevent Drop from running (which would shut down the channel)
12167        std::mem::forget(self);
12168    }
12169}
12170
12171impl FileAllocateResponder {
12172    /// Sends a response to the FIDL transaction.
12173    ///
12174    /// Sets the channel to shutdown if an error occurs.
12175    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12176        let _result = self.send_raw(result);
12177        if _result.is_err() {
12178            self.control_handle.shutdown();
12179        }
12180        self.drop_without_shutdown();
12181        _result
12182    }
12183
12184    /// Similar to "send" but does not shutdown the channel if an error occurs.
12185    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12186        let _result = self.send_raw(result);
12187        self.drop_without_shutdown();
12188        _result
12189    }
12190
12191    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12192        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12193            fidl::encoding::EmptyStruct,
12194            i32,
12195        >>(
12196            fidl::encoding::FlexibleResult::new(result),
12197            self.tx_id,
12198            0x77fa0c330b57fd2e,
12199            fidl::encoding::DynamicFlags::FLEXIBLE,
12200        )
12201    }
12202}
12203
12204#[must_use = "FIDL methods require a response to be sent"]
12205#[derive(Debug)]
12206pub struct FileEnableVerityResponder {
12207    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12208    tx_id: u32,
12209}
12210
12211/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12212/// if the responder is dropped without sending a response, so that the client
12213/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12214impl std::ops::Drop for FileEnableVerityResponder {
12215    fn drop(&mut self) {
12216        self.control_handle.shutdown();
12217        // Safety: drops once, never accessed again
12218        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12219    }
12220}
12221
12222impl fidl::endpoints::Responder for FileEnableVerityResponder {
12223    type ControlHandle = FileControlHandle;
12224
12225    fn control_handle(&self) -> &FileControlHandle {
12226        &self.control_handle
12227    }
12228
12229    fn drop_without_shutdown(mut self) {
12230        // Safety: drops once, never accessed again due to mem::forget
12231        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12232        // Prevent Drop from running (which would shut down the channel)
12233        std::mem::forget(self);
12234    }
12235}
12236
12237impl FileEnableVerityResponder {
12238    /// Sends a response to the FIDL transaction.
12239    ///
12240    /// Sets the channel to shutdown if an error occurs.
12241    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12242        let _result = self.send_raw(result);
12243        if _result.is_err() {
12244            self.control_handle.shutdown();
12245        }
12246        self.drop_without_shutdown();
12247        _result
12248    }
12249
12250    /// Similar to "send" but does not shutdown the channel if an error occurs.
12251    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12252        let _result = self.send_raw(result);
12253        self.drop_without_shutdown();
12254        _result
12255    }
12256
12257    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12258        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12259            fidl::encoding::EmptyStruct,
12260            i32,
12261        >>(
12262            fidl::encoding::FlexibleResult::new(result),
12263            self.tx_id,
12264            0x2c421ec3faaeb8bb,
12265            fidl::encoding::DynamicFlags::FLEXIBLE,
12266        )
12267    }
12268}
12269
12270#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12271pub struct LinkableMarker;
12272
12273impl fidl::endpoints::ProtocolMarker for LinkableMarker {
12274    type Proxy = LinkableProxy;
12275    type RequestStream = LinkableRequestStream;
12276    #[cfg(target_os = "fuchsia")]
12277    type SynchronousProxy = LinkableSynchronousProxy;
12278
12279    const DEBUG_NAME: &'static str = "(anonymous) Linkable";
12280}
12281pub type LinkableLinkIntoResult = Result<(), i32>;
12282
12283pub trait LinkableProxyInterface: Send + Sync {
12284    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
12285        + Send;
12286    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
12287}
12288#[derive(Debug)]
12289#[cfg(target_os = "fuchsia")]
12290pub struct LinkableSynchronousProxy {
12291    client: fidl::client::sync::Client,
12292}
12293
12294#[cfg(target_os = "fuchsia")]
12295impl fidl::endpoints::SynchronousProxy for LinkableSynchronousProxy {
12296    type Proxy = LinkableProxy;
12297    type Protocol = LinkableMarker;
12298
12299    fn from_channel(inner: fidl::Channel) -> Self {
12300        Self::new(inner)
12301    }
12302
12303    fn into_channel(self) -> fidl::Channel {
12304        self.client.into_channel()
12305    }
12306
12307    fn as_channel(&self) -> &fidl::Channel {
12308        self.client.as_channel()
12309    }
12310}
12311
12312#[cfg(target_os = "fuchsia")]
12313impl LinkableSynchronousProxy {
12314    pub fn new(channel: fidl::Channel) -> Self {
12315        let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12316        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
12317    }
12318
12319    pub fn into_channel(self) -> fidl::Channel {
12320        self.client.into_channel()
12321    }
12322
12323    /// Waits until an event arrives and returns it. It is safe for other
12324    /// threads to make concurrent requests while waiting for an event.
12325    pub fn wait_for_event(
12326        &self,
12327        deadline: zx::MonotonicInstant,
12328    ) -> Result<LinkableEvent, fidl::Error> {
12329        LinkableEvent::decode(self.client.wait_for_event(deadline)?)
12330    }
12331
12332    /// Creates a link to this this object with name `dst` in the directory represented by
12333    /// `dst_parent_token`.
12334    ///
12335    /// `dst` must be a resolved object name. Including "/" in the string will return
12336    /// `ZX_ERR_INVALID_ARGS`.
12337    ///
12338    /// This method requires the maximal set of rights supported by the filesystem for this object.
12339    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12340    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12341    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12342    /// `ZX_ERR_ACCESS_DENIED`.
12343    ///
12344    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12345    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12346    ///
12347    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12348    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12349    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12350    ///
12351    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12352    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12353    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12354    pub fn r#link_into(
12355        &self,
12356        mut dst_parent_token: fidl::Event,
12357        mut dst: &str,
12358        ___deadline: zx::MonotonicInstant,
12359    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12360        let _response = self.client.send_query::<
12361            LinkableLinkIntoRequest,
12362            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12363        >(
12364            (dst_parent_token, dst,),
12365            0x54f3949246a03e74,
12366            fidl::encoding::DynamicFlags::empty(),
12367            ___deadline,
12368        )?;
12369        Ok(_response.map(|x| x))
12370    }
12371}
12372
12373#[cfg(target_os = "fuchsia")]
12374impl From<LinkableSynchronousProxy> for zx::Handle {
12375    fn from(value: LinkableSynchronousProxy) -> Self {
12376        value.into_channel().into()
12377    }
12378}
12379
12380#[cfg(target_os = "fuchsia")]
12381impl From<fidl::Channel> for LinkableSynchronousProxy {
12382    fn from(value: fidl::Channel) -> Self {
12383        Self::new(value)
12384    }
12385}
12386
12387#[derive(Debug, Clone)]
12388pub struct LinkableProxy {
12389    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
12390}
12391
12392impl fidl::endpoints::Proxy for LinkableProxy {
12393    type Protocol = LinkableMarker;
12394
12395    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
12396        Self::new(inner)
12397    }
12398
12399    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
12400        self.client.into_channel().map_err(|client| Self { client })
12401    }
12402
12403    fn as_channel(&self) -> &::fidl::AsyncChannel {
12404        self.client.as_channel()
12405    }
12406}
12407
12408impl LinkableProxy {
12409    /// Create a new Proxy for fuchsia.io/Linkable.
12410    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
12411        let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12412        Self { client: fidl::client::Client::new(channel, protocol_name) }
12413    }
12414
12415    /// Get a Stream of events from the remote end of the protocol.
12416    ///
12417    /// # Panics
12418    ///
12419    /// Panics if the event stream was already taken.
12420    pub fn take_event_stream(&self) -> LinkableEventStream {
12421        LinkableEventStream { event_receiver: self.client.take_event_receiver() }
12422    }
12423
12424    /// Creates a link to this this object with name `dst` in the directory represented by
12425    /// `dst_parent_token`.
12426    ///
12427    /// `dst` must be a resolved object name. Including "/" in the string will return
12428    /// `ZX_ERR_INVALID_ARGS`.
12429    ///
12430    /// This method requires the maximal set of rights supported by the filesystem for this object.
12431    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12432    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12433    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12434    /// `ZX_ERR_ACCESS_DENIED`.
12435    ///
12436    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12437    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12438    ///
12439    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12440    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12441    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12442    ///
12443    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12444    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12445    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12446    pub fn r#link_into(
12447        &self,
12448        mut dst_parent_token: fidl::Event,
12449        mut dst: &str,
12450    ) -> fidl::client::QueryResponseFut<
12451        LinkableLinkIntoResult,
12452        fidl::encoding::DefaultFuchsiaResourceDialect,
12453    > {
12454        LinkableProxyInterface::r#link_into(self, dst_parent_token, dst)
12455    }
12456}
12457
12458impl LinkableProxyInterface for LinkableProxy {
12459    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
12460        LinkableLinkIntoResult,
12461        fidl::encoding::DefaultFuchsiaResourceDialect,
12462    >;
12463    fn r#link_into(
12464        &self,
12465        mut dst_parent_token: fidl::Event,
12466        mut dst: &str,
12467    ) -> Self::LinkIntoResponseFut {
12468        fn _decode(
12469            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
12470        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12471            let _response = fidl::client::decode_transaction_body::<
12472                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12473                fidl::encoding::DefaultFuchsiaResourceDialect,
12474                0x54f3949246a03e74,
12475            >(_buf?)?;
12476            Ok(_response.map(|x| x))
12477        }
12478        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
12479            (dst_parent_token, dst),
12480            0x54f3949246a03e74,
12481            fidl::encoding::DynamicFlags::empty(),
12482            _decode,
12483        )
12484    }
12485}
12486
12487pub struct LinkableEventStream {
12488    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
12489}
12490
12491impl std::marker::Unpin for LinkableEventStream {}
12492
12493impl futures::stream::FusedStream for LinkableEventStream {
12494    fn is_terminated(&self) -> bool {
12495        self.event_receiver.is_terminated()
12496    }
12497}
12498
12499impl futures::Stream for LinkableEventStream {
12500    type Item = Result<LinkableEvent, fidl::Error>;
12501
12502    fn poll_next(
12503        mut self: std::pin::Pin<&mut Self>,
12504        cx: &mut std::task::Context<'_>,
12505    ) -> std::task::Poll<Option<Self::Item>> {
12506        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
12507            &mut self.event_receiver,
12508            cx
12509        )?) {
12510            Some(buf) => std::task::Poll::Ready(Some(LinkableEvent::decode(buf))),
12511            None => std::task::Poll::Ready(None),
12512        }
12513    }
12514}
12515
12516#[derive(Debug)]
12517pub enum LinkableEvent {}
12518
12519impl LinkableEvent {
12520    /// Decodes a message buffer as a [`LinkableEvent`].
12521    fn decode(
12522        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
12523    ) -> Result<LinkableEvent, fidl::Error> {
12524        let (bytes, _handles) = buf.split_mut();
12525        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12526        debug_assert_eq!(tx_header.tx_id, 0);
12527        match tx_header.ordinal {
12528            _ => Err(fidl::Error::UnknownOrdinal {
12529                ordinal: tx_header.ordinal,
12530                protocol_name: <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12531            }),
12532        }
12533    }
12534}
12535
12536/// A Stream of incoming requests for fuchsia.io/Linkable.
12537pub struct LinkableRequestStream {
12538    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12539    is_terminated: bool,
12540}
12541
12542impl std::marker::Unpin for LinkableRequestStream {}
12543
12544impl futures::stream::FusedStream for LinkableRequestStream {
12545    fn is_terminated(&self) -> bool {
12546        self.is_terminated
12547    }
12548}
12549
12550impl fidl::endpoints::RequestStream for LinkableRequestStream {
12551    type Protocol = LinkableMarker;
12552    type ControlHandle = LinkableControlHandle;
12553
12554    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
12555        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
12556    }
12557
12558    fn control_handle(&self) -> Self::ControlHandle {
12559        LinkableControlHandle { inner: self.inner.clone() }
12560    }
12561
12562    fn into_inner(
12563        self,
12564    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
12565    {
12566        (self.inner, self.is_terminated)
12567    }
12568
12569    fn from_inner(
12570        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12571        is_terminated: bool,
12572    ) -> Self {
12573        Self { inner, is_terminated }
12574    }
12575}
12576
12577impl futures::Stream for LinkableRequestStream {
12578    type Item = Result<LinkableRequest, fidl::Error>;
12579
12580    fn poll_next(
12581        mut self: std::pin::Pin<&mut Self>,
12582        cx: &mut std::task::Context<'_>,
12583    ) -> std::task::Poll<Option<Self::Item>> {
12584        let this = &mut *self;
12585        if this.inner.check_shutdown(cx) {
12586            this.is_terminated = true;
12587            return std::task::Poll::Ready(None);
12588        }
12589        if this.is_terminated {
12590            panic!("polled LinkableRequestStream after completion");
12591        }
12592        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
12593            |bytes, handles| {
12594                match this.inner.channel().read_etc(cx, bytes, handles) {
12595                    std::task::Poll::Ready(Ok(())) => {}
12596                    std::task::Poll::Pending => return std::task::Poll::Pending,
12597                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
12598                        this.is_terminated = true;
12599                        return std::task::Poll::Ready(None);
12600                    }
12601                    std::task::Poll::Ready(Err(e)) => {
12602                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
12603                            e.into(),
12604                        ))))
12605                    }
12606                }
12607
12608                // A message has been received from the channel
12609                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12610
12611                std::task::Poll::Ready(Some(match header.ordinal {
12612                    0x54f3949246a03e74 => {
12613                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12614                        let mut req = fidl::new_empty!(
12615                            LinkableLinkIntoRequest,
12616                            fidl::encoding::DefaultFuchsiaResourceDialect
12617                        );
12618                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
12619                        let control_handle = LinkableControlHandle { inner: this.inner.clone() };
12620                        Ok(LinkableRequest::LinkInto {
12621                            dst_parent_token: req.dst_parent_token,
12622                            dst: req.dst,
12623
12624                            responder: LinkableLinkIntoResponder {
12625                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12626                                tx_id: header.tx_id,
12627                            },
12628                        })
12629                    }
12630                    _ => Err(fidl::Error::UnknownOrdinal {
12631                        ordinal: header.ordinal,
12632                        protocol_name:
12633                            <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12634                    }),
12635                }))
12636            },
12637        )
12638    }
12639}
12640
12641#[derive(Debug)]
12642pub enum LinkableRequest {
12643    /// Creates a link to this this object with name `dst` in the directory represented by
12644    /// `dst_parent_token`.
12645    ///
12646    /// `dst` must be a resolved object name. Including "/" in the string will return
12647    /// `ZX_ERR_INVALID_ARGS`.
12648    ///
12649    /// This method requires the maximal set of rights supported by the filesystem for this object.
12650    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12651    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12652    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12653    /// `ZX_ERR_ACCESS_DENIED`.
12654    ///
12655    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12656    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12657    ///
12658    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12659    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12660    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12661    ///
12662    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12663    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12664    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12665    LinkInto { dst_parent_token: fidl::Event, dst: String, responder: LinkableLinkIntoResponder },
12666}
12667
12668impl LinkableRequest {
12669    #[allow(irrefutable_let_patterns)]
12670    pub fn into_link_into(self) -> Option<(fidl::Event, String, LinkableLinkIntoResponder)> {
12671        if let LinkableRequest::LinkInto { dst_parent_token, dst, responder } = self {
12672            Some((dst_parent_token, dst, responder))
12673        } else {
12674            None
12675        }
12676    }
12677
12678    /// Name of the method defined in FIDL
12679    pub fn method_name(&self) -> &'static str {
12680        match *self {
12681            LinkableRequest::LinkInto { .. } => "link_into",
12682        }
12683    }
12684}
12685
12686#[derive(Debug, Clone)]
12687pub struct LinkableControlHandle {
12688    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12689}
12690
12691impl fidl::endpoints::ControlHandle for LinkableControlHandle {
12692    fn shutdown(&self) {
12693        self.inner.shutdown()
12694    }
12695    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
12696        self.inner.shutdown_with_epitaph(status)
12697    }
12698
12699    fn is_closed(&self) -> bool {
12700        self.inner.channel().is_closed()
12701    }
12702    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
12703        self.inner.channel().on_closed()
12704    }
12705
12706    #[cfg(target_os = "fuchsia")]
12707    fn signal_peer(
12708        &self,
12709        clear_mask: zx::Signals,
12710        set_mask: zx::Signals,
12711    ) -> Result<(), zx_status::Status> {
12712        use fidl::Peered;
12713        self.inner.channel().signal_peer(clear_mask, set_mask)
12714    }
12715}
12716
12717impl LinkableControlHandle {}
12718
12719#[must_use = "FIDL methods require a response to be sent"]
12720#[derive(Debug)]
12721pub struct LinkableLinkIntoResponder {
12722    control_handle: std::mem::ManuallyDrop<LinkableControlHandle>,
12723    tx_id: u32,
12724}
12725
12726/// Set the the channel to be shutdown (see [`LinkableControlHandle::shutdown`])
12727/// if the responder is dropped without sending a response, so that the client
12728/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12729impl std::ops::Drop for LinkableLinkIntoResponder {
12730    fn drop(&mut self) {
12731        self.control_handle.shutdown();
12732        // Safety: drops once, never accessed again
12733        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12734    }
12735}
12736
12737impl fidl::endpoints::Responder for LinkableLinkIntoResponder {
12738    type ControlHandle = LinkableControlHandle;
12739
12740    fn control_handle(&self) -> &LinkableControlHandle {
12741        &self.control_handle
12742    }
12743
12744    fn drop_without_shutdown(mut self) {
12745        // Safety: drops once, never accessed again due to mem::forget
12746        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12747        // Prevent Drop from running (which would shut down the channel)
12748        std::mem::forget(self);
12749    }
12750}
12751
12752impl LinkableLinkIntoResponder {
12753    /// Sends a response to the FIDL transaction.
12754    ///
12755    /// Sets the channel to shutdown if an error occurs.
12756    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12757        let _result = self.send_raw(result);
12758        if _result.is_err() {
12759            self.control_handle.shutdown();
12760        }
12761        self.drop_without_shutdown();
12762        _result
12763    }
12764
12765    /// Similar to "send" but does not shutdown the channel if an error occurs.
12766    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12767        let _result = self.send_raw(result);
12768        self.drop_without_shutdown();
12769        _result
12770    }
12771
12772    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12773        self.control_handle
12774            .inner
12775            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12776                result,
12777                self.tx_id,
12778                0x54f3949246a03e74,
12779                fidl::encoding::DynamicFlags::empty(),
12780            )
12781    }
12782}
12783
12784#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12785pub struct NodeMarker;
12786
12787impl fidl::endpoints::ProtocolMarker for NodeMarker {
12788    type Proxy = NodeProxy;
12789    type RequestStream = NodeRequestStream;
12790    #[cfg(target_os = "fuchsia")]
12791    type SynchronousProxy = NodeSynchronousProxy;
12792
12793    const DEBUG_NAME: &'static str = "fuchsia.io.Node";
12794}
12795impl fidl::endpoints::DiscoverableProtocolMarker for NodeMarker {}
12796pub type NodeGetFlagsResult = Result<Flags, i32>;
12797pub type NodeSetFlagsResult = Result<(), i32>;
12798pub type NodeGetAttributesResult = Result<(MutableNodeAttributes, ImmutableNodeAttributes), i32>;
12799pub type NodeUpdateAttributesResult = Result<(), i32>;
12800pub type NodeSyncResult = Result<(), i32>;
12801pub type NodeGetExtendedAttributeResult = Result<ExtendedAttributeValue, i32>;
12802pub type NodeSetExtendedAttributeResult = Result<(), i32>;
12803pub type NodeRemoveExtendedAttributeResult = Result<(), i32>;
12804
12805pub trait NodeProxyInterface: Send + Sync {
12806    fn r#clone(
12807        &self,
12808        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12809    ) -> Result<(), fidl::Error>;
12810    type CloseResponseFut: std::future::Future<
12811            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
12812        > + Send;
12813    fn r#close(&self) -> Self::CloseResponseFut;
12814    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
12815    fn r#query(&self) -> Self::QueryResponseFut;
12816    fn r#deprecated_clone(
12817        &self,
12818        flags: OpenFlags,
12819        object: fidl::endpoints::ServerEnd<NodeMarker>,
12820    ) -> Result<(), fidl::Error>;
12821    type GetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
12822        + Send;
12823    fn r#get_attr(&self) -> Self::GetAttrResponseFut;
12824    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
12825    fn r#deprecated_set_attr(
12826        &self,
12827        flags: NodeAttributeFlags,
12828        attributes: &NodeAttributes,
12829    ) -> Self::DeprecatedSetAttrResponseFut;
12830    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
12831        + Send;
12832    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
12833    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
12834        + Send;
12835    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
12836    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
12837        + Send;
12838    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
12839    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
12840        + Send;
12841    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
12842    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
12843        + Send;
12844    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
12845    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
12846        + Send;
12847    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
12848    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
12849        + Send;
12850    fn r#update_attributes(
12851        &self,
12852        payload: &MutableNodeAttributes,
12853    ) -> Self::UpdateAttributesResponseFut;
12854    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
12855    fn r#sync(&self) -> Self::SyncResponseFut;
12856    fn r#list_extended_attributes(
12857        &self,
12858        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
12859    ) -> Result<(), fidl::Error>;
12860    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
12861        + Send;
12862    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
12863    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
12864        + Send;
12865    fn r#set_extended_attribute(
12866        &self,
12867        name: &[u8],
12868        value: ExtendedAttributeValue,
12869        mode: SetExtendedAttributeMode,
12870    ) -> Self::SetExtendedAttributeResponseFut;
12871    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
12872        + Send;
12873    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
12874}
12875#[derive(Debug)]
12876#[cfg(target_os = "fuchsia")]
12877pub struct NodeSynchronousProxy {
12878    client: fidl::client::sync::Client,
12879}
12880
12881#[cfg(target_os = "fuchsia")]
12882impl fidl::endpoints::SynchronousProxy for NodeSynchronousProxy {
12883    type Proxy = NodeProxy;
12884    type Protocol = NodeMarker;
12885
12886    fn from_channel(inner: fidl::Channel) -> Self {
12887        Self::new(inner)
12888    }
12889
12890    fn into_channel(self) -> fidl::Channel {
12891        self.client.into_channel()
12892    }
12893
12894    fn as_channel(&self) -> &fidl::Channel {
12895        self.client.as_channel()
12896    }
12897}
12898
12899#[cfg(target_os = "fuchsia")]
12900impl NodeSynchronousProxy {
12901    pub fn new(channel: fidl::Channel) -> Self {
12902        let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12903        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
12904    }
12905
12906    pub fn into_channel(self) -> fidl::Channel {
12907        self.client.into_channel()
12908    }
12909
12910    /// Waits until an event arrives and returns it. It is safe for other
12911    /// threads to make concurrent requests while waiting for an event.
12912    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<NodeEvent, fidl::Error> {
12913        NodeEvent::decode(self.client.wait_for_event(deadline)?)
12914    }
12915
12916    pub fn r#clone(
12917        &self,
12918        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12919    ) -> Result<(), fidl::Error> {
12920        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
12921            (request,),
12922            0x20d8a7aba2168a79,
12923            fidl::encoding::DynamicFlags::empty(),
12924        )
12925    }
12926
12927    /// Terminates the connection.
12928    ///
12929    /// After calling `Close`, the client must not send any other requests.
12930    ///
12931    /// Servers, after sending the status response, should close the connection
12932    /// regardless of status and without sending an epitaph.
12933    ///
12934    /// Closing the client end of the channel should be semantically equivalent
12935    /// to calling `Close` without knowing when the close has completed or its
12936    /// status.
12937    pub fn r#close(
12938        &self,
12939        ___deadline: zx::MonotonicInstant,
12940    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
12941        let _response = self.client.send_query::<
12942            fidl::encoding::EmptyPayload,
12943            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12944        >(
12945            (),
12946            0x5ac5d459ad7f657e,
12947            fidl::encoding::DynamicFlags::empty(),
12948            ___deadline,
12949        )?;
12950        Ok(_response.map(|x| x))
12951    }
12952
12953    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
12954        let _response = self.client.send_query::<
12955            fidl::encoding::EmptyPayload,
12956            fidl_fuchsia_unknown::QueryableQueryResponse,
12957        >(
12958            (),
12959            0x2658edee9decfc06,
12960            fidl::encoding::DynamicFlags::empty(),
12961            ___deadline,
12962        )?;
12963        Ok(_response.protocol)
12964    }
12965
12966    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
12967    pub fn r#deprecated_clone(
12968        &self,
12969        mut flags: OpenFlags,
12970        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
12971    ) -> Result<(), fidl::Error> {
12972        self.client.send::<NodeDeprecatedCloneRequest>(
12973            (flags, object),
12974            0x5a61678f293ce16f,
12975            fidl::encoding::DynamicFlags::FLEXIBLE,
12976        )
12977    }
12978
12979    /// Acquires information about the node.
12980    ///
12981    /// This method does not require any rights.
12982    pub fn r#get_attr(
12983        &self,
12984        ___deadline: zx::MonotonicInstant,
12985    ) -> Result<(i32, NodeAttributes), fidl::Error> {
12986        let _response =
12987            self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetAttrResponse>(
12988                (),
12989                0x78985e216314dafd,
12990                fidl::encoding::DynamicFlags::empty(),
12991                ___deadline,
12992            )?;
12993        Ok((_response.s, _response.attributes))
12994    }
12995
12996    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
12997    pub fn r#deprecated_set_attr(
12998        &self,
12999        mut flags: NodeAttributeFlags,
13000        mut attributes: &NodeAttributes,
13001        ___deadline: zx::MonotonicInstant,
13002    ) -> Result<i32, fidl::Error> {
13003        let _response =
13004            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
13005                (flags, attributes),
13006                0x4186c0f40d938f46,
13007                fidl::encoding::DynamicFlags::empty(),
13008                ___deadline,
13009            )?;
13010        Ok(_response.s)
13011    }
13012
13013    /// [DEPRECATED - Use new GetFlags method instead.]
13014    pub fn r#deprecated_get_flags(
13015        &self,
13016        ___deadline: zx::MonotonicInstant,
13017    ) -> Result<(i32, OpenFlags), fidl::Error> {
13018        let _response = self
13019            .client
13020            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
13021                (),
13022                0x5b88fffb8eda3aa1,
13023                fidl::encoding::DynamicFlags::empty(),
13024                ___deadline,
13025            )?;
13026        Ok((_response.s, _response.flags))
13027    }
13028
13029    /// [DEPRECATED - Use new SetFlags method instead.]
13030    pub fn r#deprecated_set_flags(
13031        &self,
13032        mut flags: OpenFlags,
13033        ___deadline: zx::MonotonicInstant,
13034    ) -> Result<i32, fidl::Error> {
13035        let _response = self
13036            .client
13037            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
13038                (flags,),
13039                0x5295b76c71fde733,
13040                fidl::encoding::DynamicFlags::empty(),
13041                ___deadline,
13042            )?;
13043        Ok(_response.s)
13044    }
13045
13046    /// Queries the flags that apply to this node after it has been opened/created. This method does
13047    /// not require any rights.
13048    ///
13049    /// Note that the final set of flags that apply to the connection may differ from those
13050    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13051    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13052    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13053    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13054    pub fn r#get_flags(
13055        &self,
13056        ___deadline: zx::MonotonicInstant,
13057    ) -> Result<NodeGetFlagsResult, fidl::Error> {
13058        let _response = self.client.send_query::<
13059            fidl::encoding::EmptyPayload,
13060            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
13061        >(
13062            (),
13063            0x176eb318f64ec23,
13064            fidl::encoding::DynamicFlags::FLEXIBLE,
13065            ___deadline,
13066        )?
13067        .into_result::<NodeMarker>("get_flags")?;
13068        Ok(_response.map(|x| x.flags))
13069    }
13070
13071    /// Sets the flags that apply to this node after it has been opened. This method does not
13072    /// require any rights.
13073    ///
13074    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13075    /// clear append mode.
13076    ///
13077    /// Errors:
13078    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13079    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13080    pub fn r#set_flags(
13081        &self,
13082        mut flags: Flags,
13083        ___deadline: zx::MonotonicInstant,
13084    ) -> Result<NodeSetFlagsResult, fidl::Error> {
13085        let _response = self.client.send_query::<
13086            NodeSetFlagsRequest,
13087            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
13088        >(
13089            (flags,),
13090            0x55a8028685791ea8,
13091            fidl::encoding::DynamicFlags::FLEXIBLE,
13092            ___deadline,
13093        )?
13094        .into_result::<NodeMarker>("set_flags")?;
13095        Ok(_response.map(|x| x))
13096    }
13097
13098    /// Query the filesystem for filesystem-specific information.
13099    pub fn r#query_filesystem(
13100        &self,
13101        ___deadline: zx::MonotonicInstant,
13102    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
13103        let _response =
13104            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
13105                (),
13106                0x6f344a1c6b0a0610,
13107                fidl::encoding::DynamicFlags::empty(),
13108                ___deadline,
13109            )?;
13110        Ok((_response.s, _response.info))
13111    }
13112
13113    /// Acquires information about the node.
13114    ///
13115    /// The attributes of a node should be stable, independent of the
13116    /// specific protocol used to access it.
13117    ///
13118    /// If a particular attribute is not applicable or not supported,
13119    /// filesystems should leave the corresponding field absent.
13120    ///
13121    /// + `query` a bit-mask specifying which attributes to fetch. The server
13122    ///   should not return more than necessary.
13123    /// - `attributes` the returned attributes.
13124    ///
13125    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13126    pub fn r#get_attributes(
13127        &self,
13128        mut query: NodeAttributesQuery,
13129        ___deadline: zx::MonotonicInstant,
13130    ) -> Result<NodeGetAttributesResult, fidl::Error> {
13131        let _response = self.client.send_query::<
13132            NodeGetAttributesRequest,
13133            fidl::encoding::ResultType<NodeAttributes2, i32>,
13134        >(
13135            (query,),
13136            0x3d4396a638ea053b,
13137            fidl::encoding::DynamicFlags::empty(),
13138            ___deadline,
13139        )?;
13140        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
13141    }
13142
13143    /// Updates information about the node.
13144    ///
13145    /// + `attributes` the presence of a table field in `attributes` indicates
13146    /// the intent to update the corresponding attribute.
13147    ///
13148    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13149    ///
13150    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13151    pub fn r#update_attributes(
13152        &self,
13153        mut payload: &MutableNodeAttributes,
13154        ___deadline: zx::MonotonicInstant,
13155    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
13156        let _response = self.client.send_query::<
13157            MutableNodeAttributes,
13158            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13159        >(
13160            payload,
13161            0x3308c1da5a89bf08,
13162            fidl::encoding::DynamicFlags::empty(),
13163            ___deadline,
13164        )?;
13165        Ok(_response.map(|x| x))
13166    }
13167
13168    /// Synchronizes updates to the node to the underlying media, if it exists.
13169    ///
13170    /// This method will return when the filesystem server has flushed the
13171    /// relevant updates to the underlying media, but does not guarantee the
13172    /// underlying media has persisted the information, nor that any information
13173    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13174    /// between operations.
13175    ///
13176    /// This method does not require any rights.
13177    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
13178        let _response = self.client.send_query::<
13179            fidl::encoding::EmptyPayload,
13180            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13181        >(
13182            (),
13183            0x2c5c27ca0ab5dc49,
13184            fidl::encoding::DynamicFlags::empty(),
13185            ___deadline,
13186        )?;
13187        Ok(_response.map(|x| x))
13188    }
13189
13190    /// Creates an iterator over all the extended attribute names associated
13191    /// with this node. If an error occurs it is returned as an epitaph on the
13192    /// iterator request channel, and then the channel is closed.
13193    ///
13194    /// GetExtendedAttributes can be used with any of these names to retrieve
13195    /// the associated value.
13196    ///
13197    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13198    pub fn r#list_extended_attributes(
13199        &self,
13200        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13201    ) -> Result<(), fidl::Error> {
13202        self.client.send::<NodeListExtendedAttributesRequest>(
13203            (iterator,),
13204            0x4b61033de007fcd0,
13205            fidl::encoding::DynamicFlags::empty(),
13206        )
13207    }
13208
13209    /// Get the value associated with the given attribute `name` for this node.
13210    ///
13211    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13212    /// particular structure is imposed on them.
13213    ///
13214    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13215    pub fn r#get_extended_attribute(
13216        &self,
13217        mut name: &[u8],
13218        ___deadline: zx::MonotonicInstant,
13219    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
13220        let _response = self.client.send_query::<
13221            NodeGetExtendedAttributeRequest,
13222            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
13223        >(
13224            (name,),
13225            0x45ffa3ccfdeb76db,
13226            fidl::encoding::DynamicFlags::empty(),
13227            ___deadline,
13228        )?;
13229        Ok(_response.map(|x| x))
13230    }
13231
13232    /// Set the value for the given attribute `name` to `value` for this node.
13233    ///
13234    /// The attribute name may exist, in which case the attribute is updated.
13235    /// If the attribute doesn't exist, it is created. The name should have no
13236    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13237    ///
13238    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13239    pub fn r#set_extended_attribute(
13240        &self,
13241        mut name: &[u8],
13242        mut value: ExtendedAttributeValue,
13243        mut mode: SetExtendedAttributeMode,
13244        ___deadline: zx::MonotonicInstant,
13245    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
13246        let _response = self.client.send_query::<
13247            NodeSetExtendedAttributeRequest,
13248            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13249        >(
13250            (name, &mut value, mode,),
13251            0x4a951362f681f23c,
13252            fidl::encoding::DynamicFlags::empty(),
13253            ___deadline,
13254        )?;
13255        Ok(_response.map(|x| x))
13256    }
13257
13258    /// Remove the specified extended attribute.
13259    ///
13260    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13261    ///
13262    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13263    pub fn r#remove_extended_attribute(
13264        &self,
13265        mut name: &[u8],
13266        ___deadline: zx::MonotonicInstant,
13267    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
13268        let _response = self.client.send_query::<
13269            NodeRemoveExtendedAttributeRequest,
13270            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13271        >(
13272            (name,),
13273            0x7a0b9f3a9bf9032d,
13274            fidl::encoding::DynamicFlags::empty(),
13275            ___deadline,
13276        )?;
13277        Ok(_response.map(|x| x))
13278    }
13279}
13280
13281#[cfg(target_os = "fuchsia")]
13282impl From<NodeSynchronousProxy> for zx::Handle {
13283    fn from(value: NodeSynchronousProxy) -> Self {
13284        value.into_channel().into()
13285    }
13286}
13287
13288#[cfg(target_os = "fuchsia")]
13289impl From<fidl::Channel> for NodeSynchronousProxy {
13290    fn from(value: fidl::Channel) -> Self {
13291        Self::new(value)
13292    }
13293}
13294
13295#[derive(Debug, Clone)]
13296pub struct NodeProxy {
13297    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
13298}
13299
13300impl fidl::endpoints::Proxy for NodeProxy {
13301    type Protocol = NodeMarker;
13302
13303    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
13304        Self::new(inner)
13305    }
13306
13307    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
13308        self.client.into_channel().map_err(|client| Self { client })
13309    }
13310
13311    fn as_channel(&self) -> &::fidl::AsyncChannel {
13312        self.client.as_channel()
13313    }
13314}
13315
13316impl NodeProxy {
13317    /// Create a new Proxy for fuchsia.io/Node.
13318    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
13319        let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
13320        Self { client: fidl::client::Client::new(channel, protocol_name) }
13321    }
13322
13323    /// Get a Stream of events from the remote end of the protocol.
13324    ///
13325    /// # Panics
13326    ///
13327    /// Panics if the event stream was already taken.
13328    pub fn take_event_stream(&self) -> NodeEventStream {
13329        NodeEventStream { event_receiver: self.client.take_event_receiver() }
13330    }
13331
13332    pub fn r#clone(
13333        &self,
13334        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13335    ) -> Result<(), fidl::Error> {
13336        NodeProxyInterface::r#clone(self, request)
13337    }
13338
13339    /// Terminates the connection.
13340    ///
13341    /// After calling `Close`, the client must not send any other requests.
13342    ///
13343    /// Servers, after sending the status response, should close the connection
13344    /// regardless of status and without sending an epitaph.
13345    ///
13346    /// Closing the client end of the channel should be semantically equivalent
13347    /// to calling `Close` without knowing when the close has completed or its
13348    /// status.
13349    pub fn r#close(
13350        &self,
13351    ) -> fidl::client::QueryResponseFut<
13352        fidl_fuchsia_unknown::CloseableCloseResult,
13353        fidl::encoding::DefaultFuchsiaResourceDialect,
13354    > {
13355        NodeProxyInterface::r#close(self)
13356    }
13357
13358    pub fn r#query(
13359        &self,
13360    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
13361    {
13362        NodeProxyInterface::r#query(self)
13363    }
13364
13365    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
13366    pub fn r#deprecated_clone(
13367        &self,
13368        mut flags: OpenFlags,
13369        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13370    ) -> Result<(), fidl::Error> {
13371        NodeProxyInterface::r#deprecated_clone(self, flags, object)
13372    }
13373
13374    /// Acquires information about the node.
13375    ///
13376    /// This method does not require any rights.
13377    pub fn r#get_attr(
13378        &self,
13379    ) -> fidl::client::QueryResponseFut<
13380        (i32, NodeAttributes),
13381        fidl::encoding::DefaultFuchsiaResourceDialect,
13382    > {
13383        NodeProxyInterface::r#get_attr(self)
13384    }
13385
13386    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
13387    pub fn r#deprecated_set_attr(
13388        &self,
13389        mut flags: NodeAttributeFlags,
13390        mut attributes: &NodeAttributes,
13391    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13392        NodeProxyInterface::r#deprecated_set_attr(self, flags, attributes)
13393    }
13394
13395    /// [DEPRECATED - Use new GetFlags method instead.]
13396    pub fn r#deprecated_get_flags(
13397        &self,
13398    ) -> fidl::client::QueryResponseFut<
13399        (i32, OpenFlags),
13400        fidl::encoding::DefaultFuchsiaResourceDialect,
13401    > {
13402        NodeProxyInterface::r#deprecated_get_flags(self)
13403    }
13404
13405    /// [DEPRECATED - Use new SetFlags method instead.]
13406    pub fn r#deprecated_set_flags(
13407        &self,
13408        mut flags: OpenFlags,
13409    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13410        NodeProxyInterface::r#deprecated_set_flags(self, flags)
13411    }
13412
13413    /// Queries the flags that apply to this node after it has been opened/created. This method does
13414    /// not require any rights.
13415    ///
13416    /// Note that the final set of flags that apply to the connection may differ from those
13417    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13418    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13419    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13420    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13421    pub fn r#get_flags(
13422        &self,
13423    ) -> fidl::client::QueryResponseFut<
13424        NodeGetFlagsResult,
13425        fidl::encoding::DefaultFuchsiaResourceDialect,
13426    > {
13427        NodeProxyInterface::r#get_flags(self)
13428    }
13429
13430    /// Sets the flags that apply to this node after it has been opened. This method does not
13431    /// require any rights.
13432    ///
13433    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13434    /// clear append mode.
13435    ///
13436    /// Errors:
13437    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13438    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13439    pub fn r#set_flags(
13440        &self,
13441        mut flags: Flags,
13442    ) -> fidl::client::QueryResponseFut<
13443        NodeSetFlagsResult,
13444        fidl::encoding::DefaultFuchsiaResourceDialect,
13445    > {
13446        NodeProxyInterface::r#set_flags(self, flags)
13447    }
13448
13449    /// Query the filesystem for filesystem-specific information.
13450    pub fn r#query_filesystem(
13451        &self,
13452    ) -> fidl::client::QueryResponseFut<
13453        (i32, Option<Box<FilesystemInfo>>),
13454        fidl::encoding::DefaultFuchsiaResourceDialect,
13455    > {
13456        NodeProxyInterface::r#query_filesystem(self)
13457    }
13458
13459    /// Acquires information about the node.
13460    ///
13461    /// The attributes of a node should be stable, independent of the
13462    /// specific protocol used to access it.
13463    ///
13464    /// If a particular attribute is not applicable or not supported,
13465    /// filesystems should leave the corresponding field absent.
13466    ///
13467    /// + `query` a bit-mask specifying which attributes to fetch. The server
13468    ///   should not return more than necessary.
13469    /// - `attributes` the returned attributes.
13470    ///
13471    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13472    pub fn r#get_attributes(
13473        &self,
13474        mut query: NodeAttributesQuery,
13475    ) -> fidl::client::QueryResponseFut<
13476        NodeGetAttributesResult,
13477        fidl::encoding::DefaultFuchsiaResourceDialect,
13478    > {
13479        NodeProxyInterface::r#get_attributes(self, query)
13480    }
13481
13482    /// Updates information about the node.
13483    ///
13484    /// + `attributes` the presence of a table field in `attributes` indicates
13485    /// the intent to update the corresponding attribute.
13486    ///
13487    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13488    ///
13489    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13490    pub fn r#update_attributes(
13491        &self,
13492        mut payload: &MutableNodeAttributes,
13493    ) -> fidl::client::QueryResponseFut<
13494        NodeUpdateAttributesResult,
13495        fidl::encoding::DefaultFuchsiaResourceDialect,
13496    > {
13497        NodeProxyInterface::r#update_attributes(self, payload)
13498    }
13499
13500    /// Synchronizes updates to the node to the underlying media, if it exists.
13501    ///
13502    /// This method will return when the filesystem server has flushed the
13503    /// relevant updates to the underlying media, but does not guarantee the
13504    /// underlying media has persisted the information, nor that any information
13505    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13506    /// between operations.
13507    ///
13508    /// This method does not require any rights.
13509    pub fn r#sync(
13510        &self,
13511    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
13512    {
13513        NodeProxyInterface::r#sync(self)
13514    }
13515
13516    /// Creates an iterator over all the extended attribute names associated
13517    /// with this node. If an error occurs it is returned as an epitaph on the
13518    /// iterator request channel, and then the channel is closed.
13519    ///
13520    /// GetExtendedAttributes can be used with any of these names to retrieve
13521    /// the associated value.
13522    ///
13523    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13524    pub fn r#list_extended_attributes(
13525        &self,
13526        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13527    ) -> Result<(), fidl::Error> {
13528        NodeProxyInterface::r#list_extended_attributes(self, iterator)
13529    }
13530
13531    /// Get the value associated with the given attribute `name` for this node.
13532    ///
13533    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13534    /// particular structure is imposed on them.
13535    ///
13536    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13537    pub fn r#get_extended_attribute(
13538        &self,
13539        mut name: &[u8],
13540    ) -> fidl::client::QueryResponseFut<
13541        NodeGetExtendedAttributeResult,
13542        fidl::encoding::DefaultFuchsiaResourceDialect,
13543    > {
13544        NodeProxyInterface::r#get_extended_attribute(self, name)
13545    }
13546
13547    /// Set the value for the given attribute `name` to `value` for this node.
13548    ///
13549    /// The attribute name may exist, in which case the attribute is updated.
13550    /// If the attribute doesn't exist, it is created. The name should have no
13551    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13552    ///
13553    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13554    pub fn r#set_extended_attribute(
13555        &self,
13556        mut name: &[u8],
13557        mut value: ExtendedAttributeValue,
13558        mut mode: SetExtendedAttributeMode,
13559    ) -> fidl::client::QueryResponseFut<
13560        NodeSetExtendedAttributeResult,
13561        fidl::encoding::DefaultFuchsiaResourceDialect,
13562    > {
13563        NodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
13564    }
13565
13566    /// Remove the specified extended attribute.
13567    ///
13568    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13569    ///
13570    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13571    pub fn r#remove_extended_attribute(
13572        &self,
13573        mut name: &[u8],
13574    ) -> fidl::client::QueryResponseFut<
13575        NodeRemoveExtendedAttributeResult,
13576        fidl::encoding::DefaultFuchsiaResourceDialect,
13577    > {
13578        NodeProxyInterface::r#remove_extended_attribute(self, name)
13579    }
13580}
13581
13582impl NodeProxyInterface for NodeProxy {
13583    fn r#clone(
13584        &self,
13585        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13586    ) -> Result<(), fidl::Error> {
13587        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
13588            (request,),
13589            0x20d8a7aba2168a79,
13590            fidl::encoding::DynamicFlags::empty(),
13591        )
13592    }
13593
13594    type CloseResponseFut = fidl::client::QueryResponseFut<
13595        fidl_fuchsia_unknown::CloseableCloseResult,
13596        fidl::encoding::DefaultFuchsiaResourceDialect,
13597    >;
13598    fn r#close(&self) -> Self::CloseResponseFut {
13599        fn _decode(
13600            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13601        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
13602            let _response = fidl::client::decode_transaction_body::<
13603                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13604                fidl::encoding::DefaultFuchsiaResourceDialect,
13605                0x5ac5d459ad7f657e,
13606            >(_buf?)?;
13607            Ok(_response.map(|x| x))
13608        }
13609        self.client.send_query_and_decode::<
13610            fidl::encoding::EmptyPayload,
13611            fidl_fuchsia_unknown::CloseableCloseResult,
13612        >(
13613            (),
13614            0x5ac5d459ad7f657e,
13615            fidl::encoding::DynamicFlags::empty(),
13616            _decode,
13617        )
13618    }
13619
13620    type QueryResponseFut =
13621        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
13622    fn r#query(&self) -> Self::QueryResponseFut {
13623        fn _decode(
13624            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13625        ) -> Result<Vec<u8>, fidl::Error> {
13626            let _response = fidl::client::decode_transaction_body::<
13627                fidl_fuchsia_unknown::QueryableQueryResponse,
13628                fidl::encoding::DefaultFuchsiaResourceDialect,
13629                0x2658edee9decfc06,
13630            >(_buf?)?;
13631            Ok(_response.protocol)
13632        }
13633        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
13634            (),
13635            0x2658edee9decfc06,
13636            fidl::encoding::DynamicFlags::empty(),
13637            _decode,
13638        )
13639    }
13640
13641    fn r#deprecated_clone(
13642        &self,
13643        mut flags: OpenFlags,
13644        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13645    ) -> Result<(), fidl::Error> {
13646        self.client.send::<NodeDeprecatedCloneRequest>(
13647            (flags, object),
13648            0x5a61678f293ce16f,
13649            fidl::encoding::DynamicFlags::FLEXIBLE,
13650        )
13651    }
13652
13653    type GetAttrResponseFut = fidl::client::QueryResponseFut<
13654        (i32, NodeAttributes),
13655        fidl::encoding::DefaultFuchsiaResourceDialect,
13656    >;
13657    fn r#get_attr(&self) -> Self::GetAttrResponseFut {
13658        fn _decode(
13659            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13660        ) -> Result<(i32, NodeAttributes), fidl::Error> {
13661            let _response = fidl::client::decode_transaction_body::<
13662                NodeGetAttrResponse,
13663                fidl::encoding::DefaultFuchsiaResourceDialect,
13664                0x78985e216314dafd,
13665            >(_buf?)?;
13666            Ok((_response.s, _response.attributes))
13667        }
13668        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
13669            (),
13670            0x78985e216314dafd,
13671            fidl::encoding::DynamicFlags::empty(),
13672            _decode,
13673        )
13674    }
13675
13676    type DeprecatedSetAttrResponseFut =
13677        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
13678    fn r#deprecated_set_attr(
13679        &self,
13680        mut flags: NodeAttributeFlags,
13681        mut attributes: &NodeAttributes,
13682    ) -> Self::DeprecatedSetAttrResponseFut {
13683        fn _decode(
13684            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13685        ) -> Result<i32, fidl::Error> {
13686            let _response = fidl::client::decode_transaction_body::<
13687                NodeDeprecatedSetAttrResponse,
13688                fidl::encoding::DefaultFuchsiaResourceDialect,
13689                0x4186c0f40d938f46,
13690            >(_buf?)?;
13691            Ok(_response.s)
13692        }
13693        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
13694            (flags, attributes),
13695            0x4186c0f40d938f46,
13696            fidl::encoding::DynamicFlags::empty(),
13697            _decode,
13698        )
13699    }
13700
13701    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
13702        (i32, OpenFlags),
13703        fidl::encoding::DefaultFuchsiaResourceDialect,
13704    >;
13705    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
13706        fn _decode(
13707            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13708        ) -> Result<(i32, OpenFlags), fidl::Error> {
13709            let _response = fidl::client::decode_transaction_body::<
13710                NodeDeprecatedGetFlagsResponse,
13711                fidl::encoding::DefaultFuchsiaResourceDialect,
13712                0x5b88fffb8eda3aa1,
13713            >(_buf?)?;
13714            Ok((_response.s, _response.flags))
13715        }
13716        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
13717            (),
13718            0x5b88fffb8eda3aa1,
13719            fidl::encoding::DynamicFlags::empty(),
13720            _decode,
13721        )
13722    }
13723
13724    type DeprecatedSetFlagsResponseFut =
13725        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
13726    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
13727        fn _decode(
13728            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13729        ) -> Result<i32, fidl::Error> {
13730            let _response = fidl::client::decode_transaction_body::<
13731                NodeDeprecatedSetFlagsResponse,
13732                fidl::encoding::DefaultFuchsiaResourceDialect,
13733                0x5295b76c71fde733,
13734            >(_buf?)?;
13735            Ok(_response.s)
13736        }
13737        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
13738            (flags,),
13739            0x5295b76c71fde733,
13740            fidl::encoding::DynamicFlags::empty(),
13741            _decode,
13742        )
13743    }
13744
13745    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
13746        NodeGetFlagsResult,
13747        fidl::encoding::DefaultFuchsiaResourceDialect,
13748    >;
13749    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
13750        fn _decode(
13751            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13752        ) -> Result<NodeGetFlagsResult, fidl::Error> {
13753            let _response = fidl::client::decode_transaction_body::<
13754                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
13755                fidl::encoding::DefaultFuchsiaResourceDialect,
13756                0x176eb318f64ec23,
13757            >(_buf?)?
13758            .into_result::<NodeMarker>("get_flags")?;
13759            Ok(_response.map(|x| x.flags))
13760        }
13761        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
13762            (),
13763            0x176eb318f64ec23,
13764            fidl::encoding::DynamicFlags::FLEXIBLE,
13765            _decode,
13766        )
13767    }
13768
13769    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
13770        NodeSetFlagsResult,
13771        fidl::encoding::DefaultFuchsiaResourceDialect,
13772    >;
13773    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
13774        fn _decode(
13775            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13776        ) -> Result<NodeSetFlagsResult, fidl::Error> {
13777            let _response = fidl::client::decode_transaction_body::<
13778                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
13779                fidl::encoding::DefaultFuchsiaResourceDialect,
13780                0x55a8028685791ea8,
13781            >(_buf?)?
13782            .into_result::<NodeMarker>("set_flags")?;
13783            Ok(_response.map(|x| x))
13784        }
13785        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
13786            (flags,),
13787            0x55a8028685791ea8,
13788            fidl::encoding::DynamicFlags::FLEXIBLE,
13789            _decode,
13790        )
13791    }
13792
13793    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
13794        (i32, Option<Box<FilesystemInfo>>),
13795        fidl::encoding::DefaultFuchsiaResourceDialect,
13796    >;
13797    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
13798        fn _decode(
13799            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13800        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
13801            let _response = fidl::client::decode_transaction_body::<
13802                NodeQueryFilesystemResponse,
13803                fidl::encoding::DefaultFuchsiaResourceDialect,
13804                0x6f344a1c6b0a0610,
13805            >(_buf?)?;
13806            Ok((_response.s, _response.info))
13807        }
13808        self.client.send_query_and_decode::<
13809            fidl::encoding::EmptyPayload,
13810            (i32, Option<Box<FilesystemInfo>>),
13811        >(
13812            (),
13813            0x6f344a1c6b0a0610,
13814            fidl::encoding::DynamicFlags::empty(),
13815            _decode,
13816        )
13817    }
13818
13819    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
13820        NodeGetAttributesResult,
13821        fidl::encoding::DefaultFuchsiaResourceDialect,
13822    >;
13823    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
13824        fn _decode(
13825            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13826        ) -> Result<NodeGetAttributesResult, fidl::Error> {
13827            let _response = fidl::client::decode_transaction_body::<
13828                fidl::encoding::ResultType<NodeAttributes2, i32>,
13829                fidl::encoding::DefaultFuchsiaResourceDialect,
13830                0x3d4396a638ea053b,
13831            >(_buf?)?;
13832            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
13833        }
13834        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
13835            (query,),
13836            0x3d4396a638ea053b,
13837            fidl::encoding::DynamicFlags::empty(),
13838            _decode,
13839        )
13840    }
13841
13842    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
13843        NodeUpdateAttributesResult,
13844        fidl::encoding::DefaultFuchsiaResourceDialect,
13845    >;
13846    fn r#update_attributes(
13847        &self,
13848        mut payload: &MutableNodeAttributes,
13849    ) -> Self::UpdateAttributesResponseFut {
13850        fn _decode(
13851            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13852        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
13853            let _response = fidl::client::decode_transaction_body::<
13854                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13855                fidl::encoding::DefaultFuchsiaResourceDialect,
13856                0x3308c1da5a89bf08,
13857            >(_buf?)?;
13858            Ok(_response.map(|x| x))
13859        }
13860        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
13861            payload,
13862            0x3308c1da5a89bf08,
13863            fidl::encoding::DynamicFlags::empty(),
13864            _decode,
13865        )
13866    }
13867
13868    type SyncResponseFut = fidl::client::QueryResponseFut<
13869        NodeSyncResult,
13870        fidl::encoding::DefaultFuchsiaResourceDialect,
13871    >;
13872    fn r#sync(&self) -> Self::SyncResponseFut {
13873        fn _decode(
13874            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13875        ) -> Result<NodeSyncResult, fidl::Error> {
13876            let _response = fidl::client::decode_transaction_body::<
13877                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13878                fidl::encoding::DefaultFuchsiaResourceDialect,
13879                0x2c5c27ca0ab5dc49,
13880            >(_buf?)?;
13881            Ok(_response.map(|x| x))
13882        }
13883        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
13884            (),
13885            0x2c5c27ca0ab5dc49,
13886            fidl::encoding::DynamicFlags::empty(),
13887            _decode,
13888        )
13889    }
13890
13891    fn r#list_extended_attributes(
13892        &self,
13893        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13894    ) -> Result<(), fidl::Error> {
13895        self.client.send::<NodeListExtendedAttributesRequest>(
13896            (iterator,),
13897            0x4b61033de007fcd0,
13898            fidl::encoding::DynamicFlags::empty(),
13899        )
13900    }
13901
13902    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
13903        NodeGetExtendedAttributeResult,
13904        fidl::encoding::DefaultFuchsiaResourceDialect,
13905    >;
13906    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
13907        fn _decode(
13908            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13909        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
13910            let _response = fidl::client::decode_transaction_body::<
13911                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
13912                fidl::encoding::DefaultFuchsiaResourceDialect,
13913                0x45ffa3ccfdeb76db,
13914            >(_buf?)?;
13915            Ok(_response.map(|x| x))
13916        }
13917        self.client.send_query_and_decode::<
13918            NodeGetExtendedAttributeRequest,
13919            NodeGetExtendedAttributeResult,
13920        >(
13921            (name,),
13922            0x45ffa3ccfdeb76db,
13923            fidl::encoding::DynamicFlags::empty(),
13924            _decode,
13925        )
13926    }
13927
13928    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
13929        NodeSetExtendedAttributeResult,
13930        fidl::encoding::DefaultFuchsiaResourceDialect,
13931    >;
13932    fn r#set_extended_attribute(
13933        &self,
13934        mut name: &[u8],
13935        mut value: ExtendedAttributeValue,
13936        mut mode: SetExtendedAttributeMode,
13937    ) -> Self::SetExtendedAttributeResponseFut {
13938        fn _decode(
13939            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13940        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
13941            let _response = fidl::client::decode_transaction_body::<
13942                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13943                fidl::encoding::DefaultFuchsiaResourceDialect,
13944                0x4a951362f681f23c,
13945            >(_buf?)?;
13946            Ok(_response.map(|x| x))
13947        }
13948        self.client.send_query_and_decode::<
13949            NodeSetExtendedAttributeRequest,
13950            NodeSetExtendedAttributeResult,
13951        >(
13952            (name, &mut value, mode,),
13953            0x4a951362f681f23c,
13954            fidl::encoding::DynamicFlags::empty(),
13955            _decode,
13956        )
13957    }
13958
13959    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
13960        NodeRemoveExtendedAttributeResult,
13961        fidl::encoding::DefaultFuchsiaResourceDialect,
13962    >;
13963    fn r#remove_extended_attribute(
13964        &self,
13965        mut name: &[u8],
13966    ) -> Self::RemoveExtendedAttributeResponseFut {
13967        fn _decode(
13968            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13969        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
13970            let _response = fidl::client::decode_transaction_body::<
13971                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13972                fidl::encoding::DefaultFuchsiaResourceDialect,
13973                0x7a0b9f3a9bf9032d,
13974            >(_buf?)?;
13975            Ok(_response.map(|x| x))
13976        }
13977        self.client.send_query_and_decode::<
13978            NodeRemoveExtendedAttributeRequest,
13979            NodeRemoveExtendedAttributeResult,
13980        >(
13981            (name,),
13982            0x7a0b9f3a9bf9032d,
13983            fidl::encoding::DynamicFlags::empty(),
13984            _decode,
13985        )
13986    }
13987}
13988
13989pub struct NodeEventStream {
13990    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
13991}
13992
13993impl std::marker::Unpin for NodeEventStream {}
13994
13995impl futures::stream::FusedStream for NodeEventStream {
13996    fn is_terminated(&self) -> bool {
13997        self.event_receiver.is_terminated()
13998    }
13999}
14000
14001impl futures::Stream for NodeEventStream {
14002    type Item = Result<NodeEvent, fidl::Error>;
14003
14004    fn poll_next(
14005        mut self: std::pin::Pin<&mut Self>,
14006        cx: &mut std::task::Context<'_>,
14007    ) -> std::task::Poll<Option<Self::Item>> {
14008        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
14009            &mut self.event_receiver,
14010            cx
14011        )?) {
14012            Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
14013            None => std::task::Poll::Ready(None),
14014        }
14015    }
14016}
14017
14018#[derive(Debug)]
14019pub enum NodeEvent {
14020    OnOpen_ {
14021        s: i32,
14022        info: Option<Box<NodeInfoDeprecated>>,
14023    },
14024    OnRepresentation {
14025        payload: Representation,
14026    },
14027    #[non_exhaustive]
14028    _UnknownEvent {
14029        /// Ordinal of the event that was sent.
14030        ordinal: u64,
14031    },
14032}
14033
14034impl NodeEvent {
14035    #[allow(irrefutable_let_patterns)]
14036    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
14037        if let NodeEvent::OnOpen_ { s, info } = self {
14038            Some((s, info))
14039        } else {
14040            None
14041        }
14042    }
14043    #[allow(irrefutable_let_patterns)]
14044    pub fn into_on_representation(self) -> Option<Representation> {
14045        if let NodeEvent::OnRepresentation { payload } = self {
14046            Some((payload))
14047        } else {
14048            None
14049        }
14050    }
14051
14052    /// Decodes a message buffer as a [`NodeEvent`].
14053    fn decode(
14054        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
14055    ) -> Result<NodeEvent, fidl::Error> {
14056        let (bytes, _handles) = buf.split_mut();
14057        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14058        debug_assert_eq!(tx_header.tx_id, 0);
14059        match tx_header.ordinal {
14060            0x7fc7bbb1dbfd1972 => {
14061                let mut out = fidl::new_empty!(
14062                    NodeOnOpenRequest,
14063                    fidl::encoding::DefaultFuchsiaResourceDialect
14064                );
14065                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
14066                Ok((NodeEvent::OnOpen_ { s: out.s, info: out.info }))
14067            }
14068            0x5cb40567d80a510c => {
14069                let mut out =
14070                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
14071                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
14072                Ok((NodeEvent::OnRepresentation { payload: out }))
14073            }
14074            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
14075                Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
14076            }
14077            _ => Err(fidl::Error::UnknownOrdinal {
14078                ordinal: tx_header.ordinal,
14079                protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14080            }),
14081        }
14082    }
14083}
14084
14085/// A Stream of incoming requests for fuchsia.io/Node.
14086pub struct NodeRequestStream {
14087    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14088    is_terminated: bool,
14089}
14090
14091impl std::marker::Unpin for NodeRequestStream {}
14092
14093impl futures::stream::FusedStream for NodeRequestStream {
14094    fn is_terminated(&self) -> bool {
14095        self.is_terminated
14096    }
14097}
14098
14099impl fidl::endpoints::RequestStream for NodeRequestStream {
14100    type Protocol = NodeMarker;
14101    type ControlHandle = NodeControlHandle;
14102
14103    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
14104        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
14105    }
14106
14107    fn control_handle(&self) -> Self::ControlHandle {
14108        NodeControlHandle { inner: self.inner.clone() }
14109    }
14110
14111    fn into_inner(
14112        self,
14113    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
14114    {
14115        (self.inner, self.is_terminated)
14116    }
14117
14118    fn from_inner(
14119        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14120        is_terminated: bool,
14121    ) -> Self {
14122        Self { inner, is_terminated }
14123    }
14124}
14125
14126impl futures::Stream for NodeRequestStream {
14127    type Item = Result<NodeRequest, fidl::Error>;
14128
14129    fn poll_next(
14130        mut self: std::pin::Pin<&mut Self>,
14131        cx: &mut std::task::Context<'_>,
14132    ) -> std::task::Poll<Option<Self::Item>> {
14133        let this = &mut *self;
14134        if this.inner.check_shutdown(cx) {
14135            this.is_terminated = true;
14136            return std::task::Poll::Ready(None);
14137        }
14138        if this.is_terminated {
14139            panic!("polled NodeRequestStream after completion");
14140        }
14141        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
14142            |bytes, handles| {
14143                match this.inner.channel().read_etc(cx, bytes, handles) {
14144                    std::task::Poll::Ready(Ok(())) => {}
14145                    std::task::Poll::Pending => return std::task::Poll::Pending,
14146                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
14147                        this.is_terminated = true;
14148                        return std::task::Poll::Ready(None);
14149                    }
14150                    std::task::Poll::Ready(Err(e)) => {
14151                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
14152                            e.into(),
14153                        ))))
14154                    }
14155                }
14156
14157                // A message has been received from the channel
14158                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14159
14160                std::task::Poll::Ready(Some(match header.ordinal {
14161                    0x20d8a7aba2168a79 => {
14162                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14163                        let mut req = fidl::new_empty!(
14164                            fidl_fuchsia_unknown::CloneableCloneRequest,
14165                            fidl::encoding::DefaultFuchsiaResourceDialect
14166                        );
14167                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14168                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14169                        Ok(NodeRequest::Clone { request: req.request, control_handle })
14170                    }
14171                    0x5ac5d459ad7f657e => {
14172                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14173                        let mut req = fidl::new_empty!(
14174                            fidl::encoding::EmptyPayload,
14175                            fidl::encoding::DefaultFuchsiaResourceDialect
14176                        );
14177                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14178                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14179                        Ok(NodeRequest::Close {
14180                            responder: NodeCloseResponder {
14181                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14182                                tx_id: header.tx_id,
14183                            },
14184                        })
14185                    }
14186                    0x2658edee9decfc06 => {
14187                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14188                        let mut req = fidl::new_empty!(
14189                            fidl::encoding::EmptyPayload,
14190                            fidl::encoding::DefaultFuchsiaResourceDialect
14191                        );
14192                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14193                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14194                        Ok(NodeRequest::Query {
14195                            responder: NodeQueryResponder {
14196                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14197                                tx_id: header.tx_id,
14198                            },
14199                        })
14200                    }
14201                    0x5a61678f293ce16f => {
14202                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14203                        let mut req = fidl::new_empty!(
14204                            NodeDeprecatedCloneRequest,
14205                            fidl::encoding::DefaultFuchsiaResourceDialect
14206                        );
14207                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14208                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14209                        Ok(NodeRequest::DeprecatedClone {
14210                            flags: req.flags,
14211                            object: req.object,
14212
14213                            control_handle,
14214                        })
14215                    }
14216                    0x78985e216314dafd => {
14217                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14218                        let mut req = fidl::new_empty!(
14219                            fidl::encoding::EmptyPayload,
14220                            fidl::encoding::DefaultFuchsiaResourceDialect
14221                        );
14222                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14223                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14224                        Ok(NodeRequest::GetAttr {
14225                            responder: NodeGetAttrResponder {
14226                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14227                                tx_id: header.tx_id,
14228                            },
14229                        })
14230                    }
14231                    0x4186c0f40d938f46 => {
14232                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14233                        let mut req = fidl::new_empty!(
14234                            NodeDeprecatedSetAttrRequest,
14235                            fidl::encoding::DefaultFuchsiaResourceDialect
14236                        );
14237                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
14238                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14239                        Ok(NodeRequest::DeprecatedSetAttr {
14240                            flags: req.flags,
14241                            attributes: req.attributes,
14242
14243                            responder: NodeDeprecatedSetAttrResponder {
14244                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14245                                tx_id: header.tx_id,
14246                            },
14247                        })
14248                    }
14249                    0x5b88fffb8eda3aa1 => {
14250                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14251                        let mut req = fidl::new_empty!(
14252                            fidl::encoding::EmptyPayload,
14253                            fidl::encoding::DefaultFuchsiaResourceDialect
14254                        );
14255                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14256                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14257                        Ok(NodeRequest::DeprecatedGetFlags {
14258                            responder: NodeDeprecatedGetFlagsResponder {
14259                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14260                                tx_id: header.tx_id,
14261                            },
14262                        })
14263                    }
14264                    0x5295b76c71fde733 => {
14265                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14266                        let mut req = fidl::new_empty!(
14267                            NodeDeprecatedSetFlagsRequest,
14268                            fidl::encoding::DefaultFuchsiaResourceDialect
14269                        );
14270                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14271                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14272                        Ok(NodeRequest::DeprecatedSetFlags {
14273                            flags: req.flags,
14274
14275                            responder: NodeDeprecatedSetFlagsResponder {
14276                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14277                                tx_id: header.tx_id,
14278                            },
14279                        })
14280                    }
14281                    0x176eb318f64ec23 => {
14282                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14283                        let mut req = fidl::new_empty!(
14284                            fidl::encoding::EmptyPayload,
14285                            fidl::encoding::DefaultFuchsiaResourceDialect
14286                        );
14287                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14288                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14289                        Ok(NodeRequest::GetFlags {
14290                            responder: NodeGetFlagsResponder {
14291                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14292                                tx_id: header.tx_id,
14293                            },
14294                        })
14295                    }
14296                    0x55a8028685791ea8 => {
14297                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14298                        let mut req = fidl::new_empty!(
14299                            NodeSetFlagsRequest,
14300                            fidl::encoding::DefaultFuchsiaResourceDialect
14301                        );
14302                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14303                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14304                        Ok(NodeRequest::SetFlags {
14305                            flags: req.flags,
14306
14307                            responder: NodeSetFlagsResponder {
14308                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14309                                tx_id: header.tx_id,
14310                            },
14311                        })
14312                    }
14313                    0x6f344a1c6b0a0610 => {
14314                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14315                        let mut req = fidl::new_empty!(
14316                            fidl::encoding::EmptyPayload,
14317                            fidl::encoding::DefaultFuchsiaResourceDialect
14318                        );
14319                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14320                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14321                        Ok(NodeRequest::QueryFilesystem {
14322                            responder: NodeQueryFilesystemResponder {
14323                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14324                                tx_id: header.tx_id,
14325                            },
14326                        })
14327                    }
14328                    0x3d4396a638ea053b => {
14329                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14330                        let mut req = fidl::new_empty!(
14331                            NodeGetAttributesRequest,
14332                            fidl::encoding::DefaultFuchsiaResourceDialect
14333                        );
14334                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14335                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14336                        Ok(NodeRequest::GetAttributes {
14337                            query: req.query,
14338
14339                            responder: NodeGetAttributesResponder {
14340                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14341                                tx_id: header.tx_id,
14342                            },
14343                        })
14344                    }
14345                    0x3308c1da5a89bf08 => {
14346                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14347                        let mut req = fidl::new_empty!(
14348                            MutableNodeAttributes,
14349                            fidl::encoding::DefaultFuchsiaResourceDialect
14350                        );
14351                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
14352                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14353                        Ok(NodeRequest::UpdateAttributes {
14354                            payload: req,
14355                            responder: NodeUpdateAttributesResponder {
14356                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14357                                tx_id: header.tx_id,
14358                            },
14359                        })
14360                    }
14361                    0x2c5c27ca0ab5dc49 => {
14362                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14363                        let mut req = fidl::new_empty!(
14364                            fidl::encoding::EmptyPayload,
14365                            fidl::encoding::DefaultFuchsiaResourceDialect
14366                        );
14367                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14368                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14369                        Ok(NodeRequest::Sync {
14370                            responder: NodeSyncResponder {
14371                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14372                                tx_id: header.tx_id,
14373                            },
14374                        })
14375                    }
14376                    0x4b61033de007fcd0 => {
14377                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14378                        let mut req = fidl::new_empty!(
14379                            NodeListExtendedAttributesRequest,
14380                            fidl::encoding::DefaultFuchsiaResourceDialect
14381                        );
14382                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14383                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14384                        Ok(NodeRequest::ListExtendedAttributes {
14385                            iterator: req.iterator,
14386
14387                            control_handle,
14388                        })
14389                    }
14390                    0x45ffa3ccfdeb76db => {
14391                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14392                        let mut req = fidl::new_empty!(
14393                            NodeGetExtendedAttributeRequest,
14394                            fidl::encoding::DefaultFuchsiaResourceDialect
14395                        );
14396                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14397                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14398                        Ok(NodeRequest::GetExtendedAttribute {
14399                            name: req.name,
14400
14401                            responder: NodeGetExtendedAttributeResponder {
14402                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14403                                tx_id: header.tx_id,
14404                            },
14405                        })
14406                    }
14407                    0x4a951362f681f23c => {
14408                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14409                        let mut req = fidl::new_empty!(
14410                            NodeSetExtendedAttributeRequest,
14411                            fidl::encoding::DefaultFuchsiaResourceDialect
14412                        );
14413                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14414                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14415                        Ok(NodeRequest::SetExtendedAttribute {
14416                            name: req.name,
14417                            value: req.value,
14418                            mode: req.mode,
14419
14420                            responder: NodeSetExtendedAttributeResponder {
14421                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14422                                tx_id: header.tx_id,
14423                            },
14424                        })
14425                    }
14426                    0x7a0b9f3a9bf9032d => {
14427                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14428                        let mut req = fidl::new_empty!(
14429                            NodeRemoveExtendedAttributeRequest,
14430                            fidl::encoding::DefaultFuchsiaResourceDialect
14431                        );
14432                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14433                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14434                        Ok(NodeRequest::RemoveExtendedAttribute {
14435                            name: req.name,
14436
14437                            responder: NodeRemoveExtendedAttributeResponder {
14438                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14439                                tx_id: header.tx_id,
14440                            },
14441                        })
14442                    }
14443                    _ if header.tx_id == 0
14444                        && header
14445                            .dynamic_flags()
14446                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14447                    {
14448                        Ok(NodeRequest::_UnknownMethod {
14449                            ordinal: header.ordinal,
14450                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14451                            method_type: fidl::MethodType::OneWay,
14452                        })
14453                    }
14454                    _ if header
14455                        .dynamic_flags()
14456                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14457                    {
14458                        this.inner.send_framework_err(
14459                            fidl::encoding::FrameworkErr::UnknownMethod,
14460                            header.tx_id,
14461                            header.ordinal,
14462                            header.dynamic_flags(),
14463                            (bytes, handles),
14464                        )?;
14465                        Ok(NodeRequest::_UnknownMethod {
14466                            ordinal: header.ordinal,
14467                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14468                            method_type: fidl::MethodType::TwoWay,
14469                        })
14470                    }
14471                    _ => Err(fidl::Error::UnknownOrdinal {
14472                        ordinal: header.ordinal,
14473                        protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14474                    }),
14475                }))
14476            },
14477        )
14478    }
14479}
14480
14481/// Node defines the minimal interface for entities which can be accessed in a filesystem.
14482#[derive(Debug)]
14483pub enum NodeRequest {
14484    Clone {
14485        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
14486        control_handle: NodeControlHandle,
14487    },
14488    /// Terminates the connection.
14489    ///
14490    /// After calling `Close`, the client must not send any other requests.
14491    ///
14492    /// Servers, after sending the status response, should close the connection
14493    /// regardless of status and without sending an epitaph.
14494    ///
14495    /// Closing the client end of the channel should be semantically equivalent
14496    /// to calling `Close` without knowing when the close has completed or its
14497    /// status.
14498    Close {
14499        responder: NodeCloseResponder,
14500    },
14501    Query {
14502        responder: NodeQueryResponder,
14503    },
14504    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
14505    DeprecatedClone {
14506        flags: OpenFlags,
14507        object: fidl::endpoints::ServerEnd<NodeMarker>,
14508        control_handle: NodeControlHandle,
14509    },
14510    /// Acquires information about the node.
14511    ///
14512    /// This method does not require any rights.
14513    GetAttr {
14514        responder: NodeGetAttrResponder,
14515    },
14516    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
14517    DeprecatedSetAttr {
14518        flags: NodeAttributeFlags,
14519        attributes: NodeAttributes,
14520        responder: NodeDeprecatedSetAttrResponder,
14521    },
14522    /// [DEPRECATED - Use new GetFlags method instead.]
14523    DeprecatedGetFlags {
14524        responder: NodeDeprecatedGetFlagsResponder,
14525    },
14526    /// [DEPRECATED - Use new SetFlags method instead.]
14527    DeprecatedSetFlags {
14528        flags: OpenFlags,
14529        responder: NodeDeprecatedSetFlagsResponder,
14530    },
14531    /// Queries the flags that apply to this node after it has been opened/created. This method does
14532    /// not require any rights.
14533    ///
14534    /// Note that the final set of flags that apply to the connection may differ from those
14535    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
14536    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
14537    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
14538    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
14539    GetFlags {
14540        responder: NodeGetFlagsResponder,
14541    },
14542    /// Sets the flags that apply to this node after it has been opened. This method does not
14543    /// require any rights.
14544    ///
14545    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
14546    /// clear append mode.
14547    ///
14548    /// Errors:
14549    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
14550    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
14551    SetFlags {
14552        flags: Flags,
14553        responder: NodeSetFlagsResponder,
14554    },
14555    /// Query the filesystem for filesystem-specific information.
14556    QueryFilesystem {
14557        responder: NodeQueryFilesystemResponder,
14558    },
14559    /// Acquires information about the node.
14560    ///
14561    /// The attributes of a node should be stable, independent of the
14562    /// specific protocol used to access it.
14563    ///
14564    /// If a particular attribute is not applicable or not supported,
14565    /// filesystems should leave the corresponding field absent.
14566    ///
14567    /// + `query` a bit-mask specifying which attributes to fetch. The server
14568    ///   should not return more than necessary.
14569    /// - `attributes` the returned attributes.
14570    ///
14571    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14572    GetAttributes {
14573        query: NodeAttributesQuery,
14574        responder: NodeGetAttributesResponder,
14575    },
14576    /// Updates information about the node.
14577    ///
14578    /// + `attributes` the presence of a table field in `attributes` indicates
14579    /// the intent to update the corresponding attribute.
14580    ///
14581    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
14582    ///
14583    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14584    UpdateAttributes {
14585        payload: MutableNodeAttributes,
14586        responder: NodeUpdateAttributesResponder,
14587    },
14588    /// Synchronizes updates to the node to the underlying media, if it exists.
14589    ///
14590    /// This method will return when the filesystem server has flushed the
14591    /// relevant updates to the underlying media, but does not guarantee the
14592    /// underlying media has persisted the information, nor that any information
14593    /// is committed to hardware. Clients may use `Sync` to ensure ordering
14594    /// between operations.
14595    ///
14596    /// This method does not require any rights.
14597    Sync {
14598        responder: NodeSyncResponder,
14599    },
14600    /// Creates an iterator over all the extended attribute names associated
14601    /// with this node. If an error occurs it is returned as an epitaph on the
14602    /// iterator request channel, and then the channel is closed.
14603    ///
14604    /// GetExtendedAttributes can be used with any of these names to retrieve
14605    /// the associated value.
14606    ///
14607    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14608    ListExtendedAttributes {
14609        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
14610        control_handle: NodeControlHandle,
14611    },
14612    /// Get the value associated with the given attribute `name` for this node.
14613    ///
14614    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
14615    /// particular structure is imposed on them.
14616    ///
14617    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14618    GetExtendedAttribute {
14619        name: Vec<u8>,
14620        responder: NodeGetExtendedAttributeResponder,
14621    },
14622    /// Set the value for the given attribute `name` to `value` for this node.
14623    ///
14624    /// The attribute name may exist, in which case the attribute is updated.
14625    /// If the attribute doesn't exist, it is created. The name should have no
14626    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
14627    ///
14628    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14629    SetExtendedAttribute {
14630        name: Vec<u8>,
14631        value: ExtendedAttributeValue,
14632        mode: SetExtendedAttributeMode,
14633        responder: NodeSetExtendedAttributeResponder,
14634    },
14635    /// Remove the specified extended attribute.
14636    ///
14637    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
14638    ///
14639    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14640    RemoveExtendedAttribute {
14641        name: Vec<u8>,
14642        responder: NodeRemoveExtendedAttributeResponder,
14643    },
14644    /// An interaction was received which does not match any known method.
14645    #[non_exhaustive]
14646    _UnknownMethod {
14647        /// Ordinal of the method that was called.
14648        ordinal: u64,
14649        control_handle: NodeControlHandle,
14650        method_type: fidl::MethodType,
14651    },
14652}
14653
14654impl NodeRequest {
14655    #[allow(irrefutable_let_patterns)]
14656    pub fn into_clone(
14657        self,
14658    ) -> Option<(
14659        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
14660        NodeControlHandle,
14661    )> {
14662        if let NodeRequest::Clone { request, control_handle } = self {
14663            Some((request, control_handle))
14664        } else {
14665            None
14666        }
14667    }
14668
14669    #[allow(irrefutable_let_patterns)]
14670    pub fn into_close(self) -> Option<(NodeCloseResponder)> {
14671        if let NodeRequest::Close { responder } = self {
14672            Some((responder))
14673        } else {
14674            None
14675        }
14676    }
14677
14678    #[allow(irrefutable_let_patterns)]
14679    pub fn into_query(self) -> Option<(NodeQueryResponder)> {
14680        if let NodeRequest::Query { responder } = self {
14681            Some((responder))
14682        } else {
14683            None
14684        }
14685    }
14686
14687    #[allow(irrefutable_let_patterns)]
14688    pub fn into_deprecated_clone(
14689        self,
14690    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, NodeControlHandle)> {
14691        if let NodeRequest::DeprecatedClone { flags, object, control_handle } = self {
14692            Some((flags, object, control_handle))
14693        } else {
14694            None
14695        }
14696    }
14697
14698    #[allow(irrefutable_let_patterns)]
14699    pub fn into_get_attr(self) -> Option<(NodeGetAttrResponder)> {
14700        if let NodeRequest::GetAttr { responder } = self {
14701            Some((responder))
14702        } else {
14703            None
14704        }
14705    }
14706
14707    #[allow(irrefutable_let_patterns)]
14708    pub fn into_deprecated_set_attr(
14709        self,
14710    ) -> Option<(NodeAttributeFlags, NodeAttributes, NodeDeprecatedSetAttrResponder)> {
14711        if let NodeRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
14712            Some((flags, attributes, responder))
14713        } else {
14714            None
14715        }
14716    }
14717
14718    #[allow(irrefutable_let_patterns)]
14719    pub fn into_deprecated_get_flags(self) -> Option<(NodeDeprecatedGetFlagsResponder)> {
14720        if let NodeRequest::DeprecatedGetFlags { responder } = self {
14721            Some((responder))
14722        } else {
14723            None
14724        }
14725    }
14726
14727    #[allow(irrefutable_let_patterns)]
14728    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, NodeDeprecatedSetFlagsResponder)> {
14729        if let NodeRequest::DeprecatedSetFlags { flags, responder } = self {
14730            Some((flags, responder))
14731        } else {
14732            None
14733        }
14734    }
14735
14736    #[allow(irrefutable_let_patterns)]
14737    pub fn into_get_flags(self) -> Option<(NodeGetFlagsResponder)> {
14738        if let NodeRequest::GetFlags { responder } = self {
14739            Some((responder))
14740        } else {
14741            None
14742        }
14743    }
14744
14745    #[allow(irrefutable_let_patterns)]
14746    pub fn into_set_flags(self) -> Option<(Flags, NodeSetFlagsResponder)> {
14747        if let NodeRequest::SetFlags { flags, responder } = self {
14748            Some((flags, responder))
14749        } else {
14750            None
14751        }
14752    }
14753
14754    #[allow(irrefutable_let_patterns)]
14755    pub fn into_query_filesystem(self) -> Option<(NodeQueryFilesystemResponder)> {
14756        if let NodeRequest::QueryFilesystem { responder } = self {
14757            Some((responder))
14758        } else {
14759            None
14760        }
14761    }
14762
14763    #[allow(irrefutable_let_patterns)]
14764    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, NodeGetAttributesResponder)> {
14765        if let NodeRequest::GetAttributes { query, responder } = self {
14766            Some((query, responder))
14767        } else {
14768            None
14769        }
14770    }
14771
14772    #[allow(irrefutable_let_patterns)]
14773    pub fn into_update_attributes(
14774        self,
14775    ) -> Option<(MutableNodeAttributes, NodeUpdateAttributesResponder)> {
14776        if let NodeRequest::UpdateAttributes { payload, responder } = self {
14777            Some((payload, responder))
14778        } else {
14779            None
14780        }
14781    }
14782
14783    #[allow(irrefutable_let_patterns)]
14784    pub fn into_sync(self) -> Option<(NodeSyncResponder)> {
14785        if let NodeRequest::Sync { responder } = self {
14786            Some((responder))
14787        } else {
14788            None
14789        }
14790    }
14791
14792    #[allow(irrefutable_let_patterns)]
14793    pub fn into_list_extended_attributes(
14794        self,
14795    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, NodeControlHandle)>
14796    {
14797        if let NodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
14798            Some((iterator, control_handle))
14799        } else {
14800            None
14801        }
14802    }
14803
14804    #[allow(irrefutable_let_patterns)]
14805    pub fn into_get_extended_attribute(
14806        self,
14807    ) -> Option<(Vec<u8>, NodeGetExtendedAttributeResponder)> {
14808        if let NodeRequest::GetExtendedAttribute { name, responder } = self {
14809            Some((name, responder))
14810        } else {
14811            None
14812        }
14813    }
14814
14815    #[allow(irrefutable_let_patterns)]
14816    pub fn into_set_extended_attribute(
14817        self,
14818    ) -> Option<(
14819        Vec<u8>,
14820        ExtendedAttributeValue,
14821        SetExtendedAttributeMode,
14822        NodeSetExtendedAttributeResponder,
14823    )> {
14824        if let NodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
14825            Some((name, value, mode, responder))
14826        } else {
14827            None
14828        }
14829    }
14830
14831    #[allow(irrefutable_let_patterns)]
14832    pub fn into_remove_extended_attribute(
14833        self,
14834    ) -> Option<(Vec<u8>, NodeRemoveExtendedAttributeResponder)> {
14835        if let NodeRequest::RemoveExtendedAttribute { name, responder } = self {
14836            Some((name, responder))
14837        } else {
14838            None
14839        }
14840    }
14841
14842    /// Name of the method defined in FIDL
14843    pub fn method_name(&self) -> &'static str {
14844        match *self {
14845            NodeRequest::Clone { .. } => "clone",
14846            NodeRequest::Close { .. } => "close",
14847            NodeRequest::Query { .. } => "query",
14848            NodeRequest::DeprecatedClone { .. } => "deprecated_clone",
14849            NodeRequest::GetAttr { .. } => "get_attr",
14850            NodeRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
14851            NodeRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
14852            NodeRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
14853            NodeRequest::GetFlags { .. } => "get_flags",
14854            NodeRequest::SetFlags { .. } => "set_flags",
14855            NodeRequest::QueryFilesystem { .. } => "query_filesystem",
14856            NodeRequest::GetAttributes { .. } => "get_attributes",
14857            NodeRequest::UpdateAttributes { .. } => "update_attributes",
14858            NodeRequest::Sync { .. } => "sync",
14859            NodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
14860            NodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
14861            NodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
14862            NodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
14863            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
14864                "unknown one-way method"
14865            }
14866            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
14867                "unknown two-way method"
14868            }
14869        }
14870    }
14871}
14872
14873#[derive(Debug, Clone)]
14874pub struct NodeControlHandle {
14875    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14876}
14877
14878impl fidl::endpoints::ControlHandle for NodeControlHandle {
14879    fn shutdown(&self) {
14880        self.inner.shutdown()
14881    }
14882    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
14883        self.inner.shutdown_with_epitaph(status)
14884    }
14885
14886    fn is_closed(&self) -> bool {
14887        self.inner.channel().is_closed()
14888    }
14889    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
14890        self.inner.channel().on_closed()
14891    }
14892
14893    #[cfg(target_os = "fuchsia")]
14894    fn signal_peer(
14895        &self,
14896        clear_mask: zx::Signals,
14897        set_mask: zx::Signals,
14898    ) -> Result<(), zx_status::Status> {
14899        use fidl::Peered;
14900        self.inner.channel().signal_peer(clear_mask, set_mask)
14901    }
14902}
14903
14904impl NodeControlHandle {
14905    pub fn send_on_open_(
14906        &self,
14907        mut s: i32,
14908        mut info: Option<NodeInfoDeprecated>,
14909    ) -> Result<(), fidl::Error> {
14910        self.inner.send::<NodeOnOpenRequest>(
14911            (s, info.as_mut()),
14912            0,
14913            0x7fc7bbb1dbfd1972,
14914            fidl::encoding::DynamicFlags::empty(),
14915        )
14916    }
14917
14918    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
14919        self.inner.send::<Representation>(
14920            &mut payload,
14921            0,
14922            0x5cb40567d80a510c,
14923            fidl::encoding::DynamicFlags::empty(),
14924        )
14925    }
14926}
14927
14928#[must_use = "FIDL methods require a response to be sent"]
14929#[derive(Debug)]
14930pub struct NodeCloseResponder {
14931    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
14932    tx_id: u32,
14933}
14934
14935/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
14936/// if the responder is dropped without sending a response, so that the client
14937/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
14938impl std::ops::Drop for NodeCloseResponder {
14939    fn drop(&mut self) {
14940        self.control_handle.shutdown();
14941        // Safety: drops once, never accessed again
14942        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14943    }
14944}
14945
14946impl fidl::endpoints::Responder for NodeCloseResponder {
14947    type ControlHandle = NodeControlHandle;
14948
14949    fn control_handle(&self) -> &NodeControlHandle {
14950        &self.control_handle
14951    }
14952
14953    fn drop_without_shutdown(mut self) {
14954        // Safety: drops once, never accessed again due to mem::forget
14955        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14956        // Prevent Drop from running (which would shut down the channel)
14957        std::mem::forget(self);
14958    }
14959}
14960
14961impl NodeCloseResponder {
14962    /// Sends a response to the FIDL transaction.
14963    ///
14964    /// Sets the channel to shutdown if an error occurs.
14965    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
14966        let _result = self.send_raw(result);
14967        if _result.is_err() {
14968            self.control_handle.shutdown();
14969        }
14970        self.drop_without_shutdown();
14971        _result
14972    }
14973
14974    /// Similar to "send" but does not shutdown the channel if an error occurs.
14975    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
14976        let _result = self.send_raw(result);
14977        self.drop_without_shutdown();
14978        _result
14979    }
14980
14981    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
14982        self.control_handle
14983            .inner
14984            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
14985                result,
14986                self.tx_id,
14987                0x5ac5d459ad7f657e,
14988                fidl::encoding::DynamicFlags::empty(),
14989            )
14990    }
14991}
14992
14993#[must_use = "FIDL methods require a response to be sent"]
14994#[derive(Debug)]
14995pub struct NodeQueryResponder {
14996    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
14997    tx_id: u32,
14998}
14999
15000/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15001/// if the responder is dropped without sending a response, so that the client
15002/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15003impl std::ops::Drop for NodeQueryResponder {
15004    fn drop(&mut self) {
15005        self.control_handle.shutdown();
15006        // Safety: drops once, never accessed again
15007        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15008    }
15009}
15010
15011impl fidl::endpoints::Responder for NodeQueryResponder {
15012    type ControlHandle = NodeControlHandle;
15013
15014    fn control_handle(&self) -> &NodeControlHandle {
15015        &self.control_handle
15016    }
15017
15018    fn drop_without_shutdown(mut self) {
15019        // Safety: drops once, never accessed again due to mem::forget
15020        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15021        // Prevent Drop from running (which would shut down the channel)
15022        std::mem::forget(self);
15023    }
15024}
15025
15026impl NodeQueryResponder {
15027    /// Sends a response to the FIDL transaction.
15028    ///
15029    /// Sets the channel to shutdown if an error occurs.
15030    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15031        let _result = self.send_raw(protocol);
15032        if _result.is_err() {
15033            self.control_handle.shutdown();
15034        }
15035        self.drop_without_shutdown();
15036        _result
15037    }
15038
15039    /// Similar to "send" but does not shutdown the channel if an error occurs.
15040    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15041        let _result = self.send_raw(protocol);
15042        self.drop_without_shutdown();
15043        _result
15044    }
15045
15046    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15047        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
15048            (protocol,),
15049            self.tx_id,
15050            0x2658edee9decfc06,
15051            fidl::encoding::DynamicFlags::empty(),
15052        )
15053    }
15054}
15055
15056#[must_use = "FIDL methods require a response to be sent"]
15057#[derive(Debug)]
15058pub struct NodeGetAttrResponder {
15059    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15060    tx_id: u32,
15061}
15062
15063/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15064/// if the responder is dropped without sending a response, so that the client
15065/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15066impl std::ops::Drop for NodeGetAttrResponder {
15067    fn drop(&mut self) {
15068        self.control_handle.shutdown();
15069        // Safety: drops once, never accessed again
15070        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15071    }
15072}
15073
15074impl fidl::endpoints::Responder for NodeGetAttrResponder {
15075    type ControlHandle = NodeControlHandle;
15076
15077    fn control_handle(&self) -> &NodeControlHandle {
15078        &self.control_handle
15079    }
15080
15081    fn drop_without_shutdown(mut self) {
15082        // Safety: drops once, never accessed again due to mem::forget
15083        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15084        // Prevent Drop from running (which would shut down the channel)
15085        std::mem::forget(self);
15086    }
15087}
15088
15089impl NodeGetAttrResponder {
15090    /// Sends a response to the FIDL transaction.
15091    ///
15092    /// Sets the channel to shutdown if an error occurs.
15093    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15094        let _result = self.send_raw(s, attributes);
15095        if _result.is_err() {
15096            self.control_handle.shutdown();
15097        }
15098        self.drop_without_shutdown();
15099        _result
15100    }
15101
15102    /// Similar to "send" but does not shutdown the channel if an error occurs.
15103    pub fn send_no_shutdown_on_err(
15104        self,
15105        mut s: i32,
15106        mut attributes: &NodeAttributes,
15107    ) -> Result<(), fidl::Error> {
15108        let _result = self.send_raw(s, attributes);
15109        self.drop_without_shutdown();
15110        _result
15111    }
15112
15113    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15114        self.control_handle.inner.send::<NodeGetAttrResponse>(
15115            (s, attributes),
15116            self.tx_id,
15117            0x78985e216314dafd,
15118            fidl::encoding::DynamicFlags::empty(),
15119        )
15120    }
15121}
15122
15123#[must_use = "FIDL methods require a response to be sent"]
15124#[derive(Debug)]
15125pub struct NodeDeprecatedSetAttrResponder {
15126    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15127    tx_id: u32,
15128}
15129
15130/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15131/// if the responder is dropped without sending a response, so that the client
15132/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15133impl std::ops::Drop for NodeDeprecatedSetAttrResponder {
15134    fn drop(&mut self) {
15135        self.control_handle.shutdown();
15136        // Safety: drops once, never accessed again
15137        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15138    }
15139}
15140
15141impl fidl::endpoints::Responder for NodeDeprecatedSetAttrResponder {
15142    type ControlHandle = NodeControlHandle;
15143
15144    fn control_handle(&self) -> &NodeControlHandle {
15145        &self.control_handle
15146    }
15147
15148    fn drop_without_shutdown(mut self) {
15149        // Safety: drops once, never accessed again due to mem::forget
15150        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15151        // Prevent Drop from running (which would shut down the channel)
15152        std::mem::forget(self);
15153    }
15154}
15155
15156impl NodeDeprecatedSetAttrResponder {
15157    /// Sends a response to the FIDL transaction.
15158    ///
15159    /// Sets the channel to shutdown if an error occurs.
15160    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15161        let _result = self.send_raw(s);
15162        if _result.is_err() {
15163            self.control_handle.shutdown();
15164        }
15165        self.drop_without_shutdown();
15166        _result
15167    }
15168
15169    /// Similar to "send" but does not shutdown the channel if an error occurs.
15170    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15171        let _result = self.send_raw(s);
15172        self.drop_without_shutdown();
15173        _result
15174    }
15175
15176    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15177        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
15178            (s,),
15179            self.tx_id,
15180            0x4186c0f40d938f46,
15181            fidl::encoding::DynamicFlags::empty(),
15182        )
15183    }
15184}
15185
15186#[must_use = "FIDL methods require a response to be sent"]
15187#[derive(Debug)]
15188pub struct NodeDeprecatedGetFlagsResponder {
15189    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15190    tx_id: u32,
15191}
15192
15193/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15194/// if the responder is dropped without sending a response, so that the client
15195/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15196impl std::ops::Drop for NodeDeprecatedGetFlagsResponder {
15197    fn drop(&mut self) {
15198        self.control_handle.shutdown();
15199        // Safety: drops once, never accessed again
15200        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15201    }
15202}
15203
15204impl fidl::endpoints::Responder for NodeDeprecatedGetFlagsResponder {
15205    type ControlHandle = NodeControlHandle;
15206
15207    fn control_handle(&self) -> &NodeControlHandle {
15208        &self.control_handle
15209    }
15210
15211    fn drop_without_shutdown(mut self) {
15212        // Safety: drops once, never accessed again due to mem::forget
15213        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15214        // Prevent Drop from running (which would shut down the channel)
15215        std::mem::forget(self);
15216    }
15217}
15218
15219impl NodeDeprecatedGetFlagsResponder {
15220    /// Sends a response to the FIDL transaction.
15221    ///
15222    /// Sets the channel to shutdown if an error occurs.
15223    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15224        let _result = self.send_raw(s, flags);
15225        if _result.is_err() {
15226            self.control_handle.shutdown();
15227        }
15228        self.drop_without_shutdown();
15229        _result
15230    }
15231
15232    /// Similar to "send" but does not shutdown the channel if an error occurs.
15233    pub fn send_no_shutdown_on_err(
15234        self,
15235        mut s: i32,
15236        mut flags: OpenFlags,
15237    ) -> Result<(), fidl::Error> {
15238        let _result = self.send_raw(s, flags);
15239        self.drop_without_shutdown();
15240        _result
15241    }
15242
15243    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15244        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
15245            (s, flags),
15246            self.tx_id,
15247            0x5b88fffb8eda3aa1,
15248            fidl::encoding::DynamicFlags::empty(),
15249        )
15250    }
15251}
15252
15253#[must_use = "FIDL methods require a response to be sent"]
15254#[derive(Debug)]
15255pub struct NodeDeprecatedSetFlagsResponder {
15256    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15257    tx_id: u32,
15258}
15259
15260/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15261/// if the responder is dropped without sending a response, so that the client
15262/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15263impl std::ops::Drop for NodeDeprecatedSetFlagsResponder {
15264    fn drop(&mut self) {
15265        self.control_handle.shutdown();
15266        // Safety: drops once, never accessed again
15267        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15268    }
15269}
15270
15271impl fidl::endpoints::Responder for NodeDeprecatedSetFlagsResponder {
15272    type ControlHandle = NodeControlHandle;
15273
15274    fn control_handle(&self) -> &NodeControlHandle {
15275        &self.control_handle
15276    }
15277
15278    fn drop_without_shutdown(mut self) {
15279        // Safety: drops once, never accessed again due to mem::forget
15280        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15281        // Prevent Drop from running (which would shut down the channel)
15282        std::mem::forget(self);
15283    }
15284}
15285
15286impl NodeDeprecatedSetFlagsResponder {
15287    /// Sends a response to the FIDL transaction.
15288    ///
15289    /// Sets the channel to shutdown if an error occurs.
15290    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15291        let _result = self.send_raw(s);
15292        if _result.is_err() {
15293            self.control_handle.shutdown();
15294        }
15295        self.drop_without_shutdown();
15296        _result
15297    }
15298
15299    /// Similar to "send" but does not shutdown the channel if an error occurs.
15300    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15301        let _result = self.send_raw(s);
15302        self.drop_without_shutdown();
15303        _result
15304    }
15305
15306    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15307        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
15308            (s,),
15309            self.tx_id,
15310            0x5295b76c71fde733,
15311            fidl::encoding::DynamicFlags::empty(),
15312        )
15313    }
15314}
15315
15316#[must_use = "FIDL methods require a response to be sent"]
15317#[derive(Debug)]
15318pub struct NodeGetFlagsResponder {
15319    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15320    tx_id: u32,
15321}
15322
15323/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15324/// if the responder is dropped without sending a response, so that the client
15325/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15326impl std::ops::Drop for NodeGetFlagsResponder {
15327    fn drop(&mut self) {
15328        self.control_handle.shutdown();
15329        // Safety: drops once, never accessed again
15330        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15331    }
15332}
15333
15334impl fidl::endpoints::Responder for NodeGetFlagsResponder {
15335    type ControlHandle = NodeControlHandle;
15336
15337    fn control_handle(&self) -> &NodeControlHandle {
15338        &self.control_handle
15339    }
15340
15341    fn drop_without_shutdown(mut self) {
15342        // Safety: drops once, never accessed again due to mem::forget
15343        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15344        // Prevent Drop from running (which would shut down the channel)
15345        std::mem::forget(self);
15346    }
15347}
15348
15349impl NodeGetFlagsResponder {
15350    /// Sends a response to the FIDL transaction.
15351    ///
15352    /// Sets the channel to shutdown if an error occurs.
15353    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15354        let _result = self.send_raw(result);
15355        if _result.is_err() {
15356            self.control_handle.shutdown();
15357        }
15358        self.drop_without_shutdown();
15359        _result
15360    }
15361
15362    /// Similar to "send" but does not shutdown the channel if an error occurs.
15363    pub fn send_no_shutdown_on_err(
15364        self,
15365        mut result: Result<Flags, i32>,
15366    ) -> Result<(), fidl::Error> {
15367        let _result = self.send_raw(result);
15368        self.drop_without_shutdown();
15369        _result
15370    }
15371
15372    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15373        self.control_handle
15374            .inner
15375            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
15376                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
15377                self.tx_id,
15378                0x176eb318f64ec23,
15379                fidl::encoding::DynamicFlags::FLEXIBLE,
15380            )
15381    }
15382}
15383
15384#[must_use = "FIDL methods require a response to be sent"]
15385#[derive(Debug)]
15386pub struct NodeSetFlagsResponder {
15387    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15388    tx_id: u32,
15389}
15390
15391/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15392/// if the responder is dropped without sending a response, so that the client
15393/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15394impl std::ops::Drop for NodeSetFlagsResponder {
15395    fn drop(&mut self) {
15396        self.control_handle.shutdown();
15397        // Safety: drops once, never accessed again
15398        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15399    }
15400}
15401
15402impl fidl::endpoints::Responder for NodeSetFlagsResponder {
15403    type ControlHandle = NodeControlHandle;
15404
15405    fn control_handle(&self) -> &NodeControlHandle {
15406        &self.control_handle
15407    }
15408
15409    fn drop_without_shutdown(mut self) {
15410        // Safety: drops once, never accessed again due to mem::forget
15411        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15412        // Prevent Drop from running (which would shut down the channel)
15413        std::mem::forget(self);
15414    }
15415}
15416
15417impl NodeSetFlagsResponder {
15418    /// Sends a response to the FIDL transaction.
15419    ///
15420    /// Sets the channel to shutdown if an error occurs.
15421    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15422        let _result = self.send_raw(result);
15423        if _result.is_err() {
15424            self.control_handle.shutdown();
15425        }
15426        self.drop_without_shutdown();
15427        _result
15428    }
15429
15430    /// Similar to "send" but does not shutdown the channel if an error occurs.
15431    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15432        let _result = self.send_raw(result);
15433        self.drop_without_shutdown();
15434        _result
15435    }
15436
15437    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15438        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
15439            fidl::encoding::EmptyStruct,
15440            i32,
15441        >>(
15442            fidl::encoding::FlexibleResult::new(result),
15443            self.tx_id,
15444            0x55a8028685791ea8,
15445            fidl::encoding::DynamicFlags::FLEXIBLE,
15446        )
15447    }
15448}
15449
15450#[must_use = "FIDL methods require a response to be sent"]
15451#[derive(Debug)]
15452pub struct NodeQueryFilesystemResponder {
15453    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15454    tx_id: u32,
15455}
15456
15457/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15458/// if the responder is dropped without sending a response, so that the client
15459/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15460impl std::ops::Drop for NodeQueryFilesystemResponder {
15461    fn drop(&mut self) {
15462        self.control_handle.shutdown();
15463        // Safety: drops once, never accessed again
15464        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15465    }
15466}
15467
15468impl fidl::endpoints::Responder for NodeQueryFilesystemResponder {
15469    type ControlHandle = NodeControlHandle;
15470
15471    fn control_handle(&self) -> &NodeControlHandle {
15472        &self.control_handle
15473    }
15474
15475    fn drop_without_shutdown(mut self) {
15476        // Safety: drops once, never accessed again due to mem::forget
15477        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15478        // Prevent Drop from running (which would shut down the channel)
15479        std::mem::forget(self);
15480    }
15481}
15482
15483impl NodeQueryFilesystemResponder {
15484    /// Sends a response to the FIDL transaction.
15485    ///
15486    /// Sets the channel to shutdown if an error occurs.
15487    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15488        let _result = self.send_raw(s, info);
15489        if _result.is_err() {
15490            self.control_handle.shutdown();
15491        }
15492        self.drop_without_shutdown();
15493        _result
15494    }
15495
15496    /// Similar to "send" but does not shutdown the channel if an error occurs.
15497    pub fn send_no_shutdown_on_err(
15498        self,
15499        mut s: i32,
15500        mut info: Option<&FilesystemInfo>,
15501    ) -> Result<(), fidl::Error> {
15502        let _result = self.send_raw(s, info);
15503        self.drop_without_shutdown();
15504        _result
15505    }
15506
15507    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15508        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
15509            (s, info),
15510            self.tx_id,
15511            0x6f344a1c6b0a0610,
15512            fidl::encoding::DynamicFlags::empty(),
15513        )
15514    }
15515}
15516
15517#[must_use = "FIDL methods require a response to be sent"]
15518#[derive(Debug)]
15519pub struct NodeGetAttributesResponder {
15520    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15521    tx_id: u32,
15522}
15523
15524/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15525/// if the responder is dropped without sending a response, so that the client
15526/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15527impl std::ops::Drop for NodeGetAttributesResponder {
15528    fn drop(&mut self) {
15529        self.control_handle.shutdown();
15530        // Safety: drops once, never accessed again
15531        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15532    }
15533}
15534
15535impl fidl::endpoints::Responder for NodeGetAttributesResponder {
15536    type ControlHandle = NodeControlHandle;
15537
15538    fn control_handle(&self) -> &NodeControlHandle {
15539        &self.control_handle
15540    }
15541
15542    fn drop_without_shutdown(mut self) {
15543        // Safety: drops once, never accessed again due to mem::forget
15544        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15545        // Prevent Drop from running (which would shut down the channel)
15546        std::mem::forget(self);
15547    }
15548}
15549
15550impl NodeGetAttributesResponder {
15551    /// Sends a response to the FIDL transaction.
15552    ///
15553    /// Sets the channel to shutdown if an error occurs.
15554    pub fn send(
15555        self,
15556        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15557    ) -> Result<(), fidl::Error> {
15558        let _result = self.send_raw(result);
15559        if _result.is_err() {
15560            self.control_handle.shutdown();
15561        }
15562        self.drop_without_shutdown();
15563        _result
15564    }
15565
15566    /// Similar to "send" but does not shutdown the channel if an error occurs.
15567    pub fn send_no_shutdown_on_err(
15568        self,
15569        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15570    ) -> Result<(), fidl::Error> {
15571        let _result = self.send_raw(result);
15572        self.drop_without_shutdown();
15573        _result
15574    }
15575
15576    fn send_raw(
15577        &self,
15578        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15579    ) -> Result<(), fidl::Error> {
15580        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
15581            result,
15582            self.tx_id,
15583            0x3d4396a638ea053b,
15584            fidl::encoding::DynamicFlags::empty(),
15585        )
15586    }
15587}
15588
15589#[must_use = "FIDL methods require a response to be sent"]
15590#[derive(Debug)]
15591pub struct NodeUpdateAttributesResponder {
15592    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15593    tx_id: u32,
15594}
15595
15596/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15597/// if the responder is dropped without sending a response, so that the client
15598/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15599impl std::ops::Drop for NodeUpdateAttributesResponder {
15600    fn drop(&mut self) {
15601        self.control_handle.shutdown();
15602        // Safety: drops once, never accessed again
15603        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15604    }
15605}
15606
15607impl fidl::endpoints::Responder for NodeUpdateAttributesResponder {
15608    type ControlHandle = NodeControlHandle;
15609
15610    fn control_handle(&self) -> &NodeControlHandle {
15611        &self.control_handle
15612    }
15613
15614    fn drop_without_shutdown(mut self) {
15615        // Safety: drops once, never accessed again due to mem::forget
15616        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15617        // Prevent Drop from running (which would shut down the channel)
15618        std::mem::forget(self);
15619    }
15620}
15621
15622impl NodeUpdateAttributesResponder {
15623    /// Sends a response to the FIDL transaction.
15624    ///
15625    /// Sets the channel to shutdown if an error occurs.
15626    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15627        let _result = self.send_raw(result);
15628        if _result.is_err() {
15629            self.control_handle.shutdown();
15630        }
15631        self.drop_without_shutdown();
15632        _result
15633    }
15634
15635    /// Similar to "send" but does not shutdown the channel if an error occurs.
15636    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15637        let _result = self.send_raw(result);
15638        self.drop_without_shutdown();
15639        _result
15640    }
15641
15642    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15643        self.control_handle
15644            .inner
15645            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15646                result,
15647                self.tx_id,
15648                0x3308c1da5a89bf08,
15649                fidl::encoding::DynamicFlags::empty(),
15650            )
15651    }
15652}
15653
15654#[must_use = "FIDL methods require a response to be sent"]
15655#[derive(Debug)]
15656pub struct NodeSyncResponder {
15657    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15658    tx_id: u32,
15659}
15660
15661/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15662/// if the responder is dropped without sending a response, so that the client
15663/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15664impl std::ops::Drop for NodeSyncResponder {
15665    fn drop(&mut self) {
15666        self.control_handle.shutdown();
15667        // Safety: drops once, never accessed again
15668        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15669    }
15670}
15671
15672impl fidl::endpoints::Responder for NodeSyncResponder {
15673    type ControlHandle = NodeControlHandle;
15674
15675    fn control_handle(&self) -> &NodeControlHandle {
15676        &self.control_handle
15677    }
15678
15679    fn drop_without_shutdown(mut self) {
15680        // Safety: drops once, never accessed again due to mem::forget
15681        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15682        // Prevent Drop from running (which would shut down the channel)
15683        std::mem::forget(self);
15684    }
15685}
15686
15687impl NodeSyncResponder {
15688    /// Sends a response to the FIDL transaction.
15689    ///
15690    /// Sets the channel to shutdown if an error occurs.
15691    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15692        let _result = self.send_raw(result);
15693        if _result.is_err() {
15694            self.control_handle.shutdown();
15695        }
15696        self.drop_without_shutdown();
15697        _result
15698    }
15699
15700    /// Similar to "send" but does not shutdown the channel if an error occurs.
15701    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15702        let _result = self.send_raw(result);
15703        self.drop_without_shutdown();
15704        _result
15705    }
15706
15707    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15708        self.control_handle
15709            .inner
15710            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15711                result,
15712                self.tx_id,
15713                0x2c5c27ca0ab5dc49,
15714                fidl::encoding::DynamicFlags::empty(),
15715            )
15716    }
15717}
15718
15719#[must_use = "FIDL methods require a response to be sent"]
15720#[derive(Debug)]
15721pub struct NodeGetExtendedAttributeResponder {
15722    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15723    tx_id: u32,
15724}
15725
15726/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15727/// if the responder is dropped without sending a response, so that the client
15728/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15729impl std::ops::Drop for NodeGetExtendedAttributeResponder {
15730    fn drop(&mut self) {
15731        self.control_handle.shutdown();
15732        // Safety: drops once, never accessed again
15733        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15734    }
15735}
15736
15737impl fidl::endpoints::Responder for NodeGetExtendedAttributeResponder {
15738    type ControlHandle = NodeControlHandle;
15739
15740    fn control_handle(&self) -> &NodeControlHandle {
15741        &self.control_handle
15742    }
15743
15744    fn drop_without_shutdown(mut self) {
15745        // Safety: drops once, never accessed again due to mem::forget
15746        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15747        // Prevent Drop from running (which would shut down the channel)
15748        std::mem::forget(self);
15749    }
15750}
15751
15752impl NodeGetExtendedAttributeResponder {
15753    /// Sends a response to the FIDL transaction.
15754    ///
15755    /// Sets the channel to shutdown if an error occurs.
15756    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
15757        let _result = self.send_raw(result);
15758        if _result.is_err() {
15759            self.control_handle.shutdown();
15760        }
15761        self.drop_without_shutdown();
15762        _result
15763    }
15764
15765    /// Similar to "send" but does not shutdown the channel if an error occurs.
15766    pub fn send_no_shutdown_on_err(
15767        self,
15768        mut result: Result<ExtendedAttributeValue, i32>,
15769    ) -> Result<(), fidl::Error> {
15770        let _result = self.send_raw(result);
15771        self.drop_without_shutdown();
15772        _result
15773    }
15774
15775    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
15776        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
15777            result.as_mut().map_err(|e| *e),
15778            self.tx_id,
15779            0x45ffa3ccfdeb76db,
15780            fidl::encoding::DynamicFlags::empty(),
15781        )
15782    }
15783}
15784
15785#[must_use = "FIDL methods require a response to be sent"]
15786#[derive(Debug)]
15787pub struct NodeSetExtendedAttributeResponder {
15788    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15789    tx_id: u32,
15790}
15791
15792/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15793/// if the responder is dropped without sending a response, so that the client
15794/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15795impl std::ops::Drop for NodeSetExtendedAttributeResponder {
15796    fn drop(&mut self) {
15797        self.control_handle.shutdown();
15798        // Safety: drops once, never accessed again
15799        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15800    }
15801}
15802
15803impl fidl::endpoints::Responder for NodeSetExtendedAttributeResponder {
15804    type ControlHandle = NodeControlHandle;
15805
15806    fn control_handle(&self) -> &NodeControlHandle {
15807        &self.control_handle
15808    }
15809
15810    fn drop_without_shutdown(mut self) {
15811        // Safety: drops once, never accessed again due to mem::forget
15812        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15813        // Prevent Drop from running (which would shut down the channel)
15814        std::mem::forget(self);
15815    }
15816}
15817
15818impl NodeSetExtendedAttributeResponder {
15819    /// Sends a response to the FIDL transaction.
15820    ///
15821    /// Sets the channel to shutdown if an error occurs.
15822    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15823        let _result = self.send_raw(result);
15824        if _result.is_err() {
15825            self.control_handle.shutdown();
15826        }
15827        self.drop_without_shutdown();
15828        _result
15829    }
15830
15831    /// Similar to "send" but does not shutdown the channel if an error occurs.
15832    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15833        let _result = self.send_raw(result);
15834        self.drop_without_shutdown();
15835        _result
15836    }
15837
15838    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15839        self.control_handle
15840            .inner
15841            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15842                result,
15843                self.tx_id,
15844                0x4a951362f681f23c,
15845                fidl::encoding::DynamicFlags::empty(),
15846            )
15847    }
15848}
15849
15850#[must_use = "FIDL methods require a response to be sent"]
15851#[derive(Debug)]
15852pub struct NodeRemoveExtendedAttributeResponder {
15853    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15854    tx_id: u32,
15855}
15856
15857/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15858/// if the responder is dropped without sending a response, so that the client
15859/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15860impl std::ops::Drop for NodeRemoveExtendedAttributeResponder {
15861    fn drop(&mut self) {
15862        self.control_handle.shutdown();
15863        // Safety: drops once, never accessed again
15864        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15865    }
15866}
15867
15868impl fidl::endpoints::Responder for NodeRemoveExtendedAttributeResponder {
15869    type ControlHandle = NodeControlHandle;
15870
15871    fn control_handle(&self) -> &NodeControlHandle {
15872        &self.control_handle
15873    }
15874
15875    fn drop_without_shutdown(mut self) {
15876        // Safety: drops once, never accessed again due to mem::forget
15877        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15878        // Prevent Drop from running (which would shut down the channel)
15879        std::mem::forget(self);
15880    }
15881}
15882
15883impl NodeRemoveExtendedAttributeResponder {
15884    /// Sends a response to the FIDL transaction.
15885    ///
15886    /// Sets the channel to shutdown if an error occurs.
15887    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15888        let _result = self.send_raw(result);
15889        if _result.is_err() {
15890            self.control_handle.shutdown();
15891        }
15892        self.drop_without_shutdown();
15893        _result
15894    }
15895
15896    /// Similar to "send" but does not shutdown the channel if an error occurs.
15897    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15898        let _result = self.send_raw(result);
15899        self.drop_without_shutdown();
15900        _result
15901    }
15902
15903    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15904        self.control_handle
15905            .inner
15906            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15907                result,
15908                self.tx_id,
15909                0x7a0b9f3a9bf9032d,
15910                fidl::encoding::DynamicFlags::empty(),
15911            )
15912    }
15913}
15914
15915#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15916pub struct ReadableMarker;
15917
15918impl fidl::endpoints::ProtocolMarker for ReadableMarker {
15919    type Proxy = ReadableProxy;
15920    type RequestStream = ReadableRequestStream;
15921    #[cfg(target_os = "fuchsia")]
15922    type SynchronousProxy = ReadableSynchronousProxy;
15923
15924    const DEBUG_NAME: &'static str = "(anonymous) Readable";
15925}
15926pub type ReadableReadResult = Result<Vec<u8>, i32>;
15927
15928pub trait ReadableProxyInterface: Send + Sync {
15929    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
15930        + Send;
15931    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
15932}
15933#[derive(Debug)]
15934#[cfg(target_os = "fuchsia")]
15935pub struct ReadableSynchronousProxy {
15936    client: fidl::client::sync::Client,
15937}
15938
15939#[cfg(target_os = "fuchsia")]
15940impl fidl::endpoints::SynchronousProxy for ReadableSynchronousProxy {
15941    type Proxy = ReadableProxy;
15942    type Protocol = ReadableMarker;
15943
15944    fn from_channel(inner: fidl::Channel) -> Self {
15945        Self::new(inner)
15946    }
15947
15948    fn into_channel(self) -> fidl::Channel {
15949        self.client.into_channel()
15950    }
15951
15952    fn as_channel(&self) -> &fidl::Channel {
15953        self.client.as_channel()
15954    }
15955}
15956
15957#[cfg(target_os = "fuchsia")]
15958impl ReadableSynchronousProxy {
15959    pub fn new(channel: fidl::Channel) -> Self {
15960        let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
15961        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
15962    }
15963
15964    pub fn into_channel(self) -> fidl::Channel {
15965        self.client.into_channel()
15966    }
15967
15968    /// Waits until an event arrives and returns it. It is safe for other
15969    /// threads to make concurrent requests while waiting for an event.
15970    pub fn wait_for_event(
15971        &self,
15972        deadline: zx::MonotonicInstant,
15973    ) -> Result<ReadableEvent, fidl::Error> {
15974        ReadableEvent::decode(self.client.wait_for_event(deadline)?)
15975    }
15976
15977    /// Reads up to 'count' bytes at the seek offset.
15978    /// The seek offset is moved forward by the number of bytes read.
15979    ///
15980    /// ## Invariants
15981    ///
15982    /// * The returned `data.length` will never be greater than `count`.
15983    /// * If `data.length` is less than `count`, it means that the seek offset
15984    ///   has reached the end of file as part of this operation.
15985    /// * If `data.length` is zero while `count` is not, it means that the
15986    ///   seek offset is already at or beyond the end of file, and no data could
15987    ///   be read.
15988    /// * If `count` is zero, the server should perform all the checks ensuring
15989    ///   read access without actually read anything, and return an empty
15990    ///   `data` vector.
15991    ///
15992    /// This method requires the [`Rights.READ_BYTES`] right.
15993    ///
15994    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
15995    pub fn r#read(
15996        &self,
15997        mut count: u64,
15998        ___deadline: zx::MonotonicInstant,
15999    ) -> Result<ReadableReadResult, fidl::Error> {
16000        let _response = self.client.send_query::<
16001            ReadableReadRequest,
16002            fidl::encoding::ResultType<ReadableReadResponse, i32>,
16003        >(
16004            (count,),
16005            0x57e419a298c8ede,
16006            fidl::encoding::DynamicFlags::empty(),
16007            ___deadline,
16008        )?;
16009        Ok(_response.map(|x| x.data))
16010    }
16011}
16012
16013#[cfg(target_os = "fuchsia")]
16014impl From<ReadableSynchronousProxy> for zx::Handle {
16015    fn from(value: ReadableSynchronousProxy) -> Self {
16016        value.into_channel().into()
16017    }
16018}
16019
16020#[cfg(target_os = "fuchsia")]
16021impl From<fidl::Channel> for ReadableSynchronousProxy {
16022    fn from(value: fidl::Channel) -> Self {
16023        Self::new(value)
16024    }
16025}
16026
16027#[derive(Debug, Clone)]
16028pub struct ReadableProxy {
16029    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
16030}
16031
16032impl fidl::endpoints::Proxy for ReadableProxy {
16033    type Protocol = ReadableMarker;
16034
16035    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
16036        Self::new(inner)
16037    }
16038
16039    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
16040        self.client.into_channel().map_err(|client| Self { client })
16041    }
16042
16043    fn as_channel(&self) -> &::fidl::AsyncChannel {
16044        self.client.as_channel()
16045    }
16046}
16047
16048impl ReadableProxy {
16049    /// Create a new Proxy for fuchsia.io/Readable.
16050    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
16051        let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16052        Self { client: fidl::client::Client::new(channel, protocol_name) }
16053    }
16054
16055    /// Get a Stream of events from the remote end of the protocol.
16056    ///
16057    /// # Panics
16058    ///
16059    /// Panics if the event stream was already taken.
16060    pub fn take_event_stream(&self) -> ReadableEventStream {
16061        ReadableEventStream { event_receiver: self.client.take_event_receiver() }
16062    }
16063
16064    /// Reads up to 'count' bytes at the seek offset.
16065    /// The seek offset is moved forward by the number of bytes read.
16066    ///
16067    /// ## Invariants
16068    ///
16069    /// * The returned `data.length` will never be greater than `count`.
16070    /// * If `data.length` is less than `count`, it means that the seek offset
16071    ///   has reached the end of file as part of this operation.
16072    /// * If `data.length` is zero while `count` is not, it means that the
16073    ///   seek offset is already at or beyond the end of file, and no data could
16074    ///   be read.
16075    /// * If `count` is zero, the server should perform all the checks ensuring
16076    ///   read access without actually read anything, and return an empty
16077    ///   `data` vector.
16078    ///
16079    /// This method requires the [`Rights.READ_BYTES`] right.
16080    ///
16081    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16082    pub fn r#read(
16083        &self,
16084        mut count: u64,
16085    ) -> fidl::client::QueryResponseFut<
16086        ReadableReadResult,
16087        fidl::encoding::DefaultFuchsiaResourceDialect,
16088    > {
16089        ReadableProxyInterface::r#read(self, count)
16090    }
16091}
16092
16093impl ReadableProxyInterface for ReadableProxy {
16094    type ReadResponseFut = fidl::client::QueryResponseFut<
16095        ReadableReadResult,
16096        fidl::encoding::DefaultFuchsiaResourceDialect,
16097    >;
16098    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
16099        fn _decode(
16100            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
16101        ) -> Result<ReadableReadResult, fidl::Error> {
16102            let _response = fidl::client::decode_transaction_body::<
16103                fidl::encoding::ResultType<ReadableReadResponse, i32>,
16104                fidl::encoding::DefaultFuchsiaResourceDialect,
16105                0x57e419a298c8ede,
16106            >(_buf?)?;
16107            Ok(_response.map(|x| x.data))
16108        }
16109        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
16110            (count,),
16111            0x57e419a298c8ede,
16112            fidl::encoding::DynamicFlags::empty(),
16113            _decode,
16114        )
16115    }
16116}
16117
16118pub struct ReadableEventStream {
16119    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
16120}
16121
16122impl std::marker::Unpin for ReadableEventStream {}
16123
16124impl futures::stream::FusedStream for ReadableEventStream {
16125    fn is_terminated(&self) -> bool {
16126        self.event_receiver.is_terminated()
16127    }
16128}
16129
16130impl futures::Stream for ReadableEventStream {
16131    type Item = Result<ReadableEvent, fidl::Error>;
16132
16133    fn poll_next(
16134        mut self: std::pin::Pin<&mut Self>,
16135        cx: &mut std::task::Context<'_>,
16136    ) -> std::task::Poll<Option<Self::Item>> {
16137        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
16138            &mut self.event_receiver,
16139            cx
16140        )?) {
16141            Some(buf) => std::task::Poll::Ready(Some(ReadableEvent::decode(buf))),
16142            None => std::task::Poll::Ready(None),
16143        }
16144    }
16145}
16146
16147#[derive(Debug)]
16148pub enum ReadableEvent {}
16149
16150impl ReadableEvent {
16151    /// Decodes a message buffer as a [`ReadableEvent`].
16152    fn decode(
16153        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
16154    ) -> Result<ReadableEvent, fidl::Error> {
16155        let (bytes, _handles) = buf.split_mut();
16156        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16157        debug_assert_eq!(tx_header.tx_id, 0);
16158        match tx_header.ordinal {
16159            _ => Err(fidl::Error::UnknownOrdinal {
16160                ordinal: tx_header.ordinal,
16161                protocol_name: <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16162            }),
16163        }
16164    }
16165}
16166
16167/// A Stream of incoming requests for fuchsia.io/Readable.
16168pub struct ReadableRequestStream {
16169    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16170    is_terminated: bool,
16171}
16172
16173impl std::marker::Unpin for ReadableRequestStream {}
16174
16175impl futures::stream::FusedStream for ReadableRequestStream {
16176    fn is_terminated(&self) -> bool {
16177        self.is_terminated
16178    }
16179}
16180
16181impl fidl::endpoints::RequestStream for ReadableRequestStream {
16182    type Protocol = ReadableMarker;
16183    type ControlHandle = ReadableControlHandle;
16184
16185    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
16186        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
16187    }
16188
16189    fn control_handle(&self) -> Self::ControlHandle {
16190        ReadableControlHandle { inner: self.inner.clone() }
16191    }
16192
16193    fn into_inner(
16194        self,
16195    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
16196    {
16197        (self.inner, self.is_terminated)
16198    }
16199
16200    fn from_inner(
16201        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16202        is_terminated: bool,
16203    ) -> Self {
16204        Self { inner, is_terminated }
16205    }
16206}
16207
16208impl futures::Stream for ReadableRequestStream {
16209    type Item = Result<ReadableRequest, fidl::Error>;
16210
16211    fn poll_next(
16212        mut self: std::pin::Pin<&mut Self>,
16213        cx: &mut std::task::Context<'_>,
16214    ) -> std::task::Poll<Option<Self::Item>> {
16215        let this = &mut *self;
16216        if this.inner.check_shutdown(cx) {
16217            this.is_terminated = true;
16218            return std::task::Poll::Ready(None);
16219        }
16220        if this.is_terminated {
16221            panic!("polled ReadableRequestStream after completion");
16222        }
16223        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
16224            |bytes, handles| {
16225                match this.inner.channel().read_etc(cx, bytes, handles) {
16226                    std::task::Poll::Ready(Ok(())) => {}
16227                    std::task::Poll::Pending => return std::task::Poll::Pending,
16228                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
16229                        this.is_terminated = true;
16230                        return std::task::Poll::Ready(None);
16231                    }
16232                    std::task::Poll::Ready(Err(e)) => {
16233                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
16234                            e.into(),
16235                        ))))
16236                    }
16237                }
16238
16239                // A message has been received from the channel
16240                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16241
16242                std::task::Poll::Ready(Some(match header.ordinal {
16243                    0x57e419a298c8ede => {
16244                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
16245                        let mut req = fidl::new_empty!(
16246                            ReadableReadRequest,
16247                            fidl::encoding::DefaultFuchsiaResourceDialect
16248                        );
16249                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
16250                        let control_handle = ReadableControlHandle { inner: this.inner.clone() };
16251                        Ok(ReadableRequest::Read {
16252                            count: req.count,
16253
16254                            responder: ReadableReadResponder {
16255                                control_handle: std::mem::ManuallyDrop::new(control_handle),
16256                                tx_id: header.tx_id,
16257                            },
16258                        })
16259                    }
16260                    _ => Err(fidl::Error::UnknownOrdinal {
16261                        ordinal: header.ordinal,
16262                        protocol_name:
16263                            <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16264                    }),
16265                }))
16266            },
16267        )
16268    }
16269}
16270
16271#[derive(Debug)]
16272pub enum ReadableRequest {
16273    /// Reads up to 'count' bytes at the seek offset.
16274    /// The seek offset is moved forward by the number of bytes read.
16275    ///
16276    /// ## Invariants
16277    ///
16278    /// * The returned `data.length` will never be greater than `count`.
16279    /// * If `data.length` is less than `count`, it means that the seek offset
16280    ///   has reached the end of file as part of this operation.
16281    /// * If `data.length` is zero while `count` is not, it means that the
16282    ///   seek offset is already at or beyond the end of file, and no data could
16283    ///   be read.
16284    /// * If `count` is zero, the server should perform all the checks ensuring
16285    ///   read access without actually read anything, and return an empty
16286    ///   `data` vector.
16287    ///
16288    /// This method requires the [`Rights.READ_BYTES`] right.
16289    ///
16290    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16291    Read { count: u64, responder: ReadableReadResponder },
16292}
16293
16294impl ReadableRequest {
16295    #[allow(irrefutable_let_patterns)]
16296    pub fn into_read(self) -> Option<(u64, ReadableReadResponder)> {
16297        if let ReadableRequest::Read { count, responder } = self {
16298            Some((count, responder))
16299        } else {
16300            None
16301        }
16302    }
16303
16304    /// Name of the method defined in FIDL
16305    pub fn method_name(&self) -> &'static str {
16306        match *self {
16307            ReadableRequest::Read { .. } => "read",
16308        }
16309    }
16310}
16311
16312#[derive(Debug, Clone)]
16313pub struct ReadableControlHandle {
16314    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16315}
16316
16317impl fidl::endpoints::ControlHandle for ReadableControlHandle {
16318    fn shutdown(&self) {
16319        self.inner.shutdown()
16320    }
16321    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
16322        self.inner.shutdown_with_epitaph(status)
16323    }
16324
16325    fn is_closed(&self) -> bool {
16326        self.inner.channel().is_closed()
16327    }
16328    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
16329        self.inner.channel().on_closed()
16330    }
16331
16332    #[cfg(target_os = "fuchsia")]
16333    fn signal_peer(
16334        &self,
16335        clear_mask: zx::Signals,
16336        set_mask: zx::Signals,
16337    ) -> Result<(), zx_status::Status> {
16338        use fidl::Peered;
16339        self.inner.channel().signal_peer(clear_mask, set_mask)
16340    }
16341}
16342
16343impl ReadableControlHandle {}
16344
16345#[must_use = "FIDL methods require a response to be sent"]
16346#[derive(Debug)]
16347pub struct ReadableReadResponder {
16348    control_handle: std::mem::ManuallyDrop<ReadableControlHandle>,
16349    tx_id: u32,
16350}
16351
16352/// Set the the channel to be shutdown (see [`ReadableControlHandle::shutdown`])
16353/// if the responder is dropped without sending a response, so that the client
16354/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16355impl std::ops::Drop for ReadableReadResponder {
16356    fn drop(&mut self) {
16357        self.control_handle.shutdown();
16358        // Safety: drops once, never accessed again
16359        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16360    }
16361}
16362
16363impl fidl::endpoints::Responder for ReadableReadResponder {
16364    type ControlHandle = ReadableControlHandle;
16365
16366    fn control_handle(&self) -> &ReadableControlHandle {
16367        &self.control_handle
16368    }
16369
16370    fn drop_without_shutdown(mut self) {
16371        // Safety: drops once, never accessed again due to mem::forget
16372        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16373        // Prevent Drop from running (which would shut down the channel)
16374        std::mem::forget(self);
16375    }
16376}
16377
16378impl ReadableReadResponder {
16379    /// Sends a response to the FIDL transaction.
16380    ///
16381    /// Sets the channel to shutdown if an error occurs.
16382    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
16383        let _result = self.send_raw(result);
16384        if _result.is_err() {
16385            self.control_handle.shutdown();
16386        }
16387        self.drop_without_shutdown();
16388        _result
16389    }
16390
16391    /// Similar to "send" but does not shutdown the channel if an error occurs.
16392    pub fn send_no_shutdown_on_err(
16393        self,
16394        mut result: Result<&[u8], i32>,
16395    ) -> Result<(), fidl::Error> {
16396        let _result = self.send_raw(result);
16397        self.drop_without_shutdown();
16398        _result
16399    }
16400
16401    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
16402        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
16403            result.map(|data| (data,)),
16404            self.tx_id,
16405            0x57e419a298c8ede,
16406            fidl::encoding::DynamicFlags::empty(),
16407        )
16408    }
16409}
16410
16411#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
16412pub struct SymlinkMarker;
16413
16414impl fidl::endpoints::ProtocolMarker for SymlinkMarker {
16415    type Proxy = SymlinkProxy;
16416    type RequestStream = SymlinkRequestStream;
16417    #[cfg(target_os = "fuchsia")]
16418    type SynchronousProxy = SymlinkSynchronousProxy;
16419
16420    const DEBUG_NAME: &'static str = "fuchsia.io.Symlink";
16421}
16422impl fidl::endpoints::DiscoverableProtocolMarker for SymlinkMarker {}
16423
16424pub trait SymlinkProxyInterface: Send + Sync {
16425    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
16426        + Send;
16427    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
16428    fn r#clone(
16429        &self,
16430        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
16431    ) -> Result<(), fidl::Error>;
16432    type CloseResponseFut: std::future::Future<
16433            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
16434        > + Send;
16435    fn r#close(&self) -> Self::CloseResponseFut;
16436    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
16437    fn r#query(&self) -> Self::QueryResponseFut;
16438    fn r#deprecated_clone(
16439        &self,
16440        flags: OpenFlags,
16441        object: fidl::endpoints::ServerEnd<NodeMarker>,
16442    ) -> Result<(), fidl::Error>;
16443    type GetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
16444        + Send;
16445    fn r#get_attr(&self) -> Self::GetAttrResponseFut;
16446    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
16447    fn r#deprecated_set_attr(
16448        &self,
16449        flags: NodeAttributeFlags,
16450        attributes: &NodeAttributes,
16451    ) -> Self::DeprecatedSetAttrResponseFut;
16452    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
16453        + Send;
16454    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
16455    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
16456        + Send;
16457    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
16458    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
16459        + Send;
16460    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
16461    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
16462        + Send;
16463    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
16464    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
16465        + Send;
16466    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
16467    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
16468        + Send;
16469    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
16470    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
16471        + Send;
16472    fn r#update_attributes(
16473        &self,
16474        payload: &MutableNodeAttributes,
16475    ) -> Self::UpdateAttributesResponseFut;
16476    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
16477    fn r#sync(&self) -> Self::SyncResponseFut;
16478    fn r#list_extended_attributes(
16479        &self,
16480        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
16481    ) -> Result<(), fidl::Error>;
16482    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
16483        + Send;
16484    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
16485    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
16486        + Send;
16487    fn r#set_extended_attribute(
16488        &self,
16489        name: &[u8],
16490        value: ExtendedAttributeValue,
16491        mode: SetExtendedAttributeMode,
16492    ) -> Self::SetExtendedAttributeResponseFut;
16493    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
16494        + Send;
16495    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
16496    type DescribeResponseFut: std::future::Future<Output = Result<SymlinkInfo, fidl::Error>> + Send;
16497    fn r#describe(&self) -> Self::DescribeResponseFut;
16498}
16499#[derive(Debug)]
16500#[cfg(target_os = "fuchsia")]
16501pub struct SymlinkSynchronousProxy {
16502    client: fidl::client::sync::Client,
16503}
16504
16505#[cfg(target_os = "fuchsia")]
16506impl fidl::endpoints::SynchronousProxy for SymlinkSynchronousProxy {
16507    type Proxy = SymlinkProxy;
16508    type Protocol = SymlinkMarker;
16509
16510    fn from_channel(inner: fidl::Channel) -> Self {
16511        Self::new(inner)
16512    }
16513
16514    fn into_channel(self) -> fidl::Channel {
16515        self.client.into_channel()
16516    }
16517
16518    fn as_channel(&self) -> &fidl::Channel {
16519        self.client.as_channel()
16520    }
16521}
16522
16523#[cfg(target_os = "fuchsia")]
16524impl SymlinkSynchronousProxy {
16525    pub fn new(channel: fidl::Channel) -> Self {
16526        let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16527        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
16528    }
16529
16530    pub fn into_channel(self) -> fidl::Channel {
16531        self.client.into_channel()
16532    }
16533
16534    /// Waits until an event arrives and returns it. It is safe for other
16535    /// threads to make concurrent requests while waiting for an event.
16536    pub fn wait_for_event(
16537        &self,
16538        deadline: zx::MonotonicInstant,
16539    ) -> Result<SymlinkEvent, fidl::Error> {
16540        SymlinkEvent::decode(self.client.wait_for_event(deadline)?)
16541    }
16542
16543    /// Creates a link to this this object with name `dst` in the directory represented by
16544    /// `dst_parent_token`.
16545    ///
16546    /// `dst` must be a resolved object name. Including "/" in the string will return
16547    /// `ZX_ERR_INVALID_ARGS`.
16548    ///
16549    /// This method requires the maximal set of rights supported by the filesystem for this object.
16550    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
16551    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
16552    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
16553    /// `ZX_ERR_ACCESS_DENIED`.
16554    ///
16555    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
16556    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
16557    ///
16558    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
16559    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
16560    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
16561    ///
16562    /// This method does not have the same atomicity properties has the `Directory::Link` method,
16563    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
16564    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
16565    pub fn r#link_into(
16566        &self,
16567        mut dst_parent_token: fidl::Event,
16568        mut dst: &str,
16569        ___deadline: zx::MonotonicInstant,
16570    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
16571        let _response = self.client.send_query::<
16572            LinkableLinkIntoRequest,
16573            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16574        >(
16575            (dst_parent_token, dst,),
16576            0x54f3949246a03e74,
16577            fidl::encoding::DynamicFlags::empty(),
16578            ___deadline,
16579        )?;
16580        Ok(_response.map(|x| x))
16581    }
16582
16583    pub fn r#clone(
16584        &self,
16585        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
16586    ) -> Result<(), fidl::Error> {
16587        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
16588            (request,),
16589            0x20d8a7aba2168a79,
16590            fidl::encoding::DynamicFlags::empty(),
16591        )
16592    }
16593
16594    /// Terminates the connection.
16595    ///
16596    /// After calling `Close`, the client must not send any other requests.
16597    ///
16598    /// Servers, after sending the status response, should close the connection
16599    /// regardless of status and without sending an epitaph.
16600    ///
16601    /// Closing the client end of the channel should be semantically equivalent
16602    /// to calling `Close` without knowing when the close has completed or its
16603    /// status.
16604    pub fn r#close(
16605        &self,
16606        ___deadline: zx::MonotonicInstant,
16607    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
16608        let _response = self.client.send_query::<
16609            fidl::encoding::EmptyPayload,
16610            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16611        >(
16612            (),
16613            0x5ac5d459ad7f657e,
16614            fidl::encoding::DynamicFlags::empty(),
16615            ___deadline,
16616        )?;
16617        Ok(_response.map(|x| x))
16618    }
16619
16620    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
16621        let _response = self.client.send_query::<
16622            fidl::encoding::EmptyPayload,
16623            fidl_fuchsia_unknown::QueryableQueryResponse,
16624        >(
16625            (),
16626            0x2658edee9decfc06,
16627            fidl::encoding::DynamicFlags::empty(),
16628            ___deadline,
16629        )?;
16630        Ok(_response.protocol)
16631    }
16632
16633    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
16634    pub fn r#deprecated_clone(
16635        &self,
16636        mut flags: OpenFlags,
16637        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
16638    ) -> Result<(), fidl::Error> {
16639        self.client.send::<NodeDeprecatedCloneRequest>(
16640            (flags, object),
16641            0x5a61678f293ce16f,
16642            fidl::encoding::DynamicFlags::FLEXIBLE,
16643        )
16644    }
16645
16646    /// Acquires information about the node.
16647    ///
16648    /// This method does not require any rights.
16649    pub fn r#get_attr(
16650        &self,
16651        ___deadline: zx::MonotonicInstant,
16652    ) -> Result<(i32, NodeAttributes), fidl::Error> {
16653        let _response =
16654            self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetAttrResponse>(
16655                (),
16656                0x78985e216314dafd,
16657                fidl::encoding::DynamicFlags::empty(),
16658                ___deadline,
16659            )?;
16660        Ok((_response.s, _response.attributes))
16661    }
16662
16663    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
16664    pub fn r#deprecated_set_attr(
16665        &self,
16666        mut flags: NodeAttributeFlags,
16667        mut attributes: &NodeAttributes,
16668        ___deadline: zx::MonotonicInstant,
16669    ) -> Result<i32, fidl::Error> {
16670        let _response =
16671            self.client.send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse>(
16672                (flags, attributes),
16673                0x4186c0f40d938f46,
16674                fidl::encoding::DynamicFlags::empty(),
16675                ___deadline,
16676            )?;
16677        Ok(_response.s)
16678    }
16679
16680    /// [DEPRECATED - Use new GetFlags method instead.]
16681    pub fn r#deprecated_get_flags(
16682        &self,
16683        ___deadline: zx::MonotonicInstant,
16684    ) -> Result<(i32, OpenFlags), fidl::Error> {
16685        let _response = self
16686            .client
16687            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
16688                (),
16689                0x5b88fffb8eda3aa1,
16690                fidl::encoding::DynamicFlags::empty(),
16691                ___deadline,
16692            )?;
16693        Ok((_response.s, _response.flags))
16694    }
16695
16696    /// [DEPRECATED - Use new SetFlags method instead.]
16697    pub fn r#deprecated_set_flags(
16698        &self,
16699        mut flags: OpenFlags,
16700        ___deadline: zx::MonotonicInstant,
16701    ) -> Result<i32, fidl::Error> {
16702        let _response = self
16703            .client
16704            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
16705                (flags,),
16706                0x5295b76c71fde733,
16707                fidl::encoding::DynamicFlags::empty(),
16708                ___deadline,
16709            )?;
16710        Ok(_response.s)
16711    }
16712
16713    /// Queries the flags that apply to this node after it has been opened/created. This method does
16714    /// not require any rights.
16715    ///
16716    /// Note that the final set of flags that apply to the connection may differ from those
16717    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
16718    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
16719    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
16720    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
16721    pub fn r#get_flags(
16722        &self,
16723        ___deadline: zx::MonotonicInstant,
16724    ) -> Result<NodeGetFlagsResult, fidl::Error> {
16725        let _response = self.client.send_query::<
16726            fidl::encoding::EmptyPayload,
16727            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
16728        >(
16729            (),
16730            0x176eb318f64ec23,
16731            fidl::encoding::DynamicFlags::FLEXIBLE,
16732            ___deadline,
16733        )?
16734        .into_result::<SymlinkMarker>("get_flags")?;
16735        Ok(_response.map(|x| x.flags))
16736    }
16737
16738    /// Sets the flags that apply to this node after it has been opened. This method does not
16739    /// require any rights.
16740    ///
16741    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
16742    /// clear append mode.
16743    ///
16744    /// Errors:
16745    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
16746    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
16747    pub fn r#set_flags(
16748        &self,
16749        mut flags: Flags,
16750        ___deadline: zx::MonotonicInstant,
16751    ) -> Result<NodeSetFlagsResult, fidl::Error> {
16752        let _response = self.client.send_query::<
16753            NodeSetFlagsRequest,
16754            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
16755        >(
16756            (flags,),
16757            0x55a8028685791ea8,
16758            fidl::encoding::DynamicFlags::FLEXIBLE,
16759            ___deadline,
16760        )?
16761        .into_result::<SymlinkMarker>("set_flags")?;
16762        Ok(_response.map(|x| x))
16763    }
16764
16765    /// Query the filesystem for filesystem-specific information.
16766    pub fn r#query_filesystem(
16767        &self,
16768        ___deadline: zx::MonotonicInstant,
16769    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
16770        let _response =
16771            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
16772                (),
16773                0x6f344a1c6b0a0610,
16774                fidl::encoding::DynamicFlags::empty(),
16775                ___deadline,
16776            )?;
16777        Ok((_response.s, _response.info))
16778    }
16779
16780    /// Acquires information about the node.
16781    ///
16782    /// The attributes of a node should be stable, independent of the
16783    /// specific protocol used to access it.
16784    ///
16785    /// If a particular attribute is not applicable or not supported,
16786    /// filesystems should leave the corresponding field absent.
16787    ///
16788    /// + `query` a bit-mask specifying which attributes to fetch. The server
16789    ///   should not return more than necessary.
16790    /// - `attributes` the returned attributes.
16791    ///
16792    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
16793    pub fn r#get_attributes(
16794        &self,
16795        mut query: NodeAttributesQuery,
16796        ___deadline: zx::MonotonicInstant,
16797    ) -> Result<NodeGetAttributesResult, fidl::Error> {
16798        let _response = self.client.send_query::<
16799            NodeGetAttributesRequest,
16800            fidl::encoding::ResultType<NodeAttributes2, i32>,
16801        >(
16802            (query,),
16803            0x3d4396a638ea053b,
16804            fidl::encoding::DynamicFlags::empty(),
16805            ___deadline,
16806        )?;
16807        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
16808    }
16809
16810    /// Updates information about the node.
16811    ///
16812    /// + `attributes` the presence of a table field in `attributes` indicates
16813    /// the intent to update the corresponding attribute.
16814    ///
16815    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
16816    ///
16817    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
16818    pub fn r#update_attributes(
16819        &self,
16820        mut payload: &MutableNodeAttributes,
16821        ___deadline: zx::MonotonicInstant,
16822    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
16823        let _response = self.client.send_query::<
16824            MutableNodeAttributes,
16825            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16826        >(
16827            payload,
16828            0x3308c1da5a89bf08,
16829            fidl::encoding::DynamicFlags::empty(),
16830            ___deadline,
16831        )?;
16832        Ok(_response.map(|x| x))
16833    }
16834
16835    /// Synchronizes updates to the node to the underlying media, if it exists.
16836    ///
16837    /// This method will return when the filesystem server has flushed the
16838    /// relevant updates to the underlying media, but does not guarantee the
16839    /// underlying media has persisted the information, nor that any information
16840    /// is committed to hardware. Clients may use `Sync` to ensure ordering
16841    /// between operations.
16842    ///
16843    /// This method does not require any rights.
16844    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
16845        let _response = self.client.send_query::<
16846            fidl::encoding::EmptyPayload,
16847            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16848        >(
16849            (),
16850            0x2c5c27ca0ab5dc49,
16851            fidl::encoding::DynamicFlags::empty(),
16852            ___deadline,
16853        )?;
16854        Ok(_response.map(|x| x))
16855    }
16856
16857    /// Creates an iterator over all the extended attribute names associated
16858    /// with this node. If an error occurs it is returned as an epitaph on the
16859    /// iterator request channel, and then the channel is closed.
16860    ///
16861    /// GetExtendedAttributes can be used with any of these names to retrieve
16862    /// the associated value.
16863    ///
16864    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
16865    pub fn r#list_extended_attributes(
16866        &self,
16867        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
16868    ) -> Result<(), fidl::Error> {
16869        self.client.send::<NodeListExtendedAttributesRequest>(
16870            (iterator,),
16871            0x4b61033de007fcd0,
16872            fidl::encoding::DynamicFlags::empty(),
16873        )
16874    }
16875
16876    /// Get the value associated with the given attribute `name` for this node.
16877    ///
16878    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
16879    /// particular structure is imposed on them.
16880    ///
16881    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
16882    pub fn r#get_extended_attribute(
16883        &self,
16884        mut name: &[u8],
16885        ___deadline: zx::MonotonicInstant,
16886    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
16887        let _response = self.client.send_query::<
16888            NodeGetExtendedAttributeRequest,
16889            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
16890        >(
16891            (name,),
16892            0x45ffa3ccfdeb76db,
16893            fidl::encoding::DynamicFlags::empty(),
16894            ___deadline,
16895        )?;
16896        Ok(_response.map(|x| x))
16897    }
16898
16899    /// Set the value for the given attribute `name` to `value` for this node.
16900    ///
16901    /// The attribute name may exist, in which case the attribute is updated.
16902    /// If the attribute doesn't exist, it is created. The name should have no
16903    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
16904    ///
16905    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
16906    pub fn r#set_extended_attribute(
16907        &self,
16908        mut name: &[u8],
16909        mut value: ExtendedAttributeValue,
16910        mut mode: SetExtendedAttributeMode,
16911        ___deadline: zx::MonotonicInstant,
16912    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
16913        let _response = self.client.send_query::<
16914            NodeSetExtendedAttributeRequest,
16915            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16916        >(
16917            (name, &mut value, mode,),
16918            0x4a951362f681f23c,
16919            fidl::encoding::DynamicFlags::empty(),
16920            ___deadline,
16921        )?;
16922        Ok(_response.map(|x| x))
16923    }
16924
16925    /// Remove the specified extended attribute.
16926    ///
16927    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
16928    ///
16929    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
16930    pub fn r#remove_extended_attribute(
16931        &self,
16932        mut name: &[u8],
16933        ___deadline: zx::MonotonicInstant,
16934    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
16935        let _response = self.client.send_query::<
16936            NodeRemoveExtendedAttributeRequest,
16937            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
16938        >(
16939            (name,),
16940            0x7a0b9f3a9bf9032d,
16941            fidl::encoding::DynamicFlags::empty(),
16942            ___deadline,
16943        )?;
16944        Ok(_response.map(|x| x))
16945    }
16946
16947    pub fn r#describe(
16948        &self,
16949        ___deadline: zx::MonotonicInstant,
16950    ) -> Result<SymlinkInfo, fidl::Error> {
16951        let _response = self
16952            .client
16953            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleType<SymlinkInfo>>(
16954                (),
16955                0x742c2ea5e89831f3,
16956                fidl::encoding::DynamicFlags::FLEXIBLE,
16957                ___deadline,
16958            )?
16959            .into_result::<SymlinkMarker>("describe")?;
16960        Ok(_response)
16961    }
16962}
16963
16964#[cfg(target_os = "fuchsia")]
16965impl From<SymlinkSynchronousProxy> for zx::Handle {
16966    fn from(value: SymlinkSynchronousProxy) -> Self {
16967        value.into_channel().into()
16968    }
16969}
16970
16971#[cfg(target_os = "fuchsia")]
16972impl From<fidl::Channel> for SymlinkSynchronousProxy {
16973    fn from(value: fidl::Channel) -> Self {
16974        Self::new(value)
16975    }
16976}
16977
16978#[derive(Debug, Clone)]
16979pub struct SymlinkProxy {
16980    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
16981}
16982
16983impl fidl::endpoints::Proxy for SymlinkProxy {
16984    type Protocol = SymlinkMarker;
16985
16986    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
16987        Self::new(inner)
16988    }
16989
16990    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
16991        self.client.into_channel().map_err(|client| Self { client })
16992    }
16993
16994    fn as_channel(&self) -> &::fidl::AsyncChannel {
16995        self.client.as_channel()
16996    }
16997}
16998
16999impl SymlinkProxy {
17000    /// Create a new Proxy for fuchsia.io/Symlink.
17001    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
17002        let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
17003        Self { client: fidl::client::Client::new(channel, protocol_name) }
17004    }
17005
17006    /// Get a Stream of events from the remote end of the protocol.
17007    ///
17008    /// # Panics
17009    ///
17010    /// Panics if the event stream was already taken.
17011    pub fn take_event_stream(&self) -> SymlinkEventStream {
17012        SymlinkEventStream { event_receiver: self.client.take_event_receiver() }
17013    }
17014
17015    /// Creates a link to this this object with name `dst` in the directory represented by
17016    /// `dst_parent_token`.
17017    ///
17018    /// `dst` must be a resolved object name. Including "/" in the string will return
17019    /// `ZX_ERR_INVALID_ARGS`.
17020    ///
17021    /// This method requires the maximal set of rights supported by the filesystem for this object.
17022    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
17023    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
17024    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
17025    /// `ZX_ERR_ACCESS_DENIED`.
17026    ///
17027    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
17028    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
17029    ///
17030    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
17031    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
17032    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
17033    ///
17034    /// This method does not have the same atomicity properties has the `Directory::Link` method,
17035    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
17036    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
17037    pub fn r#link_into(
17038        &self,
17039        mut dst_parent_token: fidl::Event,
17040        mut dst: &str,
17041    ) -> fidl::client::QueryResponseFut<
17042        LinkableLinkIntoResult,
17043        fidl::encoding::DefaultFuchsiaResourceDialect,
17044    > {
17045        SymlinkProxyInterface::r#link_into(self, dst_parent_token, dst)
17046    }
17047
17048    pub fn r#clone(
17049        &self,
17050        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17051    ) -> Result<(), fidl::Error> {
17052        SymlinkProxyInterface::r#clone(self, request)
17053    }
17054
17055    /// Terminates the connection.
17056    ///
17057    /// After calling `Close`, the client must not send any other requests.
17058    ///
17059    /// Servers, after sending the status response, should close the connection
17060    /// regardless of status and without sending an epitaph.
17061    ///
17062    /// Closing the client end of the channel should be semantically equivalent
17063    /// to calling `Close` without knowing when the close has completed or its
17064    /// status.
17065    pub fn r#close(
17066        &self,
17067    ) -> fidl::client::QueryResponseFut<
17068        fidl_fuchsia_unknown::CloseableCloseResult,
17069        fidl::encoding::DefaultFuchsiaResourceDialect,
17070    > {
17071        SymlinkProxyInterface::r#close(self)
17072    }
17073
17074    pub fn r#query(
17075        &self,
17076    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
17077    {
17078        SymlinkProxyInterface::r#query(self)
17079    }
17080
17081    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
17082    pub fn r#deprecated_clone(
17083        &self,
17084        mut flags: OpenFlags,
17085        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17086    ) -> Result<(), fidl::Error> {
17087        SymlinkProxyInterface::r#deprecated_clone(self, flags, object)
17088    }
17089
17090    /// Acquires information about the node.
17091    ///
17092    /// This method does not require any rights.
17093    pub fn r#get_attr(
17094        &self,
17095    ) -> fidl::client::QueryResponseFut<
17096        (i32, NodeAttributes),
17097        fidl::encoding::DefaultFuchsiaResourceDialect,
17098    > {
17099        SymlinkProxyInterface::r#get_attr(self)
17100    }
17101
17102    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
17103    pub fn r#deprecated_set_attr(
17104        &self,
17105        mut flags: NodeAttributeFlags,
17106        mut attributes: &NodeAttributes,
17107    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
17108        SymlinkProxyInterface::r#deprecated_set_attr(self, flags, attributes)
17109    }
17110
17111    /// [DEPRECATED - Use new GetFlags method instead.]
17112    pub fn r#deprecated_get_flags(
17113        &self,
17114    ) -> fidl::client::QueryResponseFut<
17115        (i32, OpenFlags),
17116        fidl::encoding::DefaultFuchsiaResourceDialect,
17117    > {
17118        SymlinkProxyInterface::r#deprecated_get_flags(self)
17119    }
17120
17121    /// [DEPRECATED - Use new SetFlags method instead.]
17122    pub fn r#deprecated_set_flags(
17123        &self,
17124        mut flags: OpenFlags,
17125    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
17126        SymlinkProxyInterface::r#deprecated_set_flags(self, flags)
17127    }
17128
17129    /// Queries the flags that apply to this node after it has been opened/created. This method does
17130    /// not require any rights.
17131    ///
17132    /// Note that the final set of flags that apply to the connection may differ from those
17133    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
17134    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
17135    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
17136    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
17137    pub fn r#get_flags(
17138        &self,
17139    ) -> fidl::client::QueryResponseFut<
17140        NodeGetFlagsResult,
17141        fidl::encoding::DefaultFuchsiaResourceDialect,
17142    > {
17143        SymlinkProxyInterface::r#get_flags(self)
17144    }
17145
17146    /// Sets the flags that apply to this node after it has been opened. This method does not
17147    /// require any rights.
17148    ///
17149    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
17150    /// clear append mode.
17151    ///
17152    /// Errors:
17153    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
17154    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
17155    pub fn r#set_flags(
17156        &self,
17157        mut flags: Flags,
17158    ) -> fidl::client::QueryResponseFut<
17159        NodeSetFlagsResult,
17160        fidl::encoding::DefaultFuchsiaResourceDialect,
17161    > {
17162        SymlinkProxyInterface::r#set_flags(self, flags)
17163    }
17164
17165    /// Query the filesystem for filesystem-specific information.
17166    pub fn r#query_filesystem(
17167        &self,
17168    ) -> fidl::client::QueryResponseFut<
17169        (i32, Option<Box<FilesystemInfo>>),
17170        fidl::encoding::DefaultFuchsiaResourceDialect,
17171    > {
17172        SymlinkProxyInterface::r#query_filesystem(self)
17173    }
17174
17175    /// Acquires information about the node.
17176    ///
17177    /// The attributes of a node should be stable, independent of the
17178    /// specific protocol used to access it.
17179    ///
17180    /// If a particular attribute is not applicable or not supported,
17181    /// filesystems should leave the corresponding field absent.
17182    ///
17183    /// + `query` a bit-mask specifying which attributes to fetch. The server
17184    ///   should not return more than necessary.
17185    /// - `attributes` the returned attributes.
17186    ///
17187    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17188    pub fn r#get_attributes(
17189        &self,
17190        mut query: NodeAttributesQuery,
17191    ) -> fidl::client::QueryResponseFut<
17192        NodeGetAttributesResult,
17193        fidl::encoding::DefaultFuchsiaResourceDialect,
17194    > {
17195        SymlinkProxyInterface::r#get_attributes(self, query)
17196    }
17197
17198    /// Updates information about the node.
17199    ///
17200    /// + `attributes` the presence of a table field in `attributes` indicates
17201    /// the intent to update the corresponding attribute.
17202    ///
17203    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
17204    ///
17205    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17206    pub fn r#update_attributes(
17207        &self,
17208        mut payload: &MutableNodeAttributes,
17209    ) -> fidl::client::QueryResponseFut<
17210        NodeUpdateAttributesResult,
17211        fidl::encoding::DefaultFuchsiaResourceDialect,
17212    > {
17213        SymlinkProxyInterface::r#update_attributes(self, payload)
17214    }
17215
17216    /// Synchronizes updates to the node to the underlying media, if it exists.
17217    ///
17218    /// This method will return when the filesystem server has flushed the
17219    /// relevant updates to the underlying media, but does not guarantee the
17220    /// underlying media has persisted the information, nor that any information
17221    /// is committed to hardware. Clients may use `Sync` to ensure ordering
17222    /// between operations.
17223    ///
17224    /// This method does not require any rights.
17225    pub fn r#sync(
17226        &self,
17227    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
17228    {
17229        SymlinkProxyInterface::r#sync(self)
17230    }
17231
17232    /// Creates an iterator over all the extended attribute names associated
17233    /// with this node. If an error occurs it is returned as an epitaph on the
17234    /// iterator request channel, and then the channel is closed.
17235    ///
17236    /// GetExtendedAttributes can be used with any of these names to retrieve
17237    /// the associated value.
17238    ///
17239    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17240    pub fn r#list_extended_attributes(
17241        &self,
17242        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17243    ) -> Result<(), fidl::Error> {
17244        SymlinkProxyInterface::r#list_extended_attributes(self, iterator)
17245    }
17246
17247    /// Get the value associated with the given attribute `name` for this node.
17248    ///
17249    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
17250    /// particular structure is imposed on them.
17251    ///
17252    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17253    pub fn r#get_extended_attribute(
17254        &self,
17255        mut name: &[u8],
17256    ) -> fidl::client::QueryResponseFut<
17257        NodeGetExtendedAttributeResult,
17258        fidl::encoding::DefaultFuchsiaResourceDialect,
17259    > {
17260        SymlinkProxyInterface::r#get_extended_attribute(self, name)
17261    }
17262
17263    /// Set the value for the given attribute `name` to `value` for this node.
17264    ///
17265    /// The attribute name may exist, in which case the attribute is updated.
17266    /// If the attribute doesn't exist, it is created. The name should have no
17267    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
17268    ///
17269    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17270    pub fn r#set_extended_attribute(
17271        &self,
17272        mut name: &[u8],
17273        mut value: ExtendedAttributeValue,
17274        mut mode: SetExtendedAttributeMode,
17275    ) -> fidl::client::QueryResponseFut<
17276        NodeSetExtendedAttributeResult,
17277        fidl::encoding::DefaultFuchsiaResourceDialect,
17278    > {
17279        SymlinkProxyInterface::r#set_extended_attribute(self, name, value, mode)
17280    }
17281
17282    /// Remove the specified extended attribute.
17283    ///
17284    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
17285    ///
17286    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17287    pub fn r#remove_extended_attribute(
17288        &self,
17289        mut name: &[u8],
17290    ) -> fidl::client::QueryResponseFut<
17291        NodeRemoveExtendedAttributeResult,
17292        fidl::encoding::DefaultFuchsiaResourceDialect,
17293    > {
17294        SymlinkProxyInterface::r#remove_extended_attribute(self, name)
17295    }
17296
17297    pub fn r#describe(
17298        &self,
17299    ) -> fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
17300    {
17301        SymlinkProxyInterface::r#describe(self)
17302    }
17303}
17304
17305impl SymlinkProxyInterface for SymlinkProxy {
17306    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
17307        LinkableLinkIntoResult,
17308        fidl::encoding::DefaultFuchsiaResourceDialect,
17309    >;
17310    fn r#link_into(
17311        &self,
17312        mut dst_parent_token: fidl::Event,
17313        mut dst: &str,
17314    ) -> Self::LinkIntoResponseFut {
17315        fn _decode(
17316            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17317        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
17318            let _response = fidl::client::decode_transaction_body::<
17319                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17320                fidl::encoding::DefaultFuchsiaResourceDialect,
17321                0x54f3949246a03e74,
17322            >(_buf?)?;
17323            Ok(_response.map(|x| x))
17324        }
17325        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
17326            (dst_parent_token, dst),
17327            0x54f3949246a03e74,
17328            fidl::encoding::DynamicFlags::empty(),
17329            _decode,
17330        )
17331    }
17332
17333    fn r#clone(
17334        &self,
17335        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17336    ) -> Result<(), fidl::Error> {
17337        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
17338            (request,),
17339            0x20d8a7aba2168a79,
17340            fidl::encoding::DynamicFlags::empty(),
17341        )
17342    }
17343
17344    type CloseResponseFut = fidl::client::QueryResponseFut<
17345        fidl_fuchsia_unknown::CloseableCloseResult,
17346        fidl::encoding::DefaultFuchsiaResourceDialect,
17347    >;
17348    fn r#close(&self) -> Self::CloseResponseFut {
17349        fn _decode(
17350            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17351        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
17352            let _response = fidl::client::decode_transaction_body::<
17353                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17354                fidl::encoding::DefaultFuchsiaResourceDialect,
17355                0x5ac5d459ad7f657e,
17356            >(_buf?)?;
17357            Ok(_response.map(|x| x))
17358        }
17359        self.client.send_query_and_decode::<
17360            fidl::encoding::EmptyPayload,
17361            fidl_fuchsia_unknown::CloseableCloseResult,
17362        >(
17363            (),
17364            0x5ac5d459ad7f657e,
17365            fidl::encoding::DynamicFlags::empty(),
17366            _decode,
17367        )
17368    }
17369
17370    type QueryResponseFut =
17371        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
17372    fn r#query(&self) -> Self::QueryResponseFut {
17373        fn _decode(
17374            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17375        ) -> Result<Vec<u8>, fidl::Error> {
17376            let _response = fidl::client::decode_transaction_body::<
17377                fidl_fuchsia_unknown::QueryableQueryResponse,
17378                fidl::encoding::DefaultFuchsiaResourceDialect,
17379                0x2658edee9decfc06,
17380            >(_buf?)?;
17381            Ok(_response.protocol)
17382        }
17383        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
17384            (),
17385            0x2658edee9decfc06,
17386            fidl::encoding::DynamicFlags::empty(),
17387            _decode,
17388        )
17389    }
17390
17391    fn r#deprecated_clone(
17392        &self,
17393        mut flags: OpenFlags,
17394        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17395    ) -> Result<(), fidl::Error> {
17396        self.client.send::<NodeDeprecatedCloneRequest>(
17397            (flags, object),
17398            0x5a61678f293ce16f,
17399            fidl::encoding::DynamicFlags::FLEXIBLE,
17400        )
17401    }
17402
17403    type GetAttrResponseFut = fidl::client::QueryResponseFut<
17404        (i32, NodeAttributes),
17405        fidl::encoding::DefaultFuchsiaResourceDialect,
17406    >;
17407    fn r#get_attr(&self) -> Self::GetAttrResponseFut {
17408        fn _decode(
17409            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17410        ) -> Result<(i32, NodeAttributes), fidl::Error> {
17411            let _response = fidl::client::decode_transaction_body::<
17412                NodeGetAttrResponse,
17413                fidl::encoding::DefaultFuchsiaResourceDialect,
17414                0x78985e216314dafd,
17415            >(_buf?)?;
17416            Ok((_response.s, _response.attributes))
17417        }
17418        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
17419            (),
17420            0x78985e216314dafd,
17421            fidl::encoding::DynamicFlags::empty(),
17422            _decode,
17423        )
17424    }
17425
17426    type DeprecatedSetAttrResponseFut =
17427        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
17428    fn r#deprecated_set_attr(
17429        &self,
17430        mut flags: NodeAttributeFlags,
17431        mut attributes: &NodeAttributes,
17432    ) -> Self::DeprecatedSetAttrResponseFut {
17433        fn _decode(
17434            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17435        ) -> Result<i32, fidl::Error> {
17436            let _response = fidl::client::decode_transaction_body::<
17437                NodeDeprecatedSetAttrResponse,
17438                fidl::encoding::DefaultFuchsiaResourceDialect,
17439                0x4186c0f40d938f46,
17440            >(_buf?)?;
17441            Ok(_response.s)
17442        }
17443        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
17444            (flags, attributes),
17445            0x4186c0f40d938f46,
17446            fidl::encoding::DynamicFlags::empty(),
17447            _decode,
17448        )
17449    }
17450
17451    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
17452        (i32, OpenFlags),
17453        fidl::encoding::DefaultFuchsiaResourceDialect,
17454    >;
17455    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
17456        fn _decode(
17457            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17458        ) -> Result<(i32, OpenFlags), fidl::Error> {
17459            let _response = fidl::client::decode_transaction_body::<
17460                NodeDeprecatedGetFlagsResponse,
17461                fidl::encoding::DefaultFuchsiaResourceDialect,
17462                0x5b88fffb8eda3aa1,
17463            >(_buf?)?;
17464            Ok((_response.s, _response.flags))
17465        }
17466        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
17467            (),
17468            0x5b88fffb8eda3aa1,
17469            fidl::encoding::DynamicFlags::empty(),
17470            _decode,
17471        )
17472    }
17473
17474    type DeprecatedSetFlagsResponseFut =
17475        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
17476    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
17477        fn _decode(
17478            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17479        ) -> Result<i32, fidl::Error> {
17480            let _response = fidl::client::decode_transaction_body::<
17481                NodeDeprecatedSetFlagsResponse,
17482                fidl::encoding::DefaultFuchsiaResourceDialect,
17483                0x5295b76c71fde733,
17484            >(_buf?)?;
17485            Ok(_response.s)
17486        }
17487        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
17488            (flags,),
17489            0x5295b76c71fde733,
17490            fidl::encoding::DynamicFlags::empty(),
17491            _decode,
17492        )
17493    }
17494
17495    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
17496        NodeGetFlagsResult,
17497        fidl::encoding::DefaultFuchsiaResourceDialect,
17498    >;
17499    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
17500        fn _decode(
17501            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17502        ) -> Result<NodeGetFlagsResult, fidl::Error> {
17503            let _response = fidl::client::decode_transaction_body::<
17504                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
17505                fidl::encoding::DefaultFuchsiaResourceDialect,
17506                0x176eb318f64ec23,
17507            >(_buf?)?
17508            .into_result::<SymlinkMarker>("get_flags")?;
17509            Ok(_response.map(|x| x.flags))
17510        }
17511        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
17512            (),
17513            0x176eb318f64ec23,
17514            fidl::encoding::DynamicFlags::FLEXIBLE,
17515            _decode,
17516        )
17517    }
17518
17519    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
17520        NodeSetFlagsResult,
17521        fidl::encoding::DefaultFuchsiaResourceDialect,
17522    >;
17523    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
17524        fn _decode(
17525            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17526        ) -> Result<NodeSetFlagsResult, fidl::Error> {
17527            let _response = fidl::client::decode_transaction_body::<
17528                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
17529                fidl::encoding::DefaultFuchsiaResourceDialect,
17530                0x55a8028685791ea8,
17531            >(_buf?)?
17532            .into_result::<SymlinkMarker>("set_flags")?;
17533            Ok(_response.map(|x| x))
17534        }
17535        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
17536            (flags,),
17537            0x55a8028685791ea8,
17538            fidl::encoding::DynamicFlags::FLEXIBLE,
17539            _decode,
17540        )
17541    }
17542
17543    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
17544        (i32, Option<Box<FilesystemInfo>>),
17545        fidl::encoding::DefaultFuchsiaResourceDialect,
17546    >;
17547    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
17548        fn _decode(
17549            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17550        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
17551            let _response = fidl::client::decode_transaction_body::<
17552                NodeQueryFilesystemResponse,
17553                fidl::encoding::DefaultFuchsiaResourceDialect,
17554                0x6f344a1c6b0a0610,
17555            >(_buf?)?;
17556            Ok((_response.s, _response.info))
17557        }
17558        self.client.send_query_and_decode::<
17559            fidl::encoding::EmptyPayload,
17560            (i32, Option<Box<FilesystemInfo>>),
17561        >(
17562            (),
17563            0x6f344a1c6b0a0610,
17564            fidl::encoding::DynamicFlags::empty(),
17565            _decode,
17566        )
17567    }
17568
17569    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
17570        NodeGetAttributesResult,
17571        fidl::encoding::DefaultFuchsiaResourceDialect,
17572    >;
17573    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
17574        fn _decode(
17575            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17576        ) -> Result<NodeGetAttributesResult, fidl::Error> {
17577            let _response = fidl::client::decode_transaction_body::<
17578                fidl::encoding::ResultType<NodeAttributes2, i32>,
17579                fidl::encoding::DefaultFuchsiaResourceDialect,
17580                0x3d4396a638ea053b,
17581            >(_buf?)?;
17582            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
17583        }
17584        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
17585            (query,),
17586            0x3d4396a638ea053b,
17587            fidl::encoding::DynamicFlags::empty(),
17588            _decode,
17589        )
17590    }
17591
17592    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
17593        NodeUpdateAttributesResult,
17594        fidl::encoding::DefaultFuchsiaResourceDialect,
17595    >;
17596    fn r#update_attributes(
17597        &self,
17598        mut payload: &MutableNodeAttributes,
17599    ) -> Self::UpdateAttributesResponseFut {
17600        fn _decode(
17601            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17602        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
17603            let _response = fidl::client::decode_transaction_body::<
17604                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17605                fidl::encoding::DefaultFuchsiaResourceDialect,
17606                0x3308c1da5a89bf08,
17607            >(_buf?)?;
17608            Ok(_response.map(|x| x))
17609        }
17610        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
17611            payload,
17612            0x3308c1da5a89bf08,
17613            fidl::encoding::DynamicFlags::empty(),
17614            _decode,
17615        )
17616    }
17617
17618    type SyncResponseFut = fidl::client::QueryResponseFut<
17619        NodeSyncResult,
17620        fidl::encoding::DefaultFuchsiaResourceDialect,
17621    >;
17622    fn r#sync(&self) -> Self::SyncResponseFut {
17623        fn _decode(
17624            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17625        ) -> Result<NodeSyncResult, fidl::Error> {
17626            let _response = fidl::client::decode_transaction_body::<
17627                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17628                fidl::encoding::DefaultFuchsiaResourceDialect,
17629                0x2c5c27ca0ab5dc49,
17630            >(_buf?)?;
17631            Ok(_response.map(|x| x))
17632        }
17633        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
17634            (),
17635            0x2c5c27ca0ab5dc49,
17636            fidl::encoding::DynamicFlags::empty(),
17637            _decode,
17638        )
17639    }
17640
17641    fn r#list_extended_attributes(
17642        &self,
17643        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17644    ) -> Result<(), fidl::Error> {
17645        self.client.send::<NodeListExtendedAttributesRequest>(
17646            (iterator,),
17647            0x4b61033de007fcd0,
17648            fidl::encoding::DynamicFlags::empty(),
17649        )
17650    }
17651
17652    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
17653        NodeGetExtendedAttributeResult,
17654        fidl::encoding::DefaultFuchsiaResourceDialect,
17655    >;
17656    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
17657        fn _decode(
17658            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17659        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
17660            let _response = fidl::client::decode_transaction_body::<
17661                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
17662                fidl::encoding::DefaultFuchsiaResourceDialect,
17663                0x45ffa3ccfdeb76db,
17664            >(_buf?)?;
17665            Ok(_response.map(|x| x))
17666        }
17667        self.client.send_query_and_decode::<
17668            NodeGetExtendedAttributeRequest,
17669            NodeGetExtendedAttributeResult,
17670        >(
17671            (name,),
17672            0x45ffa3ccfdeb76db,
17673            fidl::encoding::DynamicFlags::empty(),
17674            _decode,
17675        )
17676    }
17677
17678    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
17679        NodeSetExtendedAttributeResult,
17680        fidl::encoding::DefaultFuchsiaResourceDialect,
17681    >;
17682    fn r#set_extended_attribute(
17683        &self,
17684        mut name: &[u8],
17685        mut value: ExtendedAttributeValue,
17686        mut mode: SetExtendedAttributeMode,
17687    ) -> Self::SetExtendedAttributeResponseFut {
17688        fn _decode(
17689            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17690        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
17691            let _response = fidl::client::decode_transaction_body::<
17692                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17693                fidl::encoding::DefaultFuchsiaResourceDialect,
17694                0x4a951362f681f23c,
17695            >(_buf?)?;
17696            Ok(_response.map(|x| x))
17697        }
17698        self.client.send_query_and_decode::<
17699            NodeSetExtendedAttributeRequest,
17700            NodeSetExtendedAttributeResult,
17701        >(
17702            (name, &mut value, mode,),
17703            0x4a951362f681f23c,
17704            fidl::encoding::DynamicFlags::empty(),
17705            _decode,
17706        )
17707    }
17708
17709    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
17710        NodeRemoveExtendedAttributeResult,
17711        fidl::encoding::DefaultFuchsiaResourceDialect,
17712    >;
17713    fn r#remove_extended_attribute(
17714        &self,
17715        mut name: &[u8],
17716    ) -> Self::RemoveExtendedAttributeResponseFut {
17717        fn _decode(
17718            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17719        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
17720            let _response = fidl::client::decode_transaction_body::<
17721                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17722                fidl::encoding::DefaultFuchsiaResourceDialect,
17723                0x7a0b9f3a9bf9032d,
17724            >(_buf?)?;
17725            Ok(_response.map(|x| x))
17726        }
17727        self.client.send_query_and_decode::<
17728            NodeRemoveExtendedAttributeRequest,
17729            NodeRemoveExtendedAttributeResult,
17730        >(
17731            (name,),
17732            0x7a0b9f3a9bf9032d,
17733            fidl::encoding::DynamicFlags::empty(),
17734            _decode,
17735        )
17736    }
17737
17738    type DescribeResponseFut =
17739        fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
17740    fn r#describe(&self) -> Self::DescribeResponseFut {
17741        fn _decode(
17742            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17743        ) -> Result<SymlinkInfo, fidl::Error> {
17744            let _response = fidl::client::decode_transaction_body::<
17745                fidl::encoding::FlexibleType<SymlinkInfo>,
17746                fidl::encoding::DefaultFuchsiaResourceDialect,
17747                0x742c2ea5e89831f3,
17748            >(_buf?)?
17749            .into_result::<SymlinkMarker>("describe")?;
17750            Ok(_response)
17751        }
17752        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SymlinkInfo>(
17753            (),
17754            0x742c2ea5e89831f3,
17755            fidl::encoding::DynamicFlags::FLEXIBLE,
17756            _decode,
17757        )
17758    }
17759}
17760
17761pub struct SymlinkEventStream {
17762    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
17763}
17764
17765impl std::marker::Unpin for SymlinkEventStream {}
17766
17767impl futures::stream::FusedStream for SymlinkEventStream {
17768    fn is_terminated(&self) -> bool {
17769        self.event_receiver.is_terminated()
17770    }
17771}
17772
17773impl futures::Stream for SymlinkEventStream {
17774    type Item = Result<SymlinkEvent, fidl::Error>;
17775
17776    fn poll_next(
17777        mut self: std::pin::Pin<&mut Self>,
17778        cx: &mut std::task::Context<'_>,
17779    ) -> std::task::Poll<Option<Self::Item>> {
17780        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
17781            &mut self.event_receiver,
17782            cx
17783        )?) {
17784            Some(buf) => std::task::Poll::Ready(Some(SymlinkEvent::decode(buf))),
17785            None => std::task::Poll::Ready(None),
17786        }
17787    }
17788}
17789
17790#[derive(Debug)]
17791pub enum SymlinkEvent {
17792    OnOpen_ {
17793        s: i32,
17794        info: Option<Box<NodeInfoDeprecated>>,
17795    },
17796    OnRepresentation {
17797        payload: Representation,
17798    },
17799    #[non_exhaustive]
17800    _UnknownEvent {
17801        /// Ordinal of the event that was sent.
17802        ordinal: u64,
17803    },
17804}
17805
17806impl SymlinkEvent {
17807    #[allow(irrefutable_let_patterns)]
17808    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
17809        if let SymlinkEvent::OnOpen_ { s, info } = self {
17810            Some((s, info))
17811        } else {
17812            None
17813        }
17814    }
17815    #[allow(irrefutable_let_patterns)]
17816    pub fn into_on_representation(self) -> Option<Representation> {
17817        if let SymlinkEvent::OnRepresentation { payload } = self {
17818            Some((payload))
17819        } else {
17820            None
17821        }
17822    }
17823
17824    /// Decodes a message buffer as a [`SymlinkEvent`].
17825    fn decode(
17826        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
17827    ) -> Result<SymlinkEvent, fidl::Error> {
17828        let (bytes, _handles) = buf.split_mut();
17829        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17830        debug_assert_eq!(tx_header.tx_id, 0);
17831        match tx_header.ordinal {
17832            0x7fc7bbb1dbfd1972 => {
17833                let mut out = fidl::new_empty!(
17834                    NodeOnOpenRequest,
17835                    fidl::encoding::DefaultFuchsiaResourceDialect
17836                );
17837                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
17838                Ok((SymlinkEvent::OnOpen_ { s: out.s, info: out.info }))
17839            }
17840            0x5cb40567d80a510c => {
17841                let mut out =
17842                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
17843                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
17844                Ok((SymlinkEvent::OnRepresentation { payload: out }))
17845            }
17846            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
17847                Ok(SymlinkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
17848            }
17849            _ => Err(fidl::Error::UnknownOrdinal {
17850                ordinal: tx_header.ordinal,
17851                protocol_name: <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
17852            }),
17853        }
17854    }
17855}
17856
17857/// A Stream of incoming requests for fuchsia.io/Symlink.
17858pub struct SymlinkRequestStream {
17859    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
17860    is_terminated: bool,
17861}
17862
17863impl std::marker::Unpin for SymlinkRequestStream {}
17864
17865impl futures::stream::FusedStream for SymlinkRequestStream {
17866    fn is_terminated(&self) -> bool {
17867        self.is_terminated
17868    }
17869}
17870
17871impl fidl::endpoints::RequestStream for SymlinkRequestStream {
17872    type Protocol = SymlinkMarker;
17873    type ControlHandle = SymlinkControlHandle;
17874
17875    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
17876        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
17877    }
17878
17879    fn control_handle(&self) -> Self::ControlHandle {
17880        SymlinkControlHandle { inner: self.inner.clone() }
17881    }
17882
17883    fn into_inner(
17884        self,
17885    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
17886    {
17887        (self.inner, self.is_terminated)
17888    }
17889
17890    fn from_inner(
17891        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
17892        is_terminated: bool,
17893    ) -> Self {
17894        Self { inner, is_terminated }
17895    }
17896}
17897
17898impl futures::Stream for SymlinkRequestStream {
17899    type Item = Result<SymlinkRequest, fidl::Error>;
17900
17901    fn poll_next(
17902        mut self: std::pin::Pin<&mut Self>,
17903        cx: &mut std::task::Context<'_>,
17904    ) -> std::task::Poll<Option<Self::Item>> {
17905        let this = &mut *self;
17906        if this.inner.check_shutdown(cx) {
17907            this.is_terminated = true;
17908            return std::task::Poll::Ready(None);
17909        }
17910        if this.is_terminated {
17911            panic!("polled SymlinkRequestStream after completion");
17912        }
17913        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
17914            |bytes, handles| {
17915                match this.inner.channel().read_etc(cx, bytes, handles) {
17916                    std::task::Poll::Ready(Ok(())) => {}
17917                    std::task::Poll::Pending => return std::task::Poll::Pending,
17918                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
17919                        this.is_terminated = true;
17920                        return std::task::Poll::Ready(None);
17921                    }
17922                    std::task::Poll::Ready(Err(e)) => {
17923                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
17924                            e.into(),
17925                        ))))
17926                    }
17927                }
17928
17929                // A message has been received from the channel
17930                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17931
17932                std::task::Poll::Ready(Some(match header.ordinal {
17933                    0x54f3949246a03e74 => {
17934                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17935                        let mut req = fidl::new_empty!(
17936                            LinkableLinkIntoRequest,
17937                            fidl::encoding::DefaultFuchsiaResourceDialect
17938                        );
17939                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
17940                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17941                        Ok(SymlinkRequest::LinkInto {
17942                            dst_parent_token: req.dst_parent_token,
17943                            dst: req.dst,
17944
17945                            responder: SymlinkLinkIntoResponder {
17946                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17947                                tx_id: header.tx_id,
17948                            },
17949                        })
17950                    }
17951                    0x20d8a7aba2168a79 => {
17952                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
17953                        let mut req = fidl::new_empty!(
17954                            fidl_fuchsia_unknown::CloneableCloneRequest,
17955                            fidl::encoding::DefaultFuchsiaResourceDialect
17956                        );
17957                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
17958                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17959                        Ok(SymlinkRequest::Clone { request: req.request, control_handle })
17960                    }
17961                    0x5ac5d459ad7f657e => {
17962                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17963                        let mut req = fidl::new_empty!(
17964                            fidl::encoding::EmptyPayload,
17965                            fidl::encoding::DefaultFuchsiaResourceDialect
17966                        );
17967                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
17968                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17969                        Ok(SymlinkRequest::Close {
17970                            responder: SymlinkCloseResponder {
17971                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17972                                tx_id: header.tx_id,
17973                            },
17974                        })
17975                    }
17976                    0x2658edee9decfc06 => {
17977                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17978                        let mut req = fidl::new_empty!(
17979                            fidl::encoding::EmptyPayload,
17980                            fidl::encoding::DefaultFuchsiaResourceDialect
17981                        );
17982                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
17983                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17984                        Ok(SymlinkRequest::Query {
17985                            responder: SymlinkQueryResponder {
17986                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17987                                tx_id: header.tx_id,
17988                            },
17989                        })
17990                    }
17991                    0x5a61678f293ce16f => {
17992                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
17993                        let mut req = fidl::new_empty!(
17994                            NodeDeprecatedCloneRequest,
17995                            fidl::encoding::DefaultFuchsiaResourceDialect
17996                        );
17997                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
17998                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
17999                        Ok(SymlinkRequest::DeprecatedClone {
18000                            flags: req.flags,
18001                            object: req.object,
18002
18003                            control_handle,
18004                        })
18005                    }
18006                    0x78985e216314dafd => {
18007                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18008                        let mut req = fidl::new_empty!(
18009                            fidl::encoding::EmptyPayload,
18010                            fidl::encoding::DefaultFuchsiaResourceDialect
18011                        );
18012                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18013                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18014                        Ok(SymlinkRequest::GetAttr {
18015                            responder: SymlinkGetAttrResponder {
18016                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18017                                tx_id: header.tx_id,
18018                            },
18019                        })
18020                    }
18021                    0x4186c0f40d938f46 => {
18022                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18023                        let mut req = fidl::new_empty!(
18024                            NodeDeprecatedSetAttrRequest,
18025                            fidl::encoding::DefaultFuchsiaResourceDialect
18026                        );
18027                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
18028                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18029                        Ok(SymlinkRequest::DeprecatedSetAttr {
18030                            flags: req.flags,
18031                            attributes: req.attributes,
18032
18033                            responder: SymlinkDeprecatedSetAttrResponder {
18034                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18035                                tx_id: header.tx_id,
18036                            },
18037                        })
18038                    }
18039                    0x5b88fffb8eda3aa1 => {
18040                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18041                        let mut req = fidl::new_empty!(
18042                            fidl::encoding::EmptyPayload,
18043                            fidl::encoding::DefaultFuchsiaResourceDialect
18044                        );
18045                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18046                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18047                        Ok(SymlinkRequest::DeprecatedGetFlags {
18048                            responder: SymlinkDeprecatedGetFlagsResponder {
18049                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18050                                tx_id: header.tx_id,
18051                            },
18052                        })
18053                    }
18054                    0x5295b76c71fde733 => {
18055                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18056                        let mut req = fidl::new_empty!(
18057                            NodeDeprecatedSetFlagsRequest,
18058                            fidl::encoding::DefaultFuchsiaResourceDialect
18059                        );
18060                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
18061                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18062                        Ok(SymlinkRequest::DeprecatedSetFlags {
18063                            flags: req.flags,
18064
18065                            responder: SymlinkDeprecatedSetFlagsResponder {
18066                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18067                                tx_id: header.tx_id,
18068                            },
18069                        })
18070                    }
18071                    0x176eb318f64ec23 => {
18072                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18073                        let mut req = fidl::new_empty!(
18074                            fidl::encoding::EmptyPayload,
18075                            fidl::encoding::DefaultFuchsiaResourceDialect
18076                        );
18077                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18078                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18079                        Ok(SymlinkRequest::GetFlags {
18080                            responder: SymlinkGetFlagsResponder {
18081                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18082                                tx_id: header.tx_id,
18083                            },
18084                        })
18085                    }
18086                    0x55a8028685791ea8 => {
18087                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18088                        let mut req = fidl::new_empty!(
18089                            NodeSetFlagsRequest,
18090                            fidl::encoding::DefaultFuchsiaResourceDialect
18091                        );
18092                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
18093                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18094                        Ok(SymlinkRequest::SetFlags {
18095                            flags: req.flags,
18096
18097                            responder: SymlinkSetFlagsResponder {
18098                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18099                                tx_id: header.tx_id,
18100                            },
18101                        })
18102                    }
18103                    0x6f344a1c6b0a0610 => {
18104                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18105                        let mut req = fidl::new_empty!(
18106                            fidl::encoding::EmptyPayload,
18107                            fidl::encoding::DefaultFuchsiaResourceDialect
18108                        );
18109                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18110                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18111                        Ok(SymlinkRequest::QueryFilesystem {
18112                            responder: SymlinkQueryFilesystemResponder {
18113                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18114                                tx_id: header.tx_id,
18115                            },
18116                        })
18117                    }
18118                    0x3d4396a638ea053b => {
18119                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18120                        let mut req = fidl::new_empty!(
18121                            NodeGetAttributesRequest,
18122                            fidl::encoding::DefaultFuchsiaResourceDialect
18123                        );
18124                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
18125                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18126                        Ok(SymlinkRequest::GetAttributes {
18127                            query: req.query,
18128
18129                            responder: SymlinkGetAttributesResponder {
18130                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18131                                tx_id: header.tx_id,
18132                            },
18133                        })
18134                    }
18135                    0x3308c1da5a89bf08 => {
18136                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18137                        let mut req = fidl::new_empty!(
18138                            MutableNodeAttributes,
18139                            fidl::encoding::DefaultFuchsiaResourceDialect
18140                        );
18141                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
18142                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18143                        Ok(SymlinkRequest::UpdateAttributes {
18144                            payload: req,
18145                            responder: SymlinkUpdateAttributesResponder {
18146                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18147                                tx_id: header.tx_id,
18148                            },
18149                        })
18150                    }
18151                    0x2c5c27ca0ab5dc49 => {
18152                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18153                        let mut req = fidl::new_empty!(
18154                            fidl::encoding::EmptyPayload,
18155                            fidl::encoding::DefaultFuchsiaResourceDialect
18156                        );
18157                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18158                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18159                        Ok(SymlinkRequest::Sync {
18160                            responder: SymlinkSyncResponder {
18161                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18162                                tx_id: header.tx_id,
18163                            },
18164                        })
18165                    }
18166                    0x4b61033de007fcd0 => {
18167                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18168                        let mut req = fidl::new_empty!(
18169                            NodeListExtendedAttributesRequest,
18170                            fidl::encoding::DefaultFuchsiaResourceDialect
18171                        );
18172                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
18173                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18174                        Ok(SymlinkRequest::ListExtendedAttributes {
18175                            iterator: req.iterator,
18176
18177                            control_handle,
18178                        })
18179                    }
18180                    0x45ffa3ccfdeb76db => {
18181                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18182                        let mut req = fidl::new_empty!(
18183                            NodeGetExtendedAttributeRequest,
18184                            fidl::encoding::DefaultFuchsiaResourceDialect
18185                        );
18186                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18187                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18188                        Ok(SymlinkRequest::GetExtendedAttribute {
18189                            name: req.name,
18190
18191                            responder: SymlinkGetExtendedAttributeResponder {
18192                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18193                                tx_id: header.tx_id,
18194                            },
18195                        })
18196                    }
18197                    0x4a951362f681f23c => {
18198                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18199                        let mut req = fidl::new_empty!(
18200                            NodeSetExtendedAttributeRequest,
18201                            fidl::encoding::DefaultFuchsiaResourceDialect
18202                        );
18203                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18204                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18205                        Ok(SymlinkRequest::SetExtendedAttribute {
18206                            name: req.name,
18207                            value: req.value,
18208                            mode: req.mode,
18209
18210                            responder: SymlinkSetExtendedAttributeResponder {
18211                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18212                                tx_id: header.tx_id,
18213                            },
18214                        })
18215                    }
18216                    0x7a0b9f3a9bf9032d => {
18217                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18218                        let mut req = fidl::new_empty!(
18219                            NodeRemoveExtendedAttributeRequest,
18220                            fidl::encoding::DefaultFuchsiaResourceDialect
18221                        );
18222                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18223                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18224                        Ok(SymlinkRequest::RemoveExtendedAttribute {
18225                            name: req.name,
18226
18227                            responder: SymlinkRemoveExtendedAttributeResponder {
18228                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18229                                tx_id: header.tx_id,
18230                            },
18231                        })
18232                    }
18233                    0x742c2ea5e89831f3 => {
18234                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18235                        let mut req = fidl::new_empty!(
18236                            fidl::encoding::EmptyPayload,
18237                            fidl::encoding::DefaultFuchsiaResourceDialect
18238                        );
18239                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18240                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18241                        Ok(SymlinkRequest::Describe {
18242                            responder: SymlinkDescribeResponder {
18243                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18244                                tx_id: header.tx_id,
18245                            },
18246                        })
18247                    }
18248                    _ if header.tx_id == 0
18249                        && header
18250                            .dynamic_flags()
18251                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
18252                    {
18253                        Ok(SymlinkRequest::_UnknownMethod {
18254                            ordinal: header.ordinal,
18255                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
18256                            method_type: fidl::MethodType::OneWay,
18257                        })
18258                    }
18259                    _ if header
18260                        .dynamic_flags()
18261                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
18262                    {
18263                        this.inner.send_framework_err(
18264                            fidl::encoding::FrameworkErr::UnknownMethod,
18265                            header.tx_id,
18266                            header.ordinal,
18267                            header.dynamic_flags(),
18268                            (bytes, handles),
18269                        )?;
18270                        Ok(SymlinkRequest::_UnknownMethod {
18271                            ordinal: header.ordinal,
18272                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
18273                            method_type: fidl::MethodType::TwoWay,
18274                        })
18275                    }
18276                    _ => Err(fidl::Error::UnknownOrdinal {
18277                        ordinal: header.ordinal,
18278                        protocol_name:
18279                            <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
18280                    }),
18281                }))
18282            },
18283        )
18284    }
18285}
18286
18287/// A ['Node'] which contains a symbolic link.
18288#[derive(Debug)]
18289pub enum SymlinkRequest {
18290    /// Creates a link to this this object with name `dst` in the directory represented by
18291    /// `dst_parent_token`.
18292    ///
18293    /// `dst` must be a resolved object name. Including "/" in the string will return
18294    /// `ZX_ERR_INVALID_ARGS`.
18295    ///
18296    /// This method requires the maximal set of rights supported by the filesystem for this object.
18297    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
18298    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
18299    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
18300    /// `ZX_ERR_ACCESS_DENIED`.
18301    ///
18302    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
18303    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
18304    ///
18305    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
18306    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
18307    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
18308    ///
18309    /// This method does not have the same atomicity properties has the `Directory::Link` method,
18310    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
18311    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
18312    LinkInto {
18313        dst_parent_token: fidl::Event,
18314        dst: String,
18315        responder: SymlinkLinkIntoResponder,
18316    },
18317    Clone {
18318        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
18319        control_handle: SymlinkControlHandle,
18320    },
18321    /// Terminates the connection.
18322    ///
18323    /// After calling `Close`, the client must not send any other requests.
18324    ///
18325    /// Servers, after sending the status response, should close the connection
18326    /// regardless of status and without sending an epitaph.
18327    ///
18328    /// Closing the client end of the channel should be semantically equivalent
18329    /// to calling `Close` without knowing when the close has completed or its
18330    /// status.
18331    Close {
18332        responder: SymlinkCloseResponder,
18333    },
18334    Query {
18335        responder: SymlinkQueryResponder,
18336    },
18337    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
18338    DeprecatedClone {
18339        flags: OpenFlags,
18340        object: fidl::endpoints::ServerEnd<NodeMarker>,
18341        control_handle: SymlinkControlHandle,
18342    },
18343    /// Acquires information about the node.
18344    ///
18345    /// This method does not require any rights.
18346    GetAttr {
18347        responder: SymlinkGetAttrResponder,
18348    },
18349    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
18350    DeprecatedSetAttr {
18351        flags: NodeAttributeFlags,
18352        attributes: NodeAttributes,
18353        responder: SymlinkDeprecatedSetAttrResponder,
18354    },
18355    /// [DEPRECATED - Use new GetFlags method instead.]
18356    DeprecatedGetFlags {
18357        responder: SymlinkDeprecatedGetFlagsResponder,
18358    },
18359    /// [DEPRECATED - Use new SetFlags method instead.]
18360    DeprecatedSetFlags {
18361        flags: OpenFlags,
18362        responder: SymlinkDeprecatedSetFlagsResponder,
18363    },
18364    /// Queries the flags that apply to this node after it has been opened/created. This method does
18365    /// not require any rights.
18366    ///
18367    /// Note that the final set of flags that apply to the connection may differ from those
18368    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
18369    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
18370    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
18371    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
18372    GetFlags {
18373        responder: SymlinkGetFlagsResponder,
18374    },
18375    /// Sets the flags that apply to this node after it has been opened. This method does not
18376    /// require any rights.
18377    ///
18378    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
18379    /// clear append mode.
18380    ///
18381    /// Errors:
18382    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
18383    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
18384    SetFlags {
18385        flags: Flags,
18386        responder: SymlinkSetFlagsResponder,
18387    },
18388    /// Query the filesystem for filesystem-specific information.
18389    QueryFilesystem {
18390        responder: SymlinkQueryFilesystemResponder,
18391    },
18392    /// Acquires information about the node.
18393    ///
18394    /// The attributes of a node should be stable, independent of the
18395    /// specific protocol used to access it.
18396    ///
18397    /// If a particular attribute is not applicable or not supported,
18398    /// filesystems should leave the corresponding field absent.
18399    ///
18400    /// + `query` a bit-mask specifying which attributes to fetch. The server
18401    ///   should not return more than necessary.
18402    /// - `attributes` the returned attributes.
18403    ///
18404    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18405    GetAttributes {
18406        query: NodeAttributesQuery,
18407        responder: SymlinkGetAttributesResponder,
18408    },
18409    /// Updates information about the node.
18410    ///
18411    /// + `attributes` the presence of a table field in `attributes` indicates
18412    /// the intent to update the corresponding attribute.
18413    ///
18414    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
18415    ///
18416    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
18417    UpdateAttributes {
18418        payload: MutableNodeAttributes,
18419        responder: SymlinkUpdateAttributesResponder,
18420    },
18421    /// Synchronizes updates to the node to the underlying media, if it exists.
18422    ///
18423    /// This method will return when the filesystem server has flushed the
18424    /// relevant updates to the underlying media, but does not guarantee the
18425    /// underlying media has persisted the information, nor that any information
18426    /// is committed to hardware. Clients may use `Sync` to ensure ordering
18427    /// between operations.
18428    ///
18429    /// This method does not require any rights.
18430    Sync {
18431        responder: SymlinkSyncResponder,
18432    },
18433    /// Creates an iterator over all the extended attribute names associated
18434    /// with this node. If an error occurs it is returned as an epitaph on the
18435    /// iterator request channel, and then the channel is closed.
18436    ///
18437    /// GetExtendedAttributes can be used with any of these names to retrieve
18438    /// the associated value.
18439    ///
18440    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18441    ListExtendedAttributes {
18442        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
18443        control_handle: SymlinkControlHandle,
18444    },
18445    /// Get the value associated with the given attribute `name` for this node.
18446    ///
18447    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
18448    /// particular structure is imposed on them.
18449    ///
18450    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18451    GetExtendedAttribute {
18452        name: Vec<u8>,
18453        responder: SymlinkGetExtendedAttributeResponder,
18454    },
18455    /// Set the value for the given attribute `name` to `value` for this node.
18456    ///
18457    /// The attribute name may exist, in which case the attribute is updated.
18458    /// If the attribute doesn't exist, it is created. The name should have no
18459    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
18460    ///
18461    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
18462    SetExtendedAttribute {
18463        name: Vec<u8>,
18464        value: ExtendedAttributeValue,
18465        mode: SetExtendedAttributeMode,
18466        responder: SymlinkSetExtendedAttributeResponder,
18467    },
18468    /// Remove the specified extended attribute.
18469    ///
18470    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
18471    ///
18472    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
18473    RemoveExtendedAttribute {
18474        name: Vec<u8>,
18475        responder: SymlinkRemoveExtendedAttributeResponder,
18476    },
18477    Describe {
18478        responder: SymlinkDescribeResponder,
18479    },
18480    /// An interaction was received which does not match any known method.
18481    #[non_exhaustive]
18482    _UnknownMethod {
18483        /// Ordinal of the method that was called.
18484        ordinal: u64,
18485        control_handle: SymlinkControlHandle,
18486        method_type: fidl::MethodType,
18487    },
18488}
18489
18490impl SymlinkRequest {
18491    #[allow(irrefutable_let_patterns)]
18492    pub fn into_link_into(self) -> Option<(fidl::Event, String, SymlinkLinkIntoResponder)> {
18493        if let SymlinkRequest::LinkInto { dst_parent_token, dst, responder } = self {
18494            Some((dst_parent_token, dst, responder))
18495        } else {
18496            None
18497        }
18498    }
18499
18500    #[allow(irrefutable_let_patterns)]
18501    pub fn into_clone(
18502        self,
18503    ) -> Option<(
18504        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
18505        SymlinkControlHandle,
18506    )> {
18507        if let SymlinkRequest::Clone { request, control_handle } = self {
18508            Some((request, control_handle))
18509        } else {
18510            None
18511        }
18512    }
18513
18514    #[allow(irrefutable_let_patterns)]
18515    pub fn into_close(self) -> Option<(SymlinkCloseResponder)> {
18516        if let SymlinkRequest::Close { responder } = self {
18517            Some((responder))
18518        } else {
18519            None
18520        }
18521    }
18522
18523    #[allow(irrefutable_let_patterns)]
18524    pub fn into_query(self) -> Option<(SymlinkQueryResponder)> {
18525        if let SymlinkRequest::Query { responder } = self {
18526            Some((responder))
18527        } else {
18528            None
18529        }
18530    }
18531
18532    #[allow(irrefutable_let_patterns)]
18533    pub fn into_deprecated_clone(
18534        self,
18535    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, SymlinkControlHandle)> {
18536        if let SymlinkRequest::DeprecatedClone { flags, object, control_handle } = self {
18537            Some((flags, object, control_handle))
18538        } else {
18539            None
18540        }
18541    }
18542
18543    #[allow(irrefutable_let_patterns)]
18544    pub fn into_get_attr(self) -> Option<(SymlinkGetAttrResponder)> {
18545        if let SymlinkRequest::GetAttr { responder } = self {
18546            Some((responder))
18547        } else {
18548            None
18549        }
18550    }
18551
18552    #[allow(irrefutable_let_patterns)]
18553    pub fn into_deprecated_set_attr(
18554        self,
18555    ) -> Option<(NodeAttributeFlags, NodeAttributes, SymlinkDeprecatedSetAttrResponder)> {
18556        if let SymlinkRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
18557            Some((flags, attributes, responder))
18558        } else {
18559            None
18560        }
18561    }
18562
18563    #[allow(irrefutable_let_patterns)]
18564    pub fn into_deprecated_get_flags(self) -> Option<(SymlinkDeprecatedGetFlagsResponder)> {
18565        if let SymlinkRequest::DeprecatedGetFlags { responder } = self {
18566            Some((responder))
18567        } else {
18568            None
18569        }
18570    }
18571
18572    #[allow(irrefutable_let_patterns)]
18573    pub fn into_deprecated_set_flags(
18574        self,
18575    ) -> Option<(OpenFlags, SymlinkDeprecatedSetFlagsResponder)> {
18576        if let SymlinkRequest::DeprecatedSetFlags { flags, responder } = self {
18577            Some((flags, responder))
18578        } else {
18579            None
18580        }
18581    }
18582
18583    #[allow(irrefutable_let_patterns)]
18584    pub fn into_get_flags(self) -> Option<(SymlinkGetFlagsResponder)> {
18585        if let SymlinkRequest::GetFlags { responder } = self {
18586            Some((responder))
18587        } else {
18588            None
18589        }
18590    }
18591
18592    #[allow(irrefutable_let_patterns)]
18593    pub fn into_set_flags(self) -> Option<(Flags, SymlinkSetFlagsResponder)> {
18594        if let SymlinkRequest::SetFlags { flags, responder } = self {
18595            Some((flags, responder))
18596        } else {
18597            None
18598        }
18599    }
18600
18601    #[allow(irrefutable_let_patterns)]
18602    pub fn into_query_filesystem(self) -> Option<(SymlinkQueryFilesystemResponder)> {
18603        if let SymlinkRequest::QueryFilesystem { responder } = self {
18604            Some((responder))
18605        } else {
18606            None
18607        }
18608    }
18609
18610    #[allow(irrefutable_let_patterns)]
18611    pub fn into_get_attributes(
18612        self,
18613    ) -> Option<(NodeAttributesQuery, SymlinkGetAttributesResponder)> {
18614        if let SymlinkRequest::GetAttributes { query, responder } = self {
18615            Some((query, responder))
18616        } else {
18617            None
18618        }
18619    }
18620
18621    #[allow(irrefutable_let_patterns)]
18622    pub fn into_update_attributes(
18623        self,
18624    ) -> Option<(MutableNodeAttributes, SymlinkUpdateAttributesResponder)> {
18625        if let SymlinkRequest::UpdateAttributes { payload, responder } = self {
18626            Some((payload, responder))
18627        } else {
18628            None
18629        }
18630    }
18631
18632    #[allow(irrefutable_let_patterns)]
18633    pub fn into_sync(self) -> Option<(SymlinkSyncResponder)> {
18634        if let SymlinkRequest::Sync { responder } = self {
18635            Some((responder))
18636        } else {
18637            None
18638        }
18639    }
18640
18641    #[allow(irrefutable_let_patterns)]
18642    pub fn into_list_extended_attributes(
18643        self,
18644    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, SymlinkControlHandle)>
18645    {
18646        if let SymlinkRequest::ListExtendedAttributes { iterator, control_handle } = self {
18647            Some((iterator, control_handle))
18648        } else {
18649            None
18650        }
18651    }
18652
18653    #[allow(irrefutable_let_patterns)]
18654    pub fn into_get_extended_attribute(
18655        self,
18656    ) -> Option<(Vec<u8>, SymlinkGetExtendedAttributeResponder)> {
18657        if let SymlinkRequest::GetExtendedAttribute { name, responder } = self {
18658            Some((name, responder))
18659        } else {
18660            None
18661        }
18662    }
18663
18664    #[allow(irrefutable_let_patterns)]
18665    pub fn into_set_extended_attribute(
18666        self,
18667    ) -> Option<(
18668        Vec<u8>,
18669        ExtendedAttributeValue,
18670        SetExtendedAttributeMode,
18671        SymlinkSetExtendedAttributeResponder,
18672    )> {
18673        if let SymlinkRequest::SetExtendedAttribute { name, value, mode, responder } = self {
18674            Some((name, value, mode, responder))
18675        } else {
18676            None
18677        }
18678    }
18679
18680    #[allow(irrefutable_let_patterns)]
18681    pub fn into_remove_extended_attribute(
18682        self,
18683    ) -> Option<(Vec<u8>, SymlinkRemoveExtendedAttributeResponder)> {
18684        if let SymlinkRequest::RemoveExtendedAttribute { name, responder } = self {
18685            Some((name, responder))
18686        } else {
18687            None
18688        }
18689    }
18690
18691    #[allow(irrefutable_let_patterns)]
18692    pub fn into_describe(self) -> Option<(SymlinkDescribeResponder)> {
18693        if let SymlinkRequest::Describe { responder } = self {
18694            Some((responder))
18695        } else {
18696            None
18697        }
18698    }
18699
18700    /// Name of the method defined in FIDL
18701    pub fn method_name(&self) -> &'static str {
18702        match *self {
18703            SymlinkRequest::LinkInto { .. } => "link_into",
18704            SymlinkRequest::Clone { .. } => "clone",
18705            SymlinkRequest::Close { .. } => "close",
18706            SymlinkRequest::Query { .. } => "query",
18707            SymlinkRequest::DeprecatedClone { .. } => "deprecated_clone",
18708            SymlinkRequest::GetAttr { .. } => "get_attr",
18709            SymlinkRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
18710            SymlinkRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
18711            SymlinkRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
18712            SymlinkRequest::GetFlags { .. } => "get_flags",
18713            SymlinkRequest::SetFlags { .. } => "set_flags",
18714            SymlinkRequest::QueryFilesystem { .. } => "query_filesystem",
18715            SymlinkRequest::GetAttributes { .. } => "get_attributes",
18716            SymlinkRequest::UpdateAttributes { .. } => "update_attributes",
18717            SymlinkRequest::Sync { .. } => "sync",
18718            SymlinkRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
18719            SymlinkRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
18720            SymlinkRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
18721            SymlinkRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
18722            SymlinkRequest::Describe { .. } => "describe",
18723            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
18724                "unknown one-way method"
18725            }
18726            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
18727                "unknown two-way method"
18728            }
18729        }
18730    }
18731}
18732
18733#[derive(Debug, Clone)]
18734pub struct SymlinkControlHandle {
18735    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
18736}
18737
18738impl fidl::endpoints::ControlHandle for SymlinkControlHandle {
18739    fn shutdown(&self) {
18740        self.inner.shutdown()
18741    }
18742    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
18743        self.inner.shutdown_with_epitaph(status)
18744    }
18745
18746    fn is_closed(&self) -> bool {
18747        self.inner.channel().is_closed()
18748    }
18749    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
18750        self.inner.channel().on_closed()
18751    }
18752
18753    #[cfg(target_os = "fuchsia")]
18754    fn signal_peer(
18755        &self,
18756        clear_mask: zx::Signals,
18757        set_mask: zx::Signals,
18758    ) -> Result<(), zx_status::Status> {
18759        use fidl::Peered;
18760        self.inner.channel().signal_peer(clear_mask, set_mask)
18761    }
18762}
18763
18764impl SymlinkControlHandle {
18765    pub fn send_on_open_(
18766        &self,
18767        mut s: i32,
18768        mut info: Option<NodeInfoDeprecated>,
18769    ) -> Result<(), fidl::Error> {
18770        self.inner.send::<NodeOnOpenRequest>(
18771            (s, info.as_mut()),
18772            0,
18773            0x7fc7bbb1dbfd1972,
18774            fidl::encoding::DynamicFlags::empty(),
18775        )
18776    }
18777
18778    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
18779        self.inner.send::<Representation>(
18780            &mut payload,
18781            0,
18782            0x5cb40567d80a510c,
18783            fidl::encoding::DynamicFlags::empty(),
18784        )
18785    }
18786}
18787
18788#[must_use = "FIDL methods require a response to be sent"]
18789#[derive(Debug)]
18790pub struct SymlinkLinkIntoResponder {
18791    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18792    tx_id: u32,
18793}
18794
18795/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18796/// if the responder is dropped without sending a response, so that the client
18797/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18798impl std::ops::Drop for SymlinkLinkIntoResponder {
18799    fn drop(&mut self) {
18800        self.control_handle.shutdown();
18801        // Safety: drops once, never accessed again
18802        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18803    }
18804}
18805
18806impl fidl::endpoints::Responder for SymlinkLinkIntoResponder {
18807    type ControlHandle = SymlinkControlHandle;
18808
18809    fn control_handle(&self) -> &SymlinkControlHandle {
18810        &self.control_handle
18811    }
18812
18813    fn drop_without_shutdown(mut self) {
18814        // Safety: drops once, never accessed again due to mem::forget
18815        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18816        // Prevent Drop from running (which would shut down the channel)
18817        std::mem::forget(self);
18818    }
18819}
18820
18821impl SymlinkLinkIntoResponder {
18822    /// Sends a response to the FIDL transaction.
18823    ///
18824    /// Sets the channel to shutdown if an error occurs.
18825    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18826        let _result = self.send_raw(result);
18827        if _result.is_err() {
18828            self.control_handle.shutdown();
18829        }
18830        self.drop_without_shutdown();
18831        _result
18832    }
18833
18834    /// Similar to "send" but does not shutdown the channel if an error occurs.
18835    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18836        let _result = self.send_raw(result);
18837        self.drop_without_shutdown();
18838        _result
18839    }
18840
18841    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18842        self.control_handle
18843            .inner
18844            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
18845                result,
18846                self.tx_id,
18847                0x54f3949246a03e74,
18848                fidl::encoding::DynamicFlags::empty(),
18849            )
18850    }
18851}
18852
18853#[must_use = "FIDL methods require a response to be sent"]
18854#[derive(Debug)]
18855pub struct SymlinkCloseResponder {
18856    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18857    tx_id: u32,
18858}
18859
18860/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18861/// if the responder is dropped without sending a response, so that the client
18862/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18863impl std::ops::Drop for SymlinkCloseResponder {
18864    fn drop(&mut self) {
18865        self.control_handle.shutdown();
18866        // Safety: drops once, never accessed again
18867        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18868    }
18869}
18870
18871impl fidl::endpoints::Responder for SymlinkCloseResponder {
18872    type ControlHandle = SymlinkControlHandle;
18873
18874    fn control_handle(&self) -> &SymlinkControlHandle {
18875        &self.control_handle
18876    }
18877
18878    fn drop_without_shutdown(mut self) {
18879        // Safety: drops once, never accessed again due to mem::forget
18880        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18881        // Prevent Drop from running (which would shut down the channel)
18882        std::mem::forget(self);
18883    }
18884}
18885
18886impl SymlinkCloseResponder {
18887    /// Sends a response to the FIDL transaction.
18888    ///
18889    /// Sets the channel to shutdown if an error occurs.
18890    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18891        let _result = self.send_raw(result);
18892        if _result.is_err() {
18893            self.control_handle.shutdown();
18894        }
18895        self.drop_without_shutdown();
18896        _result
18897    }
18898
18899    /// Similar to "send" but does not shutdown the channel if an error occurs.
18900    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18901        let _result = self.send_raw(result);
18902        self.drop_without_shutdown();
18903        _result
18904    }
18905
18906    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
18907        self.control_handle
18908            .inner
18909            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
18910                result,
18911                self.tx_id,
18912                0x5ac5d459ad7f657e,
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 SymlinkQueryResponder {
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 SymlinkQueryResponder {
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 SymlinkQueryResponder {
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 SymlinkQueryResponder {
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 protocol: &[u8]) -> Result<(), fidl::Error> {
18956        let _result = self.send_raw(protocol);
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(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
18966        let _result = self.send_raw(protocol);
18967        self.drop_without_shutdown();
18968        _result
18969    }
18970
18971    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
18972        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
18973            (protocol,),
18974            self.tx_id,
18975            0x2658edee9decfc06,
18976            fidl::encoding::DynamicFlags::empty(),
18977        )
18978    }
18979}
18980
18981#[must_use = "FIDL methods require a response to be sent"]
18982#[derive(Debug)]
18983pub struct SymlinkGetAttrResponder {
18984    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
18985    tx_id: u32,
18986}
18987
18988/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
18989/// if the responder is dropped without sending a response, so that the client
18990/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18991impl std::ops::Drop for SymlinkGetAttrResponder {
18992    fn drop(&mut self) {
18993        self.control_handle.shutdown();
18994        // Safety: drops once, never accessed again
18995        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18996    }
18997}
18998
18999impl fidl::endpoints::Responder for SymlinkGetAttrResponder {
19000    type ControlHandle = SymlinkControlHandle;
19001
19002    fn control_handle(&self) -> &SymlinkControlHandle {
19003        &self.control_handle
19004    }
19005
19006    fn drop_without_shutdown(mut self) {
19007        // Safety: drops once, never accessed again due to mem::forget
19008        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19009        // Prevent Drop from running (which would shut down the channel)
19010        std::mem::forget(self);
19011    }
19012}
19013
19014impl SymlinkGetAttrResponder {
19015    /// Sends a response to the FIDL transaction.
19016    ///
19017    /// Sets the channel to shutdown if an error occurs.
19018    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
19019        let _result = self.send_raw(s, attributes);
19020        if _result.is_err() {
19021            self.control_handle.shutdown();
19022        }
19023        self.drop_without_shutdown();
19024        _result
19025    }
19026
19027    /// Similar to "send" but does not shutdown the channel if an error occurs.
19028    pub fn send_no_shutdown_on_err(
19029        self,
19030        mut s: i32,
19031        mut attributes: &NodeAttributes,
19032    ) -> Result<(), fidl::Error> {
19033        let _result = self.send_raw(s, attributes);
19034        self.drop_without_shutdown();
19035        _result
19036    }
19037
19038    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
19039        self.control_handle.inner.send::<NodeGetAttrResponse>(
19040            (s, attributes),
19041            self.tx_id,
19042            0x78985e216314dafd,
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 SymlinkDeprecatedSetAttrResponder {
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 SymlinkDeprecatedSetAttrResponder {
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 SymlinkDeprecatedSetAttrResponder {
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 SymlinkDeprecatedSetAttrResponder {
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) -> Result<(), fidl::Error> {
19086        let _result = self.send_raw(s);
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(self, mut s: i32) -> Result<(), fidl::Error> {
19096        let _result = self.send_raw(s);
19097        self.drop_without_shutdown();
19098        _result
19099    }
19100
19101    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
19102        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
19103            (s,),
19104            self.tx_id,
19105            0x4186c0f40d938f46,
19106            fidl::encoding::DynamicFlags::empty(),
19107        )
19108    }
19109}
19110
19111#[must_use = "FIDL methods require a response to be sent"]
19112#[derive(Debug)]
19113pub struct SymlinkDeprecatedGetFlagsResponder {
19114    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19115    tx_id: u32,
19116}
19117
19118/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19119/// if the responder is dropped without sending a response, so that the client
19120/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19121impl std::ops::Drop for SymlinkDeprecatedGetFlagsResponder {
19122    fn drop(&mut self) {
19123        self.control_handle.shutdown();
19124        // Safety: drops once, never accessed again
19125        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19126    }
19127}
19128
19129impl fidl::endpoints::Responder for SymlinkDeprecatedGetFlagsResponder {
19130    type ControlHandle = SymlinkControlHandle;
19131
19132    fn control_handle(&self) -> &SymlinkControlHandle {
19133        &self.control_handle
19134    }
19135
19136    fn drop_without_shutdown(mut self) {
19137        // Safety: drops once, never accessed again due to mem::forget
19138        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19139        // Prevent Drop from running (which would shut down the channel)
19140        std::mem::forget(self);
19141    }
19142}
19143
19144impl SymlinkDeprecatedGetFlagsResponder {
19145    /// Sends a response to the FIDL transaction.
19146    ///
19147    /// Sets the channel to shutdown if an error occurs.
19148    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
19149        let _result = self.send_raw(s, flags);
19150        if _result.is_err() {
19151            self.control_handle.shutdown();
19152        }
19153        self.drop_without_shutdown();
19154        _result
19155    }
19156
19157    /// Similar to "send" but does not shutdown the channel if an error occurs.
19158    pub fn send_no_shutdown_on_err(
19159        self,
19160        mut s: i32,
19161        mut flags: OpenFlags,
19162    ) -> Result<(), fidl::Error> {
19163        let _result = self.send_raw(s, flags);
19164        self.drop_without_shutdown();
19165        _result
19166    }
19167
19168    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
19169        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
19170            (s, flags),
19171            self.tx_id,
19172            0x5b88fffb8eda3aa1,
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 SymlinkDeprecatedSetFlagsResponder {
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 SymlinkDeprecatedSetFlagsResponder {
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 SymlinkDeprecatedSetFlagsResponder {
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 SymlinkDeprecatedSetFlagsResponder {
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 s: i32) -> Result<(), fidl::Error> {
19216        let _result = self.send_raw(s);
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(self, mut s: i32) -> Result<(), fidl::Error> {
19226        let _result = self.send_raw(s);
19227        self.drop_without_shutdown();
19228        _result
19229    }
19230
19231    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
19232        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
19233            (s,),
19234            self.tx_id,
19235            0x5295b76c71fde733,
19236            fidl::encoding::DynamicFlags::empty(),
19237        )
19238    }
19239}
19240
19241#[must_use = "FIDL methods require a response to be sent"]
19242#[derive(Debug)]
19243pub struct SymlinkGetFlagsResponder {
19244    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19245    tx_id: u32,
19246}
19247
19248/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19249/// if the responder is dropped without sending a response, so that the client
19250/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19251impl std::ops::Drop for SymlinkGetFlagsResponder {
19252    fn drop(&mut self) {
19253        self.control_handle.shutdown();
19254        // Safety: drops once, never accessed again
19255        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19256    }
19257}
19258
19259impl fidl::endpoints::Responder for SymlinkGetFlagsResponder {
19260    type ControlHandle = SymlinkControlHandle;
19261
19262    fn control_handle(&self) -> &SymlinkControlHandle {
19263        &self.control_handle
19264    }
19265
19266    fn drop_without_shutdown(mut self) {
19267        // Safety: drops once, never accessed again due to mem::forget
19268        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19269        // Prevent Drop from running (which would shut down the channel)
19270        std::mem::forget(self);
19271    }
19272}
19273
19274impl SymlinkGetFlagsResponder {
19275    /// Sends a response to the FIDL transaction.
19276    ///
19277    /// Sets the channel to shutdown if an error occurs.
19278    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
19279        let _result = self.send_raw(result);
19280        if _result.is_err() {
19281            self.control_handle.shutdown();
19282        }
19283        self.drop_without_shutdown();
19284        _result
19285    }
19286
19287    /// Similar to "send" but does not shutdown the channel if an error occurs.
19288    pub fn send_no_shutdown_on_err(
19289        self,
19290        mut result: Result<Flags, i32>,
19291    ) -> Result<(), fidl::Error> {
19292        let _result = self.send_raw(result);
19293        self.drop_without_shutdown();
19294        _result
19295    }
19296
19297    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
19298        self.control_handle
19299            .inner
19300            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
19301                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
19302                self.tx_id,
19303                0x176eb318f64ec23,
19304                fidl::encoding::DynamicFlags::FLEXIBLE,
19305            )
19306    }
19307}
19308
19309#[must_use = "FIDL methods require a response to be sent"]
19310#[derive(Debug)]
19311pub struct SymlinkSetFlagsResponder {
19312    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19313    tx_id: u32,
19314}
19315
19316/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19317/// if the responder is dropped without sending a response, so that the client
19318/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19319impl std::ops::Drop for SymlinkSetFlagsResponder {
19320    fn drop(&mut self) {
19321        self.control_handle.shutdown();
19322        // Safety: drops once, never accessed again
19323        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19324    }
19325}
19326
19327impl fidl::endpoints::Responder for SymlinkSetFlagsResponder {
19328    type ControlHandle = SymlinkControlHandle;
19329
19330    fn control_handle(&self) -> &SymlinkControlHandle {
19331        &self.control_handle
19332    }
19333
19334    fn drop_without_shutdown(mut self) {
19335        // Safety: drops once, never accessed again due to mem::forget
19336        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19337        // Prevent Drop from running (which would shut down the channel)
19338        std::mem::forget(self);
19339    }
19340}
19341
19342impl SymlinkSetFlagsResponder {
19343    /// Sends a response to the FIDL transaction.
19344    ///
19345    /// Sets the channel to shutdown if an error occurs.
19346    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19347        let _result = self.send_raw(result);
19348        if _result.is_err() {
19349            self.control_handle.shutdown();
19350        }
19351        self.drop_without_shutdown();
19352        _result
19353    }
19354
19355    /// Similar to "send" but does not shutdown the channel if an error occurs.
19356    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19357        let _result = self.send_raw(result);
19358        self.drop_without_shutdown();
19359        _result
19360    }
19361
19362    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19363        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
19364            fidl::encoding::EmptyStruct,
19365            i32,
19366        >>(
19367            fidl::encoding::FlexibleResult::new(result),
19368            self.tx_id,
19369            0x55a8028685791ea8,
19370            fidl::encoding::DynamicFlags::FLEXIBLE,
19371        )
19372    }
19373}
19374
19375#[must_use = "FIDL methods require a response to be sent"]
19376#[derive(Debug)]
19377pub struct SymlinkQueryFilesystemResponder {
19378    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19379    tx_id: u32,
19380}
19381
19382/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19383/// if the responder is dropped without sending a response, so that the client
19384/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19385impl std::ops::Drop for SymlinkQueryFilesystemResponder {
19386    fn drop(&mut self) {
19387        self.control_handle.shutdown();
19388        // Safety: drops once, never accessed again
19389        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19390    }
19391}
19392
19393impl fidl::endpoints::Responder for SymlinkQueryFilesystemResponder {
19394    type ControlHandle = SymlinkControlHandle;
19395
19396    fn control_handle(&self) -> &SymlinkControlHandle {
19397        &self.control_handle
19398    }
19399
19400    fn drop_without_shutdown(mut self) {
19401        // Safety: drops once, never accessed again due to mem::forget
19402        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19403        // Prevent Drop from running (which would shut down the channel)
19404        std::mem::forget(self);
19405    }
19406}
19407
19408impl SymlinkQueryFilesystemResponder {
19409    /// Sends a response to the FIDL transaction.
19410    ///
19411    /// Sets the channel to shutdown if an error occurs.
19412    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
19413        let _result = self.send_raw(s, info);
19414        if _result.is_err() {
19415            self.control_handle.shutdown();
19416        }
19417        self.drop_without_shutdown();
19418        _result
19419    }
19420
19421    /// Similar to "send" but does not shutdown the channel if an error occurs.
19422    pub fn send_no_shutdown_on_err(
19423        self,
19424        mut s: i32,
19425        mut info: Option<&FilesystemInfo>,
19426    ) -> Result<(), fidl::Error> {
19427        let _result = self.send_raw(s, info);
19428        self.drop_without_shutdown();
19429        _result
19430    }
19431
19432    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
19433        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
19434            (s, info),
19435            self.tx_id,
19436            0x6f344a1c6b0a0610,
19437            fidl::encoding::DynamicFlags::empty(),
19438        )
19439    }
19440}
19441
19442#[must_use = "FIDL methods require a response to be sent"]
19443#[derive(Debug)]
19444pub struct SymlinkGetAttributesResponder {
19445    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19446    tx_id: u32,
19447}
19448
19449/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19450/// if the responder is dropped without sending a response, so that the client
19451/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19452impl std::ops::Drop for SymlinkGetAttributesResponder {
19453    fn drop(&mut self) {
19454        self.control_handle.shutdown();
19455        // Safety: drops once, never accessed again
19456        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19457    }
19458}
19459
19460impl fidl::endpoints::Responder for SymlinkGetAttributesResponder {
19461    type ControlHandle = SymlinkControlHandle;
19462
19463    fn control_handle(&self) -> &SymlinkControlHandle {
19464        &self.control_handle
19465    }
19466
19467    fn drop_without_shutdown(mut self) {
19468        // Safety: drops once, never accessed again due to mem::forget
19469        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19470        // Prevent Drop from running (which would shut down the channel)
19471        std::mem::forget(self);
19472    }
19473}
19474
19475impl SymlinkGetAttributesResponder {
19476    /// Sends a response to the FIDL transaction.
19477    ///
19478    /// Sets the channel to shutdown if an error occurs.
19479    pub fn send(
19480        self,
19481        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
19482    ) -> Result<(), fidl::Error> {
19483        let _result = self.send_raw(result);
19484        if _result.is_err() {
19485            self.control_handle.shutdown();
19486        }
19487        self.drop_without_shutdown();
19488        _result
19489    }
19490
19491    /// Similar to "send" but does not shutdown the channel if an error occurs.
19492    pub fn send_no_shutdown_on_err(
19493        self,
19494        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
19495    ) -> Result<(), fidl::Error> {
19496        let _result = self.send_raw(result);
19497        self.drop_without_shutdown();
19498        _result
19499    }
19500
19501    fn send_raw(
19502        &self,
19503        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
19504    ) -> Result<(), fidl::Error> {
19505        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
19506            result,
19507            self.tx_id,
19508            0x3d4396a638ea053b,
19509            fidl::encoding::DynamicFlags::empty(),
19510        )
19511    }
19512}
19513
19514#[must_use = "FIDL methods require a response to be sent"]
19515#[derive(Debug)]
19516pub struct SymlinkUpdateAttributesResponder {
19517    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19518    tx_id: u32,
19519}
19520
19521/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19522/// if the responder is dropped without sending a response, so that the client
19523/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19524impl std::ops::Drop for SymlinkUpdateAttributesResponder {
19525    fn drop(&mut self) {
19526        self.control_handle.shutdown();
19527        // Safety: drops once, never accessed again
19528        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19529    }
19530}
19531
19532impl fidl::endpoints::Responder for SymlinkUpdateAttributesResponder {
19533    type ControlHandle = SymlinkControlHandle;
19534
19535    fn control_handle(&self) -> &SymlinkControlHandle {
19536        &self.control_handle
19537    }
19538
19539    fn drop_without_shutdown(mut self) {
19540        // Safety: drops once, never accessed again due to mem::forget
19541        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19542        // Prevent Drop from running (which would shut down the channel)
19543        std::mem::forget(self);
19544    }
19545}
19546
19547impl SymlinkUpdateAttributesResponder {
19548    /// Sends a response to the FIDL transaction.
19549    ///
19550    /// Sets the channel to shutdown if an error occurs.
19551    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19552        let _result = self.send_raw(result);
19553        if _result.is_err() {
19554            self.control_handle.shutdown();
19555        }
19556        self.drop_without_shutdown();
19557        _result
19558    }
19559
19560    /// Similar to "send" but does not shutdown the channel if an error occurs.
19561    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19562        let _result = self.send_raw(result);
19563        self.drop_without_shutdown();
19564        _result
19565    }
19566
19567    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19568        self.control_handle
19569            .inner
19570            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19571                result,
19572                self.tx_id,
19573                0x3308c1da5a89bf08,
19574                fidl::encoding::DynamicFlags::empty(),
19575            )
19576    }
19577}
19578
19579#[must_use = "FIDL methods require a response to be sent"]
19580#[derive(Debug)]
19581pub struct SymlinkSyncResponder {
19582    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19583    tx_id: u32,
19584}
19585
19586/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19587/// if the responder is dropped without sending a response, so that the client
19588/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19589impl std::ops::Drop for SymlinkSyncResponder {
19590    fn drop(&mut self) {
19591        self.control_handle.shutdown();
19592        // Safety: drops once, never accessed again
19593        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19594    }
19595}
19596
19597impl fidl::endpoints::Responder for SymlinkSyncResponder {
19598    type ControlHandle = SymlinkControlHandle;
19599
19600    fn control_handle(&self) -> &SymlinkControlHandle {
19601        &self.control_handle
19602    }
19603
19604    fn drop_without_shutdown(mut self) {
19605        // Safety: drops once, never accessed again due to mem::forget
19606        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19607        // Prevent Drop from running (which would shut down the channel)
19608        std::mem::forget(self);
19609    }
19610}
19611
19612impl SymlinkSyncResponder {
19613    /// Sends a response to the FIDL transaction.
19614    ///
19615    /// Sets the channel to shutdown if an error occurs.
19616    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19617        let _result = self.send_raw(result);
19618        if _result.is_err() {
19619            self.control_handle.shutdown();
19620        }
19621        self.drop_without_shutdown();
19622        _result
19623    }
19624
19625    /// Similar to "send" but does not shutdown the channel if an error occurs.
19626    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19627        let _result = self.send_raw(result);
19628        self.drop_without_shutdown();
19629        _result
19630    }
19631
19632    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19633        self.control_handle
19634            .inner
19635            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19636                result,
19637                self.tx_id,
19638                0x2c5c27ca0ab5dc49,
19639                fidl::encoding::DynamicFlags::empty(),
19640            )
19641    }
19642}
19643
19644#[must_use = "FIDL methods require a response to be sent"]
19645#[derive(Debug)]
19646pub struct SymlinkGetExtendedAttributeResponder {
19647    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19648    tx_id: u32,
19649}
19650
19651/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19652/// if the responder is dropped without sending a response, so that the client
19653/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19654impl std::ops::Drop for SymlinkGetExtendedAttributeResponder {
19655    fn drop(&mut self) {
19656        self.control_handle.shutdown();
19657        // Safety: drops once, never accessed again
19658        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19659    }
19660}
19661
19662impl fidl::endpoints::Responder for SymlinkGetExtendedAttributeResponder {
19663    type ControlHandle = SymlinkControlHandle;
19664
19665    fn control_handle(&self) -> &SymlinkControlHandle {
19666        &self.control_handle
19667    }
19668
19669    fn drop_without_shutdown(mut self) {
19670        // Safety: drops once, never accessed again due to mem::forget
19671        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19672        // Prevent Drop from running (which would shut down the channel)
19673        std::mem::forget(self);
19674    }
19675}
19676
19677impl SymlinkGetExtendedAttributeResponder {
19678    /// Sends a response to the FIDL transaction.
19679    ///
19680    /// Sets the channel to shutdown if an error occurs.
19681    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
19682        let _result = self.send_raw(result);
19683        if _result.is_err() {
19684            self.control_handle.shutdown();
19685        }
19686        self.drop_without_shutdown();
19687        _result
19688    }
19689
19690    /// Similar to "send" but does not shutdown the channel if an error occurs.
19691    pub fn send_no_shutdown_on_err(
19692        self,
19693        mut result: Result<ExtendedAttributeValue, i32>,
19694    ) -> 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<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
19701        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
19702            result.as_mut().map_err(|e| *e),
19703            self.tx_id,
19704            0x45ffa3ccfdeb76db,
19705            fidl::encoding::DynamicFlags::empty(),
19706        )
19707    }
19708}
19709
19710#[must_use = "FIDL methods require a response to be sent"]
19711#[derive(Debug)]
19712pub struct SymlinkSetExtendedAttributeResponder {
19713    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19714    tx_id: u32,
19715}
19716
19717/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19718/// if the responder is dropped without sending a response, so that the client
19719/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19720impl std::ops::Drop for SymlinkSetExtendedAttributeResponder {
19721    fn drop(&mut self) {
19722        self.control_handle.shutdown();
19723        // Safety: drops once, never accessed again
19724        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19725    }
19726}
19727
19728impl fidl::endpoints::Responder for SymlinkSetExtendedAttributeResponder {
19729    type ControlHandle = SymlinkControlHandle;
19730
19731    fn control_handle(&self) -> &SymlinkControlHandle {
19732        &self.control_handle
19733    }
19734
19735    fn drop_without_shutdown(mut self) {
19736        // Safety: drops once, never accessed again due to mem::forget
19737        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19738        // Prevent Drop from running (which would shut down the channel)
19739        std::mem::forget(self);
19740    }
19741}
19742
19743impl SymlinkSetExtendedAttributeResponder {
19744    /// Sends a response to the FIDL transaction.
19745    ///
19746    /// Sets the channel to shutdown if an error occurs.
19747    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19748        let _result = self.send_raw(result);
19749        if _result.is_err() {
19750            self.control_handle.shutdown();
19751        }
19752        self.drop_without_shutdown();
19753        _result
19754    }
19755
19756    /// Similar to "send" but does not shutdown the channel if an error occurs.
19757    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19758        let _result = self.send_raw(result);
19759        self.drop_without_shutdown();
19760        _result
19761    }
19762
19763    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19764        self.control_handle
19765            .inner
19766            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19767                result,
19768                self.tx_id,
19769                0x4a951362f681f23c,
19770                fidl::encoding::DynamicFlags::empty(),
19771            )
19772    }
19773}
19774
19775#[must_use = "FIDL methods require a response to be sent"]
19776#[derive(Debug)]
19777pub struct SymlinkRemoveExtendedAttributeResponder {
19778    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19779    tx_id: u32,
19780}
19781
19782/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19783/// if the responder is dropped without sending a response, so that the client
19784/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19785impl std::ops::Drop for SymlinkRemoveExtendedAttributeResponder {
19786    fn drop(&mut self) {
19787        self.control_handle.shutdown();
19788        // Safety: drops once, never accessed again
19789        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19790    }
19791}
19792
19793impl fidl::endpoints::Responder for SymlinkRemoveExtendedAttributeResponder {
19794    type ControlHandle = SymlinkControlHandle;
19795
19796    fn control_handle(&self) -> &SymlinkControlHandle {
19797        &self.control_handle
19798    }
19799
19800    fn drop_without_shutdown(mut self) {
19801        // Safety: drops once, never accessed again due to mem::forget
19802        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19803        // Prevent Drop from running (which would shut down the channel)
19804        std::mem::forget(self);
19805    }
19806}
19807
19808impl SymlinkRemoveExtendedAttributeResponder {
19809    /// Sends a response to the FIDL transaction.
19810    ///
19811    /// Sets the channel to shutdown if an error occurs.
19812    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19813        let _result = self.send_raw(result);
19814        if _result.is_err() {
19815            self.control_handle.shutdown();
19816        }
19817        self.drop_without_shutdown();
19818        _result
19819    }
19820
19821    /// Similar to "send" but does not shutdown the channel if an error occurs.
19822    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19823        let _result = self.send_raw(result);
19824        self.drop_without_shutdown();
19825        _result
19826    }
19827
19828    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19829        self.control_handle
19830            .inner
19831            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19832                result,
19833                self.tx_id,
19834                0x7a0b9f3a9bf9032d,
19835                fidl::encoding::DynamicFlags::empty(),
19836            )
19837    }
19838}
19839
19840#[must_use = "FIDL methods require a response to be sent"]
19841#[derive(Debug)]
19842pub struct SymlinkDescribeResponder {
19843    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19844    tx_id: u32,
19845}
19846
19847/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19848/// if the responder is dropped without sending a response, so that the client
19849/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19850impl std::ops::Drop for SymlinkDescribeResponder {
19851    fn drop(&mut self) {
19852        self.control_handle.shutdown();
19853        // Safety: drops once, never accessed again
19854        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19855    }
19856}
19857
19858impl fidl::endpoints::Responder for SymlinkDescribeResponder {
19859    type ControlHandle = SymlinkControlHandle;
19860
19861    fn control_handle(&self) -> &SymlinkControlHandle {
19862        &self.control_handle
19863    }
19864
19865    fn drop_without_shutdown(mut self) {
19866        // Safety: drops once, never accessed again due to mem::forget
19867        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19868        // Prevent Drop from running (which would shut down the channel)
19869        std::mem::forget(self);
19870    }
19871}
19872
19873impl SymlinkDescribeResponder {
19874    /// Sends a response to the FIDL transaction.
19875    ///
19876    /// Sets the channel to shutdown if an error occurs.
19877    pub fn send(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
19878        let _result = self.send_raw(payload);
19879        if _result.is_err() {
19880            self.control_handle.shutdown();
19881        }
19882        self.drop_without_shutdown();
19883        _result
19884    }
19885
19886    /// Similar to "send" but does not shutdown the channel if an error occurs.
19887    pub fn send_no_shutdown_on_err(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
19888        let _result = self.send_raw(payload);
19889        self.drop_without_shutdown();
19890        _result
19891    }
19892
19893    fn send_raw(&self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
19894        self.control_handle.inner.send::<fidl::encoding::FlexibleType<SymlinkInfo>>(
19895            fidl::encoding::Flexible::new(payload),
19896            self.tx_id,
19897            0x742c2ea5e89831f3,
19898            fidl::encoding::DynamicFlags::FLEXIBLE,
19899        )
19900    }
19901}
19902
19903#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
19904pub struct WritableMarker;
19905
19906impl fidl::endpoints::ProtocolMarker for WritableMarker {
19907    type Proxy = WritableProxy;
19908    type RequestStream = WritableRequestStream;
19909    #[cfg(target_os = "fuchsia")]
19910    type SynchronousProxy = WritableSynchronousProxy;
19911
19912    const DEBUG_NAME: &'static str = "(anonymous) Writable";
19913}
19914pub type WritableWriteResult = Result<u64, i32>;
19915
19916pub trait WritableProxyInterface: Send + Sync {
19917    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
19918        + Send;
19919    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
19920}
19921#[derive(Debug)]
19922#[cfg(target_os = "fuchsia")]
19923pub struct WritableSynchronousProxy {
19924    client: fidl::client::sync::Client,
19925}
19926
19927#[cfg(target_os = "fuchsia")]
19928impl fidl::endpoints::SynchronousProxy for WritableSynchronousProxy {
19929    type Proxy = WritableProxy;
19930    type Protocol = WritableMarker;
19931
19932    fn from_channel(inner: fidl::Channel) -> Self {
19933        Self::new(inner)
19934    }
19935
19936    fn into_channel(self) -> fidl::Channel {
19937        self.client.into_channel()
19938    }
19939
19940    fn as_channel(&self) -> &fidl::Channel {
19941        self.client.as_channel()
19942    }
19943}
19944
19945#[cfg(target_os = "fuchsia")]
19946impl WritableSynchronousProxy {
19947    pub fn new(channel: fidl::Channel) -> Self {
19948        let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
19949        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
19950    }
19951
19952    pub fn into_channel(self) -> fidl::Channel {
19953        self.client.into_channel()
19954    }
19955
19956    /// Waits until an event arrives and returns it. It is safe for other
19957    /// threads to make concurrent requests while waiting for an event.
19958    pub fn wait_for_event(
19959        &self,
19960        deadline: zx::MonotonicInstant,
19961    ) -> Result<WritableEvent, fidl::Error> {
19962        WritableEvent::decode(self.client.wait_for_event(deadline)?)
19963    }
19964
19965    /// Writes data at the seek offset.
19966    /// The seek offset is moved forward by the number of bytes written.
19967    /// If the file is in append mode, the seek offset is first set to the end
19968    /// of the file, followed by the write, in one atomic step.
19969    ///
19970    /// The file size may grow if the seek offset plus `data.length` is beyond
19971    /// the current end of file.
19972    ///
19973    /// + request `data` the byte buffer to write to the file.
19974    /// - response `actual_count` the number of bytes written.
19975    ///
19976    /// ## Invariants
19977    ///
19978    /// * The returned `actual_count` will never be greater than `data.length`.
19979    /// * If the server is unable to write all the data due to e.g. not enough
19980    ///   space, `actual_count` may be less than `data.length`.  If no bytes
19981    ///   could be written, an error is returned.
19982    /// * If `data.length` is zero, the server should perform all the checks
19983    ///   ensuring write access without mutating the file and return a
19984    ///   successful write of zero bytes.  The seek offset is still updated if
19985    ///   in append mode.
19986    ///
19987    /// This method requires the [`Rights.WRITE_BYTES`] right.
19988    pub fn r#write(
19989        &self,
19990        mut data: &[u8],
19991        ___deadline: zx::MonotonicInstant,
19992    ) -> Result<WritableWriteResult, fidl::Error> {
19993        let _response = self.client.send_query::<
19994            WritableWriteRequest,
19995            fidl::encoding::ResultType<WritableWriteResponse, i32>,
19996        >(
19997            (data,),
19998            0x6a31437832469f82,
19999            fidl::encoding::DynamicFlags::empty(),
20000            ___deadline,
20001        )?;
20002        Ok(_response.map(|x| x.actual_count))
20003    }
20004}
20005
20006#[cfg(target_os = "fuchsia")]
20007impl From<WritableSynchronousProxy> for zx::Handle {
20008    fn from(value: WritableSynchronousProxy) -> Self {
20009        value.into_channel().into()
20010    }
20011}
20012
20013#[cfg(target_os = "fuchsia")]
20014impl From<fidl::Channel> for WritableSynchronousProxy {
20015    fn from(value: fidl::Channel) -> Self {
20016        Self::new(value)
20017    }
20018}
20019
20020#[derive(Debug, Clone)]
20021pub struct WritableProxy {
20022    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
20023}
20024
20025impl fidl::endpoints::Proxy for WritableProxy {
20026    type Protocol = WritableMarker;
20027
20028    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
20029        Self::new(inner)
20030    }
20031
20032    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
20033        self.client.into_channel().map_err(|client| Self { client })
20034    }
20035
20036    fn as_channel(&self) -> &::fidl::AsyncChannel {
20037        self.client.as_channel()
20038    }
20039}
20040
20041impl WritableProxy {
20042    /// Create a new Proxy for fuchsia.io/Writable.
20043    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
20044        let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
20045        Self { client: fidl::client::Client::new(channel, protocol_name) }
20046    }
20047
20048    /// Get a Stream of events from the remote end of the protocol.
20049    ///
20050    /// # Panics
20051    ///
20052    /// Panics if the event stream was already taken.
20053    pub fn take_event_stream(&self) -> WritableEventStream {
20054        WritableEventStream { event_receiver: self.client.take_event_receiver() }
20055    }
20056
20057    /// Writes data at the seek offset.
20058    /// The seek offset is moved forward by the number of bytes written.
20059    /// If the file is in append mode, the seek offset is first set to the end
20060    /// of the file, followed by the write, in one atomic step.
20061    ///
20062    /// The file size may grow if the seek offset plus `data.length` is beyond
20063    /// the current end of file.
20064    ///
20065    /// + request `data` the byte buffer to write to the file.
20066    /// - response `actual_count` the number of bytes written.
20067    ///
20068    /// ## Invariants
20069    ///
20070    /// * The returned `actual_count` will never be greater than `data.length`.
20071    /// * If the server is unable to write all the data due to e.g. not enough
20072    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20073    ///   could be written, an error is returned.
20074    /// * If `data.length` is zero, the server should perform all the checks
20075    ///   ensuring write access without mutating the file and return a
20076    ///   successful write of zero bytes.  The seek offset is still updated if
20077    ///   in append mode.
20078    ///
20079    /// This method requires the [`Rights.WRITE_BYTES`] right.
20080    pub fn r#write(
20081        &self,
20082        mut data: &[u8],
20083    ) -> fidl::client::QueryResponseFut<
20084        WritableWriteResult,
20085        fidl::encoding::DefaultFuchsiaResourceDialect,
20086    > {
20087        WritableProxyInterface::r#write(self, data)
20088    }
20089}
20090
20091impl WritableProxyInterface for WritableProxy {
20092    type WriteResponseFut = fidl::client::QueryResponseFut<
20093        WritableWriteResult,
20094        fidl::encoding::DefaultFuchsiaResourceDialect,
20095    >;
20096    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
20097        fn _decode(
20098            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
20099        ) -> Result<WritableWriteResult, fidl::Error> {
20100            let _response = fidl::client::decode_transaction_body::<
20101                fidl::encoding::ResultType<WritableWriteResponse, i32>,
20102                fidl::encoding::DefaultFuchsiaResourceDialect,
20103                0x6a31437832469f82,
20104            >(_buf?)?;
20105            Ok(_response.map(|x| x.actual_count))
20106        }
20107        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
20108            (data,),
20109            0x6a31437832469f82,
20110            fidl::encoding::DynamicFlags::empty(),
20111            _decode,
20112        )
20113    }
20114}
20115
20116pub struct WritableEventStream {
20117    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
20118}
20119
20120impl std::marker::Unpin for WritableEventStream {}
20121
20122impl futures::stream::FusedStream for WritableEventStream {
20123    fn is_terminated(&self) -> bool {
20124        self.event_receiver.is_terminated()
20125    }
20126}
20127
20128impl futures::Stream for WritableEventStream {
20129    type Item = Result<WritableEvent, fidl::Error>;
20130
20131    fn poll_next(
20132        mut self: std::pin::Pin<&mut Self>,
20133        cx: &mut std::task::Context<'_>,
20134    ) -> std::task::Poll<Option<Self::Item>> {
20135        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
20136            &mut self.event_receiver,
20137            cx
20138        )?) {
20139            Some(buf) => std::task::Poll::Ready(Some(WritableEvent::decode(buf))),
20140            None => std::task::Poll::Ready(None),
20141        }
20142    }
20143}
20144
20145#[derive(Debug)]
20146pub enum WritableEvent {}
20147
20148impl WritableEvent {
20149    /// Decodes a message buffer as a [`WritableEvent`].
20150    fn decode(
20151        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
20152    ) -> Result<WritableEvent, fidl::Error> {
20153        let (bytes, _handles) = buf.split_mut();
20154        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
20155        debug_assert_eq!(tx_header.tx_id, 0);
20156        match tx_header.ordinal {
20157            _ => Err(fidl::Error::UnknownOrdinal {
20158                ordinal: tx_header.ordinal,
20159                protocol_name: <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
20160            }),
20161        }
20162    }
20163}
20164
20165/// A Stream of incoming requests for fuchsia.io/Writable.
20166pub struct WritableRequestStream {
20167    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20168    is_terminated: bool,
20169}
20170
20171impl std::marker::Unpin for WritableRequestStream {}
20172
20173impl futures::stream::FusedStream for WritableRequestStream {
20174    fn is_terminated(&self) -> bool {
20175        self.is_terminated
20176    }
20177}
20178
20179impl fidl::endpoints::RequestStream for WritableRequestStream {
20180    type Protocol = WritableMarker;
20181    type ControlHandle = WritableControlHandle;
20182
20183    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
20184        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
20185    }
20186
20187    fn control_handle(&self) -> Self::ControlHandle {
20188        WritableControlHandle { inner: self.inner.clone() }
20189    }
20190
20191    fn into_inner(
20192        self,
20193    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
20194    {
20195        (self.inner, self.is_terminated)
20196    }
20197
20198    fn from_inner(
20199        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20200        is_terminated: bool,
20201    ) -> Self {
20202        Self { inner, is_terminated }
20203    }
20204}
20205
20206impl futures::Stream for WritableRequestStream {
20207    type Item = Result<WritableRequest, fidl::Error>;
20208
20209    fn poll_next(
20210        mut self: std::pin::Pin<&mut Self>,
20211        cx: &mut std::task::Context<'_>,
20212    ) -> std::task::Poll<Option<Self::Item>> {
20213        let this = &mut *self;
20214        if this.inner.check_shutdown(cx) {
20215            this.is_terminated = true;
20216            return std::task::Poll::Ready(None);
20217        }
20218        if this.is_terminated {
20219            panic!("polled WritableRequestStream after completion");
20220        }
20221        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
20222            |bytes, handles| {
20223                match this.inner.channel().read_etc(cx, bytes, handles) {
20224                    std::task::Poll::Ready(Ok(())) => {}
20225                    std::task::Poll::Pending => return std::task::Poll::Pending,
20226                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
20227                        this.is_terminated = true;
20228                        return std::task::Poll::Ready(None);
20229                    }
20230                    std::task::Poll::Ready(Err(e)) => {
20231                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
20232                            e.into(),
20233                        ))))
20234                    }
20235                }
20236
20237                // A message has been received from the channel
20238                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
20239
20240                std::task::Poll::Ready(Some(match header.ordinal {
20241                    0x6a31437832469f82 => {
20242                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
20243                        let mut req = fidl::new_empty!(
20244                            WritableWriteRequest,
20245                            fidl::encoding::DefaultFuchsiaResourceDialect
20246                        );
20247                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
20248                        let control_handle = WritableControlHandle { inner: this.inner.clone() };
20249                        Ok(WritableRequest::Write {
20250                            data: req.data,
20251
20252                            responder: WritableWriteResponder {
20253                                control_handle: std::mem::ManuallyDrop::new(control_handle),
20254                                tx_id: header.tx_id,
20255                            },
20256                        })
20257                    }
20258                    _ => Err(fidl::Error::UnknownOrdinal {
20259                        ordinal: header.ordinal,
20260                        protocol_name:
20261                            <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
20262                    }),
20263                }))
20264            },
20265        )
20266    }
20267}
20268
20269#[derive(Debug)]
20270pub enum WritableRequest {
20271    /// Writes data at the seek offset.
20272    /// The seek offset is moved forward by the number of bytes written.
20273    /// If the file is in append mode, the seek offset is first set to the end
20274    /// of the file, followed by the write, in one atomic step.
20275    ///
20276    /// The file size may grow if the seek offset plus `data.length` is beyond
20277    /// the current end of file.
20278    ///
20279    /// + request `data` the byte buffer to write to the file.
20280    /// - response `actual_count` the number of bytes written.
20281    ///
20282    /// ## Invariants
20283    ///
20284    /// * The returned `actual_count` will never be greater than `data.length`.
20285    /// * If the server is unable to write all the data due to e.g. not enough
20286    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20287    ///   could be written, an error is returned.
20288    /// * If `data.length` is zero, the server should perform all the checks
20289    ///   ensuring write access without mutating the file and return a
20290    ///   successful write of zero bytes.  The seek offset is still updated if
20291    ///   in append mode.
20292    ///
20293    /// This method requires the [`Rights.WRITE_BYTES`] right.
20294    Write { data: Vec<u8>, responder: WritableWriteResponder },
20295}
20296
20297impl WritableRequest {
20298    #[allow(irrefutable_let_patterns)]
20299    pub fn into_write(self) -> Option<(Vec<u8>, WritableWriteResponder)> {
20300        if let WritableRequest::Write { data, responder } = self {
20301            Some((data, responder))
20302        } else {
20303            None
20304        }
20305    }
20306
20307    /// Name of the method defined in FIDL
20308    pub fn method_name(&self) -> &'static str {
20309        match *self {
20310            WritableRequest::Write { .. } => "write",
20311        }
20312    }
20313}
20314
20315#[derive(Debug, Clone)]
20316pub struct WritableControlHandle {
20317    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20318}
20319
20320impl fidl::endpoints::ControlHandle for WritableControlHandle {
20321    fn shutdown(&self) {
20322        self.inner.shutdown()
20323    }
20324    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
20325        self.inner.shutdown_with_epitaph(status)
20326    }
20327
20328    fn is_closed(&self) -> bool {
20329        self.inner.channel().is_closed()
20330    }
20331    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
20332        self.inner.channel().on_closed()
20333    }
20334
20335    #[cfg(target_os = "fuchsia")]
20336    fn signal_peer(
20337        &self,
20338        clear_mask: zx::Signals,
20339        set_mask: zx::Signals,
20340    ) -> Result<(), zx_status::Status> {
20341        use fidl::Peered;
20342        self.inner.channel().signal_peer(clear_mask, set_mask)
20343    }
20344}
20345
20346impl WritableControlHandle {}
20347
20348#[must_use = "FIDL methods require a response to be sent"]
20349#[derive(Debug)]
20350pub struct WritableWriteResponder {
20351    control_handle: std::mem::ManuallyDrop<WritableControlHandle>,
20352    tx_id: u32,
20353}
20354
20355/// Set the the channel to be shutdown (see [`WritableControlHandle::shutdown`])
20356/// if the responder is dropped without sending a response, so that the client
20357/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20358impl std::ops::Drop for WritableWriteResponder {
20359    fn drop(&mut self) {
20360        self.control_handle.shutdown();
20361        // Safety: drops once, never accessed again
20362        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20363    }
20364}
20365
20366impl fidl::endpoints::Responder for WritableWriteResponder {
20367    type ControlHandle = WritableControlHandle;
20368
20369    fn control_handle(&self) -> &WritableControlHandle {
20370        &self.control_handle
20371    }
20372
20373    fn drop_without_shutdown(mut self) {
20374        // Safety: drops once, never accessed again due to mem::forget
20375        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20376        // Prevent Drop from running (which would shut down the channel)
20377        std::mem::forget(self);
20378    }
20379}
20380
20381impl WritableWriteResponder {
20382    /// Sends a response to the FIDL transaction.
20383    ///
20384    /// Sets the channel to shutdown if an error occurs.
20385    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
20386        let _result = self.send_raw(result);
20387        if _result.is_err() {
20388            self.control_handle.shutdown();
20389        }
20390        self.drop_without_shutdown();
20391        _result
20392    }
20393
20394    /// Similar to "send" but does not shutdown the channel if an error occurs.
20395    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
20396        let _result = self.send_raw(result);
20397        self.drop_without_shutdown();
20398        _result
20399    }
20400
20401    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
20402        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
20403            result.map(|actual_count| (actual_count,)),
20404            self.tx_id,
20405            0x6a31437832469f82,
20406            fidl::encoding::DynamicFlags::empty(),
20407        )
20408    }
20409}
20410
20411mod internal {
20412    use super::*;
20413
20414    impl fidl::encoding::ResourceTypeMarker for DirectoryCreateSymlinkRequest {
20415        type Borrowed<'a> = &'a mut Self;
20416        fn take_or_borrow<'a>(
20417            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20418        ) -> Self::Borrowed<'a> {
20419            value
20420        }
20421    }
20422
20423    unsafe impl fidl::encoding::TypeMarker for DirectoryCreateSymlinkRequest {
20424        type Owned = Self;
20425
20426        #[inline(always)]
20427        fn inline_align(_context: fidl::encoding::Context) -> usize {
20428            8
20429        }
20430
20431        #[inline(always)]
20432        fn inline_size(_context: fidl::encoding::Context) -> usize {
20433            40
20434        }
20435    }
20436
20437    unsafe impl
20438        fidl::encoding::Encode<
20439            DirectoryCreateSymlinkRequest,
20440            fidl::encoding::DefaultFuchsiaResourceDialect,
20441        > for &mut DirectoryCreateSymlinkRequest
20442    {
20443        #[inline]
20444        unsafe fn encode(
20445            self,
20446            encoder: &mut fidl::encoding::Encoder<
20447                '_,
20448                fidl::encoding::DefaultFuchsiaResourceDialect,
20449            >,
20450            offset: usize,
20451            _depth: fidl::encoding::Depth,
20452        ) -> fidl::Result<()> {
20453            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
20454            // Delegate to tuple encoding.
20455            fidl::encoding::Encode::<
20456                DirectoryCreateSymlinkRequest,
20457                fidl::encoding::DefaultFuchsiaResourceDialect,
20458            >::encode(
20459                (
20460                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
20461                        &self.name,
20462                    ),
20463                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
20464                        &self.target,
20465                    ),
20466                    <fidl::encoding::Optional<
20467                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20468                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20469                        &mut self.connection
20470                    ),
20471                ),
20472                encoder,
20473                offset,
20474                _depth,
20475            )
20476        }
20477    }
20478    unsafe impl<
20479            T0: fidl::encoding::Encode<
20480                fidl::encoding::BoundedString<255>,
20481                fidl::encoding::DefaultFuchsiaResourceDialect,
20482            >,
20483            T1: fidl::encoding::Encode<
20484                fidl::encoding::Vector<u8, 4095>,
20485                fidl::encoding::DefaultFuchsiaResourceDialect,
20486            >,
20487            T2: fidl::encoding::Encode<
20488                fidl::encoding::Optional<
20489                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20490                >,
20491                fidl::encoding::DefaultFuchsiaResourceDialect,
20492            >,
20493        >
20494        fidl::encoding::Encode<
20495            DirectoryCreateSymlinkRequest,
20496            fidl::encoding::DefaultFuchsiaResourceDialect,
20497        > for (T0, T1, T2)
20498    {
20499        #[inline]
20500        unsafe fn encode(
20501            self,
20502            encoder: &mut fidl::encoding::Encoder<
20503                '_,
20504                fidl::encoding::DefaultFuchsiaResourceDialect,
20505            >,
20506            offset: usize,
20507            depth: fidl::encoding::Depth,
20508        ) -> fidl::Result<()> {
20509            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
20510            // Zero out padding regions. There's no need to apply masks
20511            // because the unmasked parts will be overwritten by fields.
20512            unsafe {
20513                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
20514                (ptr as *mut u64).write_unaligned(0);
20515            }
20516            // Write the fields.
20517            self.0.encode(encoder, offset + 0, depth)?;
20518            self.1.encode(encoder, offset + 16, depth)?;
20519            self.2.encode(encoder, offset + 32, depth)?;
20520            Ok(())
20521        }
20522    }
20523
20524    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20525        for DirectoryCreateSymlinkRequest
20526    {
20527        #[inline(always)]
20528        fn new_empty() -> Self {
20529            Self {
20530                name: fidl::new_empty!(
20531                    fidl::encoding::BoundedString<255>,
20532                    fidl::encoding::DefaultFuchsiaResourceDialect
20533                ),
20534                target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect),
20535                connection: fidl::new_empty!(
20536                    fidl::encoding::Optional<
20537                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20538                    >,
20539                    fidl::encoding::DefaultFuchsiaResourceDialect
20540                ),
20541            }
20542        }
20543
20544        #[inline]
20545        unsafe fn decode(
20546            &mut self,
20547            decoder: &mut fidl::encoding::Decoder<
20548                '_,
20549                fidl::encoding::DefaultFuchsiaResourceDialect,
20550            >,
20551            offset: usize,
20552            _depth: fidl::encoding::Depth,
20553        ) -> fidl::Result<()> {
20554            decoder.debug_check_bounds::<Self>(offset);
20555            // Verify that padding bytes are zero.
20556            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
20557            let padval = unsafe { (ptr as *const u64).read_unaligned() };
20558            let mask = 0xffffffff00000000u64;
20559            let maskedval = padval & mask;
20560            if maskedval != 0 {
20561                return Err(fidl::Error::NonZeroPadding {
20562                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
20563                });
20564            }
20565            fidl::decode!(
20566                fidl::encoding::BoundedString<255>,
20567                fidl::encoding::DefaultFuchsiaResourceDialect,
20568                &mut self.name,
20569                decoder,
20570                offset + 0,
20571                _depth
20572            )?;
20573            fidl::decode!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.target, decoder, offset + 16, _depth)?;
20574            fidl::decode!(
20575                fidl::encoding::Optional<
20576                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
20577                >,
20578                fidl::encoding::DefaultFuchsiaResourceDialect,
20579                &mut self.connection,
20580                decoder,
20581                offset + 32,
20582                _depth
20583            )?;
20584            Ok(())
20585        }
20586    }
20587
20588    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedOpenRequest {
20589        type Borrowed<'a> = &'a mut Self;
20590        fn take_or_borrow<'a>(
20591            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20592        ) -> Self::Borrowed<'a> {
20593            value
20594        }
20595    }
20596
20597    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedOpenRequest {
20598        type Owned = Self;
20599
20600        #[inline(always)]
20601        fn inline_align(_context: fidl::encoding::Context) -> usize {
20602            8
20603        }
20604
20605        #[inline(always)]
20606        fn inline_size(_context: fidl::encoding::Context) -> usize {
20607            32
20608        }
20609    }
20610
20611    unsafe impl
20612        fidl::encoding::Encode<
20613            DirectoryDeprecatedOpenRequest,
20614            fidl::encoding::DefaultFuchsiaResourceDialect,
20615        > for &mut DirectoryDeprecatedOpenRequest
20616    {
20617        #[inline]
20618        unsafe fn encode(
20619            self,
20620            encoder: &mut fidl::encoding::Encoder<
20621                '_,
20622                fidl::encoding::DefaultFuchsiaResourceDialect,
20623            >,
20624            offset: usize,
20625            _depth: fidl::encoding::Depth,
20626        ) -> fidl::Result<()> {
20627            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
20628            // Delegate to tuple encoding.
20629            fidl::encoding::Encode::<DirectoryDeprecatedOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
20630                (
20631                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
20632                    <ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
20633                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
20634                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
20635                ),
20636                encoder, offset, _depth
20637            )
20638        }
20639    }
20640    unsafe impl<
20641            T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
20642            T1: fidl::encoding::Encode<ModeType, fidl::encoding::DefaultFuchsiaResourceDialect>,
20643            T2: fidl::encoding::Encode<
20644                fidl::encoding::BoundedString<4095>,
20645                fidl::encoding::DefaultFuchsiaResourceDialect,
20646            >,
20647            T3: fidl::encoding::Encode<
20648                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
20649                fidl::encoding::DefaultFuchsiaResourceDialect,
20650            >,
20651        >
20652        fidl::encoding::Encode<
20653            DirectoryDeprecatedOpenRequest,
20654            fidl::encoding::DefaultFuchsiaResourceDialect,
20655        > for (T0, T1, T2, T3)
20656    {
20657        #[inline]
20658        unsafe fn encode(
20659            self,
20660            encoder: &mut fidl::encoding::Encoder<
20661                '_,
20662                fidl::encoding::DefaultFuchsiaResourceDialect,
20663            >,
20664            offset: usize,
20665            depth: fidl::encoding::Depth,
20666        ) -> fidl::Result<()> {
20667            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
20668            // Zero out padding regions. There's no need to apply masks
20669            // because the unmasked parts will be overwritten by fields.
20670            unsafe {
20671                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
20672                (ptr as *mut u64).write_unaligned(0);
20673            }
20674            // Write the fields.
20675            self.0.encode(encoder, offset + 0, depth)?;
20676            self.1.encode(encoder, offset + 4, depth)?;
20677            self.2.encode(encoder, offset + 8, depth)?;
20678            self.3.encode(encoder, offset + 24, depth)?;
20679            Ok(())
20680        }
20681    }
20682
20683    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20684        for DirectoryDeprecatedOpenRequest
20685    {
20686        #[inline(always)]
20687        fn new_empty() -> Self {
20688            Self {
20689                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
20690                mode: fidl::new_empty!(ModeType, fidl::encoding::DefaultFuchsiaResourceDialect),
20691                path: fidl::new_empty!(
20692                    fidl::encoding::BoundedString<4095>,
20693                    fidl::encoding::DefaultFuchsiaResourceDialect
20694                ),
20695                object: fidl::new_empty!(
20696                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
20697                    fidl::encoding::DefaultFuchsiaResourceDialect
20698                ),
20699            }
20700        }
20701
20702        #[inline]
20703        unsafe fn decode(
20704            &mut self,
20705            decoder: &mut fidl::encoding::Decoder<
20706                '_,
20707                fidl::encoding::DefaultFuchsiaResourceDialect,
20708            >,
20709            offset: usize,
20710            _depth: fidl::encoding::Depth,
20711        ) -> fidl::Result<()> {
20712            decoder.debug_check_bounds::<Self>(offset);
20713            // Verify that padding bytes are zero.
20714            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
20715            let padval = unsafe { (ptr as *const u64).read_unaligned() };
20716            let mask = 0xffffffff00000000u64;
20717            let maskedval = padval & mask;
20718            if maskedval != 0 {
20719                return Err(fidl::Error::NonZeroPadding {
20720                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
20721                });
20722            }
20723            fidl::decode!(
20724                OpenFlags,
20725                fidl::encoding::DefaultFuchsiaResourceDialect,
20726                &mut self.flags,
20727                decoder,
20728                offset + 0,
20729                _depth
20730            )?;
20731            fidl::decode!(
20732                ModeType,
20733                fidl::encoding::DefaultFuchsiaResourceDialect,
20734                &mut self.mode,
20735                decoder,
20736                offset + 4,
20737                _depth
20738            )?;
20739            fidl::decode!(
20740                fidl::encoding::BoundedString<4095>,
20741                fidl::encoding::DefaultFuchsiaResourceDialect,
20742                &mut self.path,
20743                decoder,
20744                offset + 8,
20745                _depth
20746            )?;
20747            fidl::decode!(
20748                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
20749                fidl::encoding::DefaultFuchsiaResourceDialect,
20750                &mut self.object,
20751                decoder,
20752                offset + 24,
20753                _depth
20754            )?;
20755            Ok(())
20756        }
20757    }
20758
20759    impl fidl::encoding::ResourceTypeMarker for DirectoryGetTokenResponse {
20760        type Borrowed<'a> = &'a mut Self;
20761        fn take_or_borrow<'a>(
20762            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20763        ) -> Self::Borrowed<'a> {
20764            value
20765        }
20766    }
20767
20768    unsafe impl fidl::encoding::TypeMarker for DirectoryGetTokenResponse {
20769        type Owned = Self;
20770
20771        #[inline(always)]
20772        fn inline_align(_context: fidl::encoding::Context) -> usize {
20773            4
20774        }
20775
20776        #[inline(always)]
20777        fn inline_size(_context: fidl::encoding::Context) -> usize {
20778            8
20779        }
20780    }
20781
20782    unsafe impl
20783        fidl::encoding::Encode<
20784            DirectoryGetTokenResponse,
20785            fidl::encoding::DefaultFuchsiaResourceDialect,
20786        > for &mut DirectoryGetTokenResponse
20787    {
20788        #[inline]
20789        unsafe fn encode(
20790            self,
20791            encoder: &mut fidl::encoding::Encoder<
20792                '_,
20793                fidl::encoding::DefaultFuchsiaResourceDialect,
20794            >,
20795            offset: usize,
20796            _depth: fidl::encoding::Depth,
20797        ) -> fidl::Result<()> {
20798            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
20799            // Delegate to tuple encoding.
20800            fidl::encoding::Encode::<
20801                DirectoryGetTokenResponse,
20802                fidl::encoding::DefaultFuchsiaResourceDialect,
20803            >::encode(
20804                (
20805                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
20806                    <fidl::encoding::Optional<
20807                        fidl::encoding::HandleType<
20808                            fidl::Handle,
20809                            { fidl::ObjectType::NONE.into_raw() },
20810                            2147483648,
20811                        >,
20812                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20813                        &mut self.token
20814                    ),
20815                ),
20816                encoder,
20817                offset,
20818                _depth,
20819            )
20820        }
20821    }
20822    unsafe impl<
20823            T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
20824            T1: fidl::encoding::Encode<
20825                fidl::encoding::Optional<
20826                    fidl::encoding::HandleType<
20827                        fidl::Handle,
20828                        { fidl::ObjectType::NONE.into_raw() },
20829                        2147483648,
20830                    >,
20831                >,
20832                fidl::encoding::DefaultFuchsiaResourceDialect,
20833            >,
20834        >
20835        fidl::encoding::Encode<
20836            DirectoryGetTokenResponse,
20837            fidl::encoding::DefaultFuchsiaResourceDialect,
20838        > for (T0, T1)
20839    {
20840        #[inline]
20841        unsafe fn encode(
20842            self,
20843            encoder: &mut fidl::encoding::Encoder<
20844                '_,
20845                fidl::encoding::DefaultFuchsiaResourceDialect,
20846            >,
20847            offset: usize,
20848            depth: fidl::encoding::Depth,
20849        ) -> fidl::Result<()> {
20850            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
20851            // Zero out padding regions. There's no need to apply masks
20852            // because the unmasked parts will be overwritten by fields.
20853            // Write the fields.
20854            self.0.encode(encoder, offset + 0, depth)?;
20855            self.1.encode(encoder, offset + 4, depth)?;
20856            Ok(())
20857        }
20858    }
20859
20860    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20861        for DirectoryGetTokenResponse
20862    {
20863        #[inline(always)]
20864        fn new_empty() -> Self {
20865            Self {
20866                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
20867                token: fidl::new_empty!(
20868                    fidl::encoding::Optional<
20869                        fidl::encoding::HandleType<
20870                            fidl::Handle,
20871                            { fidl::ObjectType::NONE.into_raw() },
20872                            2147483648,
20873                        >,
20874                    >,
20875                    fidl::encoding::DefaultFuchsiaResourceDialect
20876                ),
20877            }
20878        }
20879
20880        #[inline]
20881        unsafe fn decode(
20882            &mut self,
20883            decoder: &mut fidl::encoding::Decoder<
20884                '_,
20885                fidl::encoding::DefaultFuchsiaResourceDialect,
20886            >,
20887            offset: usize,
20888            _depth: fidl::encoding::Depth,
20889        ) -> fidl::Result<()> {
20890            decoder.debug_check_bounds::<Self>(offset);
20891            // Verify that padding bytes are zero.
20892            fidl::decode!(
20893                i32,
20894                fidl::encoding::DefaultFuchsiaResourceDialect,
20895                &mut self.s,
20896                decoder,
20897                offset + 0,
20898                _depth
20899            )?;
20900            fidl::decode!(
20901                fidl::encoding::Optional<
20902                    fidl::encoding::HandleType<
20903                        fidl::Handle,
20904                        { fidl::ObjectType::NONE.into_raw() },
20905                        2147483648,
20906                    >,
20907                >,
20908                fidl::encoding::DefaultFuchsiaResourceDialect,
20909                &mut self.token,
20910                decoder,
20911                offset + 4,
20912                _depth
20913            )?;
20914            Ok(())
20915        }
20916    }
20917
20918    impl fidl::encoding::ResourceTypeMarker for DirectoryLinkRequest {
20919        type Borrowed<'a> = &'a mut Self;
20920        fn take_or_borrow<'a>(
20921            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20922        ) -> Self::Borrowed<'a> {
20923            value
20924        }
20925    }
20926
20927    unsafe impl fidl::encoding::TypeMarker for DirectoryLinkRequest {
20928        type Owned = Self;
20929
20930        #[inline(always)]
20931        fn inline_align(_context: fidl::encoding::Context) -> usize {
20932            8
20933        }
20934
20935        #[inline(always)]
20936        fn inline_size(_context: fidl::encoding::Context) -> usize {
20937            40
20938        }
20939    }
20940
20941    unsafe impl
20942        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
20943        for &mut DirectoryLinkRequest
20944    {
20945        #[inline]
20946        unsafe fn encode(
20947            self,
20948            encoder: &mut fidl::encoding::Encoder<
20949                '_,
20950                fidl::encoding::DefaultFuchsiaResourceDialect,
20951            >,
20952            offset: usize,
20953            _depth: fidl::encoding::Depth,
20954        ) -> fidl::Result<()> {
20955            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
20956            // Delegate to tuple encoding.
20957            fidl::encoding::Encode::<
20958                DirectoryLinkRequest,
20959                fidl::encoding::DefaultFuchsiaResourceDialect,
20960            >::encode(
20961                (
20962                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
20963                        &self.src,
20964                    ),
20965                    <fidl::encoding::HandleType<
20966                        fidl::Handle,
20967                        { fidl::ObjectType::NONE.into_raw() },
20968                        2147483648,
20969                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20970                        &mut self.dst_parent_token,
20971                    ),
20972                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
20973                        &self.dst,
20974                    ),
20975                ),
20976                encoder,
20977                offset,
20978                _depth,
20979            )
20980        }
20981    }
20982    unsafe impl<
20983            T0: fidl::encoding::Encode<
20984                fidl::encoding::BoundedString<255>,
20985                fidl::encoding::DefaultFuchsiaResourceDialect,
20986            >,
20987            T1: fidl::encoding::Encode<
20988                fidl::encoding::HandleType<
20989                    fidl::Handle,
20990                    { fidl::ObjectType::NONE.into_raw() },
20991                    2147483648,
20992                >,
20993                fidl::encoding::DefaultFuchsiaResourceDialect,
20994            >,
20995            T2: fidl::encoding::Encode<
20996                fidl::encoding::BoundedString<255>,
20997                fidl::encoding::DefaultFuchsiaResourceDialect,
20998            >,
20999        >
21000        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21001        for (T0, T1, T2)
21002    {
21003        #[inline]
21004        unsafe fn encode(
21005            self,
21006            encoder: &mut fidl::encoding::Encoder<
21007                '_,
21008                fidl::encoding::DefaultFuchsiaResourceDialect,
21009            >,
21010            offset: usize,
21011            depth: fidl::encoding::Depth,
21012        ) -> fidl::Result<()> {
21013            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
21014            // Zero out padding regions. There's no need to apply masks
21015            // because the unmasked parts will be overwritten by fields.
21016            unsafe {
21017                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21018                (ptr as *mut u64).write_unaligned(0);
21019            }
21020            // Write the fields.
21021            self.0.encode(encoder, offset + 0, depth)?;
21022            self.1.encode(encoder, offset + 16, depth)?;
21023            self.2.encode(encoder, offset + 24, depth)?;
21024            Ok(())
21025        }
21026    }
21027
21028    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21029        for DirectoryLinkRequest
21030    {
21031        #[inline(always)]
21032        fn new_empty() -> Self {
21033            Self {
21034                src: fidl::new_empty!(
21035                    fidl::encoding::BoundedString<255>,
21036                    fidl::encoding::DefaultFuchsiaResourceDialect
21037                ),
21038                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21039                dst: fidl::new_empty!(
21040                    fidl::encoding::BoundedString<255>,
21041                    fidl::encoding::DefaultFuchsiaResourceDialect
21042                ),
21043            }
21044        }
21045
21046        #[inline]
21047        unsafe fn decode(
21048            &mut self,
21049            decoder: &mut fidl::encoding::Decoder<
21050                '_,
21051                fidl::encoding::DefaultFuchsiaResourceDialect,
21052            >,
21053            offset: usize,
21054            _depth: fidl::encoding::Depth,
21055        ) -> fidl::Result<()> {
21056            decoder.debug_check_bounds::<Self>(offset);
21057            // Verify that padding bytes are zero.
21058            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21059            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21060            let mask = 0xffffffff00000000u64;
21061            let maskedval = padval & mask;
21062            if maskedval != 0 {
21063                return Err(fidl::Error::NonZeroPadding {
21064                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21065                });
21066            }
21067            fidl::decode!(
21068                fidl::encoding::BoundedString<255>,
21069                fidl::encoding::DefaultFuchsiaResourceDialect,
21070                &mut self.src,
21071                decoder,
21072                offset + 0,
21073                _depth
21074            )?;
21075            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)?;
21076            fidl::decode!(
21077                fidl::encoding::BoundedString<255>,
21078                fidl::encoding::DefaultFuchsiaResourceDialect,
21079                &mut self.dst,
21080                decoder,
21081                offset + 24,
21082                _depth
21083            )?;
21084            Ok(())
21085        }
21086    }
21087
21088    impl fidl::encoding::ResourceTypeMarker for DirectoryOpenRequest {
21089        type Borrowed<'a> = &'a mut Self;
21090        fn take_or_borrow<'a>(
21091            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21092        ) -> Self::Borrowed<'a> {
21093            value
21094        }
21095    }
21096
21097    unsafe impl fidl::encoding::TypeMarker for DirectoryOpenRequest {
21098        type Owned = Self;
21099
21100        #[inline(always)]
21101        fn inline_align(_context: fidl::encoding::Context) -> usize {
21102            8
21103        }
21104
21105        #[inline(always)]
21106        fn inline_size(_context: fidl::encoding::Context) -> usize {
21107            48
21108        }
21109    }
21110
21111    unsafe impl
21112        fidl::encoding::Encode<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21113        for &mut DirectoryOpenRequest
21114    {
21115        #[inline]
21116        unsafe fn encode(
21117            self,
21118            encoder: &mut fidl::encoding::Encoder<
21119                '_,
21120                fidl::encoding::DefaultFuchsiaResourceDialect,
21121            >,
21122            offset: usize,
21123            _depth: fidl::encoding::Depth,
21124        ) -> fidl::Result<()> {
21125            encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
21126            // Delegate to tuple encoding.
21127            fidl::encoding::Encode::<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21128                (
21129                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
21130                    <Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
21131                    <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
21132                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
21133                ),
21134                encoder, offset, _depth
21135            )
21136        }
21137    }
21138    unsafe impl<
21139            T0: fidl::encoding::Encode<
21140                fidl::encoding::BoundedString<4095>,
21141                fidl::encoding::DefaultFuchsiaResourceDialect,
21142            >,
21143            T1: fidl::encoding::Encode<Flags, fidl::encoding::DefaultFuchsiaResourceDialect>,
21144            T2: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
21145            T3: fidl::encoding::Encode<
21146                fidl::encoding::HandleType<
21147                    fidl::Channel,
21148                    { fidl::ObjectType::CHANNEL.into_raw() },
21149                    2147483648,
21150                >,
21151                fidl::encoding::DefaultFuchsiaResourceDialect,
21152            >,
21153        >
21154        fidl::encoding::Encode<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21155        for (T0, T1, T2, T3)
21156    {
21157        #[inline]
21158        unsafe fn encode(
21159            self,
21160            encoder: &mut fidl::encoding::Encoder<
21161                '_,
21162                fidl::encoding::DefaultFuchsiaResourceDialect,
21163            >,
21164            offset: usize,
21165            depth: fidl::encoding::Depth,
21166        ) -> fidl::Result<()> {
21167            encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
21168            // Zero out padding regions. There's no need to apply masks
21169            // because the unmasked parts will be overwritten by fields.
21170            unsafe {
21171                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
21172                (ptr as *mut u64).write_unaligned(0);
21173            }
21174            // Write the fields.
21175            self.0.encode(encoder, offset + 0, depth)?;
21176            self.1.encode(encoder, offset + 16, depth)?;
21177            self.2.encode(encoder, offset + 24, depth)?;
21178            self.3.encode(encoder, offset + 40, depth)?;
21179            Ok(())
21180        }
21181    }
21182
21183    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21184        for DirectoryOpenRequest
21185    {
21186        #[inline(always)]
21187        fn new_empty() -> Self {
21188            Self {
21189                path: fidl::new_empty!(
21190                    fidl::encoding::BoundedString<4095>,
21191                    fidl::encoding::DefaultFuchsiaResourceDialect
21192                ),
21193                flags: fidl::new_empty!(Flags, fidl::encoding::DefaultFuchsiaResourceDialect),
21194                options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
21195                object: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21196            }
21197        }
21198
21199        #[inline]
21200        unsafe fn decode(
21201            &mut self,
21202            decoder: &mut fidl::encoding::Decoder<
21203                '_,
21204                fidl::encoding::DefaultFuchsiaResourceDialect,
21205            >,
21206            offset: usize,
21207            _depth: fidl::encoding::Depth,
21208        ) -> fidl::Result<()> {
21209            decoder.debug_check_bounds::<Self>(offset);
21210            // Verify that padding bytes are zero.
21211            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
21212            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21213            let mask = 0xffffffff00000000u64;
21214            let maskedval = padval & mask;
21215            if maskedval != 0 {
21216                return Err(fidl::Error::NonZeroPadding {
21217                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
21218                });
21219            }
21220            fidl::decode!(
21221                fidl::encoding::BoundedString<4095>,
21222                fidl::encoding::DefaultFuchsiaResourceDialect,
21223                &mut self.path,
21224                decoder,
21225                offset + 0,
21226                _depth
21227            )?;
21228            fidl::decode!(
21229                Flags,
21230                fidl::encoding::DefaultFuchsiaResourceDialect,
21231                &mut self.flags,
21232                decoder,
21233                offset + 16,
21234                _depth
21235            )?;
21236            fidl::decode!(
21237                Options,
21238                fidl::encoding::DefaultFuchsiaResourceDialect,
21239                &mut self.options,
21240                decoder,
21241                offset + 24,
21242                _depth
21243            )?;
21244            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.object, decoder, offset + 40, _depth)?;
21245            Ok(())
21246        }
21247    }
21248
21249    impl fidl::encoding::ResourceTypeMarker for DirectoryRenameRequest {
21250        type Borrowed<'a> = &'a mut Self;
21251        fn take_or_borrow<'a>(
21252            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21253        ) -> Self::Borrowed<'a> {
21254            value
21255        }
21256    }
21257
21258    unsafe impl fidl::encoding::TypeMarker for DirectoryRenameRequest {
21259        type Owned = Self;
21260
21261        #[inline(always)]
21262        fn inline_align(_context: fidl::encoding::Context) -> usize {
21263            8
21264        }
21265
21266        #[inline(always)]
21267        fn inline_size(_context: fidl::encoding::Context) -> usize {
21268            40
21269        }
21270    }
21271
21272    unsafe impl
21273        fidl::encoding::Encode<
21274            DirectoryRenameRequest,
21275            fidl::encoding::DefaultFuchsiaResourceDialect,
21276        > for &mut DirectoryRenameRequest
21277    {
21278        #[inline]
21279        unsafe fn encode(
21280            self,
21281            encoder: &mut fidl::encoding::Encoder<
21282                '_,
21283                fidl::encoding::DefaultFuchsiaResourceDialect,
21284            >,
21285            offset: usize,
21286            _depth: fidl::encoding::Depth,
21287        ) -> fidl::Result<()> {
21288            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
21289            // Delegate to tuple encoding.
21290            fidl::encoding::Encode::<
21291                DirectoryRenameRequest,
21292                fidl::encoding::DefaultFuchsiaResourceDialect,
21293            >::encode(
21294                (
21295                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21296                        &self.src,
21297                    ),
21298                    <fidl::encoding::HandleType<
21299                        fidl::Event,
21300                        { fidl::ObjectType::EVENT.into_raw() },
21301                        2147483648,
21302                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21303                        &mut self.dst_parent_token,
21304                    ),
21305                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21306                        &self.dst,
21307                    ),
21308                ),
21309                encoder,
21310                offset,
21311                _depth,
21312            )
21313        }
21314    }
21315    unsafe impl<
21316            T0: fidl::encoding::Encode<
21317                fidl::encoding::BoundedString<255>,
21318                fidl::encoding::DefaultFuchsiaResourceDialect,
21319            >,
21320            T1: fidl::encoding::Encode<
21321                fidl::encoding::HandleType<
21322                    fidl::Event,
21323                    { fidl::ObjectType::EVENT.into_raw() },
21324                    2147483648,
21325                >,
21326                fidl::encoding::DefaultFuchsiaResourceDialect,
21327            >,
21328            T2: fidl::encoding::Encode<
21329                fidl::encoding::BoundedString<255>,
21330                fidl::encoding::DefaultFuchsiaResourceDialect,
21331            >,
21332        >
21333        fidl::encoding::Encode<
21334            DirectoryRenameRequest,
21335            fidl::encoding::DefaultFuchsiaResourceDialect,
21336        > for (T0, T1, T2)
21337    {
21338        #[inline]
21339        unsafe fn encode(
21340            self,
21341            encoder: &mut fidl::encoding::Encoder<
21342                '_,
21343                fidl::encoding::DefaultFuchsiaResourceDialect,
21344            >,
21345            offset: usize,
21346            depth: fidl::encoding::Depth,
21347        ) -> fidl::Result<()> {
21348            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
21349            // Zero out padding regions. There's no need to apply masks
21350            // because the unmasked parts will be overwritten by fields.
21351            unsafe {
21352                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21353                (ptr as *mut u64).write_unaligned(0);
21354            }
21355            // Write the fields.
21356            self.0.encode(encoder, offset + 0, depth)?;
21357            self.1.encode(encoder, offset + 16, depth)?;
21358            self.2.encode(encoder, offset + 24, depth)?;
21359            Ok(())
21360        }
21361    }
21362
21363    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21364        for DirectoryRenameRequest
21365    {
21366        #[inline(always)]
21367        fn new_empty() -> Self {
21368            Self {
21369                src: fidl::new_empty!(
21370                    fidl::encoding::BoundedString<255>,
21371                    fidl::encoding::DefaultFuchsiaResourceDialect
21372                ),
21373                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21374                dst: fidl::new_empty!(
21375                    fidl::encoding::BoundedString<255>,
21376                    fidl::encoding::DefaultFuchsiaResourceDialect
21377                ),
21378            }
21379        }
21380
21381        #[inline]
21382        unsafe fn decode(
21383            &mut self,
21384            decoder: &mut fidl::encoding::Decoder<
21385                '_,
21386                fidl::encoding::DefaultFuchsiaResourceDialect,
21387            >,
21388            offset: usize,
21389            _depth: fidl::encoding::Depth,
21390        ) -> fidl::Result<()> {
21391            decoder.debug_check_bounds::<Self>(offset);
21392            // Verify that padding bytes are zero.
21393            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21394            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21395            let mask = 0xffffffff00000000u64;
21396            let maskedval = padval & mask;
21397            if maskedval != 0 {
21398                return Err(fidl::Error::NonZeroPadding {
21399                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21400                });
21401            }
21402            fidl::decode!(
21403                fidl::encoding::BoundedString<255>,
21404                fidl::encoding::DefaultFuchsiaResourceDialect,
21405                &mut self.src,
21406                decoder,
21407                offset + 0,
21408                _depth
21409            )?;
21410            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)?;
21411            fidl::decode!(
21412                fidl::encoding::BoundedString<255>,
21413                fidl::encoding::DefaultFuchsiaResourceDialect,
21414                &mut self.dst,
21415                decoder,
21416                offset + 24,
21417                _depth
21418            )?;
21419            Ok(())
21420        }
21421    }
21422
21423    impl fidl::encoding::ResourceTypeMarker for DirectoryWatchRequest {
21424        type Borrowed<'a> = &'a mut Self;
21425        fn take_or_borrow<'a>(
21426            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21427        ) -> Self::Borrowed<'a> {
21428            value
21429        }
21430    }
21431
21432    unsafe impl fidl::encoding::TypeMarker for DirectoryWatchRequest {
21433        type Owned = Self;
21434
21435        #[inline(always)]
21436        fn inline_align(_context: fidl::encoding::Context) -> usize {
21437            4
21438        }
21439
21440        #[inline(always)]
21441        fn inline_size(_context: fidl::encoding::Context) -> usize {
21442            12
21443        }
21444    }
21445
21446    unsafe impl
21447        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21448        for &mut DirectoryWatchRequest
21449    {
21450        #[inline]
21451        unsafe fn encode(
21452            self,
21453            encoder: &mut fidl::encoding::Encoder<
21454                '_,
21455                fidl::encoding::DefaultFuchsiaResourceDialect,
21456            >,
21457            offset: usize,
21458            _depth: fidl::encoding::Depth,
21459        ) -> fidl::Result<()> {
21460            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
21461            // Delegate to tuple encoding.
21462            fidl::encoding::Encode::<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21463                (
21464                    <WatchMask as fidl::encoding::ValueTypeMarker>::borrow(&self.mask),
21465                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
21466                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
21467                ),
21468                encoder, offset, _depth
21469            )
21470        }
21471    }
21472    unsafe impl<
21473            T0: fidl::encoding::Encode<WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect>,
21474            T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
21475            T2: fidl::encoding::Encode<
21476                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
21477                fidl::encoding::DefaultFuchsiaResourceDialect,
21478            >,
21479        >
21480        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21481        for (T0, T1, T2)
21482    {
21483        #[inline]
21484        unsafe fn encode(
21485            self,
21486            encoder: &mut fidl::encoding::Encoder<
21487                '_,
21488                fidl::encoding::DefaultFuchsiaResourceDialect,
21489            >,
21490            offset: usize,
21491            depth: fidl::encoding::Depth,
21492        ) -> fidl::Result<()> {
21493            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
21494            // Zero out padding regions. There's no need to apply masks
21495            // because the unmasked parts will be overwritten by fields.
21496            // Write the fields.
21497            self.0.encode(encoder, offset + 0, depth)?;
21498            self.1.encode(encoder, offset + 4, depth)?;
21499            self.2.encode(encoder, offset + 8, depth)?;
21500            Ok(())
21501        }
21502    }
21503
21504    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21505        for DirectoryWatchRequest
21506    {
21507        #[inline(always)]
21508        fn new_empty() -> Self {
21509            Self {
21510                mask: fidl::new_empty!(WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect),
21511                options: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
21512                watcher: fidl::new_empty!(
21513                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
21514                    fidl::encoding::DefaultFuchsiaResourceDialect
21515                ),
21516            }
21517        }
21518
21519        #[inline]
21520        unsafe fn decode(
21521            &mut self,
21522            decoder: &mut fidl::encoding::Decoder<
21523                '_,
21524                fidl::encoding::DefaultFuchsiaResourceDialect,
21525            >,
21526            offset: usize,
21527            _depth: fidl::encoding::Depth,
21528        ) -> fidl::Result<()> {
21529            decoder.debug_check_bounds::<Self>(offset);
21530            // Verify that padding bytes are zero.
21531            fidl::decode!(
21532                WatchMask,
21533                fidl::encoding::DefaultFuchsiaResourceDialect,
21534                &mut self.mask,
21535                decoder,
21536                offset + 0,
21537                _depth
21538            )?;
21539            fidl::decode!(
21540                u32,
21541                fidl::encoding::DefaultFuchsiaResourceDialect,
21542                &mut self.options,
21543                decoder,
21544                offset + 4,
21545                _depth
21546            )?;
21547            fidl::decode!(
21548                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
21549                fidl::encoding::DefaultFuchsiaResourceDialect,
21550                &mut self.watcher,
21551                decoder,
21552                offset + 8,
21553                _depth
21554            )?;
21555            Ok(())
21556        }
21557    }
21558
21559    impl fidl::encoding::ResourceTypeMarker for FileAllocateRequest {
21560        type Borrowed<'a> = &'a mut Self;
21561        fn take_or_borrow<'a>(
21562            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21563        ) -> Self::Borrowed<'a> {
21564            value
21565        }
21566    }
21567
21568    unsafe impl fidl::encoding::TypeMarker for FileAllocateRequest {
21569        type Owned = Self;
21570
21571        #[inline(always)]
21572        fn inline_align(_context: fidl::encoding::Context) -> usize {
21573            8
21574        }
21575
21576        #[inline(always)]
21577        fn inline_size(_context: fidl::encoding::Context) -> usize {
21578            24
21579        }
21580    }
21581
21582    unsafe impl
21583        fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21584        for &mut FileAllocateRequest
21585    {
21586        #[inline]
21587        unsafe fn encode(
21588            self,
21589            encoder: &mut fidl::encoding::Encoder<
21590                '_,
21591                fidl::encoding::DefaultFuchsiaResourceDialect,
21592            >,
21593            offset: usize,
21594            _depth: fidl::encoding::Depth,
21595        ) -> fidl::Result<()> {
21596            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
21597            // Delegate to tuple encoding.
21598            fidl::encoding::Encode::<
21599                FileAllocateRequest,
21600                fidl::encoding::DefaultFuchsiaResourceDialect,
21601            >::encode(
21602                (
21603                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
21604                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
21605                    <AllocateMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
21606                ),
21607                encoder,
21608                offset,
21609                _depth,
21610            )
21611        }
21612    }
21613    unsafe impl<
21614            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
21615            T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
21616            T2: fidl::encoding::Encode<AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect>,
21617        >
21618        fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21619        for (T0, T1, T2)
21620    {
21621        #[inline]
21622        unsafe fn encode(
21623            self,
21624            encoder: &mut fidl::encoding::Encoder<
21625                '_,
21626                fidl::encoding::DefaultFuchsiaResourceDialect,
21627            >,
21628            offset: usize,
21629            depth: fidl::encoding::Depth,
21630        ) -> fidl::Result<()> {
21631            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
21632            // Zero out padding regions. There's no need to apply masks
21633            // because the unmasked parts will be overwritten by fields.
21634            unsafe {
21635                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21636                (ptr as *mut u64).write_unaligned(0);
21637            }
21638            // Write the fields.
21639            self.0.encode(encoder, offset + 0, depth)?;
21640            self.1.encode(encoder, offset + 8, depth)?;
21641            self.2.encode(encoder, offset + 16, depth)?;
21642            Ok(())
21643        }
21644    }
21645
21646    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21647        for FileAllocateRequest
21648    {
21649        #[inline(always)]
21650        fn new_empty() -> Self {
21651            Self {
21652                offset: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
21653                length: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
21654                mode: fidl::new_empty!(AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect),
21655            }
21656        }
21657
21658        #[inline]
21659        unsafe fn decode(
21660            &mut self,
21661            decoder: &mut fidl::encoding::Decoder<
21662                '_,
21663                fidl::encoding::DefaultFuchsiaResourceDialect,
21664            >,
21665            offset: usize,
21666            _depth: fidl::encoding::Depth,
21667        ) -> fidl::Result<()> {
21668            decoder.debug_check_bounds::<Self>(offset);
21669            // Verify that padding bytes are zero.
21670            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21671            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21672            let mask = 0xffffffff00000000u64;
21673            let maskedval = padval & mask;
21674            if maskedval != 0 {
21675                return Err(fidl::Error::NonZeroPadding {
21676                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21677                });
21678            }
21679            fidl::decode!(
21680                u64,
21681                fidl::encoding::DefaultFuchsiaResourceDialect,
21682                &mut self.offset,
21683                decoder,
21684                offset + 0,
21685                _depth
21686            )?;
21687            fidl::decode!(
21688                u64,
21689                fidl::encoding::DefaultFuchsiaResourceDialect,
21690                &mut self.length,
21691                decoder,
21692                offset + 8,
21693                _depth
21694            )?;
21695            fidl::decode!(
21696                AllocateMode,
21697                fidl::encoding::DefaultFuchsiaResourceDialect,
21698                &mut self.mode,
21699                decoder,
21700                offset + 16,
21701                _depth
21702            )?;
21703            Ok(())
21704        }
21705    }
21706
21707    impl fidl::encoding::ResourceTypeMarker for FileEnableVerityRequest {
21708        type Borrowed<'a> = &'a mut Self;
21709        fn take_or_borrow<'a>(
21710            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21711        ) -> Self::Borrowed<'a> {
21712            value
21713        }
21714    }
21715
21716    unsafe impl fidl::encoding::TypeMarker for FileEnableVerityRequest {
21717        type Owned = Self;
21718
21719        #[inline(always)]
21720        fn inline_align(_context: fidl::encoding::Context) -> usize {
21721            8
21722        }
21723
21724        #[inline(always)]
21725        fn inline_size(_context: fidl::encoding::Context) -> usize {
21726            16
21727        }
21728    }
21729
21730    unsafe impl
21731        fidl::encoding::Encode<
21732            FileEnableVerityRequest,
21733            fidl::encoding::DefaultFuchsiaResourceDialect,
21734        > for &mut FileEnableVerityRequest
21735    {
21736        #[inline]
21737        unsafe fn encode(
21738            self,
21739            encoder: &mut fidl::encoding::Encoder<
21740                '_,
21741                fidl::encoding::DefaultFuchsiaResourceDialect,
21742            >,
21743            offset: usize,
21744            _depth: fidl::encoding::Depth,
21745        ) -> fidl::Result<()> {
21746            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
21747            // Delegate to tuple encoding.
21748            fidl::encoding::Encode::<
21749                FileEnableVerityRequest,
21750                fidl::encoding::DefaultFuchsiaResourceDialect,
21751            >::encode(
21752                (<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
21753                encoder,
21754                offset,
21755                _depth,
21756            )
21757        }
21758    }
21759    unsafe impl<
21760            T0: fidl::encoding::Encode<
21761                VerificationOptions,
21762                fidl::encoding::DefaultFuchsiaResourceDialect,
21763            >,
21764        >
21765        fidl::encoding::Encode<
21766            FileEnableVerityRequest,
21767            fidl::encoding::DefaultFuchsiaResourceDialect,
21768        > for (T0,)
21769    {
21770        #[inline]
21771        unsafe fn encode(
21772            self,
21773            encoder: &mut fidl::encoding::Encoder<
21774                '_,
21775                fidl::encoding::DefaultFuchsiaResourceDialect,
21776            >,
21777            offset: usize,
21778            depth: fidl::encoding::Depth,
21779        ) -> fidl::Result<()> {
21780            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
21781            // Zero out padding regions. There's no need to apply masks
21782            // because the unmasked parts will be overwritten by fields.
21783            // Write the fields.
21784            self.0.encode(encoder, offset + 0, depth)?;
21785            Ok(())
21786        }
21787    }
21788
21789    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21790        for FileEnableVerityRequest
21791    {
21792        #[inline(always)]
21793        fn new_empty() -> Self {
21794            Self {
21795                options: fidl::new_empty!(
21796                    VerificationOptions,
21797                    fidl::encoding::DefaultFuchsiaResourceDialect
21798                ),
21799            }
21800        }
21801
21802        #[inline]
21803        unsafe fn decode(
21804            &mut self,
21805            decoder: &mut fidl::encoding::Decoder<
21806                '_,
21807                fidl::encoding::DefaultFuchsiaResourceDialect,
21808            >,
21809            offset: usize,
21810            _depth: fidl::encoding::Depth,
21811        ) -> fidl::Result<()> {
21812            decoder.debug_check_bounds::<Self>(offset);
21813            // Verify that padding bytes are zero.
21814            fidl::decode!(
21815                VerificationOptions,
21816                fidl::encoding::DefaultFuchsiaResourceDialect,
21817                &mut self.options,
21818                decoder,
21819                offset + 0,
21820                _depth
21821            )?;
21822            Ok(())
21823        }
21824    }
21825
21826    impl fidl::encoding::ResourceTypeMarker for FileObject {
21827        type Borrowed<'a> = &'a mut Self;
21828        fn take_or_borrow<'a>(
21829            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21830        ) -> Self::Borrowed<'a> {
21831            value
21832        }
21833    }
21834
21835    unsafe impl fidl::encoding::TypeMarker for FileObject {
21836        type Owned = Self;
21837
21838        #[inline(always)]
21839        fn inline_align(_context: fidl::encoding::Context) -> usize {
21840            4
21841        }
21842
21843        #[inline(always)]
21844        fn inline_size(_context: fidl::encoding::Context) -> usize {
21845            8
21846        }
21847    }
21848
21849    unsafe impl fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
21850        for &mut FileObject
21851    {
21852        #[inline]
21853        unsafe fn encode(
21854            self,
21855            encoder: &mut fidl::encoding::Encoder<
21856                '_,
21857                fidl::encoding::DefaultFuchsiaResourceDialect,
21858            >,
21859            offset: usize,
21860            _depth: fidl::encoding::Depth,
21861        ) -> fidl::Result<()> {
21862            encoder.debug_check_bounds::<FileObject>(offset);
21863            // Delegate to tuple encoding.
21864            fidl::encoding::Encode::<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21865                (
21866                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.event),
21867                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stream),
21868                ),
21869                encoder, offset, _depth
21870            )
21871        }
21872    }
21873    unsafe impl<
21874            T0: fidl::encoding::Encode<
21875                fidl::encoding::Optional<
21876                    fidl::encoding::HandleType<
21877                        fidl::Event,
21878                        { fidl::ObjectType::EVENT.into_raw() },
21879                        2147483648,
21880                    >,
21881                >,
21882                fidl::encoding::DefaultFuchsiaResourceDialect,
21883            >,
21884            T1: fidl::encoding::Encode<
21885                fidl::encoding::Optional<
21886                    fidl::encoding::HandleType<
21887                        fidl::Stream,
21888                        { fidl::ObjectType::STREAM.into_raw() },
21889                        2147483648,
21890                    >,
21891                >,
21892                fidl::encoding::DefaultFuchsiaResourceDialect,
21893            >,
21894        > fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
21895        for (T0, T1)
21896    {
21897        #[inline]
21898        unsafe fn encode(
21899            self,
21900            encoder: &mut fidl::encoding::Encoder<
21901                '_,
21902                fidl::encoding::DefaultFuchsiaResourceDialect,
21903            >,
21904            offset: usize,
21905            depth: fidl::encoding::Depth,
21906        ) -> fidl::Result<()> {
21907            encoder.debug_check_bounds::<FileObject>(offset);
21908            // Zero out padding regions. There's no need to apply masks
21909            // because the unmasked parts will be overwritten by fields.
21910            // Write the fields.
21911            self.0.encode(encoder, offset + 0, depth)?;
21912            self.1.encode(encoder, offset + 4, depth)?;
21913            Ok(())
21914        }
21915    }
21916
21917    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileObject {
21918        #[inline(always)]
21919        fn new_empty() -> Self {
21920            Self {
21921                event: fidl::new_empty!(
21922                    fidl::encoding::Optional<
21923                        fidl::encoding::HandleType<
21924                            fidl::Event,
21925                            { fidl::ObjectType::EVENT.into_raw() },
21926                            2147483648,
21927                        >,
21928                    >,
21929                    fidl::encoding::DefaultFuchsiaResourceDialect
21930                ),
21931                stream: fidl::new_empty!(
21932                    fidl::encoding::Optional<
21933                        fidl::encoding::HandleType<
21934                            fidl::Stream,
21935                            { fidl::ObjectType::STREAM.into_raw() },
21936                            2147483648,
21937                        >,
21938                    >,
21939                    fidl::encoding::DefaultFuchsiaResourceDialect
21940                ),
21941            }
21942        }
21943
21944        #[inline]
21945        unsafe fn decode(
21946            &mut self,
21947            decoder: &mut fidl::encoding::Decoder<
21948                '_,
21949                fidl::encoding::DefaultFuchsiaResourceDialect,
21950            >,
21951            offset: usize,
21952            _depth: fidl::encoding::Depth,
21953        ) -> fidl::Result<()> {
21954            decoder.debug_check_bounds::<Self>(offset);
21955            // Verify that padding bytes are zero.
21956            fidl::decode!(
21957                fidl::encoding::Optional<
21958                    fidl::encoding::HandleType<
21959                        fidl::Event,
21960                        { fidl::ObjectType::EVENT.into_raw() },
21961                        2147483648,
21962                    >,
21963                >,
21964                fidl::encoding::DefaultFuchsiaResourceDialect,
21965                &mut self.event,
21966                decoder,
21967                offset + 0,
21968                _depth
21969            )?;
21970            fidl::decode!(
21971                fidl::encoding::Optional<
21972                    fidl::encoding::HandleType<
21973                        fidl::Stream,
21974                        { fidl::ObjectType::STREAM.into_raw() },
21975                        2147483648,
21976                    >,
21977                >,
21978                fidl::encoding::DefaultFuchsiaResourceDialect,
21979                &mut self.stream,
21980                decoder,
21981                offset + 4,
21982                _depth
21983            )?;
21984            Ok(())
21985        }
21986    }
21987
21988    impl fidl::encoding::ResourceTypeMarker for FileGetBackingMemoryResponse {
21989        type Borrowed<'a> = &'a mut Self;
21990        fn take_or_borrow<'a>(
21991            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21992        ) -> Self::Borrowed<'a> {
21993            value
21994        }
21995    }
21996
21997    unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryResponse {
21998        type Owned = Self;
21999
22000        #[inline(always)]
22001        fn inline_align(_context: fidl::encoding::Context) -> usize {
22002            4
22003        }
22004
22005        #[inline(always)]
22006        fn inline_size(_context: fidl::encoding::Context) -> usize {
22007            4
22008        }
22009    }
22010
22011    unsafe impl
22012        fidl::encoding::Encode<
22013            FileGetBackingMemoryResponse,
22014            fidl::encoding::DefaultFuchsiaResourceDialect,
22015        > for &mut FileGetBackingMemoryResponse
22016    {
22017        #[inline]
22018        unsafe fn encode(
22019            self,
22020            encoder: &mut fidl::encoding::Encoder<
22021                '_,
22022                fidl::encoding::DefaultFuchsiaResourceDialect,
22023            >,
22024            offset: usize,
22025            _depth: fidl::encoding::Depth,
22026        ) -> fidl::Result<()> {
22027            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
22028            // Delegate to tuple encoding.
22029            fidl::encoding::Encode::<
22030                FileGetBackingMemoryResponse,
22031                fidl::encoding::DefaultFuchsiaResourceDialect,
22032            >::encode(
22033                (<fidl::encoding::HandleType<
22034                    fidl::Vmo,
22035                    { fidl::ObjectType::VMO.into_raw() },
22036                    2147483648,
22037                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22038                    &mut self.vmo
22039                ),),
22040                encoder,
22041                offset,
22042                _depth,
22043            )
22044        }
22045    }
22046    unsafe impl<
22047            T0: fidl::encoding::Encode<
22048                fidl::encoding::HandleType<
22049                    fidl::Vmo,
22050                    { fidl::ObjectType::VMO.into_raw() },
22051                    2147483648,
22052                >,
22053                fidl::encoding::DefaultFuchsiaResourceDialect,
22054            >,
22055        >
22056        fidl::encoding::Encode<
22057            FileGetBackingMemoryResponse,
22058            fidl::encoding::DefaultFuchsiaResourceDialect,
22059        > for (T0,)
22060    {
22061        #[inline]
22062        unsafe fn encode(
22063            self,
22064            encoder: &mut fidl::encoding::Encoder<
22065                '_,
22066                fidl::encoding::DefaultFuchsiaResourceDialect,
22067            >,
22068            offset: usize,
22069            depth: fidl::encoding::Depth,
22070        ) -> fidl::Result<()> {
22071            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
22072            // Zero out padding regions. There's no need to apply masks
22073            // because the unmasked parts will be overwritten by fields.
22074            // Write the fields.
22075            self.0.encode(encoder, offset + 0, depth)?;
22076            Ok(())
22077        }
22078    }
22079
22080    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22081        for FileGetBackingMemoryResponse
22082    {
22083        #[inline(always)]
22084        fn new_empty() -> Self {
22085            Self {
22086                vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22087            }
22088        }
22089
22090        #[inline]
22091        unsafe fn decode(
22092            &mut self,
22093            decoder: &mut fidl::encoding::Decoder<
22094                '_,
22095                fidl::encoding::DefaultFuchsiaResourceDialect,
22096            >,
22097            offset: usize,
22098            _depth: fidl::encoding::Depth,
22099        ) -> fidl::Result<()> {
22100            decoder.debug_check_bounds::<Self>(offset);
22101            // Verify that padding bytes are zero.
22102            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
22103            Ok(())
22104        }
22105    }
22106
22107    impl fidl::encoding::ResourceTypeMarker for LinkableLinkIntoRequest {
22108        type Borrowed<'a> = &'a mut Self;
22109        fn take_or_borrow<'a>(
22110            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22111        ) -> Self::Borrowed<'a> {
22112            value
22113        }
22114    }
22115
22116    unsafe impl fidl::encoding::TypeMarker for LinkableLinkIntoRequest {
22117        type Owned = Self;
22118
22119        #[inline(always)]
22120        fn inline_align(_context: fidl::encoding::Context) -> usize {
22121            8
22122        }
22123
22124        #[inline(always)]
22125        fn inline_size(_context: fidl::encoding::Context) -> usize {
22126            24
22127        }
22128    }
22129
22130    unsafe impl
22131        fidl::encoding::Encode<
22132            LinkableLinkIntoRequest,
22133            fidl::encoding::DefaultFuchsiaResourceDialect,
22134        > for &mut LinkableLinkIntoRequest
22135    {
22136        #[inline]
22137        unsafe fn encode(
22138            self,
22139            encoder: &mut fidl::encoding::Encoder<
22140                '_,
22141                fidl::encoding::DefaultFuchsiaResourceDialect,
22142            >,
22143            offset: usize,
22144            _depth: fidl::encoding::Depth,
22145        ) -> fidl::Result<()> {
22146            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
22147            // Delegate to tuple encoding.
22148            fidl::encoding::Encode::<
22149                LinkableLinkIntoRequest,
22150                fidl::encoding::DefaultFuchsiaResourceDialect,
22151            >::encode(
22152                (
22153                    <fidl::encoding::HandleType<
22154                        fidl::Event,
22155                        { fidl::ObjectType::EVENT.into_raw() },
22156                        2147483648,
22157                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22158                        &mut self.dst_parent_token,
22159                    ),
22160                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
22161                        &self.dst,
22162                    ),
22163                ),
22164                encoder,
22165                offset,
22166                _depth,
22167            )
22168        }
22169    }
22170    unsafe impl<
22171            T0: fidl::encoding::Encode<
22172                fidl::encoding::HandleType<
22173                    fidl::Event,
22174                    { fidl::ObjectType::EVENT.into_raw() },
22175                    2147483648,
22176                >,
22177                fidl::encoding::DefaultFuchsiaResourceDialect,
22178            >,
22179            T1: fidl::encoding::Encode<
22180                fidl::encoding::BoundedString<255>,
22181                fidl::encoding::DefaultFuchsiaResourceDialect,
22182            >,
22183        >
22184        fidl::encoding::Encode<
22185            LinkableLinkIntoRequest,
22186            fidl::encoding::DefaultFuchsiaResourceDialect,
22187        > for (T0, T1)
22188    {
22189        #[inline]
22190        unsafe fn encode(
22191            self,
22192            encoder: &mut fidl::encoding::Encoder<
22193                '_,
22194                fidl::encoding::DefaultFuchsiaResourceDialect,
22195            >,
22196            offset: usize,
22197            depth: fidl::encoding::Depth,
22198        ) -> fidl::Result<()> {
22199            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
22200            // Zero out padding regions. There's no need to apply masks
22201            // because the unmasked parts will be overwritten by fields.
22202            unsafe {
22203                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
22204                (ptr as *mut u64).write_unaligned(0);
22205            }
22206            // Write the fields.
22207            self.0.encode(encoder, offset + 0, depth)?;
22208            self.1.encode(encoder, offset + 8, depth)?;
22209            Ok(())
22210        }
22211    }
22212
22213    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22214        for LinkableLinkIntoRequest
22215    {
22216        #[inline(always)]
22217        fn new_empty() -> Self {
22218            Self {
22219                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22220                dst: fidl::new_empty!(
22221                    fidl::encoding::BoundedString<255>,
22222                    fidl::encoding::DefaultFuchsiaResourceDialect
22223                ),
22224            }
22225        }
22226
22227        #[inline]
22228        unsafe fn decode(
22229            &mut self,
22230            decoder: &mut fidl::encoding::Decoder<
22231                '_,
22232                fidl::encoding::DefaultFuchsiaResourceDialect,
22233            >,
22234            offset: usize,
22235            _depth: fidl::encoding::Depth,
22236        ) -> fidl::Result<()> {
22237            decoder.debug_check_bounds::<Self>(offset);
22238            // Verify that padding bytes are zero.
22239            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
22240            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22241            let mask = 0xffffffff00000000u64;
22242            let maskedval = padval & mask;
22243            if maskedval != 0 {
22244                return Err(fidl::Error::NonZeroPadding {
22245                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
22246                });
22247            }
22248            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)?;
22249            fidl::decode!(
22250                fidl::encoding::BoundedString<255>,
22251                fidl::encoding::DefaultFuchsiaResourceDialect,
22252                &mut self.dst,
22253                decoder,
22254                offset + 8,
22255                _depth
22256            )?;
22257            Ok(())
22258        }
22259    }
22260
22261    impl fidl::encoding::ResourceTypeMarker for NodeDeprecatedCloneRequest {
22262        type Borrowed<'a> = &'a mut Self;
22263        fn take_or_borrow<'a>(
22264            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22265        ) -> Self::Borrowed<'a> {
22266            value
22267        }
22268    }
22269
22270    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedCloneRequest {
22271        type Owned = Self;
22272
22273        #[inline(always)]
22274        fn inline_align(_context: fidl::encoding::Context) -> usize {
22275            4
22276        }
22277
22278        #[inline(always)]
22279        fn inline_size(_context: fidl::encoding::Context) -> usize {
22280            8
22281        }
22282    }
22283
22284    unsafe impl
22285        fidl::encoding::Encode<
22286            NodeDeprecatedCloneRequest,
22287            fidl::encoding::DefaultFuchsiaResourceDialect,
22288        > for &mut NodeDeprecatedCloneRequest
22289    {
22290        #[inline]
22291        unsafe fn encode(
22292            self,
22293            encoder: &mut fidl::encoding::Encoder<
22294                '_,
22295                fidl::encoding::DefaultFuchsiaResourceDialect,
22296            >,
22297            offset: usize,
22298            _depth: fidl::encoding::Depth,
22299        ) -> fidl::Result<()> {
22300            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
22301            // Delegate to tuple encoding.
22302            fidl::encoding::Encode::<NodeDeprecatedCloneRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22303                (
22304                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
22305                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
22306                ),
22307                encoder, offset, _depth
22308            )
22309        }
22310    }
22311    unsafe impl<
22312            T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
22313            T1: fidl::encoding::Encode<
22314                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22315                fidl::encoding::DefaultFuchsiaResourceDialect,
22316            >,
22317        >
22318        fidl::encoding::Encode<
22319            NodeDeprecatedCloneRequest,
22320            fidl::encoding::DefaultFuchsiaResourceDialect,
22321        > for (T0, T1)
22322    {
22323        #[inline]
22324        unsafe fn encode(
22325            self,
22326            encoder: &mut fidl::encoding::Encoder<
22327                '_,
22328                fidl::encoding::DefaultFuchsiaResourceDialect,
22329            >,
22330            offset: usize,
22331            depth: fidl::encoding::Depth,
22332        ) -> fidl::Result<()> {
22333            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
22334            // Zero out padding regions. There's no need to apply masks
22335            // because the unmasked parts will be overwritten by fields.
22336            // Write the fields.
22337            self.0.encode(encoder, offset + 0, depth)?;
22338            self.1.encode(encoder, offset + 4, depth)?;
22339            Ok(())
22340        }
22341    }
22342
22343    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22344        for NodeDeprecatedCloneRequest
22345    {
22346        #[inline(always)]
22347        fn new_empty() -> Self {
22348            Self {
22349                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
22350                object: fidl::new_empty!(
22351                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22352                    fidl::encoding::DefaultFuchsiaResourceDialect
22353                ),
22354            }
22355        }
22356
22357        #[inline]
22358        unsafe fn decode(
22359            &mut self,
22360            decoder: &mut fidl::encoding::Decoder<
22361                '_,
22362                fidl::encoding::DefaultFuchsiaResourceDialect,
22363            >,
22364            offset: usize,
22365            _depth: fidl::encoding::Depth,
22366        ) -> fidl::Result<()> {
22367            decoder.debug_check_bounds::<Self>(offset);
22368            // Verify that padding bytes are zero.
22369            fidl::decode!(
22370                OpenFlags,
22371                fidl::encoding::DefaultFuchsiaResourceDialect,
22372                &mut self.flags,
22373                decoder,
22374                offset + 0,
22375                _depth
22376            )?;
22377            fidl::decode!(
22378                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22379                fidl::encoding::DefaultFuchsiaResourceDialect,
22380                &mut self.object,
22381                decoder,
22382                offset + 4,
22383                _depth
22384            )?;
22385            Ok(())
22386        }
22387    }
22388
22389    impl fidl::encoding::ResourceTypeMarker for NodeListExtendedAttributesRequest {
22390        type Borrowed<'a> = &'a mut Self;
22391        fn take_or_borrow<'a>(
22392            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22393        ) -> Self::Borrowed<'a> {
22394            value
22395        }
22396    }
22397
22398    unsafe impl fidl::encoding::TypeMarker for NodeListExtendedAttributesRequest {
22399        type Owned = Self;
22400
22401        #[inline(always)]
22402        fn inline_align(_context: fidl::encoding::Context) -> usize {
22403            4
22404        }
22405
22406        #[inline(always)]
22407        fn inline_size(_context: fidl::encoding::Context) -> usize {
22408            4
22409        }
22410    }
22411
22412    unsafe impl
22413        fidl::encoding::Encode<
22414            NodeListExtendedAttributesRequest,
22415            fidl::encoding::DefaultFuchsiaResourceDialect,
22416        > for &mut NodeListExtendedAttributesRequest
22417    {
22418        #[inline]
22419        unsafe fn encode(
22420            self,
22421            encoder: &mut fidl::encoding::Encoder<
22422                '_,
22423                fidl::encoding::DefaultFuchsiaResourceDialect,
22424            >,
22425            offset: usize,
22426            _depth: fidl::encoding::Depth,
22427        ) -> fidl::Result<()> {
22428            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
22429            // Delegate to tuple encoding.
22430            fidl::encoding::Encode::<
22431                NodeListExtendedAttributesRequest,
22432                fidl::encoding::DefaultFuchsiaResourceDialect,
22433            >::encode(
22434                (<fidl::encoding::Endpoint<
22435                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22436                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22437                    &mut self.iterator
22438                ),),
22439                encoder,
22440                offset,
22441                _depth,
22442            )
22443        }
22444    }
22445    unsafe impl<
22446            T0: fidl::encoding::Encode<
22447                fidl::encoding::Endpoint<
22448                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22449                >,
22450                fidl::encoding::DefaultFuchsiaResourceDialect,
22451            >,
22452        >
22453        fidl::encoding::Encode<
22454            NodeListExtendedAttributesRequest,
22455            fidl::encoding::DefaultFuchsiaResourceDialect,
22456        > for (T0,)
22457    {
22458        #[inline]
22459        unsafe fn encode(
22460            self,
22461            encoder: &mut fidl::encoding::Encoder<
22462                '_,
22463                fidl::encoding::DefaultFuchsiaResourceDialect,
22464            >,
22465            offset: usize,
22466            depth: fidl::encoding::Depth,
22467        ) -> fidl::Result<()> {
22468            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
22469            // Zero out padding regions. There's no need to apply masks
22470            // because the unmasked parts will be overwritten by fields.
22471            // Write the fields.
22472            self.0.encode(encoder, offset + 0, depth)?;
22473            Ok(())
22474        }
22475    }
22476
22477    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22478        for NodeListExtendedAttributesRequest
22479    {
22480        #[inline(always)]
22481        fn new_empty() -> Self {
22482            Self {
22483                iterator: fidl::new_empty!(
22484                    fidl::encoding::Endpoint<
22485                        fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22486                    >,
22487                    fidl::encoding::DefaultFuchsiaResourceDialect
22488                ),
22489            }
22490        }
22491
22492        #[inline]
22493        unsafe fn decode(
22494            &mut self,
22495            decoder: &mut fidl::encoding::Decoder<
22496                '_,
22497                fidl::encoding::DefaultFuchsiaResourceDialect,
22498            >,
22499            offset: usize,
22500            _depth: fidl::encoding::Depth,
22501        ) -> fidl::Result<()> {
22502            decoder.debug_check_bounds::<Self>(offset);
22503            // Verify that padding bytes are zero.
22504            fidl::decode!(
22505                fidl::encoding::Endpoint<
22506                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22507                >,
22508                fidl::encoding::DefaultFuchsiaResourceDialect,
22509                &mut self.iterator,
22510                decoder,
22511                offset + 0,
22512                _depth
22513            )?;
22514            Ok(())
22515        }
22516    }
22517
22518    impl fidl::encoding::ResourceTypeMarker for NodeOnOpenRequest {
22519        type Borrowed<'a> = &'a mut Self;
22520        fn take_or_borrow<'a>(
22521            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22522        ) -> Self::Borrowed<'a> {
22523            value
22524        }
22525    }
22526
22527    unsafe impl fidl::encoding::TypeMarker for NodeOnOpenRequest {
22528        type Owned = Self;
22529
22530        #[inline(always)]
22531        fn inline_align(_context: fidl::encoding::Context) -> usize {
22532            8
22533        }
22534
22535        #[inline(always)]
22536        fn inline_size(_context: fidl::encoding::Context) -> usize {
22537            24
22538        }
22539    }
22540
22541    unsafe impl
22542        fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22543        for &mut NodeOnOpenRequest
22544    {
22545        #[inline]
22546        unsafe fn encode(
22547            self,
22548            encoder: &mut fidl::encoding::Encoder<
22549                '_,
22550                fidl::encoding::DefaultFuchsiaResourceDialect,
22551            >,
22552            offset: usize,
22553            _depth: fidl::encoding::Depth,
22554        ) -> fidl::Result<()> {
22555            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
22556            // Delegate to tuple encoding.
22557            fidl::encoding::Encode::<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22558                (
22559                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
22560                    <fidl::encoding::OptionalUnion<NodeInfoDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
22561                ),
22562                encoder, offset, _depth
22563            )
22564        }
22565    }
22566    unsafe impl<
22567            T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
22568            T1: fidl::encoding::Encode<
22569                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
22570                fidl::encoding::DefaultFuchsiaResourceDialect,
22571            >,
22572        >
22573        fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22574        for (T0, T1)
22575    {
22576        #[inline]
22577        unsafe fn encode(
22578            self,
22579            encoder: &mut fidl::encoding::Encoder<
22580                '_,
22581                fidl::encoding::DefaultFuchsiaResourceDialect,
22582            >,
22583            offset: usize,
22584            depth: fidl::encoding::Depth,
22585        ) -> fidl::Result<()> {
22586            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
22587            // Zero out padding regions. There's no need to apply masks
22588            // because the unmasked parts will be overwritten by fields.
22589            unsafe {
22590                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
22591                (ptr as *mut u64).write_unaligned(0);
22592            }
22593            // Write the fields.
22594            self.0.encode(encoder, offset + 0, depth)?;
22595            self.1.encode(encoder, offset + 8, depth)?;
22596            Ok(())
22597        }
22598    }
22599
22600    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22601        for NodeOnOpenRequest
22602    {
22603        #[inline(always)]
22604        fn new_empty() -> Self {
22605            Self {
22606                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
22607                info: fidl::new_empty!(
22608                    fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
22609                    fidl::encoding::DefaultFuchsiaResourceDialect
22610                ),
22611            }
22612        }
22613
22614        #[inline]
22615        unsafe fn decode(
22616            &mut self,
22617            decoder: &mut fidl::encoding::Decoder<
22618                '_,
22619                fidl::encoding::DefaultFuchsiaResourceDialect,
22620            >,
22621            offset: usize,
22622            _depth: fidl::encoding::Depth,
22623        ) -> fidl::Result<()> {
22624            decoder.debug_check_bounds::<Self>(offset);
22625            // Verify that padding bytes are zero.
22626            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
22627            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22628            let mask = 0xffffffff00000000u64;
22629            let maskedval = padval & mask;
22630            if maskedval != 0 {
22631                return Err(fidl::Error::NonZeroPadding {
22632                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
22633                });
22634            }
22635            fidl::decode!(
22636                i32,
22637                fidl::encoding::DefaultFuchsiaResourceDialect,
22638                &mut self.s,
22639                decoder,
22640                offset + 0,
22641                _depth
22642            )?;
22643            fidl::decode!(
22644                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
22645                fidl::encoding::DefaultFuchsiaResourceDialect,
22646                &mut self.info,
22647                decoder,
22648                offset + 8,
22649                _depth
22650            )?;
22651            Ok(())
22652        }
22653    }
22654
22655    impl fidl::encoding::ResourceTypeMarker for NodeSetExtendedAttributeRequest {
22656        type Borrowed<'a> = &'a mut Self;
22657        fn take_or_borrow<'a>(
22658            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22659        ) -> Self::Borrowed<'a> {
22660            value
22661        }
22662    }
22663
22664    unsafe impl fidl::encoding::TypeMarker for NodeSetExtendedAttributeRequest {
22665        type Owned = Self;
22666
22667        #[inline(always)]
22668        fn inline_align(_context: fidl::encoding::Context) -> usize {
22669            8
22670        }
22671
22672        #[inline(always)]
22673        fn inline_size(_context: fidl::encoding::Context) -> usize {
22674            40
22675        }
22676    }
22677
22678    unsafe impl
22679        fidl::encoding::Encode<
22680            NodeSetExtendedAttributeRequest,
22681            fidl::encoding::DefaultFuchsiaResourceDialect,
22682        > for &mut NodeSetExtendedAttributeRequest
22683    {
22684        #[inline]
22685        unsafe fn encode(
22686            self,
22687            encoder: &mut fidl::encoding::Encoder<
22688                '_,
22689                fidl::encoding::DefaultFuchsiaResourceDialect,
22690            >,
22691            offset: usize,
22692            _depth: fidl::encoding::Depth,
22693        ) -> fidl::Result<()> {
22694            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
22695            // Delegate to tuple encoding.
22696            fidl::encoding::Encode::<
22697                NodeSetExtendedAttributeRequest,
22698                fidl::encoding::DefaultFuchsiaResourceDialect,
22699            >::encode(
22700                (
22701                    <fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
22702                        &self.name,
22703                    ),
22704                    <ExtendedAttributeValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22705                        &mut self.value,
22706                    ),
22707                    <SetExtendedAttributeMode as fidl::encoding::ValueTypeMarker>::borrow(
22708                        &self.mode,
22709                    ),
22710                ),
22711                encoder,
22712                offset,
22713                _depth,
22714            )
22715        }
22716    }
22717    unsafe impl<
22718            T0: fidl::encoding::Encode<
22719                fidl::encoding::Vector<u8, 255>,
22720                fidl::encoding::DefaultFuchsiaResourceDialect,
22721            >,
22722            T1: fidl::encoding::Encode<
22723                ExtendedAttributeValue,
22724                fidl::encoding::DefaultFuchsiaResourceDialect,
22725            >,
22726            T2: fidl::encoding::Encode<
22727                SetExtendedAttributeMode,
22728                fidl::encoding::DefaultFuchsiaResourceDialect,
22729            >,
22730        >
22731        fidl::encoding::Encode<
22732            NodeSetExtendedAttributeRequest,
22733            fidl::encoding::DefaultFuchsiaResourceDialect,
22734        > for (T0, T1, T2)
22735    {
22736        #[inline]
22737        unsafe fn encode(
22738            self,
22739            encoder: &mut fidl::encoding::Encoder<
22740                '_,
22741                fidl::encoding::DefaultFuchsiaResourceDialect,
22742            >,
22743            offset: usize,
22744            depth: fidl::encoding::Depth,
22745        ) -> fidl::Result<()> {
22746            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
22747            // Zero out padding regions. There's no need to apply masks
22748            // because the unmasked parts will be overwritten by fields.
22749            unsafe {
22750                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
22751                (ptr as *mut u64).write_unaligned(0);
22752            }
22753            // Write the fields.
22754            self.0.encode(encoder, offset + 0, depth)?;
22755            self.1.encode(encoder, offset + 16, depth)?;
22756            self.2.encode(encoder, offset + 32, depth)?;
22757            Ok(())
22758        }
22759    }
22760
22761    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22762        for NodeSetExtendedAttributeRequest
22763    {
22764        #[inline(always)]
22765        fn new_empty() -> Self {
22766            Self {
22767                name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect),
22768                value: fidl::new_empty!(
22769                    ExtendedAttributeValue,
22770                    fidl::encoding::DefaultFuchsiaResourceDialect
22771                ),
22772                mode: fidl::new_empty!(
22773                    SetExtendedAttributeMode,
22774                    fidl::encoding::DefaultFuchsiaResourceDialect
22775                ),
22776            }
22777        }
22778
22779        #[inline]
22780        unsafe fn decode(
22781            &mut self,
22782            decoder: &mut fidl::encoding::Decoder<
22783                '_,
22784                fidl::encoding::DefaultFuchsiaResourceDialect,
22785            >,
22786            offset: usize,
22787            _depth: fidl::encoding::Depth,
22788        ) -> fidl::Result<()> {
22789            decoder.debug_check_bounds::<Self>(offset);
22790            // Verify that padding bytes are zero.
22791            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
22792            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22793            let mask = 0xffffffff00000000u64;
22794            let maskedval = padval & mask;
22795            if maskedval != 0 {
22796                return Err(fidl::Error::NonZeroPadding {
22797                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
22798                });
22799            }
22800            fidl::decode!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.name, decoder, offset + 0, _depth)?;
22801            fidl::decode!(
22802                ExtendedAttributeValue,
22803                fidl::encoding::DefaultFuchsiaResourceDialect,
22804                &mut self.value,
22805                decoder,
22806                offset + 16,
22807                _depth
22808            )?;
22809            fidl::decode!(
22810                SetExtendedAttributeMode,
22811                fidl::encoding::DefaultFuchsiaResourceDialect,
22812                &mut self.mode,
22813                decoder,
22814                offset + 32,
22815                _depth
22816            )?;
22817            Ok(())
22818        }
22819    }
22820
22821    impl ConnectionInfo {
22822        #[inline(always)]
22823        fn max_ordinal_present(&self) -> u64 {
22824            if let Some(_) = self.rights {
22825                return 1;
22826            }
22827            0
22828        }
22829    }
22830
22831    impl fidl::encoding::ResourceTypeMarker for ConnectionInfo {
22832        type Borrowed<'a> = &'a mut Self;
22833        fn take_or_borrow<'a>(
22834            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22835        ) -> Self::Borrowed<'a> {
22836            value
22837        }
22838    }
22839
22840    unsafe impl fidl::encoding::TypeMarker for ConnectionInfo {
22841        type Owned = Self;
22842
22843        #[inline(always)]
22844        fn inline_align(_context: fidl::encoding::Context) -> usize {
22845            8
22846        }
22847
22848        #[inline(always)]
22849        fn inline_size(_context: fidl::encoding::Context) -> usize {
22850            16
22851        }
22852    }
22853
22854    unsafe impl
22855        fidl::encoding::Encode<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
22856        for &mut ConnectionInfo
22857    {
22858        unsafe fn encode(
22859            self,
22860            encoder: &mut fidl::encoding::Encoder<
22861                '_,
22862                fidl::encoding::DefaultFuchsiaResourceDialect,
22863            >,
22864            offset: usize,
22865            mut depth: fidl::encoding::Depth,
22866        ) -> fidl::Result<()> {
22867            encoder.debug_check_bounds::<ConnectionInfo>(offset);
22868            // Vector header
22869            let max_ordinal: u64 = self.max_ordinal_present();
22870            encoder.write_num(max_ordinal, offset);
22871            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
22872            // Calling encoder.out_of_line_offset(0) is not allowed.
22873            if max_ordinal == 0 {
22874                return Ok(());
22875            }
22876            depth.increment()?;
22877            let envelope_size = 8;
22878            let bytes_len = max_ordinal as usize * envelope_size;
22879            #[allow(unused_variables)]
22880            let offset = encoder.out_of_line_offset(bytes_len);
22881            let mut _prev_end_offset: usize = 0;
22882            if 1 > max_ordinal {
22883                return Ok(());
22884            }
22885
22886            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
22887            // are envelope_size bytes.
22888            let cur_offset: usize = (1 - 1) * envelope_size;
22889
22890            // Zero reserved fields.
22891            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22892
22893            // Safety:
22894            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
22895            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
22896            //   envelope_size bytes, there is always sufficient room.
22897            fidl::encoding::encode_in_envelope_optional::<
22898                Operations,
22899                fidl::encoding::DefaultFuchsiaResourceDialect,
22900            >(
22901                self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
22902                encoder,
22903                offset + cur_offset,
22904                depth,
22905            )?;
22906
22907            _prev_end_offset = cur_offset + envelope_size;
22908
22909            Ok(())
22910        }
22911    }
22912
22913    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22914        for ConnectionInfo
22915    {
22916        #[inline(always)]
22917        fn new_empty() -> Self {
22918            Self::default()
22919        }
22920
22921        unsafe fn decode(
22922            &mut self,
22923            decoder: &mut fidl::encoding::Decoder<
22924                '_,
22925                fidl::encoding::DefaultFuchsiaResourceDialect,
22926            >,
22927            offset: usize,
22928            mut depth: fidl::encoding::Depth,
22929        ) -> fidl::Result<()> {
22930            decoder.debug_check_bounds::<Self>(offset);
22931            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22932                None => return Err(fidl::Error::NotNullable),
22933                Some(len) => len,
22934            };
22935            // Calling decoder.out_of_line_offset(0) is not allowed.
22936            if len == 0 {
22937                return Ok(());
22938            };
22939            depth.increment()?;
22940            let envelope_size = 8;
22941            let bytes_len = len * envelope_size;
22942            let offset = decoder.out_of_line_offset(bytes_len)?;
22943            // Decode the envelope for each type.
22944            let mut _next_ordinal_to_read = 0;
22945            let mut next_offset = offset;
22946            let end_offset = offset + bytes_len;
22947            _next_ordinal_to_read += 1;
22948            if next_offset >= end_offset {
22949                return Ok(());
22950            }
22951
22952            // Decode unknown envelopes for gaps in ordinals.
22953            while _next_ordinal_to_read < 1 {
22954                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22955                _next_ordinal_to_read += 1;
22956                next_offset += envelope_size;
22957            }
22958
22959            let next_out_of_line = decoder.next_out_of_line();
22960            let handles_before = decoder.remaining_handles();
22961            if let Some((inlined, num_bytes, num_handles)) =
22962                fidl::encoding::decode_envelope_header(decoder, next_offset)?
22963            {
22964                let member_inline_size =
22965                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22966                if inlined != (member_inline_size <= 4) {
22967                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
22968                }
22969                let inner_offset;
22970                let mut inner_depth = depth.clone();
22971                if inlined {
22972                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22973                    inner_offset = next_offset;
22974                } else {
22975                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22976                    inner_depth.increment()?;
22977                }
22978                let val_ref = self.rights.get_or_insert_with(|| {
22979                    fidl::new_empty!(Operations, fidl::encoding::DefaultFuchsiaResourceDialect)
22980                });
22981                fidl::decode!(
22982                    Operations,
22983                    fidl::encoding::DefaultFuchsiaResourceDialect,
22984                    val_ref,
22985                    decoder,
22986                    inner_offset,
22987                    inner_depth
22988                )?;
22989                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22990                {
22991                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
22992                }
22993                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22994                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22995                }
22996            }
22997
22998            next_offset += envelope_size;
22999
23000            // Decode the remaining unknown envelopes.
23001            while next_offset < end_offset {
23002                _next_ordinal_to_read += 1;
23003                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23004                next_offset += envelope_size;
23005            }
23006
23007            Ok(())
23008        }
23009    }
23010
23011    impl FileInfo {
23012        #[inline(always)]
23013        fn max_ordinal_present(&self) -> u64 {
23014            if let Some(_) = self.attributes {
23015                return 4;
23016            }
23017            if let Some(_) = self.stream {
23018                return 3;
23019            }
23020            if let Some(_) = self.observer {
23021                return 2;
23022            }
23023            if let Some(_) = self.is_append {
23024                return 1;
23025            }
23026            0
23027        }
23028    }
23029
23030    impl fidl::encoding::ResourceTypeMarker for FileInfo {
23031        type Borrowed<'a> = &'a mut Self;
23032        fn take_or_borrow<'a>(
23033            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23034        ) -> Self::Borrowed<'a> {
23035            value
23036        }
23037    }
23038
23039    unsafe impl fidl::encoding::TypeMarker for FileInfo {
23040        type Owned = Self;
23041
23042        #[inline(always)]
23043        fn inline_align(_context: fidl::encoding::Context) -> usize {
23044            8
23045        }
23046
23047        #[inline(always)]
23048        fn inline_size(_context: fidl::encoding::Context) -> usize {
23049            16
23050        }
23051    }
23052
23053    unsafe impl fidl::encoding::Encode<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
23054        for &mut FileInfo
23055    {
23056        unsafe fn encode(
23057            self,
23058            encoder: &mut fidl::encoding::Encoder<
23059                '_,
23060                fidl::encoding::DefaultFuchsiaResourceDialect,
23061            >,
23062            offset: usize,
23063            mut depth: fidl::encoding::Depth,
23064        ) -> fidl::Result<()> {
23065            encoder.debug_check_bounds::<FileInfo>(offset);
23066            // Vector header
23067            let max_ordinal: u64 = self.max_ordinal_present();
23068            encoder.write_num(max_ordinal, offset);
23069            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23070            // Calling encoder.out_of_line_offset(0) is not allowed.
23071            if max_ordinal == 0 {
23072                return Ok(());
23073            }
23074            depth.increment()?;
23075            let envelope_size = 8;
23076            let bytes_len = max_ordinal as usize * envelope_size;
23077            #[allow(unused_variables)]
23078            let offset = encoder.out_of_line_offset(bytes_len);
23079            let mut _prev_end_offset: usize = 0;
23080            if 1 > max_ordinal {
23081                return Ok(());
23082            }
23083
23084            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23085            // are envelope_size bytes.
23086            let cur_offset: usize = (1 - 1) * envelope_size;
23087
23088            // Zero reserved fields.
23089            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23090
23091            // Safety:
23092            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23093            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23094            //   envelope_size bytes, there is always sufficient room.
23095            fidl::encoding::encode_in_envelope_optional::<
23096                bool,
23097                fidl::encoding::DefaultFuchsiaResourceDialect,
23098            >(
23099                self.is_append.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
23100                encoder,
23101                offset + cur_offset,
23102                depth,
23103            )?;
23104
23105            _prev_end_offset = cur_offset + envelope_size;
23106            if 2 > max_ordinal {
23107                return Ok(());
23108            }
23109
23110            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23111            // are envelope_size bytes.
23112            let cur_offset: usize = (2 - 1) * envelope_size;
23113
23114            // Zero reserved fields.
23115            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23116
23117            // Safety:
23118            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23119            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23120            //   envelope_size bytes, there is always sufficient room.
23121            fidl::encoding::encode_in_envelope_optional::<
23122                fidl::encoding::HandleType<
23123                    fidl::Event,
23124                    { fidl::ObjectType::EVENT.into_raw() },
23125                    2147483648,
23126                >,
23127                fidl::encoding::DefaultFuchsiaResourceDialect,
23128            >(
23129                self.observer.as_mut().map(
23130                    <fidl::encoding::HandleType<
23131                        fidl::Event,
23132                        { fidl::ObjectType::EVENT.into_raw() },
23133                        2147483648,
23134                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
23135                ),
23136                encoder,
23137                offset + cur_offset,
23138                depth,
23139            )?;
23140
23141            _prev_end_offset = cur_offset + envelope_size;
23142            if 3 > max_ordinal {
23143                return Ok(());
23144            }
23145
23146            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23147            // are envelope_size bytes.
23148            let cur_offset: usize = (3 - 1) * envelope_size;
23149
23150            // Zero reserved fields.
23151            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23152
23153            // Safety:
23154            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23155            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23156            //   envelope_size bytes, there is always sufficient room.
23157            fidl::encoding::encode_in_envelope_optional::<
23158                fidl::encoding::HandleType<
23159                    fidl::Stream,
23160                    { fidl::ObjectType::STREAM.into_raw() },
23161                    2147483648,
23162                >,
23163                fidl::encoding::DefaultFuchsiaResourceDialect,
23164            >(
23165                self.stream.as_mut().map(
23166                    <fidl::encoding::HandleType<
23167                        fidl::Stream,
23168                        { fidl::ObjectType::STREAM.into_raw() },
23169                        2147483648,
23170                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
23171                ),
23172                encoder,
23173                offset + cur_offset,
23174                depth,
23175            )?;
23176
23177            _prev_end_offset = cur_offset + envelope_size;
23178            if 4 > max_ordinal {
23179                return Ok(());
23180            }
23181
23182            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23183            // are envelope_size bytes.
23184            let cur_offset: usize = (4 - 1) * envelope_size;
23185
23186            // Zero reserved fields.
23187            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23188
23189            // Safety:
23190            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23191            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23192            //   envelope_size bytes, there is always sufficient room.
23193            fidl::encoding::encode_in_envelope_optional::<
23194                NodeAttributes2,
23195                fidl::encoding::DefaultFuchsiaResourceDialect,
23196            >(
23197                self.attributes
23198                    .as_ref()
23199                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
23200                encoder,
23201                offset + cur_offset,
23202                depth,
23203            )?;
23204
23205            _prev_end_offset = cur_offset + envelope_size;
23206
23207            Ok(())
23208        }
23209    }
23210
23211    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileInfo {
23212        #[inline(always)]
23213        fn new_empty() -> Self {
23214            Self::default()
23215        }
23216
23217        unsafe fn decode(
23218            &mut self,
23219            decoder: &mut fidl::encoding::Decoder<
23220                '_,
23221                fidl::encoding::DefaultFuchsiaResourceDialect,
23222            >,
23223            offset: usize,
23224            mut depth: fidl::encoding::Depth,
23225        ) -> fidl::Result<()> {
23226            decoder.debug_check_bounds::<Self>(offset);
23227            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23228                None => return Err(fidl::Error::NotNullable),
23229                Some(len) => len,
23230            };
23231            // Calling decoder.out_of_line_offset(0) is not allowed.
23232            if len == 0 {
23233                return Ok(());
23234            };
23235            depth.increment()?;
23236            let envelope_size = 8;
23237            let bytes_len = len * envelope_size;
23238            let offset = decoder.out_of_line_offset(bytes_len)?;
23239            // Decode the envelope for each type.
23240            let mut _next_ordinal_to_read = 0;
23241            let mut next_offset = offset;
23242            let end_offset = offset + bytes_len;
23243            _next_ordinal_to_read += 1;
23244            if next_offset >= end_offset {
23245                return Ok(());
23246            }
23247
23248            // Decode unknown envelopes for gaps in ordinals.
23249            while _next_ordinal_to_read < 1 {
23250                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23251                _next_ordinal_to_read += 1;
23252                next_offset += envelope_size;
23253            }
23254
23255            let next_out_of_line = decoder.next_out_of_line();
23256            let handles_before = decoder.remaining_handles();
23257            if let Some((inlined, num_bytes, num_handles)) =
23258                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23259            {
23260                let member_inline_size =
23261                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23262                if inlined != (member_inline_size <= 4) {
23263                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23264                }
23265                let inner_offset;
23266                let mut inner_depth = depth.clone();
23267                if inlined {
23268                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23269                    inner_offset = next_offset;
23270                } else {
23271                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23272                    inner_depth.increment()?;
23273                }
23274                let val_ref = self.is_append.get_or_insert_with(|| {
23275                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
23276                });
23277                fidl::decode!(
23278                    bool,
23279                    fidl::encoding::DefaultFuchsiaResourceDialect,
23280                    val_ref,
23281                    decoder,
23282                    inner_offset,
23283                    inner_depth
23284                )?;
23285                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23286                {
23287                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23288                }
23289                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23290                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23291                }
23292            }
23293
23294            next_offset += envelope_size;
23295            _next_ordinal_to_read += 1;
23296            if next_offset >= end_offset {
23297                return Ok(());
23298            }
23299
23300            // Decode unknown envelopes for gaps in ordinals.
23301            while _next_ordinal_to_read < 2 {
23302                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23303                _next_ordinal_to_read += 1;
23304                next_offset += envelope_size;
23305            }
23306
23307            let next_out_of_line = decoder.next_out_of_line();
23308            let handles_before = decoder.remaining_handles();
23309            if let Some((inlined, num_bytes, num_handles)) =
23310                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23311            {
23312                let member_inline_size = <fidl::encoding::HandleType<
23313                    fidl::Event,
23314                    { fidl::ObjectType::EVENT.into_raw() },
23315                    2147483648,
23316                > as fidl::encoding::TypeMarker>::inline_size(
23317                    decoder.context
23318                );
23319                if inlined != (member_inline_size <= 4) {
23320                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23321                }
23322                let inner_offset;
23323                let mut inner_depth = depth.clone();
23324                if inlined {
23325                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23326                    inner_offset = next_offset;
23327                } else {
23328                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23329                    inner_depth.increment()?;
23330                }
23331                let val_ref =
23332                self.observer.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
23333                fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
23334                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23335                {
23336                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23337                }
23338                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23339                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23340                }
23341            }
23342
23343            next_offset += envelope_size;
23344            _next_ordinal_to_read += 1;
23345            if next_offset >= end_offset {
23346                return Ok(());
23347            }
23348
23349            // Decode unknown envelopes for gaps in ordinals.
23350            while _next_ordinal_to_read < 3 {
23351                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23352                _next_ordinal_to_read += 1;
23353                next_offset += envelope_size;
23354            }
23355
23356            let next_out_of_line = decoder.next_out_of_line();
23357            let handles_before = decoder.remaining_handles();
23358            if let Some((inlined, num_bytes, num_handles)) =
23359                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23360            {
23361                let member_inline_size = <fidl::encoding::HandleType<
23362                    fidl::Stream,
23363                    { fidl::ObjectType::STREAM.into_raw() },
23364                    2147483648,
23365                > as fidl::encoding::TypeMarker>::inline_size(
23366                    decoder.context
23367                );
23368                if inlined != (member_inline_size <= 4) {
23369                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23370                }
23371                let inner_offset;
23372                let mut inner_depth = depth.clone();
23373                if inlined {
23374                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23375                    inner_offset = next_offset;
23376                } else {
23377                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23378                    inner_depth.increment()?;
23379                }
23380                let val_ref =
23381                self.stream.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
23382                fidl::decode!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
23383                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23384                {
23385                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23386                }
23387                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23388                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23389                }
23390            }
23391
23392            next_offset += envelope_size;
23393            _next_ordinal_to_read += 1;
23394            if next_offset >= end_offset {
23395                return Ok(());
23396            }
23397
23398            // Decode unknown envelopes for gaps in ordinals.
23399            while _next_ordinal_to_read < 4 {
23400                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23401                _next_ordinal_to_read += 1;
23402                next_offset += envelope_size;
23403            }
23404
23405            let next_out_of_line = decoder.next_out_of_line();
23406            let handles_before = decoder.remaining_handles();
23407            if let Some((inlined, num_bytes, num_handles)) =
23408                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23409            {
23410                let member_inline_size =
23411                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23412                if inlined != (member_inline_size <= 4) {
23413                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23414                }
23415                let inner_offset;
23416                let mut inner_depth = depth.clone();
23417                if inlined {
23418                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23419                    inner_offset = next_offset;
23420                } else {
23421                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23422                    inner_depth.increment()?;
23423                }
23424                let val_ref = self.attributes.get_or_insert_with(|| {
23425                    fidl::new_empty!(NodeAttributes2, fidl::encoding::DefaultFuchsiaResourceDialect)
23426                });
23427                fidl::decode!(
23428                    NodeAttributes2,
23429                    fidl::encoding::DefaultFuchsiaResourceDialect,
23430                    val_ref,
23431                    decoder,
23432                    inner_offset,
23433                    inner_depth
23434                )?;
23435                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23436                {
23437                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23438                }
23439                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23440                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23441                }
23442            }
23443
23444            next_offset += envelope_size;
23445
23446            // Decode the remaining unknown envelopes.
23447            while next_offset < end_offset {
23448                _next_ordinal_to_read += 1;
23449                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23450                next_offset += envelope_size;
23451            }
23452
23453            Ok(())
23454        }
23455    }
23456
23457    impl fidl::encoding::ResourceTypeMarker for ExtendedAttributeValue {
23458        type Borrowed<'a> = &'a mut Self;
23459        fn take_or_borrow<'a>(
23460            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23461        ) -> Self::Borrowed<'a> {
23462            value
23463        }
23464    }
23465
23466    unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeValue {
23467        type Owned = Self;
23468
23469        #[inline(always)]
23470        fn inline_align(_context: fidl::encoding::Context) -> usize {
23471            8
23472        }
23473
23474        #[inline(always)]
23475        fn inline_size(_context: fidl::encoding::Context) -> usize {
23476            16
23477        }
23478    }
23479
23480    unsafe impl
23481        fidl::encoding::Encode<
23482            ExtendedAttributeValue,
23483            fidl::encoding::DefaultFuchsiaResourceDialect,
23484        > for &mut ExtendedAttributeValue
23485    {
23486        #[inline]
23487        unsafe fn encode(
23488            self,
23489            encoder: &mut fidl::encoding::Encoder<
23490                '_,
23491                fidl::encoding::DefaultFuchsiaResourceDialect,
23492            >,
23493            offset: usize,
23494            _depth: fidl::encoding::Depth,
23495        ) -> fidl::Result<()> {
23496            encoder.debug_check_bounds::<ExtendedAttributeValue>(offset);
23497            encoder.write_num::<u64>(self.ordinal(), offset);
23498            match self {
23499                ExtendedAttributeValue::Bytes(ref val) => fidl::encoding::encode_in_envelope::<
23500                    fidl::encoding::Vector<u8, 32768>,
23501                    fidl::encoding::DefaultFuchsiaResourceDialect,
23502                >(
23503                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::ValueTypeMarker>::borrow(
23504                        val,
23505                    ),
23506                    encoder,
23507                    offset + 8,
23508                    _depth,
23509                ),
23510                ExtendedAttributeValue::Buffer(ref mut val) => {
23511                    fidl::encoding::encode_in_envelope::<
23512                        fidl::encoding::HandleType<
23513                            fidl::Vmo,
23514                            { fidl::ObjectType::VMO.into_raw() },
23515                            2147483648,
23516                        >,
23517                        fidl::encoding::DefaultFuchsiaResourceDialect,
23518                    >(
23519                        <fidl::encoding::HandleType<
23520                            fidl::Vmo,
23521                            { fidl::ObjectType::VMO.into_raw() },
23522                            2147483648,
23523                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
23524                            val
23525                        ),
23526                        encoder,
23527                        offset + 8,
23528                        _depth,
23529                    )
23530                }
23531                ExtendedAttributeValue::__SourceBreaking { .. } => {
23532                    Err(fidl::Error::UnknownUnionTag)
23533                }
23534            }
23535        }
23536    }
23537
23538    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23539        for ExtendedAttributeValue
23540    {
23541        #[inline(always)]
23542        fn new_empty() -> Self {
23543            Self::__SourceBreaking { unknown_ordinal: 0 }
23544        }
23545
23546        #[inline]
23547        unsafe fn decode(
23548            &mut self,
23549            decoder: &mut fidl::encoding::Decoder<
23550                '_,
23551                fidl::encoding::DefaultFuchsiaResourceDialect,
23552            >,
23553            offset: usize,
23554            mut depth: fidl::encoding::Depth,
23555        ) -> fidl::Result<()> {
23556            decoder.debug_check_bounds::<Self>(offset);
23557            #[allow(unused_variables)]
23558            let next_out_of_line = decoder.next_out_of_line();
23559            let handles_before = decoder.remaining_handles();
23560            let (ordinal, inlined, num_bytes, num_handles) =
23561                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23562
23563            let member_inline_size = match ordinal {
23564                1 => {
23565                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::TypeMarker>::inline_size(
23566                        decoder.context,
23567                    )
23568                }
23569                2 => <fidl::encoding::HandleType<
23570                    fidl::Vmo,
23571                    { fidl::ObjectType::VMO.into_raw() },
23572                    2147483648,
23573                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23574                0 => return Err(fidl::Error::UnknownUnionTag),
23575                _ => num_bytes as usize,
23576            };
23577
23578            if inlined != (member_inline_size <= 4) {
23579                return Err(fidl::Error::InvalidInlineBitInEnvelope);
23580            }
23581            let _inner_offset;
23582            if inlined {
23583                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23584                _inner_offset = offset + 8;
23585            } else {
23586                depth.increment()?;
23587                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23588            }
23589            match ordinal {
23590                1 => {
23591                    #[allow(irrefutable_let_patterns)]
23592                    if let ExtendedAttributeValue::Bytes(_) = self {
23593                        // Do nothing, read the value into the object
23594                    } else {
23595                        // Initialize `self` to the right variant
23596                        *self = ExtendedAttributeValue::Bytes(
23597                            fidl::new_empty!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect),
23598                        );
23599                    }
23600                    #[allow(irrefutable_let_patterns)]
23601                    if let ExtendedAttributeValue::Bytes(ref mut val) = self {
23602                        fidl::decode!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
23603                    } else {
23604                        unreachable!()
23605                    }
23606                }
23607                2 => {
23608                    #[allow(irrefutable_let_patterns)]
23609                    if let ExtendedAttributeValue::Buffer(_) = self {
23610                        // Do nothing, read the value into the object
23611                    } else {
23612                        // Initialize `self` to the right variant
23613                        *self = ExtendedAttributeValue::Buffer(
23614                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
23615                        );
23616                    }
23617                    #[allow(irrefutable_let_patterns)]
23618                    if let ExtendedAttributeValue::Buffer(ref mut val) = self {
23619                        fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
23620                    } else {
23621                        unreachable!()
23622                    }
23623                }
23624                #[allow(deprecated)]
23625                ordinal => {
23626                    for _ in 0..num_handles {
23627                        decoder.drop_next_handle()?;
23628                    }
23629                    *self = ExtendedAttributeValue::__SourceBreaking { unknown_ordinal: ordinal };
23630                }
23631            }
23632            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23633                return Err(fidl::Error::InvalidNumBytesInEnvelope);
23634            }
23635            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23636                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23637            }
23638            Ok(())
23639        }
23640    }
23641
23642    impl fidl::encoding::ResourceTypeMarker for NodeInfoDeprecated {
23643        type Borrowed<'a> = &'a mut Self;
23644        fn take_or_borrow<'a>(
23645            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23646        ) -> Self::Borrowed<'a> {
23647            value
23648        }
23649    }
23650
23651    unsafe impl fidl::encoding::TypeMarker for NodeInfoDeprecated {
23652        type Owned = Self;
23653
23654        #[inline(always)]
23655        fn inline_align(_context: fidl::encoding::Context) -> usize {
23656            8
23657        }
23658
23659        #[inline(always)]
23660        fn inline_size(_context: fidl::encoding::Context) -> usize {
23661            16
23662        }
23663    }
23664
23665    unsafe impl
23666        fidl::encoding::Encode<NodeInfoDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>
23667        for &mut NodeInfoDeprecated
23668    {
23669        #[inline]
23670        unsafe fn encode(
23671            self,
23672            encoder: &mut fidl::encoding::Encoder<
23673                '_,
23674                fidl::encoding::DefaultFuchsiaResourceDialect,
23675            >,
23676            offset: usize,
23677            _depth: fidl::encoding::Depth,
23678        ) -> fidl::Result<()> {
23679            encoder.debug_check_bounds::<NodeInfoDeprecated>(offset);
23680            encoder.write_num::<u64>(self.ordinal(), offset);
23681            match self {
23682                NodeInfoDeprecated::Service(ref val) => fidl::encoding::encode_in_envelope::<
23683                    Service,
23684                    fidl::encoding::DefaultFuchsiaResourceDialect,
23685                >(
23686                    <Service as fidl::encoding::ValueTypeMarker>::borrow(val),
23687                    encoder,
23688                    offset + 8,
23689                    _depth,
23690                ),
23691                NodeInfoDeprecated::File(ref mut val) => fidl::encoding::encode_in_envelope::<
23692                    FileObject,
23693                    fidl::encoding::DefaultFuchsiaResourceDialect,
23694                >(
23695                    <FileObject as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
23696                    encoder,
23697                    offset + 8,
23698                    _depth,
23699                ),
23700                NodeInfoDeprecated::Directory(ref val) => fidl::encoding::encode_in_envelope::<
23701                    DirectoryObject,
23702                    fidl::encoding::DefaultFuchsiaResourceDialect,
23703                >(
23704                    <DirectoryObject as fidl::encoding::ValueTypeMarker>::borrow(val),
23705                    encoder,
23706                    offset + 8,
23707                    _depth,
23708                ),
23709                NodeInfoDeprecated::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
23710                    SymlinkObject,
23711                    fidl::encoding::DefaultFuchsiaResourceDialect,
23712                >(
23713                    <SymlinkObject as fidl::encoding::ValueTypeMarker>::borrow(val),
23714                    encoder,
23715                    offset + 8,
23716                    _depth,
23717                ),
23718            }
23719        }
23720    }
23721
23722    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23723        for NodeInfoDeprecated
23724    {
23725        #[inline(always)]
23726        fn new_empty() -> Self {
23727            Self::Service(fidl::new_empty!(Service, fidl::encoding::DefaultFuchsiaResourceDialect))
23728        }
23729
23730        #[inline]
23731        unsafe fn decode(
23732            &mut self,
23733            decoder: &mut fidl::encoding::Decoder<
23734                '_,
23735                fidl::encoding::DefaultFuchsiaResourceDialect,
23736            >,
23737            offset: usize,
23738            mut depth: fidl::encoding::Depth,
23739        ) -> fidl::Result<()> {
23740            decoder.debug_check_bounds::<Self>(offset);
23741            #[allow(unused_variables)]
23742            let next_out_of_line = decoder.next_out_of_line();
23743            let handles_before = decoder.remaining_handles();
23744            let (ordinal, inlined, num_bytes, num_handles) =
23745                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23746
23747            let member_inline_size = match ordinal {
23748                1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23749                2 => <FileObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23750                3 => <DirectoryObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23751                4 => <SymlinkObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23752                _ => return Err(fidl::Error::UnknownUnionTag),
23753            };
23754
23755            if inlined != (member_inline_size <= 4) {
23756                return Err(fidl::Error::InvalidInlineBitInEnvelope);
23757            }
23758            let _inner_offset;
23759            if inlined {
23760                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23761                _inner_offset = offset + 8;
23762            } else {
23763                depth.increment()?;
23764                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23765            }
23766            match ordinal {
23767                1 => {
23768                    #[allow(irrefutable_let_patterns)]
23769                    if let NodeInfoDeprecated::Service(_) = self {
23770                        // Do nothing, read the value into the object
23771                    } else {
23772                        // Initialize `self` to the right variant
23773                        *self = NodeInfoDeprecated::Service(fidl::new_empty!(
23774                            Service,
23775                            fidl::encoding::DefaultFuchsiaResourceDialect
23776                        ));
23777                    }
23778                    #[allow(irrefutable_let_patterns)]
23779                    if let NodeInfoDeprecated::Service(ref mut val) = self {
23780                        fidl::decode!(
23781                            Service,
23782                            fidl::encoding::DefaultFuchsiaResourceDialect,
23783                            val,
23784                            decoder,
23785                            _inner_offset,
23786                            depth
23787                        )?;
23788                    } else {
23789                        unreachable!()
23790                    }
23791                }
23792                2 => {
23793                    #[allow(irrefutable_let_patterns)]
23794                    if let NodeInfoDeprecated::File(_) = self {
23795                        // Do nothing, read the value into the object
23796                    } else {
23797                        // Initialize `self` to the right variant
23798                        *self = NodeInfoDeprecated::File(fidl::new_empty!(
23799                            FileObject,
23800                            fidl::encoding::DefaultFuchsiaResourceDialect
23801                        ));
23802                    }
23803                    #[allow(irrefutable_let_patterns)]
23804                    if let NodeInfoDeprecated::File(ref mut val) = self {
23805                        fidl::decode!(
23806                            FileObject,
23807                            fidl::encoding::DefaultFuchsiaResourceDialect,
23808                            val,
23809                            decoder,
23810                            _inner_offset,
23811                            depth
23812                        )?;
23813                    } else {
23814                        unreachable!()
23815                    }
23816                }
23817                3 => {
23818                    #[allow(irrefutable_let_patterns)]
23819                    if let NodeInfoDeprecated::Directory(_) = self {
23820                        // Do nothing, read the value into the object
23821                    } else {
23822                        // Initialize `self` to the right variant
23823                        *self = NodeInfoDeprecated::Directory(fidl::new_empty!(
23824                            DirectoryObject,
23825                            fidl::encoding::DefaultFuchsiaResourceDialect
23826                        ));
23827                    }
23828                    #[allow(irrefutable_let_patterns)]
23829                    if let NodeInfoDeprecated::Directory(ref mut val) = self {
23830                        fidl::decode!(
23831                            DirectoryObject,
23832                            fidl::encoding::DefaultFuchsiaResourceDialect,
23833                            val,
23834                            decoder,
23835                            _inner_offset,
23836                            depth
23837                        )?;
23838                    } else {
23839                        unreachable!()
23840                    }
23841                }
23842                4 => {
23843                    #[allow(irrefutable_let_patterns)]
23844                    if let NodeInfoDeprecated::Symlink(_) = self {
23845                        // Do nothing, read the value into the object
23846                    } else {
23847                        // Initialize `self` to the right variant
23848                        *self = NodeInfoDeprecated::Symlink(fidl::new_empty!(
23849                            SymlinkObject,
23850                            fidl::encoding::DefaultFuchsiaResourceDialect
23851                        ));
23852                    }
23853                    #[allow(irrefutable_let_patterns)]
23854                    if let NodeInfoDeprecated::Symlink(ref mut val) = self {
23855                        fidl::decode!(
23856                            SymlinkObject,
23857                            fidl::encoding::DefaultFuchsiaResourceDialect,
23858                            val,
23859                            decoder,
23860                            _inner_offset,
23861                            depth
23862                        )?;
23863                    } else {
23864                        unreachable!()
23865                    }
23866                }
23867                ordinal => panic!("unexpected ordinal {:?}", ordinal),
23868            }
23869            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23870                return Err(fidl::Error::InvalidNumBytesInEnvelope);
23871            }
23872            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23873                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23874            }
23875            Ok(())
23876        }
23877    }
23878
23879    impl fidl::encoding::ResourceTypeMarker for Representation {
23880        type Borrowed<'a> = &'a mut Self;
23881        fn take_or_borrow<'a>(
23882            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23883        ) -> Self::Borrowed<'a> {
23884            value
23885        }
23886    }
23887
23888    unsafe impl fidl::encoding::TypeMarker for Representation {
23889        type Owned = Self;
23890
23891        #[inline(always)]
23892        fn inline_align(_context: fidl::encoding::Context) -> usize {
23893            8
23894        }
23895
23896        #[inline(always)]
23897        fn inline_size(_context: fidl::encoding::Context) -> usize {
23898            16
23899        }
23900    }
23901
23902    unsafe impl
23903        fidl::encoding::Encode<Representation, fidl::encoding::DefaultFuchsiaResourceDialect>
23904        for &mut Representation
23905    {
23906        #[inline]
23907        unsafe fn encode(
23908            self,
23909            encoder: &mut fidl::encoding::Encoder<
23910                '_,
23911                fidl::encoding::DefaultFuchsiaResourceDialect,
23912            >,
23913            offset: usize,
23914            _depth: fidl::encoding::Depth,
23915        ) -> fidl::Result<()> {
23916            encoder.debug_check_bounds::<Representation>(offset);
23917            encoder.write_num::<u64>(self.ordinal(), offset);
23918            match self {
23919                Representation::Node(ref val) => fidl::encoding::encode_in_envelope::<
23920                    NodeInfo,
23921                    fidl::encoding::DefaultFuchsiaResourceDialect,
23922                >(
23923                    <NodeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
23924                    encoder,
23925                    offset + 8,
23926                    _depth,
23927                ),
23928                Representation::Directory(ref val) => fidl::encoding::encode_in_envelope::<
23929                    DirectoryInfo,
23930                    fidl::encoding::DefaultFuchsiaResourceDialect,
23931                >(
23932                    <DirectoryInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
23933                    encoder,
23934                    offset + 8,
23935                    _depth,
23936                ),
23937                Representation::File(ref mut val) => fidl::encoding::encode_in_envelope::<
23938                    FileInfo,
23939                    fidl::encoding::DefaultFuchsiaResourceDialect,
23940                >(
23941                    <FileInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
23942                    encoder,
23943                    offset + 8,
23944                    _depth,
23945                ),
23946                Representation::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
23947                    SymlinkInfo,
23948                    fidl::encoding::DefaultFuchsiaResourceDialect,
23949                >(
23950                    <SymlinkInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
23951                    encoder,
23952                    offset + 8,
23953                    _depth,
23954                ),
23955                Representation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
23956            }
23957        }
23958    }
23959
23960    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23961        for Representation
23962    {
23963        #[inline(always)]
23964        fn new_empty() -> Self {
23965            Self::__SourceBreaking { unknown_ordinal: 0 }
23966        }
23967
23968        #[inline]
23969        unsafe fn decode(
23970            &mut self,
23971            decoder: &mut fidl::encoding::Decoder<
23972                '_,
23973                fidl::encoding::DefaultFuchsiaResourceDialect,
23974            >,
23975            offset: usize,
23976            mut depth: fidl::encoding::Depth,
23977        ) -> fidl::Result<()> {
23978            decoder.debug_check_bounds::<Self>(offset);
23979            #[allow(unused_variables)]
23980            let next_out_of_line = decoder.next_out_of_line();
23981            let handles_before = decoder.remaining_handles();
23982            let (ordinal, inlined, num_bytes, num_handles) =
23983                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23984
23985            let member_inline_size = match ordinal {
23986                1 => <NodeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23987                2 => <DirectoryInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23988                3 => <FileInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23989                4 => <SymlinkInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23990                0 => return Err(fidl::Error::UnknownUnionTag),
23991                _ => num_bytes as usize,
23992            };
23993
23994            if inlined != (member_inline_size <= 4) {
23995                return Err(fidl::Error::InvalidInlineBitInEnvelope);
23996            }
23997            let _inner_offset;
23998            if inlined {
23999                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24000                _inner_offset = offset + 8;
24001            } else {
24002                depth.increment()?;
24003                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24004            }
24005            match ordinal {
24006                1 => {
24007                    #[allow(irrefutable_let_patterns)]
24008                    if let Representation::Node(_) = self {
24009                        // Do nothing, read the value into the object
24010                    } else {
24011                        // Initialize `self` to the right variant
24012                        *self = Representation::Node(fidl::new_empty!(
24013                            NodeInfo,
24014                            fidl::encoding::DefaultFuchsiaResourceDialect
24015                        ));
24016                    }
24017                    #[allow(irrefutable_let_patterns)]
24018                    if let Representation::Node(ref mut val) = self {
24019                        fidl::decode!(
24020                            NodeInfo,
24021                            fidl::encoding::DefaultFuchsiaResourceDialect,
24022                            val,
24023                            decoder,
24024                            _inner_offset,
24025                            depth
24026                        )?;
24027                    } else {
24028                        unreachable!()
24029                    }
24030                }
24031                2 => {
24032                    #[allow(irrefutable_let_patterns)]
24033                    if let Representation::Directory(_) = self {
24034                        // Do nothing, read the value into the object
24035                    } else {
24036                        // Initialize `self` to the right variant
24037                        *self = Representation::Directory(fidl::new_empty!(
24038                            DirectoryInfo,
24039                            fidl::encoding::DefaultFuchsiaResourceDialect
24040                        ));
24041                    }
24042                    #[allow(irrefutable_let_patterns)]
24043                    if let Representation::Directory(ref mut val) = self {
24044                        fidl::decode!(
24045                            DirectoryInfo,
24046                            fidl::encoding::DefaultFuchsiaResourceDialect,
24047                            val,
24048                            decoder,
24049                            _inner_offset,
24050                            depth
24051                        )?;
24052                    } else {
24053                        unreachable!()
24054                    }
24055                }
24056                3 => {
24057                    #[allow(irrefutable_let_patterns)]
24058                    if let Representation::File(_) = self {
24059                        // Do nothing, read the value into the object
24060                    } else {
24061                        // Initialize `self` to the right variant
24062                        *self = Representation::File(fidl::new_empty!(
24063                            FileInfo,
24064                            fidl::encoding::DefaultFuchsiaResourceDialect
24065                        ));
24066                    }
24067                    #[allow(irrefutable_let_patterns)]
24068                    if let Representation::File(ref mut val) = self {
24069                        fidl::decode!(
24070                            FileInfo,
24071                            fidl::encoding::DefaultFuchsiaResourceDialect,
24072                            val,
24073                            decoder,
24074                            _inner_offset,
24075                            depth
24076                        )?;
24077                    } else {
24078                        unreachable!()
24079                    }
24080                }
24081                4 => {
24082                    #[allow(irrefutable_let_patterns)]
24083                    if let Representation::Symlink(_) = self {
24084                        // Do nothing, read the value into the object
24085                    } else {
24086                        // Initialize `self` to the right variant
24087                        *self = Representation::Symlink(fidl::new_empty!(
24088                            SymlinkInfo,
24089                            fidl::encoding::DefaultFuchsiaResourceDialect
24090                        ));
24091                    }
24092                    #[allow(irrefutable_let_patterns)]
24093                    if let Representation::Symlink(ref mut val) = self {
24094                        fidl::decode!(
24095                            SymlinkInfo,
24096                            fidl::encoding::DefaultFuchsiaResourceDialect,
24097                            val,
24098                            decoder,
24099                            _inner_offset,
24100                            depth
24101                        )?;
24102                    } else {
24103                        unreachable!()
24104                    }
24105                }
24106                #[allow(deprecated)]
24107                ordinal => {
24108                    for _ in 0..num_handles {
24109                        decoder.drop_next_handle()?;
24110                    }
24111                    *self = Representation::__SourceBreaking { unknown_ordinal: ordinal };
24112                }
24113            }
24114            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24115                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24116            }
24117            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24118                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24119            }
24120            Ok(())
24121        }
24122    }
24123}