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 SetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
950    fn r#set_attr(
951        &self,
952        flags: NodeAttributeFlags,
953        attributes: &NodeAttributes,
954    ) -> Self::SetAttrResponseFut;
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 GetConnectionInfoResponseFut: std::future::Future<Output = Result<ConnectionInfo, fidl::Error>>
971        + Send;
972    fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut;
973    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
974        + Send;
975    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
976    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
977        + Send;
978    fn r#update_attributes(
979        &self,
980        payload: &MutableNodeAttributes,
981    ) -> Self::UpdateAttributesResponseFut;
982    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
983    fn r#sync(&self) -> Self::SyncResponseFut;
984    fn r#list_extended_attributes(
985        &self,
986        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
987    ) -> Result<(), fidl::Error>;
988    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
989        + Send;
990    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
991    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
992        + Send;
993    fn r#set_extended_attribute(
994        &self,
995        name: &[u8],
996        value: ExtendedAttributeValue,
997        mode: SetExtendedAttributeMode,
998    ) -> Self::SetExtendedAttributeResponseFut;
999    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
1000        + Send;
1001    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
1002    fn r#deprecated_open(
1003        &self,
1004        flags: OpenFlags,
1005        mode: ModeType,
1006        path: &str,
1007        object: fidl::endpoints::ServerEnd<NodeMarker>,
1008    ) -> Result<(), fidl::Error>;
1009    fn r#open(
1010        &self,
1011        path: &str,
1012        flags: Flags,
1013        options: &Options,
1014        object: fidl::Channel,
1015    ) -> Result<(), fidl::Error>;
1016    type ReadDirentsResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>), fidl::Error>>
1017        + Send;
1018    fn r#read_dirents(&self, max_bytes: u64) -> Self::ReadDirentsResponseFut;
1019    type RewindResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1020    fn r#rewind(&self) -> Self::RewindResponseFut;
1021    type GetTokenResponseFut: std::future::Future<Output = Result<(i32, Option<fidl::Handle>), fidl::Error>>
1022        + Send;
1023    fn r#get_token(&self) -> Self::GetTokenResponseFut;
1024    type LinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1025    fn r#link(&self, src: &str, dst_parent_token: fidl::Handle, dst: &str)
1026        -> Self::LinkResponseFut;
1027    type UnlinkResponseFut: std::future::Future<Output = Result<DirectoryUnlinkResult, fidl::Error>>
1028        + Send;
1029    fn r#unlink(&self, name: &str, options: &UnlinkOptions) -> Self::UnlinkResponseFut;
1030    type RenameResponseFut: std::future::Future<Output = Result<DirectoryRenameResult, fidl::Error>>
1031        + Send;
1032    fn r#rename(
1033        &self,
1034        src: &str,
1035        dst_parent_token: fidl::Event,
1036        dst: &str,
1037    ) -> Self::RenameResponseFut;
1038    type CreateSymlinkResponseFut: std::future::Future<Output = Result<DirectoryCreateSymlinkResult, fidl::Error>>
1039        + Send;
1040    fn r#create_symlink(
1041        &self,
1042        name: &str,
1043        target: &[u8],
1044        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1045    ) -> Self::CreateSymlinkResponseFut;
1046    type WatchResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1047    fn r#watch(
1048        &self,
1049        mask: WatchMask,
1050        options: u32,
1051        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1052    ) -> Self::WatchResponseFut;
1053}
1054#[derive(Debug)]
1055#[cfg(target_os = "fuchsia")]
1056pub struct DirectorySynchronousProxy {
1057    client: fidl::client::sync::Client,
1058}
1059
1060#[cfg(target_os = "fuchsia")]
1061impl fidl::endpoints::SynchronousProxy for DirectorySynchronousProxy {
1062    type Proxy = DirectoryProxy;
1063    type Protocol = DirectoryMarker;
1064
1065    fn from_channel(inner: fidl::Channel) -> Self {
1066        Self::new(inner)
1067    }
1068
1069    fn into_channel(self) -> fidl::Channel {
1070        self.client.into_channel()
1071    }
1072
1073    fn as_channel(&self) -> &fidl::Channel {
1074        self.client.as_channel()
1075    }
1076}
1077
1078#[cfg(target_os = "fuchsia")]
1079impl DirectorySynchronousProxy {
1080    pub fn new(channel: fidl::Channel) -> Self {
1081        let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1082        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1083    }
1084
1085    pub fn into_channel(self) -> fidl::Channel {
1086        self.client.into_channel()
1087    }
1088
1089    /// Waits until an event arrives and returns it. It is safe for other
1090    /// threads to make concurrent requests while waiting for an event.
1091    pub fn wait_for_event(
1092        &self,
1093        deadline: zx::MonotonicInstant,
1094    ) -> Result<DirectoryEvent, fidl::Error> {
1095        DirectoryEvent::decode(self.client.wait_for_event(deadline)?)
1096    }
1097
1098    /// Acquires an advisory lock on the underlying file.
1099    ///
1100    /// The lock lasts until either this connection is closed or
1101    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1102    /// explicitly.
1103    ///
1104    /// Advisory locks are purely advisory. They do not prevent actual read or
1105    /// write operations from occurring on the file, either through this
1106    /// connection or through other connections.
1107    ///
1108    /// This method requires the following rights:
1109    ///
1110    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1111    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1112    ///   [`AdvisoryLockType.WRITE`].
1113    ///
1114    /// # Errors
1115    ///
1116    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1117    ///   example, another connection might hold a conflicting lock type.
1118    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1119    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1120    ///   to acquire the given type of lock.
1121    pub fn r#advisory_lock(
1122        &self,
1123        mut request: &AdvisoryLockRequest,
1124        ___deadline: zx::MonotonicInstant,
1125    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
1126        let _response = self.client.send_query::<
1127            AdvisoryLockingAdvisoryLockRequest,
1128            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1129        >(
1130            (request,),
1131            0x6ee9c0ad53ec87aa,
1132            fidl::encoding::DynamicFlags::empty(),
1133            ___deadline,
1134        )?;
1135        Ok(_response.map(|x| x))
1136    }
1137
1138    pub fn r#clone(
1139        &self,
1140        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1141    ) -> Result<(), fidl::Error> {
1142        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
1143            (request,),
1144            0x20d8a7aba2168a79,
1145            fidl::encoding::DynamicFlags::empty(),
1146        )
1147    }
1148
1149    /// Terminates the connection.
1150    ///
1151    /// After calling `Close`, the client must not send any other requests.
1152    ///
1153    /// Servers, after sending the status response, should close the connection
1154    /// regardless of status and without sending an epitaph.
1155    ///
1156    /// Closing the client end of the channel should be semantically equivalent
1157    /// to calling `Close` without knowing when the close has completed or its
1158    /// status.
1159    pub fn r#close(
1160        &self,
1161        ___deadline: zx::MonotonicInstant,
1162    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
1163        let _response = self.client.send_query::<
1164            fidl::encoding::EmptyPayload,
1165            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1166        >(
1167            (),
1168            0x5ac5d459ad7f657e,
1169            fidl::encoding::DynamicFlags::empty(),
1170            ___deadline,
1171        )?;
1172        Ok(_response.map(|x| x))
1173    }
1174
1175    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
1176        let _response = self.client.send_query::<
1177            fidl::encoding::EmptyPayload,
1178            fidl_fuchsia_unknown::QueryableQueryResponse,
1179        >(
1180            (),
1181            0x2658edee9decfc06,
1182            fidl::encoding::DynamicFlags::empty(),
1183            ___deadline,
1184        )?;
1185        Ok(_response.protocol)
1186    }
1187
1188    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1189    pub fn r#deprecated_clone(
1190        &self,
1191        mut flags: OpenFlags,
1192        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1193    ) -> Result<(), fidl::Error> {
1194        self.client.send::<NodeDeprecatedCloneRequest>(
1195            (flags, object),
1196            0x5a61678f293ce16f,
1197            fidl::encoding::DynamicFlags::FLEXIBLE,
1198        )
1199    }
1200
1201    /// Acquires information about the node.
1202    ///
1203    /// This method does not require any rights.
1204    pub fn r#get_attr(
1205        &self,
1206        ___deadline: zx::MonotonicInstant,
1207    ) -> Result<(i32, NodeAttributes), fidl::Error> {
1208        let _response =
1209            self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetAttrResponse>(
1210                (),
1211                0x78985e216314dafd,
1212                fidl::encoding::DynamicFlags::empty(),
1213                ___deadline,
1214            )?;
1215        Ok((_response.s, _response.attributes))
1216    }
1217
1218    /// Updates information about the node.
1219    ///
1220    /// Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.
1221    ///
1222    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1223    /// `ZX_ERR_BAD_HANDLE`.
1224    pub fn r#set_attr(
1225        &self,
1226        mut flags: NodeAttributeFlags,
1227        mut attributes: &NodeAttributes,
1228        ___deadline: zx::MonotonicInstant,
1229    ) -> Result<i32, fidl::Error> {
1230        let _response = self.client.send_query::<NodeSetAttrRequest, NodeSetAttrResponse>(
1231            (flags, attributes),
1232            0x4186c0f40d938f46,
1233            fidl::encoding::DynamicFlags::empty(),
1234            ___deadline,
1235        )?;
1236        Ok(_response.s)
1237    }
1238
1239    /// [DEPRECATED - Use new GetFlags method instead.]
1240    pub fn r#deprecated_get_flags(
1241        &self,
1242        ___deadline: zx::MonotonicInstant,
1243    ) -> Result<(i32, OpenFlags), fidl::Error> {
1244        let _response = self
1245            .client
1246            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
1247                (),
1248                0x5b88fffb8eda3aa1,
1249                fidl::encoding::DynamicFlags::empty(),
1250                ___deadline,
1251            )?;
1252        Ok((_response.s, _response.flags))
1253    }
1254
1255    /// [DEPRECATED - Use new SetFlags method instead.]
1256    pub fn r#deprecated_set_flags(
1257        &self,
1258        mut flags: OpenFlags,
1259        ___deadline: zx::MonotonicInstant,
1260    ) -> Result<i32, fidl::Error> {
1261        let _response = self
1262            .client
1263            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
1264                (flags,),
1265                0x5295b76c71fde733,
1266                fidl::encoding::DynamicFlags::empty(),
1267                ___deadline,
1268            )?;
1269        Ok(_response.s)
1270    }
1271
1272    /// Queries the flags that apply to this node after it has been opened/created. This method does
1273    /// not require any rights.
1274    ///
1275    /// Note that the final set of flags that apply to the connection may differ from those
1276    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1277    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1278    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1279    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1280    pub fn r#get_flags(
1281        &self,
1282        ___deadline: zx::MonotonicInstant,
1283    ) -> Result<NodeGetFlagsResult, fidl::Error> {
1284        let _response = self.client.send_query::<
1285            fidl::encoding::EmptyPayload,
1286            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
1287        >(
1288            (),
1289            0x176eb318f64ec23,
1290            fidl::encoding::DynamicFlags::FLEXIBLE,
1291            ___deadline,
1292        )?
1293        .into_result::<DirectoryMarker>("get_flags")?;
1294        Ok(_response.map(|x| x.flags))
1295    }
1296
1297    /// Sets the flags that apply to this node after it has been opened. This method does not
1298    /// require any rights.
1299    ///
1300    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1301    /// clear append mode.
1302    ///
1303    /// Errors:
1304    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1305    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1306    pub fn r#set_flags(
1307        &self,
1308        mut flags: Flags,
1309        ___deadline: zx::MonotonicInstant,
1310    ) -> Result<NodeSetFlagsResult, fidl::Error> {
1311        let _response = self.client.send_query::<
1312            NodeSetFlagsRequest,
1313            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1314        >(
1315            (flags,),
1316            0x55a8028685791ea8,
1317            fidl::encoding::DynamicFlags::FLEXIBLE,
1318            ___deadline,
1319        )?
1320        .into_result::<DirectoryMarker>("set_flags")?;
1321        Ok(_response.map(|x| x))
1322    }
1323
1324    /// Query the filesystem for filesystem-specific information.
1325    pub fn r#query_filesystem(
1326        &self,
1327        ___deadline: zx::MonotonicInstant,
1328    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
1329        let _response =
1330            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
1331                (),
1332                0x6f344a1c6b0a0610,
1333                fidl::encoding::DynamicFlags::empty(),
1334                ___deadline,
1335            )?;
1336        Ok((_response.s, _response.info))
1337    }
1338
1339    /// Acquires information about the connection.
1340    ///
1341    /// This method does not require any rights.
1342    pub fn r#get_connection_info(
1343        &self,
1344        ___deadline: zx::MonotonicInstant,
1345    ) -> Result<ConnectionInfo, fidl::Error> {
1346        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, ConnectionInfo>(
1347            (),
1348            0x584c377c7c0a6d0b,
1349            fidl::encoding::DynamicFlags::empty(),
1350            ___deadline,
1351        )?;
1352        Ok(_response)
1353    }
1354
1355    /// Acquires information about the node.
1356    ///
1357    /// The attributes of a node should be stable, independent of the
1358    /// specific protocol used to access it.
1359    ///
1360    /// If a particular attribute is not applicable or not supported,
1361    /// filesystems should leave the corresponding field absent.
1362    ///
1363    /// + `query` a bit-mask specifying which attributes to fetch. The server
1364    ///   should not return more than necessary.
1365    /// - `attributes` the returned attributes.
1366    ///
1367    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1368    pub fn r#get_attributes(
1369        &self,
1370        mut query: NodeAttributesQuery,
1371        ___deadline: zx::MonotonicInstant,
1372    ) -> Result<NodeGetAttributesResult, fidl::Error> {
1373        let _response = self.client.send_query::<
1374            NodeGetAttributesRequest,
1375            fidl::encoding::ResultType<NodeAttributes2, i32>,
1376        >(
1377            (query,),
1378            0x3d4396a638ea053b,
1379            fidl::encoding::DynamicFlags::empty(),
1380            ___deadline,
1381        )?;
1382        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
1383    }
1384
1385    /// Updates information about the node.
1386    ///
1387    /// + `attributes` the presence of a table field in `attributes` indicates
1388    /// the intent to update the corresponding attribute.
1389    ///
1390    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
1391    ///
1392    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1393    pub fn r#update_attributes(
1394        &self,
1395        mut payload: &MutableNodeAttributes,
1396        ___deadline: zx::MonotonicInstant,
1397    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
1398        let _response = self.client.send_query::<
1399            MutableNodeAttributes,
1400            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1401        >(
1402            payload,
1403            0x3308c1da5a89bf08,
1404            fidl::encoding::DynamicFlags::empty(),
1405            ___deadline,
1406        )?;
1407        Ok(_response.map(|x| x))
1408    }
1409
1410    /// Synchronizes updates to the node to the underlying media, if it exists.
1411    ///
1412    /// This method will return when the filesystem server has flushed the
1413    /// relevant updates to the underlying media, but does not guarantee the
1414    /// underlying media has persisted the information, nor that any information
1415    /// is committed to hardware. Clients may use `Sync` to ensure ordering
1416    /// between operations.
1417    ///
1418    /// This method does not require any rights.
1419    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
1420        let _response = self.client.send_query::<
1421            fidl::encoding::EmptyPayload,
1422            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1423        >(
1424            (),
1425            0x2c5c27ca0ab5dc49,
1426            fidl::encoding::DynamicFlags::empty(),
1427            ___deadline,
1428        )?;
1429        Ok(_response.map(|x| x))
1430    }
1431
1432    /// Creates an iterator over all the extended attribute names associated
1433    /// with this node. If an error occurs it is returned as an epitaph on the
1434    /// iterator request channel, and then the channel is closed.
1435    ///
1436    /// GetExtendedAttributes can be used with any of these names to retrieve
1437    /// the associated value.
1438    ///
1439    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1440    pub fn r#list_extended_attributes(
1441        &self,
1442        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
1443    ) -> Result<(), fidl::Error> {
1444        self.client.send::<NodeListExtendedAttributesRequest>(
1445            (iterator,),
1446            0x4b61033de007fcd0,
1447            fidl::encoding::DynamicFlags::empty(),
1448        )
1449    }
1450
1451    /// Get the value associated with the given attribute `name` for this node.
1452    ///
1453    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
1454    /// particular structure is imposed on them.
1455    ///
1456    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1457    pub fn r#get_extended_attribute(
1458        &self,
1459        mut name: &[u8],
1460        ___deadline: zx::MonotonicInstant,
1461    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
1462        let _response = self.client.send_query::<
1463            NodeGetExtendedAttributeRequest,
1464            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
1465        >(
1466            (name,),
1467            0x45ffa3ccfdeb76db,
1468            fidl::encoding::DynamicFlags::empty(),
1469            ___deadline,
1470        )?;
1471        Ok(_response.map(|x| x))
1472    }
1473
1474    /// Set the value for the given attribute `name` to `value` for this node.
1475    ///
1476    /// The attribute name may exist, in which case the attribute is updated.
1477    /// If the attribute doesn't exist, it is created. The name should have no
1478    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
1479    ///
1480    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1481    pub fn r#set_extended_attribute(
1482        &self,
1483        mut name: &[u8],
1484        mut value: ExtendedAttributeValue,
1485        mut mode: SetExtendedAttributeMode,
1486        ___deadline: zx::MonotonicInstant,
1487    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
1488        let _response = self.client.send_query::<
1489            NodeSetExtendedAttributeRequest,
1490            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1491        >(
1492            (name, &mut value, mode,),
1493            0x4a951362f681f23c,
1494            fidl::encoding::DynamicFlags::empty(),
1495            ___deadline,
1496        )?;
1497        Ok(_response.map(|x| x))
1498    }
1499
1500    /// Remove the specified extended attribute.
1501    ///
1502    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
1503    ///
1504    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1505    pub fn r#remove_extended_attribute(
1506        &self,
1507        mut name: &[u8],
1508        ___deadline: zx::MonotonicInstant,
1509    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
1510        let _response = self.client.send_query::<
1511            NodeRemoveExtendedAttributeRequest,
1512            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1513        >(
1514            (name,),
1515            0x7a0b9f3a9bf9032d,
1516            fidl::encoding::DynamicFlags::empty(),
1517            ___deadline,
1518        )?;
1519        Ok(_response.map(|x| x))
1520    }
1521
1522    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
1523    pub fn r#deprecated_open(
1524        &self,
1525        mut flags: OpenFlags,
1526        mut mode: ModeType,
1527        mut path: &str,
1528        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1529    ) -> Result<(), fidl::Error> {
1530        self.client.send::<DirectoryDeprecatedOpenRequest>(
1531            (flags, mode, path, object),
1532            0x2c5044561d685ec0,
1533            fidl::encoding::DynamicFlags::FLEXIBLE,
1534        )
1535    }
1536
1537    /// Open (or create) a node relative to this directory. Any errors are communicated via an
1538    /// epitaph sent on the `object` channel.
1539    ///
1540    /// Errors:
1541    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
1542    /// * See [`Flags`] for other errors which may be communicated based on `flags`
1543    pub fn r#open(
1544        &self,
1545        mut path: &str,
1546        mut flags: Flags,
1547        mut options: &Options,
1548        mut object: fidl::Channel,
1549    ) -> Result<(), fidl::Error> {
1550        self.client.send::<DirectoryOpenRequest>(
1551            (path, flags, options, object),
1552            0x568ddcb9a9cbb6d9,
1553            fidl::encoding::DynamicFlags::empty(),
1554        )
1555    }
1556
1557    /// Reads a collection of variably sized dirents into a buffer.
1558    /// The number of dirents in a directory may be very large: akin to
1559    /// calling read multiple times on a file, directories have a seek
1560    /// offset which is updated on subsequent calls to ReadDirents.
1561    /// Each call to ReadDirents will only return whole dirent structures,
1562    /// they will not get split across ReadDirent calls. When the seek
1563    /// offset reaches the end, `dirents` will be empty.
1564    ///
1565    /// These dirents are of the form:
1566    /// ```
1567    /// struct dirent {
1568    ///   // Describes the inode of the entry.
1569    ///   uint64 ino;
1570    ///   // Describes the length of the dirent name in bytes.
1571    ///   uint8 size;
1572    ///   // Describes the type of the entry. Aligned with the
1573    ///   // POSIX d_type values. Use `DirentType` constants.
1574    ///   uint8 type;
1575    ///   // Unterminated name of entry.
1576    ///   char name[0];
1577    /// }
1578    /// ```
1579    ///
1580    /// This method does not require any rights, since one could always probe for
1581    /// directory contents by triggering name conflicts during file creation.
1582    pub fn r#read_dirents(
1583        &self,
1584        mut max_bytes: u64,
1585        ___deadline: zx::MonotonicInstant,
1586    ) -> Result<(i32, Vec<u8>), fidl::Error> {
1587        let _response =
1588            self.client.send_query::<DirectoryReadDirentsRequest, DirectoryReadDirentsResponse>(
1589                (max_bytes,),
1590                0x3582806bf27faa0a,
1591                fidl::encoding::DynamicFlags::empty(),
1592                ___deadline,
1593            )?;
1594        Ok((_response.s, _response.dirents))
1595    }
1596
1597    /// Resets the directory seek offset.
1598    ///
1599    /// This method does not require any rights, similar to ReadDirents.
1600    pub fn r#rewind(&self, ___deadline: zx::MonotonicInstant) -> Result<i32, fidl::Error> {
1601        let _response =
1602            self.client.send_query::<fidl::encoding::EmptyPayload, DirectoryRewindResponse>(
1603                (),
1604                0x16b1202af0f34c71,
1605                fidl::encoding::DynamicFlags::empty(),
1606                ___deadline,
1607            )?;
1608        Ok(_response.s)
1609    }
1610
1611    /// Acquires a token to a Directory which can be used to identify access to it at a later point
1612    /// in time. The token will remain valid for as long as the connection requesting the token
1613    /// remains open.
1614    ///
1615    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1616    /// `ZX_ERR_BAD_HANDLE`.
1617    pub fn r#get_token(
1618        &self,
1619        ___deadline: zx::MonotonicInstant,
1620    ) -> Result<(i32, Option<fidl::Handle>), fidl::Error> {
1621        let _response =
1622            self.client.send_query::<fidl::encoding::EmptyPayload, DirectoryGetTokenResponse>(
1623                (),
1624                0x26ae9d18763c8655,
1625                fidl::encoding::DynamicFlags::empty(),
1626                ___deadline,
1627            )?;
1628        Ok((_response.s, _response.token))
1629    }
1630
1631    /// Creates a link to an object named src by the name dst, within a directory represented by
1632    /// token.
1633    ///
1634    /// `src` must be a resolved object name. Including "/" in the string will
1635    /// return `ZX_ERR_INVALID_ARGS`.
1636    ///
1637    /// `dst` must be a resolved object name. Including "/" in the string will
1638    /// return `ZX_ERR_INVALID_ARGS`.
1639    ///
1640    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
1641    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
1642    ///
1643    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
1644    /// there are two actors operating concurrently, and one actor performs a rename that affects
1645    /// the source within this directory, and the other does a link, each will appear to occur
1646    /// atomically in an unspecified order.
1647    pub fn r#link(
1648        &self,
1649        mut src: &str,
1650        mut dst_parent_token: fidl::Handle,
1651        mut dst: &str,
1652        ___deadline: zx::MonotonicInstant,
1653    ) -> Result<i32, fidl::Error> {
1654        let _response = self.client.send_query::<DirectoryLinkRequest, DirectoryLinkResponse>(
1655            (src, dst_parent_token, dst),
1656            0x740604c0c7c930e7,
1657            fidl::encoding::DynamicFlags::empty(),
1658            ___deadline,
1659        )?;
1660        Ok(_response.s)
1661    }
1662
1663    /// Removes a child node from the this directory's list of entries.
1664    ///
1665    /// Note: this does not guarantee that the underlying object is destroyed.
1666    /// Although the link will be removed from the containing directory,
1667    /// objects with multiple references (such as files which are still open)
1668    /// will not actually be destroyed until all references are closed.
1669    ///
1670    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
1671    ///   [`Rights.WRITE_BYTES`].
1672    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
1673    ///   support writing.
1674    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
1675    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
1676    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
1677    ///   containing a remote channel.
1678    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
1679    ///     something other than a directory was found.
1680    ///
1681    /// Other errors may be returned for filesystem-specific reasons.
1682    ///
1683    /// This method requires the following rights:
1684    ///
1685    /// * [`Rights.ENUMERATE`]
1686    /// * [`Rights.MODIFY_DIRECTORY`]
1687    pub fn r#unlink(
1688        &self,
1689        mut name: &str,
1690        mut options: &UnlinkOptions,
1691        ___deadline: zx::MonotonicInstant,
1692    ) -> Result<DirectoryUnlinkResult, fidl::Error> {
1693        let _response = self.client.send_query::<
1694            DirectoryUnlinkRequest,
1695            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1696        >(
1697            (name, options,),
1698            0x750a0326a78d7bed,
1699            fidl::encoding::DynamicFlags::empty(),
1700            ___deadline,
1701        )?;
1702        Ok(_response.map(|x| x))
1703    }
1704
1705    /// Renames a node named `src` to the name `dst`, in a directory represented
1706    /// by `dst_parent_token`.
1707    ///
1708    /// `src` and `dst` must be valid node names.
1709    /// See [`Name`] for what constitutes a valid name.
1710    ///
1711    /// This method requires the following rights on both the current connection, and the connection
1712    /// identified by `dst_parent_token`:
1713    ///
1714    /// * [`Rights.ENUMERATE`]
1715    /// * [`Rights.MODIFY_DIRECTORY`]
1716    ///
1717    /// The following requirements are necessary to avoid rights escalations.
1718    ///
1719    /// If the source and destination directory differ, the source directory must also have the
1720    /// maximal set of abilities supported for files, which would typically be
1721    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
1722    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
1723    /// right.
1724    ///
1725    /// If `src` refers to a directory, and differs from the destination directory, then the source
1726    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
1727    ///
1728    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
1729    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
1730    pub fn r#rename(
1731        &self,
1732        mut src: &str,
1733        mut dst_parent_token: fidl::Event,
1734        mut dst: &str,
1735        ___deadline: zx::MonotonicInstant,
1736    ) -> Result<DirectoryRenameResult, fidl::Error> {
1737        let _response = self.client.send_query::<
1738            DirectoryRenameRequest,
1739            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1740        >(
1741            (src, dst_parent_token, dst,),
1742            0x7060e7723b9928de,
1743            fidl::encoding::DynamicFlags::empty(),
1744            ___deadline,
1745        )?;
1746        Ok(_response.map(|x| x))
1747    }
1748
1749    /// Creates a symbolic link.
1750    ///
1751    /// `name` is the name to be given to the created symbolic link.
1752    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
1753    /// will perform no validation of `target` except for a server chosen maximum length.
1754    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
1755    /// on the successfully created node.
1756    ///
1757    /// * [`Rights.MODIFY_DIRECTORY`]
1758    ///
1759    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
1760    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
1761    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
1762    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
1763    pub fn r#create_symlink(
1764        &self,
1765        mut name: &str,
1766        mut target: &[u8],
1767        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1768        ___deadline: zx::MonotonicInstant,
1769    ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
1770        let _response = self.client.send_query::<
1771            DirectoryCreateSymlinkRequest,
1772            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1773        >(
1774            (name, target, connection,),
1775            0x21ce0f19ec043889,
1776            fidl::encoding::DynamicFlags::empty(),
1777            ___deadline,
1778        )?;
1779        Ok(_response.map(|x| x))
1780    }
1781
1782    /// Watches a directory, receiving events of added messages on the
1783    /// watcher request channel.
1784    ///
1785    /// Options must be zero; it is reserved.
1786    ///
1787    /// This method does not require any rights, similar to ReadDirents.
1788    pub fn r#watch(
1789        &self,
1790        mut mask: WatchMask,
1791        mut options: u32,
1792        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1793        ___deadline: zx::MonotonicInstant,
1794    ) -> Result<i32, fidl::Error> {
1795        let _response = self.client.send_query::<DirectoryWatchRequest, DirectoryWatchResponse>(
1796            (mask, options, watcher),
1797            0x5717193a59d66d91,
1798            fidl::encoding::DynamicFlags::empty(),
1799            ___deadline,
1800        )?;
1801        Ok(_response.s)
1802    }
1803}
1804
1805#[cfg(target_os = "fuchsia")]
1806impl From<DirectorySynchronousProxy> for zx::Handle {
1807    fn from(value: DirectorySynchronousProxy) -> Self {
1808        value.into_channel().into()
1809    }
1810}
1811
1812#[cfg(target_os = "fuchsia")]
1813impl From<fidl::Channel> for DirectorySynchronousProxy {
1814    fn from(value: fidl::Channel) -> Self {
1815        Self::new(value)
1816    }
1817}
1818
1819#[derive(Debug, Clone)]
1820pub struct DirectoryProxy {
1821    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1822}
1823
1824impl fidl::endpoints::Proxy for DirectoryProxy {
1825    type Protocol = DirectoryMarker;
1826
1827    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1828        Self::new(inner)
1829    }
1830
1831    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1832        self.client.into_channel().map_err(|client| Self { client })
1833    }
1834
1835    fn as_channel(&self) -> &::fidl::AsyncChannel {
1836        self.client.as_channel()
1837    }
1838}
1839
1840impl DirectoryProxy {
1841    /// Create a new Proxy for fuchsia.io/Directory.
1842    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1843        let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1844        Self { client: fidl::client::Client::new(channel, protocol_name) }
1845    }
1846
1847    /// Get a Stream of events from the remote end of the protocol.
1848    ///
1849    /// # Panics
1850    ///
1851    /// Panics if the event stream was already taken.
1852    pub fn take_event_stream(&self) -> DirectoryEventStream {
1853        DirectoryEventStream { event_receiver: self.client.take_event_receiver() }
1854    }
1855
1856    /// Acquires an advisory lock on the underlying file.
1857    ///
1858    /// The lock lasts until either this connection is closed or
1859    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1860    /// explicitly.
1861    ///
1862    /// Advisory locks are purely advisory. They do not prevent actual read or
1863    /// write operations from occurring on the file, either through this
1864    /// connection or through other connections.
1865    ///
1866    /// This method requires the following rights:
1867    ///
1868    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1869    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1870    ///   [`AdvisoryLockType.WRITE`].
1871    ///
1872    /// # Errors
1873    ///
1874    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1875    ///   example, another connection might hold a conflicting lock type.
1876    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1877    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1878    ///   to acquire the given type of lock.
1879    pub fn r#advisory_lock(
1880        &self,
1881        mut request: &AdvisoryLockRequest,
1882    ) -> fidl::client::QueryResponseFut<
1883        AdvisoryLockingAdvisoryLockResult,
1884        fidl::encoding::DefaultFuchsiaResourceDialect,
1885    > {
1886        DirectoryProxyInterface::r#advisory_lock(self, request)
1887    }
1888
1889    pub fn r#clone(
1890        &self,
1891        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1892    ) -> Result<(), fidl::Error> {
1893        DirectoryProxyInterface::r#clone(self, request)
1894    }
1895
1896    /// Terminates the connection.
1897    ///
1898    /// After calling `Close`, the client must not send any other requests.
1899    ///
1900    /// Servers, after sending the status response, should close the connection
1901    /// regardless of status and without sending an epitaph.
1902    ///
1903    /// Closing the client end of the channel should be semantically equivalent
1904    /// to calling `Close` without knowing when the close has completed or its
1905    /// status.
1906    pub fn r#close(
1907        &self,
1908    ) -> fidl::client::QueryResponseFut<
1909        fidl_fuchsia_unknown::CloseableCloseResult,
1910        fidl::encoding::DefaultFuchsiaResourceDialect,
1911    > {
1912        DirectoryProxyInterface::r#close(self)
1913    }
1914
1915    pub fn r#query(
1916        &self,
1917    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
1918    {
1919        DirectoryProxyInterface::r#query(self)
1920    }
1921
1922    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1923    pub fn r#deprecated_clone(
1924        &self,
1925        mut flags: OpenFlags,
1926        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1927    ) -> Result<(), fidl::Error> {
1928        DirectoryProxyInterface::r#deprecated_clone(self, flags, object)
1929    }
1930
1931    /// Acquires information about the node.
1932    ///
1933    /// This method does not require any rights.
1934    pub fn r#get_attr(
1935        &self,
1936    ) -> fidl::client::QueryResponseFut<
1937        (i32, NodeAttributes),
1938        fidl::encoding::DefaultFuchsiaResourceDialect,
1939    > {
1940        DirectoryProxyInterface::r#get_attr(self)
1941    }
1942
1943    /// Updates information about the node.
1944    ///
1945    /// Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.
1946    ///
1947    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1948    /// `ZX_ERR_BAD_HANDLE`.
1949    pub fn r#set_attr(
1950        &self,
1951        mut flags: NodeAttributeFlags,
1952        mut attributes: &NodeAttributes,
1953    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
1954        DirectoryProxyInterface::r#set_attr(self, flags, attributes)
1955    }
1956
1957    /// [DEPRECATED - Use new GetFlags method instead.]
1958    pub fn r#deprecated_get_flags(
1959        &self,
1960    ) -> fidl::client::QueryResponseFut<
1961        (i32, OpenFlags),
1962        fidl::encoding::DefaultFuchsiaResourceDialect,
1963    > {
1964        DirectoryProxyInterface::r#deprecated_get_flags(self)
1965    }
1966
1967    /// [DEPRECATED - Use new SetFlags method instead.]
1968    pub fn r#deprecated_set_flags(
1969        &self,
1970        mut flags: OpenFlags,
1971    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
1972        DirectoryProxyInterface::r#deprecated_set_flags(self, flags)
1973    }
1974
1975    /// Queries the flags that apply to this node after it has been opened/created. This method does
1976    /// not require any rights.
1977    ///
1978    /// Note that the final set of flags that apply to the connection may differ from those
1979    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1980    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1981    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1982    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1983    pub fn r#get_flags(
1984        &self,
1985    ) -> fidl::client::QueryResponseFut<
1986        NodeGetFlagsResult,
1987        fidl::encoding::DefaultFuchsiaResourceDialect,
1988    > {
1989        DirectoryProxyInterface::r#get_flags(self)
1990    }
1991
1992    /// Sets the flags that apply to this node after it has been opened. This method does not
1993    /// require any rights.
1994    ///
1995    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1996    /// clear append mode.
1997    ///
1998    /// Errors:
1999    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
2000    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
2001    pub fn r#set_flags(
2002        &self,
2003        mut flags: Flags,
2004    ) -> fidl::client::QueryResponseFut<
2005        NodeSetFlagsResult,
2006        fidl::encoding::DefaultFuchsiaResourceDialect,
2007    > {
2008        DirectoryProxyInterface::r#set_flags(self, flags)
2009    }
2010
2011    /// Query the filesystem for filesystem-specific information.
2012    pub fn r#query_filesystem(
2013        &self,
2014    ) -> fidl::client::QueryResponseFut<
2015        (i32, Option<Box<FilesystemInfo>>),
2016        fidl::encoding::DefaultFuchsiaResourceDialect,
2017    > {
2018        DirectoryProxyInterface::r#query_filesystem(self)
2019    }
2020
2021    /// Acquires information about the connection.
2022    ///
2023    /// This method does not require any rights.
2024    pub fn r#get_connection_info(
2025        &self,
2026    ) -> fidl::client::QueryResponseFut<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
2027    {
2028        DirectoryProxyInterface::r#get_connection_info(self)
2029    }
2030
2031    /// Acquires information about the node.
2032    ///
2033    /// The attributes of a node should be stable, independent of the
2034    /// specific protocol used to access it.
2035    ///
2036    /// If a particular attribute is not applicable or not supported,
2037    /// filesystems should leave the corresponding field absent.
2038    ///
2039    /// + `query` a bit-mask specifying which attributes to fetch. The server
2040    ///   should not return more than necessary.
2041    /// - `attributes` the returned attributes.
2042    ///
2043    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2044    pub fn r#get_attributes(
2045        &self,
2046        mut query: NodeAttributesQuery,
2047    ) -> fidl::client::QueryResponseFut<
2048        NodeGetAttributesResult,
2049        fidl::encoding::DefaultFuchsiaResourceDialect,
2050    > {
2051        DirectoryProxyInterface::r#get_attributes(self, query)
2052    }
2053
2054    /// Updates information about the node.
2055    ///
2056    /// + `attributes` the presence of a table field in `attributes` indicates
2057    /// the intent to update the corresponding attribute.
2058    ///
2059    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
2060    ///
2061    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2062    pub fn r#update_attributes(
2063        &self,
2064        mut payload: &MutableNodeAttributes,
2065    ) -> fidl::client::QueryResponseFut<
2066        NodeUpdateAttributesResult,
2067        fidl::encoding::DefaultFuchsiaResourceDialect,
2068    > {
2069        DirectoryProxyInterface::r#update_attributes(self, payload)
2070    }
2071
2072    /// Synchronizes updates to the node to the underlying media, if it exists.
2073    ///
2074    /// This method will return when the filesystem server has flushed the
2075    /// relevant updates to the underlying media, but does not guarantee the
2076    /// underlying media has persisted the information, nor that any information
2077    /// is committed to hardware. Clients may use `Sync` to ensure ordering
2078    /// between operations.
2079    ///
2080    /// This method does not require any rights.
2081    pub fn r#sync(
2082        &self,
2083    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
2084    {
2085        DirectoryProxyInterface::r#sync(self)
2086    }
2087
2088    /// Creates an iterator over all the extended attribute names associated
2089    /// with this node. If an error occurs it is returned as an epitaph on the
2090    /// iterator request channel, and then the channel is closed.
2091    ///
2092    /// GetExtendedAttributes can be used with any of these names to retrieve
2093    /// the associated value.
2094    ///
2095    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2096    pub fn r#list_extended_attributes(
2097        &self,
2098        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2099    ) -> Result<(), fidl::Error> {
2100        DirectoryProxyInterface::r#list_extended_attributes(self, iterator)
2101    }
2102
2103    /// Get the value associated with the given attribute `name` for this node.
2104    ///
2105    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
2106    /// particular structure is imposed on them.
2107    ///
2108    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2109    pub fn r#get_extended_attribute(
2110        &self,
2111        mut name: &[u8],
2112    ) -> fidl::client::QueryResponseFut<
2113        NodeGetExtendedAttributeResult,
2114        fidl::encoding::DefaultFuchsiaResourceDialect,
2115    > {
2116        DirectoryProxyInterface::r#get_extended_attribute(self, name)
2117    }
2118
2119    /// Set the value for the given attribute `name` to `value` for this node.
2120    ///
2121    /// The attribute name may exist, in which case the attribute is updated.
2122    /// If the attribute doesn't exist, it is created. The name should have no
2123    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
2124    ///
2125    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2126    pub fn r#set_extended_attribute(
2127        &self,
2128        mut name: &[u8],
2129        mut value: ExtendedAttributeValue,
2130        mut mode: SetExtendedAttributeMode,
2131    ) -> fidl::client::QueryResponseFut<
2132        NodeSetExtendedAttributeResult,
2133        fidl::encoding::DefaultFuchsiaResourceDialect,
2134    > {
2135        DirectoryProxyInterface::r#set_extended_attribute(self, name, value, mode)
2136    }
2137
2138    /// Remove the specified extended attribute.
2139    ///
2140    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
2141    ///
2142    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2143    pub fn r#remove_extended_attribute(
2144        &self,
2145        mut name: &[u8],
2146    ) -> fidl::client::QueryResponseFut<
2147        NodeRemoveExtendedAttributeResult,
2148        fidl::encoding::DefaultFuchsiaResourceDialect,
2149    > {
2150        DirectoryProxyInterface::r#remove_extended_attribute(self, name)
2151    }
2152
2153    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
2154    pub fn r#deprecated_open(
2155        &self,
2156        mut flags: OpenFlags,
2157        mut mode: ModeType,
2158        mut path: &str,
2159        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2160    ) -> Result<(), fidl::Error> {
2161        DirectoryProxyInterface::r#deprecated_open(self, flags, mode, path, object)
2162    }
2163
2164    /// Open (or create) a node relative to this directory. Any errors are communicated via an
2165    /// epitaph sent on the `object` channel.
2166    ///
2167    /// Errors:
2168    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
2169    /// * See [`Flags`] for other errors which may be communicated based on `flags`
2170    pub fn r#open(
2171        &self,
2172        mut path: &str,
2173        mut flags: Flags,
2174        mut options: &Options,
2175        mut object: fidl::Channel,
2176    ) -> Result<(), fidl::Error> {
2177        DirectoryProxyInterface::r#open(self, path, flags, options, object)
2178    }
2179
2180    /// Reads a collection of variably sized dirents into a buffer.
2181    /// The number of dirents in a directory may be very large: akin to
2182    /// calling read multiple times on a file, directories have a seek
2183    /// offset which is updated on subsequent calls to ReadDirents.
2184    /// Each call to ReadDirents will only return whole dirent structures,
2185    /// they will not get split across ReadDirent calls. When the seek
2186    /// offset reaches the end, `dirents` will be empty.
2187    ///
2188    /// These dirents are of the form:
2189    /// ```
2190    /// struct dirent {
2191    ///   // Describes the inode of the entry.
2192    ///   uint64 ino;
2193    ///   // Describes the length of the dirent name in bytes.
2194    ///   uint8 size;
2195    ///   // Describes the type of the entry. Aligned with the
2196    ///   // POSIX d_type values. Use `DirentType` constants.
2197    ///   uint8 type;
2198    ///   // Unterminated name of entry.
2199    ///   char name[0];
2200    /// }
2201    /// ```
2202    ///
2203    /// This method does not require any rights, since one could always probe for
2204    /// directory contents by triggering name conflicts during file creation.
2205    pub fn r#read_dirents(
2206        &self,
2207        mut max_bytes: u64,
2208    ) -> fidl::client::QueryResponseFut<(i32, Vec<u8>), fidl::encoding::DefaultFuchsiaResourceDialect>
2209    {
2210        DirectoryProxyInterface::r#read_dirents(self, max_bytes)
2211    }
2212
2213    /// Resets the directory seek offset.
2214    ///
2215    /// This method does not require any rights, similar to ReadDirents.
2216    pub fn r#rewind(
2217        &self,
2218    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2219        DirectoryProxyInterface::r#rewind(self)
2220    }
2221
2222    /// Acquires a token to a Directory which can be used to identify access to it at a later point
2223    /// in time. The token will remain valid for as long as the connection requesting the token
2224    /// remains open.
2225    ///
2226    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
2227    /// `ZX_ERR_BAD_HANDLE`.
2228    pub fn r#get_token(
2229        &self,
2230    ) -> fidl::client::QueryResponseFut<
2231        (i32, Option<fidl::Handle>),
2232        fidl::encoding::DefaultFuchsiaResourceDialect,
2233    > {
2234        DirectoryProxyInterface::r#get_token(self)
2235    }
2236
2237    /// Creates a link to an object named src by the name dst, within a directory represented by
2238    /// token.
2239    ///
2240    /// `src` must be a resolved object name. Including "/" in the string will
2241    /// return `ZX_ERR_INVALID_ARGS`.
2242    ///
2243    /// `dst` must be a resolved object name. Including "/" in the string will
2244    /// return `ZX_ERR_INVALID_ARGS`.
2245    ///
2246    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
2247    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
2248    ///
2249    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
2250    /// there are two actors operating concurrently, and one actor performs a rename that affects
2251    /// the source within this directory, and the other does a link, each will appear to occur
2252    /// atomically in an unspecified order.
2253    pub fn r#link(
2254        &self,
2255        mut src: &str,
2256        mut dst_parent_token: fidl::Handle,
2257        mut dst: &str,
2258    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2259        DirectoryProxyInterface::r#link(self, src, dst_parent_token, dst)
2260    }
2261
2262    /// Removes a child node from the this directory's list of entries.
2263    ///
2264    /// Note: this does not guarantee that the underlying object is destroyed.
2265    /// Although the link will be removed from the containing directory,
2266    /// objects with multiple references (such as files which are still open)
2267    /// will not actually be destroyed until all references are closed.
2268    ///
2269    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
2270    ///   [`Rights.WRITE_BYTES`].
2271    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
2272    ///   support writing.
2273    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
2274    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
2275    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
2276    ///   containing a remote channel.
2277    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
2278    ///     something other than a directory was found.
2279    ///
2280    /// Other errors may be returned for filesystem-specific reasons.
2281    ///
2282    /// This method requires the following rights:
2283    ///
2284    /// * [`Rights.ENUMERATE`]
2285    /// * [`Rights.MODIFY_DIRECTORY`]
2286    pub fn r#unlink(
2287        &self,
2288        mut name: &str,
2289        mut options: &UnlinkOptions,
2290    ) -> fidl::client::QueryResponseFut<
2291        DirectoryUnlinkResult,
2292        fidl::encoding::DefaultFuchsiaResourceDialect,
2293    > {
2294        DirectoryProxyInterface::r#unlink(self, name, options)
2295    }
2296
2297    /// Renames a node named `src` to the name `dst`, in a directory represented
2298    /// by `dst_parent_token`.
2299    ///
2300    /// `src` and `dst` must be valid node names.
2301    /// See [`Name`] for what constitutes a valid name.
2302    ///
2303    /// This method requires the following rights on both the current connection, and the connection
2304    /// identified by `dst_parent_token`:
2305    ///
2306    /// * [`Rights.ENUMERATE`]
2307    /// * [`Rights.MODIFY_DIRECTORY`]
2308    ///
2309    /// The following requirements are necessary to avoid rights escalations.
2310    ///
2311    /// If the source and destination directory differ, the source directory must also have the
2312    /// maximal set of abilities supported for files, which would typically be
2313    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
2314    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
2315    /// right.
2316    ///
2317    /// If `src` refers to a directory, and differs from the destination directory, then the source
2318    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
2319    ///
2320    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
2321    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
2322    pub fn r#rename(
2323        &self,
2324        mut src: &str,
2325        mut dst_parent_token: fidl::Event,
2326        mut dst: &str,
2327    ) -> fidl::client::QueryResponseFut<
2328        DirectoryRenameResult,
2329        fidl::encoding::DefaultFuchsiaResourceDialect,
2330    > {
2331        DirectoryProxyInterface::r#rename(self, src, dst_parent_token, dst)
2332    }
2333
2334    /// Creates a symbolic link.
2335    ///
2336    /// `name` is the name to be given to the created symbolic link.
2337    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
2338    /// will perform no validation of `target` except for a server chosen maximum length.
2339    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
2340    /// on the successfully created node.
2341    ///
2342    /// * [`Rights.MODIFY_DIRECTORY`]
2343    ///
2344    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
2345    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
2346    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
2347    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
2348    pub fn r#create_symlink(
2349        &self,
2350        mut name: &str,
2351        mut target: &[u8],
2352        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
2353    ) -> fidl::client::QueryResponseFut<
2354        DirectoryCreateSymlinkResult,
2355        fidl::encoding::DefaultFuchsiaResourceDialect,
2356    > {
2357        DirectoryProxyInterface::r#create_symlink(self, name, target, connection)
2358    }
2359
2360    /// Watches a directory, receiving events of added messages on the
2361    /// watcher request channel.
2362    ///
2363    /// Options must be zero; it is reserved.
2364    ///
2365    /// This method does not require any rights, similar to ReadDirents.
2366    pub fn r#watch(
2367        &self,
2368        mut mask: WatchMask,
2369        mut options: u32,
2370        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
2371    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2372        DirectoryProxyInterface::r#watch(self, mask, options, watcher)
2373    }
2374}
2375
2376impl DirectoryProxyInterface for DirectoryProxy {
2377    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
2378        AdvisoryLockingAdvisoryLockResult,
2379        fidl::encoding::DefaultFuchsiaResourceDialect,
2380    >;
2381    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
2382        fn _decode(
2383            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2384        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
2385            let _response = fidl::client::decode_transaction_body::<
2386                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2387                fidl::encoding::DefaultFuchsiaResourceDialect,
2388                0x6ee9c0ad53ec87aa,
2389            >(_buf?)?;
2390            Ok(_response.map(|x| x))
2391        }
2392        self.client.send_query_and_decode::<
2393            AdvisoryLockingAdvisoryLockRequest,
2394            AdvisoryLockingAdvisoryLockResult,
2395        >(
2396            (request,),
2397            0x6ee9c0ad53ec87aa,
2398            fidl::encoding::DynamicFlags::empty(),
2399            _decode,
2400        )
2401    }
2402
2403    fn r#clone(
2404        &self,
2405        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
2406    ) -> Result<(), fidl::Error> {
2407        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
2408            (request,),
2409            0x20d8a7aba2168a79,
2410            fidl::encoding::DynamicFlags::empty(),
2411        )
2412    }
2413
2414    type CloseResponseFut = fidl::client::QueryResponseFut<
2415        fidl_fuchsia_unknown::CloseableCloseResult,
2416        fidl::encoding::DefaultFuchsiaResourceDialect,
2417    >;
2418    fn r#close(&self) -> Self::CloseResponseFut {
2419        fn _decode(
2420            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2421        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
2422            let _response = fidl::client::decode_transaction_body::<
2423                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2424                fidl::encoding::DefaultFuchsiaResourceDialect,
2425                0x5ac5d459ad7f657e,
2426            >(_buf?)?;
2427            Ok(_response.map(|x| x))
2428        }
2429        self.client.send_query_and_decode::<
2430            fidl::encoding::EmptyPayload,
2431            fidl_fuchsia_unknown::CloseableCloseResult,
2432        >(
2433            (),
2434            0x5ac5d459ad7f657e,
2435            fidl::encoding::DynamicFlags::empty(),
2436            _decode,
2437        )
2438    }
2439
2440    type QueryResponseFut =
2441        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2442    fn r#query(&self) -> Self::QueryResponseFut {
2443        fn _decode(
2444            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2445        ) -> Result<Vec<u8>, fidl::Error> {
2446            let _response = fidl::client::decode_transaction_body::<
2447                fidl_fuchsia_unknown::QueryableQueryResponse,
2448                fidl::encoding::DefaultFuchsiaResourceDialect,
2449                0x2658edee9decfc06,
2450            >(_buf?)?;
2451            Ok(_response.protocol)
2452        }
2453        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
2454            (),
2455            0x2658edee9decfc06,
2456            fidl::encoding::DynamicFlags::empty(),
2457            _decode,
2458        )
2459    }
2460
2461    fn r#deprecated_clone(
2462        &self,
2463        mut flags: OpenFlags,
2464        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2465    ) -> Result<(), fidl::Error> {
2466        self.client.send::<NodeDeprecatedCloneRequest>(
2467            (flags, object),
2468            0x5a61678f293ce16f,
2469            fidl::encoding::DynamicFlags::FLEXIBLE,
2470        )
2471    }
2472
2473    type GetAttrResponseFut = fidl::client::QueryResponseFut<
2474        (i32, NodeAttributes),
2475        fidl::encoding::DefaultFuchsiaResourceDialect,
2476    >;
2477    fn r#get_attr(&self) -> Self::GetAttrResponseFut {
2478        fn _decode(
2479            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2480        ) -> Result<(i32, NodeAttributes), fidl::Error> {
2481            let _response = fidl::client::decode_transaction_body::<
2482                NodeGetAttrResponse,
2483                fidl::encoding::DefaultFuchsiaResourceDialect,
2484                0x78985e216314dafd,
2485            >(_buf?)?;
2486            Ok((_response.s, _response.attributes))
2487        }
2488        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
2489            (),
2490            0x78985e216314dafd,
2491            fidl::encoding::DynamicFlags::empty(),
2492            _decode,
2493        )
2494    }
2495
2496    type SetAttrResponseFut =
2497        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2498    fn r#set_attr(
2499        &self,
2500        mut flags: NodeAttributeFlags,
2501        mut attributes: &NodeAttributes,
2502    ) -> Self::SetAttrResponseFut {
2503        fn _decode(
2504            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2505        ) -> Result<i32, fidl::Error> {
2506            let _response = fidl::client::decode_transaction_body::<
2507                NodeSetAttrResponse,
2508                fidl::encoding::DefaultFuchsiaResourceDialect,
2509                0x4186c0f40d938f46,
2510            >(_buf?)?;
2511            Ok(_response.s)
2512        }
2513        self.client.send_query_and_decode::<NodeSetAttrRequest, i32>(
2514            (flags, attributes),
2515            0x4186c0f40d938f46,
2516            fidl::encoding::DynamicFlags::empty(),
2517            _decode,
2518        )
2519    }
2520
2521    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
2522        (i32, OpenFlags),
2523        fidl::encoding::DefaultFuchsiaResourceDialect,
2524    >;
2525    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
2526        fn _decode(
2527            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2528        ) -> Result<(i32, OpenFlags), fidl::Error> {
2529            let _response = fidl::client::decode_transaction_body::<
2530                NodeDeprecatedGetFlagsResponse,
2531                fidl::encoding::DefaultFuchsiaResourceDialect,
2532                0x5b88fffb8eda3aa1,
2533            >(_buf?)?;
2534            Ok((_response.s, _response.flags))
2535        }
2536        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
2537            (),
2538            0x5b88fffb8eda3aa1,
2539            fidl::encoding::DynamicFlags::empty(),
2540            _decode,
2541        )
2542    }
2543
2544    type DeprecatedSetFlagsResponseFut =
2545        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2546    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
2547        fn _decode(
2548            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2549        ) -> Result<i32, fidl::Error> {
2550            let _response = fidl::client::decode_transaction_body::<
2551                NodeDeprecatedSetFlagsResponse,
2552                fidl::encoding::DefaultFuchsiaResourceDialect,
2553                0x5295b76c71fde733,
2554            >(_buf?)?;
2555            Ok(_response.s)
2556        }
2557        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
2558            (flags,),
2559            0x5295b76c71fde733,
2560            fidl::encoding::DynamicFlags::empty(),
2561            _decode,
2562        )
2563    }
2564
2565    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
2566        NodeGetFlagsResult,
2567        fidl::encoding::DefaultFuchsiaResourceDialect,
2568    >;
2569    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
2570        fn _decode(
2571            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2572        ) -> Result<NodeGetFlagsResult, fidl::Error> {
2573            let _response = fidl::client::decode_transaction_body::<
2574                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
2575                fidl::encoding::DefaultFuchsiaResourceDialect,
2576                0x176eb318f64ec23,
2577            >(_buf?)?
2578            .into_result::<DirectoryMarker>("get_flags")?;
2579            Ok(_response.map(|x| x.flags))
2580        }
2581        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
2582            (),
2583            0x176eb318f64ec23,
2584            fidl::encoding::DynamicFlags::FLEXIBLE,
2585            _decode,
2586        )
2587    }
2588
2589    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
2590        NodeSetFlagsResult,
2591        fidl::encoding::DefaultFuchsiaResourceDialect,
2592    >;
2593    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
2594        fn _decode(
2595            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2596        ) -> Result<NodeSetFlagsResult, fidl::Error> {
2597            let _response = fidl::client::decode_transaction_body::<
2598                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2599                fidl::encoding::DefaultFuchsiaResourceDialect,
2600                0x55a8028685791ea8,
2601            >(_buf?)?
2602            .into_result::<DirectoryMarker>("set_flags")?;
2603            Ok(_response.map(|x| x))
2604        }
2605        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
2606            (flags,),
2607            0x55a8028685791ea8,
2608            fidl::encoding::DynamicFlags::FLEXIBLE,
2609            _decode,
2610        )
2611    }
2612
2613    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
2614        (i32, Option<Box<FilesystemInfo>>),
2615        fidl::encoding::DefaultFuchsiaResourceDialect,
2616    >;
2617    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
2618        fn _decode(
2619            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2620        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
2621            let _response = fidl::client::decode_transaction_body::<
2622                NodeQueryFilesystemResponse,
2623                fidl::encoding::DefaultFuchsiaResourceDialect,
2624                0x6f344a1c6b0a0610,
2625            >(_buf?)?;
2626            Ok((_response.s, _response.info))
2627        }
2628        self.client.send_query_and_decode::<
2629            fidl::encoding::EmptyPayload,
2630            (i32, Option<Box<FilesystemInfo>>),
2631        >(
2632            (),
2633            0x6f344a1c6b0a0610,
2634            fidl::encoding::DynamicFlags::empty(),
2635            _decode,
2636        )
2637    }
2638
2639    type GetConnectionInfoResponseFut = fidl::client::QueryResponseFut<
2640        ConnectionInfo,
2641        fidl::encoding::DefaultFuchsiaResourceDialect,
2642    >;
2643    fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut {
2644        fn _decode(
2645            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2646        ) -> Result<ConnectionInfo, fidl::Error> {
2647            let _response = fidl::client::decode_transaction_body::<
2648                ConnectionInfo,
2649                fidl::encoding::DefaultFuchsiaResourceDialect,
2650                0x584c377c7c0a6d0b,
2651            >(_buf?)?;
2652            Ok(_response)
2653        }
2654        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ConnectionInfo>(
2655            (),
2656            0x584c377c7c0a6d0b,
2657            fidl::encoding::DynamicFlags::empty(),
2658            _decode,
2659        )
2660    }
2661
2662    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
2663        NodeGetAttributesResult,
2664        fidl::encoding::DefaultFuchsiaResourceDialect,
2665    >;
2666    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
2667        fn _decode(
2668            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2669        ) -> Result<NodeGetAttributesResult, fidl::Error> {
2670            let _response = fidl::client::decode_transaction_body::<
2671                fidl::encoding::ResultType<NodeAttributes2, i32>,
2672                fidl::encoding::DefaultFuchsiaResourceDialect,
2673                0x3d4396a638ea053b,
2674            >(_buf?)?;
2675            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
2676        }
2677        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
2678            (query,),
2679            0x3d4396a638ea053b,
2680            fidl::encoding::DynamicFlags::empty(),
2681            _decode,
2682        )
2683    }
2684
2685    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
2686        NodeUpdateAttributesResult,
2687        fidl::encoding::DefaultFuchsiaResourceDialect,
2688    >;
2689    fn r#update_attributes(
2690        &self,
2691        mut payload: &MutableNodeAttributes,
2692    ) -> Self::UpdateAttributesResponseFut {
2693        fn _decode(
2694            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2695        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
2696            let _response = fidl::client::decode_transaction_body::<
2697                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2698                fidl::encoding::DefaultFuchsiaResourceDialect,
2699                0x3308c1da5a89bf08,
2700            >(_buf?)?;
2701            Ok(_response.map(|x| x))
2702        }
2703        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
2704            payload,
2705            0x3308c1da5a89bf08,
2706            fidl::encoding::DynamicFlags::empty(),
2707            _decode,
2708        )
2709    }
2710
2711    type SyncResponseFut = fidl::client::QueryResponseFut<
2712        NodeSyncResult,
2713        fidl::encoding::DefaultFuchsiaResourceDialect,
2714    >;
2715    fn r#sync(&self) -> Self::SyncResponseFut {
2716        fn _decode(
2717            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2718        ) -> Result<NodeSyncResult, fidl::Error> {
2719            let _response = fidl::client::decode_transaction_body::<
2720                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2721                fidl::encoding::DefaultFuchsiaResourceDialect,
2722                0x2c5c27ca0ab5dc49,
2723            >(_buf?)?;
2724            Ok(_response.map(|x| x))
2725        }
2726        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
2727            (),
2728            0x2c5c27ca0ab5dc49,
2729            fidl::encoding::DynamicFlags::empty(),
2730            _decode,
2731        )
2732    }
2733
2734    fn r#list_extended_attributes(
2735        &self,
2736        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2737    ) -> Result<(), fidl::Error> {
2738        self.client.send::<NodeListExtendedAttributesRequest>(
2739            (iterator,),
2740            0x4b61033de007fcd0,
2741            fidl::encoding::DynamicFlags::empty(),
2742        )
2743    }
2744
2745    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2746        NodeGetExtendedAttributeResult,
2747        fidl::encoding::DefaultFuchsiaResourceDialect,
2748    >;
2749    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
2750        fn _decode(
2751            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2752        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
2753            let _response = fidl::client::decode_transaction_body::<
2754                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
2755                fidl::encoding::DefaultFuchsiaResourceDialect,
2756                0x45ffa3ccfdeb76db,
2757            >(_buf?)?;
2758            Ok(_response.map(|x| x))
2759        }
2760        self.client.send_query_and_decode::<
2761            NodeGetExtendedAttributeRequest,
2762            NodeGetExtendedAttributeResult,
2763        >(
2764            (name,),
2765            0x45ffa3ccfdeb76db,
2766            fidl::encoding::DynamicFlags::empty(),
2767            _decode,
2768        )
2769    }
2770
2771    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2772        NodeSetExtendedAttributeResult,
2773        fidl::encoding::DefaultFuchsiaResourceDialect,
2774    >;
2775    fn r#set_extended_attribute(
2776        &self,
2777        mut name: &[u8],
2778        mut value: ExtendedAttributeValue,
2779        mut mode: SetExtendedAttributeMode,
2780    ) -> Self::SetExtendedAttributeResponseFut {
2781        fn _decode(
2782            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2783        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
2784            let _response = fidl::client::decode_transaction_body::<
2785                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2786                fidl::encoding::DefaultFuchsiaResourceDialect,
2787                0x4a951362f681f23c,
2788            >(_buf?)?;
2789            Ok(_response.map(|x| x))
2790        }
2791        self.client.send_query_and_decode::<
2792            NodeSetExtendedAttributeRequest,
2793            NodeSetExtendedAttributeResult,
2794        >(
2795            (name, &mut value, mode,),
2796            0x4a951362f681f23c,
2797            fidl::encoding::DynamicFlags::empty(),
2798            _decode,
2799        )
2800    }
2801
2802    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2803        NodeRemoveExtendedAttributeResult,
2804        fidl::encoding::DefaultFuchsiaResourceDialect,
2805    >;
2806    fn r#remove_extended_attribute(
2807        &self,
2808        mut name: &[u8],
2809    ) -> Self::RemoveExtendedAttributeResponseFut {
2810        fn _decode(
2811            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2812        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
2813            let _response = fidl::client::decode_transaction_body::<
2814                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2815                fidl::encoding::DefaultFuchsiaResourceDialect,
2816                0x7a0b9f3a9bf9032d,
2817            >(_buf?)?;
2818            Ok(_response.map(|x| x))
2819        }
2820        self.client.send_query_and_decode::<
2821            NodeRemoveExtendedAttributeRequest,
2822            NodeRemoveExtendedAttributeResult,
2823        >(
2824            (name,),
2825            0x7a0b9f3a9bf9032d,
2826            fidl::encoding::DynamicFlags::empty(),
2827            _decode,
2828        )
2829    }
2830
2831    fn r#deprecated_open(
2832        &self,
2833        mut flags: OpenFlags,
2834        mut mode: ModeType,
2835        mut path: &str,
2836        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2837    ) -> Result<(), fidl::Error> {
2838        self.client.send::<DirectoryDeprecatedOpenRequest>(
2839            (flags, mode, path, object),
2840            0x2c5044561d685ec0,
2841            fidl::encoding::DynamicFlags::FLEXIBLE,
2842        )
2843    }
2844
2845    fn r#open(
2846        &self,
2847        mut path: &str,
2848        mut flags: Flags,
2849        mut options: &Options,
2850        mut object: fidl::Channel,
2851    ) -> Result<(), fidl::Error> {
2852        self.client.send::<DirectoryOpenRequest>(
2853            (path, flags, options, object),
2854            0x568ddcb9a9cbb6d9,
2855            fidl::encoding::DynamicFlags::empty(),
2856        )
2857    }
2858
2859    type ReadDirentsResponseFut = fidl::client::QueryResponseFut<
2860        (i32, Vec<u8>),
2861        fidl::encoding::DefaultFuchsiaResourceDialect,
2862    >;
2863    fn r#read_dirents(&self, mut max_bytes: u64) -> Self::ReadDirentsResponseFut {
2864        fn _decode(
2865            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2866        ) -> Result<(i32, Vec<u8>), fidl::Error> {
2867            let _response = fidl::client::decode_transaction_body::<
2868                DirectoryReadDirentsResponse,
2869                fidl::encoding::DefaultFuchsiaResourceDialect,
2870                0x3582806bf27faa0a,
2871            >(_buf?)?;
2872            Ok((_response.s, _response.dirents))
2873        }
2874        self.client.send_query_and_decode::<DirectoryReadDirentsRequest, (i32, Vec<u8>)>(
2875            (max_bytes,),
2876            0x3582806bf27faa0a,
2877            fidl::encoding::DynamicFlags::empty(),
2878            _decode,
2879        )
2880    }
2881
2882    type RewindResponseFut =
2883        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2884    fn r#rewind(&self) -> Self::RewindResponseFut {
2885        fn _decode(
2886            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2887        ) -> Result<i32, fidl::Error> {
2888            let _response = fidl::client::decode_transaction_body::<
2889                DirectoryRewindResponse,
2890                fidl::encoding::DefaultFuchsiaResourceDialect,
2891                0x16b1202af0f34c71,
2892            >(_buf?)?;
2893            Ok(_response.s)
2894        }
2895        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
2896            (),
2897            0x16b1202af0f34c71,
2898            fidl::encoding::DynamicFlags::empty(),
2899            _decode,
2900        )
2901    }
2902
2903    type GetTokenResponseFut = fidl::client::QueryResponseFut<
2904        (i32, Option<fidl::Handle>),
2905        fidl::encoding::DefaultFuchsiaResourceDialect,
2906    >;
2907    fn r#get_token(&self) -> Self::GetTokenResponseFut {
2908        fn _decode(
2909            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2910        ) -> Result<(i32, Option<fidl::Handle>), fidl::Error> {
2911            let _response = fidl::client::decode_transaction_body::<
2912                DirectoryGetTokenResponse,
2913                fidl::encoding::DefaultFuchsiaResourceDialect,
2914                0x26ae9d18763c8655,
2915            >(_buf?)?;
2916            Ok((_response.s, _response.token))
2917        }
2918        self.client
2919            .send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, Option<fidl::Handle>)>(
2920                (),
2921                0x26ae9d18763c8655,
2922                fidl::encoding::DynamicFlags::empty(),
2923                _decode,
2924            )
2925    }
2926
2927    type LinkResponseFut =
2928        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2929    fn r#link(
2930        &self,
2931        mut src: &str,
2932        mut dst_parent_token: fidl::Handle,
2933        mut dst: &str,
2934    ) -> Self::LinkResponseFut {
2935        fn _decode(
2936            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2937        ) -> Result<i32, fidl::Error> {
2938            let _response = fidl::client::decode_transaction_body::<
2939                DirectoryLinkResponse,
2940                fidl::encoding::DefaultFuchsiaResourceDialect,
2941                0x740604c0c7c930e7,
2942            >(_buf?)?;
2943            Ok(_response.s)
2944        }
2945        self.client.send_query_and_decode::<DirectoryLinkRequest, i32>(
2946            (src, dst_parent_token, dst),
2947            0x740604c0c7c930e7,
2948            fidl::encoding::DynamicFlags::empty(),
2949            _decode,
2950        )
2951    }
2952
2953    type UnlinkResponseFut = fidl::client::QueryResponseFut<
2954        DirectoryUnlinkResult,
2955        fidl::encoding::DefaultFuchsiaResourceDialect,
2956    >;
2957    fn r#unlink(&self, mut name: &str, mut options: &UnlinkOptions) -> Self::UnlinkResponseFut {
2958        fn _decode(
2959            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2960        ) -> Result<DirectoryUnlinkResult, fidl::Error> {
2961            let _response = fidl::client::decode_transaction_body::<
2962                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2963                fidl::encoding::DefaultFuchsiaResourceDialect,
2964                0x750a0326a78d7bed,
2965            >(_buf?)?;
2966            Ok(_response.map(|x| x))
2967        }
2968        self.client.send_query_and_decode::<DirectoryUnlinkRequest, DirectoryUnlinkResult>(
2969            (name, options),
2970            0x750a0326a78d7bed,
2971            fidl::encoding::DynamicFlags::empty(),
2972            _decode,
2973        )
2974    }
2975
2976    type RenameResponseFut = fidl::client::QueryResponseFut<
2977        DirectoryRenameResult,
2978        fidl::encoding::DefaultFuchsiaResourceDialect,
2979    >;
2980    fn r#rename(
2981        &self,
2982        mut src: &str,
2983        mut dst_parent_token: fidl::Event,
2984        mut dst: &str,
2985    ) -> Self::RenameResponseFut {
2986        fn _decode(
2987            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2988        ) -> Result<DirectoryRenameResult, fidl::Error> {
2989            let _response = fidl::client::decode_transaction_body::<
2990                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2991                fidl::encoding::DefaultFuchsiaResourceDialect,
2992                0x7060e7723b9928de,
2993            >(_buf?)?;
2994            Ok(_response.map(|x| x))
2995        }
2996        self.client.send_query_and_decode::<DirectoryRenameRequest, DirectoryRenameResult>(
2997            (src, dst_parent_token, dst),
2998            0x7060e7723b9928de,
2999            fidl::encoding::DynamicFlags::empty(),
3000            _decode,
3001        )
3002    }
3003
3004    type CreateSymlinkResponseFut = fidl::client::QueryResponseFut<
3005        DirectoryCreateSymlinkResult,
3006        fidl::encoding::DefaultFuchsiaResourceDialect,
3007    >;
3008    fn r#create_symlink(
3009        &self,
3010        mut name: &str,
3011        mut target: &[u8],
3012        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
3013    ) -> Self::CreateSymlinkResponseFut {
3014        fn _decode(
3015            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3016        ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
3017            let _response = fidl::client::decode_transaction_body::<
3018                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3019                fidl::encoding::DefaultFuchsiaResourceDialect,
3020                0x21ce0f19ec043889,
3021            >(_buf?)?;
3022            Ok(_response.map(|x| x))
3023        }
3024        self.client
3025            .send_query_and_decode::<DirectoryCreateSymlinkRequest, DirectoryCreateSymlinkResult>(
3026                (name, target, connection),
3027                0x21ce0f19ec043889,
3028                fidl::encoding::DynamicFlags::empty(),
3029                _decode,
3030            )
3031    }
3032
3033    type WatchResponseFut =
3034        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
3035    fn r#watch(
3036        &self,
3037        mut mask: WatchMask,
3038        mut options: u32,
3039        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
3040    ) -> Self::WatchResponseFut {
3041        fn _decode(
3042            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3043        ) -> Result<i32, fidl::Error> {
3044            let _response = fidl::client::decode_transaction_body::<
3045                DirectoryWatchResponse,
3046                fidl::encoding::DefaultFuchsiaResourceDialect,
3047                0x5717193a59d66d91,
3048            >(_buf?)?;
3049            Ok(_response.s)
3050        }
3051        self.client.send_query_and_decode::<DirectoryWatchRequest, i32>(
3052            (mask, options, watcher),
3053            0x5717193a59d66d91,
3054            fidl::encoding::DynamicFlags::empty(),
3055            _decode,
3056        )
3057    }
3058}
3059
3060pub struct DirectoryEventStream {
3061    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3062}
3063
3064impl std::marker::Unpin for DirectoryEventStream {}
3065
3066impl futures::stream::FusedStream for DirectoryEventStream {
3067    fn is_terminated(&self) -> bool {
3068        self.event_receiver.is_terminated()
3069    }
3070}
3071
3072impl futures::Stream for DirectoryEventStream {
3073    type Item = Result<DirectoryEvent, fidl::Error>;
3074
3075    fn poll_next(
3076        mut self: std::pin::Pin<&mut Self>,
3077        cx: &mut std::task::Context<'_>,
3078    ) -> std::task::Poll<Option<Self::Item>> {
3079        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3080            &mut self.event_receiver,
3081            cx
3082        )?) {
3083            Some(buf) => std::task::Poll::Ready(Some(DirectoryEvent::decode(buf))),
3084            None => std::task::Poll::Ready(None),
3085        }
3086    }
3087}
3088
3089#[derive(Debug)]
3090pub enum DirectoryEvent {
3091    OnOpen_ {
3092        s: i32,
3093        info: Option<Box<NodeInfoDeprecated>>,
3094    },
3095    OnRepresentation {
3096        payload: Representation,
3097    },
3098    #[non_exhaustive]
3099    _UnknownEvent {
3100        /// Ordinal of the event that was sent.
3101        ordinal: u64,
3102    },
3103}
3104
3105impl DirectoryEvent {
3106    #[allow(irrefutable_let_patterns)]
3107    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
3108        if let DirectoryEvent::OnOpen_ { s, info } = self {
3109            Some((s, info))
3110        } else {
3111            None
3112        }
3113    }
3114    #[allow(irrefutable_let_patterns)]
3115    pub fn into_on_representation(self) -> Option<Representation> {
3116        if let DirectoryEvent::OnRepresentation { payload } = self {
3117            Some((payload))
3118        } else {
3119            None
3120        }
3121    }
3122
3123    /// Decodes a message buffer as a [`DirectoryEvent`].
3124    fn decode(
3125        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3126    ) -> Result<DirectoryEvent, fidl::Error> {
3127        let (bytes, _handles) = buf.split_mut();
3128        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3129        debug_assert_eq!(tx_header.tx_id, 0);
3130        match tx_header.ordinal {
3131            0x7fc7bbb1dbfd1972 => {
3132                let mut out = fidl::new_empty!(
3133                    NodeOnOpenRequest,
3134                    fidl::encoding::DefaultFuchsiaResourceDialect
3135                );
3136                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3137                Ok((DirectoryEvent::OnOpen_ { s: out.s, info: out.info }))
3138            }
3139            0x5cb40567d80a510c => {
3140                let mut out =
3141                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
3142                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
3143                Ok((DirectoryEvent::OnRepresentation { payload: out }))
3144            }
3145            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3146                Ok(DirectoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3147            }
3148            _ => Err(fidl::Error::UnknownOrdinal {
3149                ordinal: tx_header.ordinal,
3150                protocol_name: <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3151            }),
3152        }
3153    }
3154}
3155
3156/// A Stream of incoming requests for fuchsia.io/Directory.
3157pub struct DirectoryRequestStream {
3158    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3159    is_terminated: bool,
3160}
3161
3162impl std::marker::Unpin for DirectoryRequestStream {}
3163
3164impl futures::stream::FusedStream for DirectoryRequestStream {
3165    fn is_terminated(&self) -> bool {
3166        self.is_terminated
3167    }
3168}
3169
3170impl fidl::endpoints::RequestStream for DirectoryRequestStream {
3171    type Protocol = DirectoryMarker;
3172    type ControlHandle = DirectoryControlHandle;
3173
3174    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3175        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3176    }
3177
3178    fn control_handle(&self) -> Self::ControlHandle {
3179        DirectoryControlHandle { inner: self.inner.clone() }
3180    }
3181
3182    fn into_inner(
3183        self,
3184    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3185    {
3186        (self.inner, self.is_terminated)
3187    }
3188
3189    fn from_inner(
3190        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3191        is_terminated: bool,
3192    ) -> Self {
3193        Self { inner, is_terminated }
3194    }
3195}
3196
3197impl futures::Stream for DirectoryRequestStream {
3198    type Item = Result<DirectoryRequest, fidl::Error>;
3199
3200    fn poll_next(
3201        mut self: std::pin::Pin<&mut Self>,
3202        cx: &mut std::task::Context<'_>,
3203    ) -> std::task::Poll<Option<Self::Item>> {
3204        let this = &mut *self;
3205        if this.inner.check_shutdown(cx) {
3206            this.is_terminated = true;
3207            return std::task::Poll::Ready(None);
3208        }
3209        if this.is_terminated {
3210            panic!("polled DirectoryRequestStream after completion");
3211        }
3212        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3213            |bytes, handles| {
3214                match this.inner.channel().read_etc(cx, bytes, handles) {
3215                    std::task::Poll::Ready(Ok(())) => {}
3216                    std::task::Poll::Pending => return std::task::Poll::Pending,
3217                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3218                        this.is_terminated = true;
3219                        return std::task::Poll::Ready(None);
3220                    }
3221                    std::task::Poll::Ready(Err(e)) => {
3222                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3223                            e.into(),
3224                        ))))
3225                    }
3226                }
3227
3228                // A message has been received from the channel
3229                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3230
3231                std::task::Poll::Ready(Some(match header.ordinal {
3232                    0x6ee9c0ad53ec87aa => {
3233                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3234                        let mut req = fidl::new_empty!(
3235                            AdvisoryLockingAdvisoryLockRequest,
3236                            fidl::encoding::DefaultFuchsiaResourceDialect
3237                        );
3238                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
3239                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3240                        Ok(DirectoryRequest::AdvisoryLock {
3241                            request: req.request,
3242
3243                            responder: DirectoryAdvisoryLockResponder {
3244                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3245                                tx_id: header.tx_id,
3246                            },
3247                        })
3248                    }
3249                    0x20d8a7aba2168a79 => {
3250                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3251                        let mut req = fidl::new_empty!(
3252                            fidl_fuchsia_unknown::CloneableCloneRequest,
3253                            fidl::encoding::DefaultFuchsiaResourceDialect
3254                        );
3255                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3256                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3257                        Ok(DirectoryRequest::Clone { request: req.request, control_handle })
3258                    }
3259                    0x5ac5d459ad7f657e => {
3260                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3261                        let mut req = fidl::new_empty!(
3262                            fidl::encoding::EmptyPayload,
3263                            fidl::encoding::DefaultFuchsiaResourceDialect
3264                        );
3265                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3266                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3267                        Ok(DirectoryRequest::Close {
3268                            responder: DirectoryCloseResponder {
3269                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3270                                tx_id: header.tx_id,
3271                            },
3272                        })
3273                    }
3274                    0x2658edee9decfc06 => {
3275                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3276                        let mut req = fidl::new_empty!(
3277                            fidl::encoding::EmptyPayload,
3278                            fidl::encoding::DefaultFuchsiaResourceDialect
3279                        );
3280                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3281                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3282                        Ok(DirectoryRequest::Query {
3283                            responder: DirectoryQueryResponder {
3284                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3285                                tx_id: header.tx_id,
3286                            },
3287                        })
3288                    }
3289                    0x5a61678f293ce16f => {
3290                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3291                        let mut req = fidl::new_empty!(
3292                            NodeDeprecatedCloneRequest,
3293                            fidl::encoding::DefaultFuchsiaResourceDialect
3294                        );
3295                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3296                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3297                        Ok(DirectoryRequest::DeprecatedClone {
3298                            flags: req.flags,
3299                            object: req.object,
3300
3301                            control_handle,
3302                        })
3303                    }
3304                    0x78985e216314dafd => {
3305                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3306                        let mut req = fidl::new_empty!(
3307                            fidl::encoding::EmptyPayload,
3308                            fidl::encoding::DefaultFuchsiaResourceDialect
3309                        );
3310                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3311                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3312                        Ok(DirectoryRequest::GetAttr {
3313                            responder: DirectoryGetAttrResponder {
3314                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3315                                tx_id: header.tx_id,
3316                            },
3317                        })
3318                    }
3319                    0x4186c0f40d938f46 => {
3320                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3321                        let mut req = fidl::new_empty!(
3322                            NodeSetAttrRequest,
3323                            fidl::encoding::DefaultFuchsiaResourceDialect
3324                        );
3325                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
3326                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3327                        Ok(DirectoryRequest::SetAttr {
3328                            flags: req.flags,
3329                            attributes: req.attributes,
3330
3331                            responder: DirectorySetAttrResponder {
3332                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3333                                tx_id: header.tx_id,
3334                            },
3335                        })
3336                    }
3337                    0x5b88fffb8eda3aa1 => {
3338                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3339                        let mut req = fidl::new_empty!(
3340                            fidl::encoding::EmptyPayload,
3341                            fidl::encoding::DefaultFuchsiaResourceDialect
3342                        );
3343                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3344                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3345                        Ok(DirectoryRequest::DeprecatedGetFlags {
3346                            responder: DirectoryDeprecatedGetFlagsResponder {
3347                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3348                                tx_id: header.tx_id,
3349                            },
3350                        })
3351                    }
3352                    0x5295b76c71fde733 => {
3353                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3354                        let mut req = fidl::new_empty!(
3355                            NodeDeprecatedSetFlagsRequest,
3356                            fidl::encoding::DefaultFuchsiaResourceDialect
3357                        );
3358                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3359                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3360                        Ok(DirectoryRequest::DeprecatedSetFlags {
3361                            flags: req.flags,
3362
3363                            responder: DirectoryDeprecatedSetFlagsResponder {
3364                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3365                                tx_id: header.tx_id,
3366                            },
3367                        })
3368                    }
3369                    0x176eb318f64ec23 => {
3370                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3371                        let mut req = fidl::new_empty!(
3372                            fidl::encoding::EmptyPayload,
3373                            fidl::encoding::DefaultFuchsiaResourceDialect
3374                        );
3375                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3376                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3377                        Ok(DirectoryRequest::GetFlags {
3378                            responder: DirectoryGetFlagsResponder {
3379                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3380                                tx_id: header.tx_id,
3381                            },
3382                        })
3383                    }
3384                    0x55a8028685791ea8 => {
3385                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3386                        let mut req = fidl::new_empty!(
3387                            NodeSetFlagsRequest,
3388                            fidl::encoding::DefaultFuchsiaResourceDialect
3389                        );
3390                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3391                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3392                        Ok(DirectoryRequest::SetFlags {
3393                            flags: req.flags,
3394
3395                            responder: DirectorySetFlagsResponder {
3396                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3397                                tx_id: header.tx_id,
3398                            },
3399                        })
3400                    }
3401                    0x6f344a1c6b0a0610 => {
3402                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3403                        let mut req = fidl::new_empty!(
3404                            fidl::encoding::EmptyPayload,
3405                            fidl::encoding::DefaultFuchsiaResourceDialect
3406                        );
3407                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3408                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3409                        Ok(DirectoryRequest::QueryFilesystem {
3410                            responder: DirectoryQueryFilesystemResponder {
3411                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3412                                tx_id: header.tx_id,
3413                            },
3414                        })
3415                    }
3416                    0x584c377c7c0a6d0b => {
3417                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3418                        let mut req = fidl::new_empty!(
3419                            fidl::encoding::EmptyPayload,
3420                            fidl::encoding::DefaultFuchsiaResourceDialect
3421                        );
3422                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3423                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3424                        Ok(DirectoryRequest::GetConnectionInfo {
3425                            responder: DirectoryGetConnectionInfoResponder {
3426                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3427                                tx_id: header.tx_id,
3428                            },
3429                        })
3430                    }
3431                    0x3d4396a638ea053b => {
3432                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3433                        let mut req = fidl::new_empty!(
3434                            NodeGetAttributesRequest,
3435                            fidl::encoding::DefaultFuchsiaResourceDialect
3436                        );
3437                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3438                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3439                        Ok(DirectoryRequest::GetAttributes {
3440                            query: req.query,
3441
3442                            responder: DirectoryGetAttributesResponder {
3443                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3444                                tx_id: header.tx_id,
3445                            },
3446                        })
3447                    }
3448                    0x3308c1da5a89bf08 => {
3449                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3450                        let mut req = fidl::new_empty!(
3451                            MutableNodeAttributes,
3452                            fidl::encoding::DefaultFuchsiaResourceDialect
3453                        );
3454                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
3455                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3456                        Ok(DirectoryRequest::UpdateAttributes {
3457                            payload: req,
3458                            responder: DirectoryUpdateAttributesResponder {
3459                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3460                                tx_id: header.tx_id,
3461                            },
3462                        })
3463                    }
3464                    0x2c5c27ca0ab5dc49 => {
3465                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3466                        let mut req = fidl::new_empty!(
3467                            fidl::encoding::EmptyPayload,
3468                            fidl::encoding::DefaultFuchsiaResourceDialect
3469                        );
3470                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3471                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3472                        Ok(DirectoryRequest::Sync {
3473                            responder: DirectorySyncResponder {
3474                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3475                                tx_id: header.tx_id,
3476                            },
3477                        })
3478                    }
3479                    0x4b61033de007fcd0 => {
3480                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3481                        let mut req = fidl::new_empty!(
3482                            NodeListExtendedAttributesRequest,
3483                            fidl::encoding::DefaultFuchsiaResourceDialect
3484                        );
3485                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3486                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3487                        Ok(DirectoryRequest::ListExtendedAttributes {
3488                            iterator: req.iterator,
3489
3490                            control_handle,
3491                        })
3492                    }
3493                    0x45ffa3ccfdeb76db => {
3494                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3495                        let mut req = fidl::new_empty!(
3496                            NodeGetExtendedAttributeRequest,
3497                            fidl::encoding::DefaultFuchsiaResourceDialect
3498                        );
3499                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3500                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3501                        Ok(DirectoryRequest::GetExtendedAttribute {
3502                            name: req.name,
3503
3504                            responder: DirectoryGetExtendedAttributeResponder {
3505                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3506                                tx_id: header.tx_id,
3507                            },
3508                        })
3509                    }
3510                    0x4a951362f681f23c => {
3511                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3512                        let mut req = fidl::new_empty!(
3513                            NodeSetExtendedAttributeRequest,
3514                            fidl::encoding::DefaultFuchsiaResourceDialect
3515                        );
3516                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3517                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3518                        Ok(DirectoryRequest::SetExtendedAttribute {
3519                            name: req.name,
3520                            value: req.value,
3521                            mode: req.mode,
3522
3523                            responder: DirectorySetExtendedAttributeResponder {
3524                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3525                                tx_id: header.tx_id,
3526                            },
3527                        })
3528                    }
3529                    0x7a0b9f3a9bf9032d => {
3530                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3531                        let mut req = fidl::new_empty!(
3532                            NodeRemoveExtendedAttributeRequest,
3533                            fidl::encoding::DefaultFuchsiaResourceDialect
3534                        );
3535                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3536                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3537                        Ok(DirectoryRequest::RemoveExtendedAttribute {
3538                            name: req.name,
3539
3540                            responder: DirectoryRemoveExtendedAttributeResponder {
3541                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3542                                tx_id: header.tx_id,
3543                            },
3544                        })
3545                    }
3546                    0x2c5044561d685ec0 => {
3547                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3548                        let mut req = fidl::new_empty!(
3549                            DirectoryDeprecatedOpenRequest,
3550                            fidl::encoding::DefaultFuchsiaResourceDialect
3551                        );
3552                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryDeprecatedOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3553                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3554                        Ok(DirectoryRequest::DeprecatedOpen {
3555                            flags: req.flags,
3556                            mode: req.mode,
3557                            path: req.path,
3558                            object: req.object,
3559
3560                            control_handle,
3561                        })
3562                    }
3563                    0x568ddcb9a9cbb6d9 => {
3564                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3565                        let mut req = fidl::new_empty!(
3566                            DirectoryOpenRequest,
3567                            fidl::encoding::DefaultFuchsiaResourceDialect
3568                        );
3569                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3570                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3571                        Ok(DirectoryRequest::Open {
3572                            path: req.path,
3573                            flags: req.flags,
3574                            options: req.options,
3575                            object: req.object,
3576
3577                            control_handle,
3578                        })
3579                    }
3580                    0x3582806bf27faa0a => {
3581                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3582                        let mut req = fidl::new_empty!(
3583                            DirectoryReadDirentsRequest,
3584                            fidl::encoding::DefaultFuchsiaResourceDialect
3585                        );
3586                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryReadDirentsRequest>(&header, _body_bytes, handles, &mut req)?;
3587                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3588                        Ok(DirectoryRequest::ReadDirents {
3589                            max_bytes: req.max_bytes,
3590
3591                            responder: DirectoryReadDirentsResponder {
3592                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3593                                tx_id: header.tx_id,
3594                            },
3595                        })
3596                    }
3597                    0x16b1202af0f34c71 => {
3598                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3599                        let mut req = fidl::new_empty!(
3600                            fidl::encoding::EmptyPayload,
3601                            fidl::encoding::DefaultFuchsiaResourceDialect
3602                        );
3603                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3604                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3605                        Ok(DirectoryRequest::Rewind {
3606                            responder: DirectoryRewindResponder {
3607                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3608                                tx_id: header.tx_id,
3609                            },
3610                        })
3611                    }
3612                    0x26ae9d18763c8655 => {
3613                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3614                        let mut req = fidl::new_empty!(
3615                            fidl::encoding::EmptyPayload,
3616                            fidl::encoding::DefaultFuchsiaResourceDialect
3617                        );
3618                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3619                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3620                        Ok(DirectoryRequest::GetToken {
3621                            responder: DirectoryGetTokenResponder {
3622                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3623                                tx_id: header.tx_id,
3624                            },
3625                        })
3626                    }
3627                    0x740604c0c7c930e7 => {
3628                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3629                        let mut req = fidl::new_empty!(
3630                            DirectoryLinkRequest,
3631                            fidl::encoding::DefaultFuchsiaResourceDialect
3632                        );
3633                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryLinkRequest>(&header, _body_bytes, handles, &mut req)?;
3634                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3635                        Ok(DirectoryRequest::Link {
3636                            src: req.src,
3637                            dst_parent_token: req.dst_parent_token,
3638                            dst: req.dst,
3639
3640                            responder: DirectoryLinkResponder {
3641                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3642                                tx_id: header.tx_id,
3643                            },
3644                        })
3645                    }
3646                    0x750a0326a78d7bed => {
3647                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3648                        let mut req = fidl::new_empty!(
3649                            DirectoryUnlinkRequest,
3650                            fidl::encoding::DefaultFuchsiaResourceDialect
3651                        );
3652                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryUnlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3653                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3654                        Ok(DirectoryRequest::Unlink {
3655                            name: req.name,
3656                            options: req.options,
3657
3658                            responder: DirectoryUnlinkResponder {
3659                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3660                                tx_id: header.tx_id,
3661                            },
3662                        })
3663                    }
3664                    0x7060e7723b9928de => {
3665                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3666                        let mut req = fidl::new_empty!(
3667                            DirectoryRenameRequest,
3668                            fidl::encoding::DefaultFuchsiaResourceDialect
3669                        );
3670                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryRenameRequest>(&header, _body_bytes, handles, &mut req)?;
3671                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3672                        Ok(DirectoryRequest::Rename {
3673                            src: req.src,
3674                            dst_parent_token: req.dst_parent_token,
3675                            dst: req.dst,
3676
3677                            responder: DirectoryRenameResponder {
3678                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3679                                tx_id: header.tx_id,
3680                            },
3681                        })
3682                    }
3683                    0x21ce0f19ec043889 => {
3684                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3685                        let mut req = fidl::new_empty!(
3686                            DirectoryCreateSymlinkRequest,
3687                            fidl::encoding::DefaultFuchsiaResourceDialect
3688                        );
3689                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryCreateSymlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3690                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3691                        Ok(DirectoryRequest::CreateSymlink {
3692                            name: req.name,
3693                            target: req.target,
3694                            connection: req.connection,
3695
3696                            responder: DirectoryCreateSymlinkResponder {
3697                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3698                                tx_id: header.tx_id,
3699                            },
3700                        })
3701                    }
3702                    0x5717193a59d66d91 => {
3703                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3704                        let mut req = fidl::new_empty!(
3705                            DirectoryWatchRequest,
3706                            fidl::encoding::DefaultFuchsiaResourceDialect
3707                        );
3708                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryWatchRequest>(&header, _body_bytes, handles, &mut req)?;
3709                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3710                        Ok(DirectoryRequest::Watch {
3711                            mask: req.mask,
3712                            options: req.options,
3713                            watcher: req.watcher,
3714
3715                            responder: DirectoryWatchResponder {
3716                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3717                                tx_id: header.tx_id,
3718                            },
3719                        })
3720                    }
3721                    _ if header.tx_id == 0
3722                        && header
3723                            .dynamic_flags()
3724                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3725                    {
3726                        Ok(DirectoryRequest::_UnknownMethod {
3727                            ordinal: header.ordinal,
3728                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3729                            method_type: fidl::MethodType::OneWay,
3730                        })
3731                    }
3732                    _ if header
3733                        .dynamic_flags()
3734                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3735                    {
3736                        this.inner.send_framework_err(
3737                            fidl::encoding::FrameworkErr::UnknownMethod,
3738                            header.tx_id,
3739                            header.ordinal,
3740                            header.dynamic_flags(),
3741                            (bytes, handles),
3742                        )?;
3743                        Ok(DirectoryRequest::_UnknownMethod {
3744                            ordinal: header.ordinal,
3745                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3746                            method_type: fidl::MethodType::TwoWay,
3747                        })
3748                    }
3749                    _ => Err(fidl::Error::UnknownOrdinal {
3750                        ordinal: header.ordinal,
3751                        protocol_name:
3752                            <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3753                    }),
3754                }))
3755            },
3756        )
3757    }
3758}
3759
3760/// Directory defines a node which is capable of containing other Objects.
3761#[derive(Debug)]
3762pub enum DirectoryRequest {
3763    /// Acquires an advisory lock on the underlying file.
3764    ///
3765    /// The lock lasts until either this connection is closed or
3766    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
3767    /// explicitly.
3768    ///
3769    /// Advisory locks are purely advisory. They do not prevent actual read or
3770    /// write operations from occurring on the file, either through this
3771    /// connection or through other connections.
3772    ///
3773    /// This method requires the following rights:
3774    ///
3775    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
3776    /// * [`Rights.WRITE_BYTES`] if `request.type` is
3777    ///   [`AdvisoryLockType.WRITE`].
3778    ///
3779    /// # Errors
3780    ///
3781    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
3782    ///   example, another connection might hold a conflicting lock type.
3783    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
3784    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
3785    ///   to acquire the given type of lock.
3786    AdvisoryLock {
3787        request: AdvisoryLockRequest,
3788        responder: DirectoryAdvisoryLockResponder,
3789    },
3790    Clone {
3791        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
3792        control_handle: DirectoryControlHandle,
3793    },
3794    /// Terminates the connection.
3795    ///
3796    /// After calling `Close`, the client must not send any other requests.
3797    ///
3798    /// Servers, after sending the status response, should close the connection
3799    /// regardless of status and without sending an epitaph.
3800    ///
3801    /// Closing the client end of the channel should be semantically equivalent
3802    /// to calling `Close` without knowing when the close has completed or its
3803    /// status.
3804    Close {
3805        responder: DirectoryCloseResponder,
3806    },
3807    Query {
3808        responder: DirectoryQueryResponder,
3809    },
3810    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
3811    DeprecatedClone {
3812        flags: OpenFlags,
3813        object: fidl::endpoints::ServerEnd<NodeMarker>,
3814        control_handle: DirectoryControlHandle,
3815    },
3816    /// Acquires information about the node.
3817    ///
3818    /// This method does not require any rights.
3819    GetAttr {
3820        responder: DirectoryGetAttrResponder,
3821    },
3822    /// Updates information about the node.
3823    ///
3824    /// Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.
3825    ///
3826    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
3827    /// `ZX_ERR_BAD_HANDLE`.
3828    SetAttr {
3829        flags: NodeAttributeFlags,
3830        attributes: NodeAttributes,
3831        responder: DirectorySetAttrResponder,
3832    },
3833    /// [DEPRECATED - Use new GetFlags method instead.]
3834    DeprecatedGetFlags {
3835        responder: DirectoryDeprecatedGetFlagsResponder,
3836    },
3837    /// [DEPRECATED - Use new SetFlags method instead.]
3838    DeprecatedSetFlags {
3839        flags: OpenFlags,
3840        responder: DirectoryDeprecatedSetFlagsResponder,
3841    },
3842    /// Queries the flags that apply to this node after it has been opened/created. This method does
3843    /// not require any rights.
3844    ///
3845    /// Note that the final set of flags that apply to the connection may differ from those
3846    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
3847    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
3848    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
3849    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
3850    GetFlags {
3851        responder: DirectoryGetFlagsResponder,
3852    },
3853    /// Sets the flags that apply to this node after it has been opened. This method does not
3854    /// require any rights.
3855    ///
3856    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
3857    /// clear append mode.
3858    ///
3859    /// Errors:
3860    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
3861    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
3862    SetFlags {
3863        flags: Flags,
3864        responder: DirectorySetFlagsResponder,
3865    },
3866    /// Query the filesystem for filesystem-specific information.
3867    QueryFilesystem {
3868        responder: DirectoryQueryFilesystemResponder,
3869    },
3870    /// Acquires information about the connection.
3871    ///
3872    /// This method does not require any rights.
3873    GetConnectionInfo {
3874        responder: DirectoryGetConnectionInfoResponder,
3875    },
3876    /// Acquires information about the node.
3877    ///
3878    /// The attributes of a node should be stable, independent of the
3879    /// specific protocol used to access it.
3880    ///
3881    /// If a particular attribute is not applicable or not supported,
3882    /// filesystems should leave the corresponding field absent.
3883    ///
3884    /// + `query` a bit-mask specifying which attributes to fetch. The server
3885    ///   should not return more than necessary.
3886    /// - `attributes` the returned attributes.
3887    ///
3888    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3889    GetAttributes {
3890        query: NodeAttributesQuery,
3891        responder: DirectoryGetAttributesResponder,
3892    },
3893    /// Updates information about the node.
3894    ///
3895    /// + `attributes` the presence of a table field in `attributes` indicates
3896    /// the intent to update the corresponding attribute.
3897    ///
3898    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
3899    ///
3900    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3901    UpdateAttributes {
3902        payload: MutableNodeAttributes,
3903        responder: DirectoryUpdateAttributesResponder,
3904    },
3905    /// Synchronizes updates to the node to the underlying media, if it exists.
3906    ///
3907    /// This method will return when the filesystem server has flushed the
3908    /// relevant updates to the underlying media, but does not guarantee the
3909    /// underlying media has persisted the information, nor that any information
3910    /// is committed to hardware. Clients may use `Sync` to ensure ordering
3911    /// between operations.
3912    ///
3913    /// This method does not require any rights.
3914    Sync {
3915        responder: DirectorySyncResponder,
3916    },
3917    /// Creates an iterator over all the extended attribute names associated
3918    /// with this node. If an error occurs it is returned as an epitaph on the
3919    /// iterator request channel, and then the channel is closed.
3920    ///
3921    /// GetExtendedAttributes can be used with any of these names to retrieve
3922    /// the associated value.
3923    ///
3924    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3925    ListExtendedAttributes {
3926        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
3927        control_handle: DirectoryControlHandle,
3928    },
3929    /// Get the value associated with the given attribute `name` for this node.
3930    ///
3931    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
3932    /// particular structure is imposed on them.
3933    ///
3934    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3935    GetExtendedAttribute {
3936        name: Vec<u8>,
3937        responder: DirectoryGetExtendedAttributeResponder,
3938    },
3939    /// Set the value for the given attribute `name` to `value` for this node.
3940    ///
3941    /// The attribute name may exist, in which case the attribute is updated.
3942    /// If the attribute doesn't exist, it is created. The name should have no
3943    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
3944    ///
3945    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3946    SetExtendedAttribute {
3947        name: Vec<u8>,
3948        value: ExtendedAttributeValue,
3949        mode: SetExtendedAttributeMode,
3950        responder: DirectorySetExtendedAttributeResponder,
3951    },
3952    /// Remove the specified extended attribute.
3953    ///
3954    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
3955    ///
3956    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3957    RemoveExtendedAttribute {
3958        name: Vec<u8>,
3959        responder: DirectoryRemoveExtendedAttributeResponder,
3960    },
3961    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
3962    DeprecatedOpen {
3963        flags: OpenFlags,
3964        mode: ModeType,
3965        path: String,
3966        object: fidl::endpoints::ServerEnd<NodeMarker>,
3967        control_handle: DirectoryControlHandle,
3968    },
3969    /// Open (or create) a node relative to this directory. Any errors are communicated via an
3970    /// epitaph sent on the `object` channel.
3971    ///
3972    /// Errors:
3973    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
3974    /// * See [`Flags`] for other errors which may be communicated based on `flags`
3975    Open {
3976        path: String,
3977        flags: Flags,
3978        options: Options,
3979        object: fidl::Channel,
3980        control_handle: DirectoryControlHandle,
3981    },
3982    /// Reads a collection of variably sized dirents into a buffer.
3983    /// The number of dirents in a directory may be very large: akin to
3984    /// calling read multiple times on a file, directories have a seek
3985    /// offset which is updated on subsequent calls to ReadDirents.
3986    /// Each call to ReadDirents will only return whole dirent structures,
3987    /// they will not get split across ReadDirent calls. When the seek
3988    /// offset reaches the end, `dirents` will be empty.
3989    ///
3990    /// These dirents are of the form:
3991    /// ```
3992    /// struct dirent {
3993    ///   // Describes the inode of the entry.
3994    ///   uint64 ino;
3995    ///   // Describes the length of the dirent name in bytes.
3996    ///   uint8 size;
3997    ///   // Describes the type of the entry. Aligned with the
3998    ///   // POSIX d_type values. Use `DirentType` constants.
3999    ///   uint8 type;
4000    ///   // Unterminated name of entry.
4001    ///   char name[0];
4002    /// }
4003    /// ```
4004    ///
4005    /// This method does not require any rights, since one could always probe for
4006    /// directory contents by triggering name conflicts during file creation.
4007    ReadDirents {
4008        max_bytes: u64,
4009        responder: DirectoryReadDirentsResponder,
4010    },
4011    /// Resets the directory seek offset.
4012    ///
4013    /// This method does not require any rights, similar to ReadDirents.
4014    Rewind {
4015        responder: DirectoryRewindResponder,
4016    },
4017    /// Acquires a token to a Directory which can be used to identify access to it at a later point
4018    /// in time. The token will remain valid for as long as the connection requesting the token
4019    /// remains open.
4020    ///
4021    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
4022    /// `ZX_ERR_BAD_HANDLE`.
4023    GetToken {
4024        responder: DirectoryGetTokenResponder,
4025    },
4026    /// Creates a link to an object named src by the name dst, within a directory represented by
4027    /// token.
4028    ///
4029    /// `src` must be a resolved object name. Including "/" in the string will
4030    /// return `ZX_ERR_INVALID_ARGS`.
4031    ///
4032    /// `dst` must be a resolved object name. Including "/" in the string will
4033    /// return `ZX_ERR_INVALID_ARGS`.
4034    ///
4035    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
4036    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
4037    ///
4038    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
4039    /// there are two actors operating concurrently, and one actor performs a rename that affects
4040    /// the source within this directory, and the other does a link, each will appear to occur
4041    /// atomically in an unspecified order.
4042    Link {
4043        src: String,
4044        dst_parent_token: fidl::Handle,
4045        dst: String,
4046        responder: DirectoryLinkResponder,
4047    },
4048    /// Removes a child node from the this directory's list of entries.
4049    ///
4050    /// Note: this does not guarantee that the underlying object is destroyed.
4051    /// Although the link will be removed from the containing directory,
4052    /// objects with multiple references (such as files which are still open)
4053    /// will not actually be destroyed until all references are closed.
4054    ///
4055    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
4056    ///   [`Rights.WRITE_BYTES`].
4057    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
4058    ///   support writing.
4059    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
4060    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
4061    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
4062    ///   containing a remote channel.
4063    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
4064    ///     something other than a directory was found.
4065    ///
4066    /// Other errors may be returned for filesystem-specific reasons.
4067    ///
4068    /// This method requires the following rights:
4069    ///
4070    /// * [`Rights.ENUMERATE`]
4071    /// * [`Rights.MODIFY_DIRECTORY`]
4072    Unlink {
4073        name: String,
4074        options: UnlinkOptions,
4075        responder: DirectoryUnlinkResponder,
4076    },
4077    /// Renames a node named `src` to the name `dst`, in a directory represented
4078    /// by `dst_parent_token`.
4079    ///
4080    /// `src` and `dst` must be valid node names.
4081    /// See [`Name`] for what constitutes a valid name.
4082    ///
4083    /// This method requires the following rights on both the current connection, and the connection
4084    /// identified by `dst_parent_token`:
4085    ///
4086    /// * [`Rights.ENUMERATE`]
4087    /// * [`Rights.MODIFY_DIRECTORY`]
4088    ///
4089    /// The following requirements are necessary to avoid rights escalations.
4090    ///
4091    /// If the source and destination directory differ, the source directory must also have the
4092    /// maximal set of abilities supported for files, which would typically be
4093    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
4094    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
4095    /// right.
4096    ///
4097    /// If `src` refers to a directory, and differs from the destination directory, then the source
4098    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
4099    ///
4100    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
4101    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
4102    Rename {
4103        src: String,
4104        dst_parent_token: fidl::Event,
4105        dst: String,
4106        responder: DirectoryRenameResponder,
4107    },
4108    /// Creates a symbolic link.
4109    ///
4110    /// `name` is the name to be given to the created symbolic link.
4111    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
4112    /// will perform no validation of `target` except for a server chosen maximum length.
4113    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
4114    /// on the successfully created node.
4115    ///
4116    /// * [`Rights.MODIFY_DIRECTORY`]
4117    ///
4118    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
4119    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
4120    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
4121    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
4122    CreateSymlink {
4123        name: String,
4124        target: Vec<u8>,
4125        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4126        responder: DirectoryCreateSymlinkResponder,
4127    },
4128    /// Watches a directory, receiving events of added messages on the
4129    /// watcher request channel.
4130    ///
4131    /// Options must be zero; it is reserved.
4132    ///
4133    /// This method does not require any rights, similar to ReadDirents.
4134    Watch {
4135        mask: WatchMask,
4136        options: u32,
4137        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4138        responder: DirectoryWatchResponder,
4139    },
4140    /// An interaction was received which does not match any known method.
4141    #[non_exhaustive]
4142    _UnknownMethod {
4143        /// Ordinal of the method that was called.
4144        ordinal: u64,
4145        control_handle: DirectoryControlHandle,
4146        method_type: fidl::MethodType,
4147    },
4148}
4149
4150impl DirectoryRequest {
4151    #[allow(irrefutable_let_patterns)]
4152    pub fn into_advisory_lock(
4153        self,
4154    ) -> Option<(AdvisoryLockRequest, DirectoryAdvisoryLockResponder)> {
4155        if let DirectoryRequest::AdvisoryLock { request, responder } = self {
4156            Some((request, responder))
4157        } else {
4158            None
4159        }
4160    }
4161
4162    #[allow(irrefutable_let_patterns)]
4163    pub fn into_clone(
4164        self,
4165    ) -> Option<(
4166        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
4167        DirectoryControlHandle,
4168    )> {
4169        if let DirectoryRequest::Clone { request, control_handle } = self {
4170            Some((request, control_handle))
4171        } else {
4172            None
4173        }
4174    }
4175
4176    #[allow(irrefutable_let_patterns)]
4177    pub fn into_close(self) -> Option<(DirectoryCloseResponder)> {
4178        if let DirectoryRequest::Close { responder } = self {
4179            Some((responder))
4180        } else {
4181            None
4182        }
4183    }
4184
4185    #[allow(irrefutable_let_patterns)]
4186    pub fn into_query(self) -> Option<(DirectoryQueryResponder)> {
4187        if let DirectoryRequest::Query { responder } = self {
4188            Some((responder))
4189        } else {
4190            None
4191        }
4192    }
4193
4194    #[allow(irrefutable_let_patterns)]
4195    pub fn into_deprecated_clone(
4196        self,
4197    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, DirectoryControlHandle)> {
4198        if let DirectoryRequest::DeprecatedClone { flags, object, control_handle } = self {
4199            Some((flags, object, control_handle))
4200        } else {
4201            None
4202        }
4203    }
4204
4205    #[allow(irrefutable_let_patterns)]
4206    pub fn into_get_attr(self) -> Option<(DirectoryGetAttrResponder)> {
4207        if let DirectoryRequest::GetAttr { responder } = self {
4208            Some((responder))
4209        } else {
4210            None
4211        }
4212    }
4213
4214    #[allow(irrefutable_let_patterns)]
4215    pub fn into_set_attr(
4216        self,
4217    ) -> Option<(NodeAttributeFlags, NodeAttributes, DirectorySetAttrResponder)> {
4218        if let DirectoryRequest::SetAttr { flags, attributes, responder } = self {
4219            Some((flags, attributes, responder))
4220        } else {
4221            None
4222        }
4223    }
4224
4225    #[allow(irrefutable_let_patterns)]
4226    pub fn into_deprecated_get_flags(self) -> Option<(DirectoryDeprecatedGetFlagsResponder)> {
4227        if let DirectoryRequest::DeprecatedGetFlags { responder } = self {
4228            Some((responder))
4229        } else {
4230            None
4231        }
4232    }
4233
4234    #[allow(irrefutable_let_patterns)]
4235    pub fn into_deprecated_set_flags(
4236        self,
4237    ) -> Option<(OpenFlags, DirectoryDeprecatedSetFlagsResponder)> {
4238        if let DirectoryRequest::DeprecatedSetFlags { flags, responder } = self {
4239            Some((flags, responder))
4240        } else {
4241            None
4242        }
4243    }
4244
4245    #[allow(irrefutable_let_patterns)]
4246    pub fn into_get_flags(self) -> Option<(DirectoryGetFlagsResponder)> {
4247        if let DirectoryRequest::GetFlags { responder } = self {
4248            Some((responder))
4249        } else {
4250            None
4251        }
4252    }
4253
4254    #[allow(irrefutable_let_patterns)]
4255    pub fn into_set_flags(self) -> Option<(Flags, DirectorySetFlagsResponder)> {
4256        if let DirectoryRequest::SetFlags { flags, responder } = self {
4257            Some((flags, responder))
4258        } else {
4259            None
4260        }
4261    }
4262
4263    #[allow(irrefutable_let_patterns)]
4264    pub fn into_query_filesystem(self) -> Option<(DirectoryQueryFilesystemResponder)> {
4265        if let DirectoryRequest::QueryFilesystem { responder } = self {
4266            Some((responder))
4267        } else {
4268            None
4269        }
4270    }
4271
4272    #[allow(irrefutable_let_patterns)]
4273    pub fn into_get_connection_info(self) -> Option<(DirectoryGetConnectionInfoResponder)> {
4274        if let DirectoryRequest::GetConnectionInfo { responder } = self {
4275            Some((responder))
4276        } else {
4277            None
4278        }
4279    }
4280
4281    #[allow(irrefutable_let_patterns)]
4282    pub fn into_get_attributes(
4283        self,
4284    ) -> Option<(NodeAttributesQuery, DirectoryGetAttributesResponder)> {
4285        if let DirectoryRequest::GetAttributes { query, responder } = self {
4286            Some((query, responder))
4287        } else {
4288            None
4289        }
4290    }
4291
4292    #[allow(irrefutable_let_patterns)]
4293    pub fn into_update_attributes(
4294        self,
4295    ) -> Option<(MutableNodeAttributes, DirectoryUpdateAttributesResponder)> {
4296        if let DirectoryRequest::UpdateAttributes { payload, responder } = self {
4297            Some((payload, responder))
4298        } else {
4299            None
4300        }
4301    }
4302
4303    #[allow(irrefutable_let_patterns)]
4304    pub fn into_sync(self) -> Option<(DirectorySyncResponder)> {
4305        if let DirectoryRequest::Sync { responder } = self {
4306            Some((responder))
4307        } else {
4308            None
4309        }
4310    }
4311
4312    #[allow(irrefutable_let_patterns)]
4313    pub fn into_list_extended_attributes(
4314        self,
4315    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, DirectoryControlHandle)>
4316    {
4317        if let DirectoryRequest::ListExtendedAttributes { iterator, control_handle } = self {
4318            Some((iterator, control_handle))
4319        } else {
4320            None
4321        }
4322    }
4323
4324    #[allow(irrefutable_let_patterns)]
4325    pub fn into_get_extended_attribute(
4326        self,
4327    ) -> Option<(Vec<u8>, DirectoryGetExtendedAttributeResponder)> {
4328        if let DirectoryRequest::GetExtendedAttribute { name, responder } = self {
4329            Some((name, responder))
4330        } else {
4331            None
4332        }
4333    }
4334
4335    #[allow(irrefutable_let_patterns)]
4336    pub fn into_set_extended_attribute(
4337        self,
4338    ) -> Option<(
4339        Vec<u8>,
4340        ExtendedAttributeValue,
4341        SetExtendedAttributeMode,
4342        DirectorySetExtendedAttributeResponder,
4343    )> {
4344        if let DirectoryRequest::SetExtendedAttribute { name, value, mode, responder } = self {
4345            Some((name, value, mode, responder))
4346        } else {
4347            None
4348        }
4349    }
4350
4351    #[allow(irrefutable_let_patterns)]
4352    pub fn into_remove_extended_attribute(
4353        self,
4354    ) -> Option<(Vec<u8>, DirectoryRemoveExtendedAttributeResponder)> {
4355        if let DirectoryRequest::RemoveExtendedAttribute { name, responder } = self {
4356            Some((name, responder))
4357        } else {
4358            None
4359        }
4360    }
4361
4362    #[allow(irrefutable_let_patterns)]
4363    pub fn into_deprecated_open(
4364        self,
4365    ) -> Option<(
4366        OpenFlags,
4367        ModeType,
4368        String,
4369        fidl::endpoints::ServerEnd<NodeMarker>,
4370        DirectoryControlHandle,
4371    )> {
4372        if let DirectoryRequest::DeprecatedOpen { flags, mode, path, object, control_handle } = self
4373        {
4374            Some((flags, mode, path, object, control_handle))
4375        } else {
4376            None
4377        }
4378    }
4379
4380    #[allow(irrefutable_let_patterns)]
4381    pub fn into_open(
4382        self,
4383    ) -> Option<(String, Flags, Options, fidl::Channel, DirectoryControlHandle)> {
4384        if let DirectoryRequest::Open { path, flags, options, object, control_handle } = self {
4385            Some((path, flags, options, object, control_handle))
4386        } else {
4387            None
4388        }
4389    }
4390
4391    #[allow(irrefutable_let_patterns)]
4392    pub fn into_read_dirents(self) -> Option<(u64, DirectoryReadDirentsResponder)> {
4393        if let DirectoryRequest::ReadDirents { max_bytes, responder } = self {
4394            Some((max_bytes, responder))
4395        } else {
4396            None
4397        }
4398    }
4399
4400    #[allow(irrefutable_let_patterns)]
4401    pub fn into_rewind(self) -> Option<(DirectoryRewindResponder)> {
4402        if let DirectoryRequest::Rewind { responder } = self {
4403            Some((responder))
4404        } else {
4405            None
4406        }
4407    }
4408
4409    #[allow(irrefutable_let_patterns)]
4410    pub fn into_get_token(self) -> Option<(DirectoryGetTokenResponder)> {
4411        if let DirectoryRequest::GetToken { responder } = self {
4412            Some((responder))
4413        } else {
4414            None
4415        }
4416    }
4417
4418    #[allow(irrefutable_let_patterns)]
4419    pub fn into_link(self) -> Option<(String, fidl::Handle, String, DirectoryLinkResponder)> {
4420        if let DirectoryRequest::Link { src, dst_parent_token, dst, responder } = self {
4421            Some((src, dst_parent_token, dst, responder))
4422        } else {
4423            None
4424        }
4425    }
4426
4427    #[allow(irrefutable_let_patterns)]
4428    pub fn into_unlink(self) -> Option<(String, UnlinkOptions, DirectoryUnlinkResponder)> {
4429        if let DirectoryRequest::Unlink { name, options, responder } = self {
4430            Some((name, options, responder))
4431        } else {
4432            None
4433        }
4434    }
4435
4436    #[allow(irrefutable_let_patterns)]
4437    pub fn into_rename(self) -> Option<(String, fidl::Event, String, DirectoryRenameResponder)> {
4438        if let DirectoryRequest::Rename { src, dst_parent_token, dst, responder } = self {
4439            Some((src, dst_parent_token, dst, responder))
4440        } else {
4441            None
4442        }
4443    }
4444
4445    #[allow(irrefutable_let_patterns)]
4446    pub fn into_create_symlink(
4447        self,
4448    ) -> Option<(
4449        String,
4450        Vec<u8>,
4451        Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4452        DirectoryCreateSymlinkResponder,
4453    )> {
4454        if let DirectoryRequest::CreateSymlink { name, target, connection, responder } = self {
4455            Some((name, target, connection, responder))
4456        } else {
4457            None
4458        }
4459    }
4460
4461    #[allow(irrefutable_let_patterns)]
4462    pub fn into_watch(
4463        self,
4464    ) -> Option<(
4465        WatchMask,
4466        u32,
4467        fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4468        DirectoryWatchResponder,
4469    )> {
4470        if let DirectoryRequest::Watch { mask, options, watcher, responder } = self {
4471            Some((mask, options, watcher, responder))
4472        } else {
4473            None
4474        }
4475    }
4476
4477    /// Name of the method defined in FIDL
4478    pub fn method_name(&self) -> &'static str {
4479        match *self {
4480            DirectoryRequest::AdvisoryLock { .. } => "advisory_lock",
4481            DirectoryRequest::Clone { .. } => "clone",
4482            DirectoryRequest::Close { .. } => "close",
4483            DirectoryRequest::Query { .. } => "query",
4484            DirectoryRequest::DeprecatedClone { .. } => "deprecated_clone",
4485            DirectoryRequest::GetAttr { .. } => "get_attr",
4486            DirectoryRequest::SetAttr { .. } => "set_attr",
4487            DirectoryRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
4488            DirectoryRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
4489            DirectoryRequest::GetFlags { .. } => "get_flags",
4490            DirectoryRequest::SetFlags { .. } => "set_flags",
4491            DirectoryRequest::QueryFilesystem { .. } => "query_filesystem",
4492            DirectoryRequest::GetConnectionInfo { .. } => "get_connection_info",
4493            DirectoryRequest::GetAttributes { .. } => "get_attributes",
4494            DirectoryRequest::UpdateAttributes { .. } => "update_attributes",
4495            DirectoryRequest::Sync { .. } => "sync",
4496            DirectoryRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
4497            DirectoryRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
4498            DirectoryRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
4499            DirectoryRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
4500            DirectoryRequest::DeprecatedOpen { .. } => "deprecated_open",
4501            DirectoryRequest::Open { .. } => "open",
4502            DirectoryRequest::ReadDirents { .. } => "read_dirents",
4503            DirectoryRequest::Rewind { .. } => "rewind",
4504            DirectoryRequest::GetToken { .. } => "get_token",
4505            DirectoryRequest::Link { .. } => "link",
4506            DirectoryRequest::Unlink { .. } => "unlink",
4507            DirectoryRequest::Rename { .. } => "rename",
4508            DirectoryRequest::CreateSymlink { .. } => "create_symlink",
4509            DirectoryRequest::Watch { .. } => "watch",
4510            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4511                "unknown one-way method"
4512            }
4513            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4514                "unknown two-way method"
4515            }
4516        }
4517    }
4518}
4519
4520#[derive(Debug, Clone)]
4521pub struct DirectoryControlHandle {
4522    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4523}
4524
4525impl fidl::endpoints::ControlHandle for DirectoryControlHandle {
4526    fn shutdown(&self) {
4527        self.inner.shutdown()
4528    }
4529    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4530        self.inner.shutdown_with_epitaph(status)
4531    }
4532
4533    fn is_closed(&self) -> bool {
4534        self.inner.channel().is_closed()
4535    }
4536    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4537        self.inner.channel().on_closed()
4538    }
4539
4540    #[cfg(target_os = "fuchsia")]
4541    fn signal_peer(
4542        &self,
4543        clear_mask: zx::Signals,
4544        set_mask: zx::Signals,
4545    ) -> Result<(), zx_status::Status> {
4546        use fidl::Peered;
4547        self.inner.channel().signal_peer(clear_mask, set_mask)
4548    }
4549}
4550
4551impl DirectoryControlHandle {
4552    pub fn send_on_open_(
4553        &self,
4554        mut s: i32,
4555        mut info: Option<NodeInfoDeprecated>,
4556    ) -> Result<(), fidl::Error> {
4557        self.inner.send::<NodeOnOpenRequest>(
4558            (s, info.as_mut()),
4559            0,
4560            0x7fc7bbb1dbfd1972,
4561            fidl::encoding::DynamicFlags::empty(),
4562        )
4563    }
4564
4565    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
4566        self.inner.send::<Representation>(
4567            &mut payload,
4568            0,
4569            0x5cb40567d80a510c,
4570            fidl::encoding::DynamicFlags::empty(),
4571        )
4572    }
4573}
4574
4575#[must_use = "FIDL methods require a response to be sent"]
4576#[derive(Debug)]
4577pub struct DirectoryAdvisoryLockResponder {
4578    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4579    tx_id: u32,
4580}
4581
4582/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4583/// if the responder is dropped without sending a response, so that the client
4584/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4585impl std::ops::Drop for DirectoryAdvisoryLockResponder {
4586    fn drop(&mut self) {
4587        self.control_handle.shutdown();
4588        // Safety: drops once, never accessed again
4589        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4590    }
4591}
4592
4593impl fidl::endpoints::Responder for DirectoryAdvisoryLockResponder {
4594    type ControlHandle = DirectoryControlHandle;
4595
4596    fn control_handle(&self) -> &DirectoryControlHandle {
4597        &self.control_handle
4598    }
4599
4600    fn drop_without_shutdown(mut self) {
4601        // Safety: drops once, never accessed again due to mem::forget
4602        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4603        // Prevent Drop from running (which would shut down the channel)
4604        std::mem::forget(self);
4605    }
4606}
4607
4608impl DirectoryAdvisoryLockResponder {
4609    /// Sends a response to the FIDL transaction.
4610    ///
4611    /// Sets the channel to shutdown if an error occurs.
4612    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4613        let _result = self.send_raw(result);
4614        if _result.is_err() {
4615            self.control_handle.shutdown();
4616        }
4617        self.drop_without_shutdown();
4618        _result
4619    }
4620
4621    /// Similar to "send" but does not shutdown the channel if an error occurs.
4622    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4623        let _result = self.send_raw(result);
4624        self.drop_without_shutdown();
4625        _result
4626    }
4627
4628    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4629        self.control_handle
4630            .inner
4631            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4632                result,
4633                self.tx_id,
4634                0x6ee9c0ad53ec87aa,
4635                fidl::encoding::DynamicFlags::empty(),
4636            )
4637    }
4638}
4639
4640#[must_use = "FIDL methods require a response to be sent"]
4641#[derive(Debug)]
4642pub struct DirectoryCloseResponder {
4643    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4644    tx_id: u32,
4645}
4646
4647/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4648/// if the responder is dropped without sending a response, so that the client
4649/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4650impl std::ops::Drop for DirectoryCloseResponder {
4651    fn drop(&mut self) {
4652        self.control_handle.shutdown();
4653        // Safety: drops once, never accessed again
4654        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4655    }
4656}
4657
4658impl fidl::endpoints::Responder for DirectoryCloseResponder {
4659    type ControlHandle = DirectoryControlHandle;
4660
4661    fn control_handle(&self) -> &DirectoryControlHandle {
4662        &self.control_handle
4663    }
4664
4665    fn drop_without_shutdown(mut self) {
4666        // Safety: drops once, never accessed again due to mem::forget
4667        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4668        // Prevent Drop from running (which would shut down the channel)
4669        std::mem::forget(self);
4670    }
4671}
4672
4673impl DirectoryCloseResponder {
4674    /// Sends a response to the FIDL transaction.
4675    ///
4676    /// Sets the channel to shutdown if an error occurs.
4677    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4678        let _result = self.send_raw(result);
4679        if _result.is_err() {
4680            self.control_handle.shutdown();
4681        }
4682        self.drop_without_shutdown();
4683        _result
4684    }
4685
4686    /// Similar to "send" but does not shutdown the channel if an error occurs.
4687    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4688        let _result = self.send_raw(result);
4689        self.drop_without_shutdown();
4690        _result
4691    }
4692
4693    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4694        self.control_handle
4695            .inner
4696            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4697                result,
4698                self.tx_id,
4699                0x5ac5d459ad7f657e,
4700                fidl::encoding::DynamicFlags::empty(),
4701            )
4702    }
4703}
4704
4705#[must_use = "FIDL methods require a response to be sent"]
4706#[derive(Debug)]
4707pub struct DirectoryQueryResponder {
4708    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4709    tx_id: u32,
4710}
4711
4712/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4713/// if the responder is dropped without sending a response, so that the client
4714/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4715impl std::ops::Drop for DirectoryQueryResponder {
4716    fn drop(&mut self) {
4717        self.control_handle.shutdown();
4718        // Safety: drops once, never accessed again
4719        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4720    }
4721}
4722
4723impl fidl::endpoints::Responder for DirectoryQueryResponder {
4724    type ControlHandle = DirectoryControlHandle;
4725
4726    fn control_handle(&self) -> &DirectoryControlHandle {
4727        &self.control_handle
4728    }
4729
4730    fn drop_without_shutdown(mut self) {
4731        // Safety: drops once, never accessed again due to mem::forget
4732        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4733        // Prevent Drop from running (which would shut down the channel)
4734        std::mem::forget(self);
4735    }
4736}
4737
4738impl DirectoryQueryResponder {
4739    /// Sends a response to the FIDL transaction.
4740    ///
4741    /// Sets the channel to shutdown if an error occurs.
4742    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4743        let _result = self.send_raw(protocol);
4744        if _result.is_err() {
4745            self.control_handle.shutdown();
4746        }
4747        self.drop_without_shutdown();
4748        _result
4749    }
4750
4751    /// Similar to "send" but does not shutdown the channel if an error occurs.
4752    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4753        let _result = self.send_raw(protocol);
4754        self.drop_without_shutdown();
4755        _result
4756    }
4757
4758    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4759        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
4760            (protocol,),
4761            self.tx_id,
4762            0x2658edee9decfc06,
4763            fidl::encoding::DynamicFlags::empty(),
4764        )
4765    }
4766}
4767
4768#[must_use = "FIDL methods require a response to be sent"]
4769#[derive(Debug)]
4770pub struct DirectoryGetAttrResponder {
4771    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4772    tx_id: u32,
4773}
4774
4775/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4776/// if the responder is dropped without sending a response, so that the client
4777/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4778impl std::ops::Drop for DirectoryGetAttrResponder {
4779    fn drop(&mut self) {
4780        self.control_handle.shutdown();
4781        // Safety: drops once, never accessed again
4782        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4783    }
4784}
4785
4786impl fidl::endpoints::Responder for DirectoryGetAttrResponder {
4787    type ControlHandle = DirectoryControlHandle;
4788
4789    fn control_handle(&self) -> &DirectoryControlHandle {
4790        &self.control_handle
4791    }
4792
4793    fn drop_without_shutdown(mut self) {
4794        // Safety: drops once, never accessed again due to mem::forget
4795        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4796        // Prevent Drop from running (which would shut down the channel)
4797        std::mem::forget(self);
4798    }
4799}
4800
4801impl DirectoryGetAttrResponder {
4802    /// Sends a response to the FIDL transaction.
4803    ///
4804    /// Sets the channel to shutdown if an error occurs.
4805    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4806        let _result = self.send_raw(s, attributes);
4807        if _result.is_err() {
4808            self.control_handle.shutdown();
4809        }
4810        self.drop_without_shutdown();
4811        _result
4812    }
4813
4814    /// Similar to "send" but does not shutdown the channel if an error occurs.
4815    pub fn send_no_shutdown_on_err(
4816        self,
4817        mut s: i32,
4818        mut attributes: &NodeAttributes,
4819    ) -> Result<(), fidl::Error> {
4820        let _result = self.send_raw(s, attributes);
4821        self.drop_without_shutdown();
4822        _result
4823    }
4824
4825    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4826        self.control_handle.inner.send::<NodeGetAttrResponse>(
4827            (s, attributes),
4828            self.tx_id,
4829            0x78985e216314dafd,
4830            fidl::encoding::DynamicFlags::empty(),
4831        )
4832    }
4833}
4834
4835#[must_use = "FIDL methods require a response to be sent"]
4836#[derive(Debug)]
4837pub struct DirectorySetAttrResponder {
4838    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4839    tx_id: u32,
4840}
4841
4842/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4843/// if the responder is dropped without sending a response, so that the client
4844/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4845impl std::ops::Drop for DirectorySetAttrResponder {
4846    fn drop(&mut self) {
4847        self.control_handle.shutdown();
4848        // Safety: drops once, never accessed again
4849        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4850    }
4851}
4852
4853impl fidl::endpoints::Responder for DirectorySetAttrResponder {
4854    type ControlHandle = DirectoryControlHandle;
4855
4856    fn control_handle(&self) -> &DirectoryControlHandle {
4857        &self.control_handle
4858    }
4859
4860    fn drop_without_shutdown(mut self) {
4861        // Safety: drops once, never accessed again due to mem::forget
4862        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4863        // Prevent Drop from running (which would shut down the channel)
4864        std::mem::forget(self);
4865    }
4866}
4867
4868impl DirectorySetAttrResponder {
4869    /// Sends a response to the FIDL transaction.
4870    ///
4871    /// Sets the channel to shutdown if an error occurs.
4872    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4873        let _result = self.send_raw(s);
4874        if _result.is_err() {
4875            self.control_handle.shutdown();
4876        }
4877        self.drop_without_shutdown();
4878        _result
4879    }
4880
4881    /// Similar to "send" but does not shutdown the channel if an error occurs.
4882    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4883        let _result = self.send_raw(s);
4884        self.drop_without_shutdown();
4885        _result
4886    }
4887
4888    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4889        self.control_handle.inner.send::<NodeSetAttrResponse>(
4890            (s,),
4891            self.tx_id,
4892            0x4186c0f40d938f46,
4893            fidl::encoding::DynamicFlags::empty(),
4894        )
4895    }
4896}
4897
4898#[must_use = "FIDL methods require a response to be sent"]
4899#[derive(Debug)]
4900pub struct DirectoryDeprecatedGetFlagsResponder {
4901    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4902    tx_id: u32,
4903}
4904
4905/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4906/// if the responder is dropped without sending a response, so that the client
4907/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4908impl std::ops::Drop for DirectoryDeprecatedGetFlagsResponder {
4909    fn drop(&mut self) {
4910        self.control_handle.shutdown();
4911        // Safety: drops once, never accessed again
4912        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4913    }
4914}
4915
4916impl fidl::endpoints::Responder for DirectoryDeprecatedGetFlagsResponder {
4917    type ControlHandle = DirectoryControlHandle;
4918
4919    fn control_handle(&self) -> &DirectoryControlHandle {
4920        &self.control_handle
4921    }
4922
4923    fn drop_without_shutdown(mut self) {
4924        // Safety: drops once, never accessed again due to mem::forget
4925        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4926        // Prevent Drop from running (which would shut down the channel)
4927        std::mem::forget(self);
4928    }
4929}
4930
4931impl DirectoryDeprecatedGetFlagsResponder {
4932    /// Sends a response to the FIDL transaction.
4933    ///
4934    /// Sets the channel to shutdown if an error occurs.
4935    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4936        let _result = self.send_raw(s, flags);
4937        if _result.is_err() {
4938            self.control_handle.shutdown();
4939        }
4940        self.drop_without_shutdown();
4941        _result
4942    }
4943
4944    /// Similar to "send" but does not shutdown the channel if an error occurs.
4945    pub fn send_no_shutdown_on_err(
4946        self,
4947        mut s: i32,
4948        mut flags: OpenFlags,
4949    ) -> Result<(), fidl::Error> {
4950        let _result = self.send_raw(s, flags);
4951        self.drop_without_shutdown();
4952        _result
4953    }
4954
4955    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4956        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
4957            (s, flags),
4958            self.tx_id,
4959            0x5b88fffb8eda3aa1,
4960            fidl::encoding::DynamicFlags::empty(),
4961        )
4962    }
4963}
4964
4965#[must_use = "FIDL methods require a response to be sent"]
4966#[derive(Debug)]
4967pub struct DirectoryDeprecatedSetFlagsResponder {
4968    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4969    tx_id: u32,
4970}
4971
4972/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4973/// if the responder is dropped without sending a response, so that the client
4974/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4975impl std::ops::Drop for DirectoryDeprecatedSetFlagsResponder {
4976    fn drop(&mut self) {
4977        self.control_handle.shutdown();
4978        // Safety: drops once, never accessed again
4979        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4980    }
4981}
4982
4983impl fidl::endpoints::Responder for DirectoryDeprecatedSetFlagsResponder {
4984    type ControlHandle = DirectoryControlHandle;
4985
4986    fn control_handle(&self) -> &DirectoryControlHandle {
4987        &self.control_handle
4988    }
4989
4990    fn drop_without_shutdown(mut self) {
4991        // Safety: drops once, never accessed again due to mem::forget
4992        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4993        // Prevent Drop from running (which would shut down the channel)
4994        std::mem::forget(self);
4995    }
4996}
4997
4998impl DirectoryDeprecatedSetFlagsResponder {
4999    /// Sends a response to the FIDL transaction.
5000    ///
5001    /// Sets the channel to shutdown if an error occurs.
5002    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5003        let _result = self.send_raw(s);
5004        if _result.is_err() {
5005            self.control_handle.shutdown();
5006        }
5007        self.drop_without_shutdown();
5008        _result
5009    }
5010
5011    /// Similar to "send" but does not shutdown the channel if an error occurs.
5012    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5013        let _result = self.send_raw(s);
5014        self.drop_without_shutdown();
5015        _result
5016    }
5017
5018    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5019        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
5020            (s,),
5021            self.tx_id,
5022            0x5295b76c71fde733,
5023            fidl::encoding::DynamicFlags::empty(),
5024        )
5025    }
5026}
5027
5028#[must_use = "FIDL methods require a response to be sent"]
5029#[derive(Debug)]
5030pub struct DirectoryGetFlagsResponder {
5031    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5032    tx_id: u32,
5033}
5034
5035/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5036/// if the responder is dropped without sending a response, so that the client
5037/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5038impl std::ops::Drop for DirectoryGetFlagsResponder {
5039    fn drop(&mut self) {
5040        self.control_handle.shutdown();
5041        // Safety: drops once, never accessed again
5042        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5043    }
5044}
5045
5046impl fidl::endpoints::Responder for DirectoryGetFlagsResponder {
5047    type ControlHandle = DirectoryControlHandle;
5048
5049    fn control_handle(&self) -> &DirectoryControlHandle {
5050        &self.control_handle
5051    }
5052
5053    fn drop_without_shutdown(mut self) {
5054        // Safety: drops once, never accessed again due to mem::forget
5055        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5056        // Prevent Drop from running (which would shut down the channel)
5057        std::mem::forget(self);
5058    }
5059}
5060
5061impl DirectoryGetFlagsResponder {
5062    /// Sends a response to the FIDL transaction.
5063    ///
5064    /// Sets the channel to shutdown if an error occurs.
5065    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
5066        let _result = self.send_raw(result);
5067        if _result.is_err() {
5068            self.control_handle.shutdown();
5069        }
5070        self.drop_without_shutdown();
5071        _result
5072    }
5073
5074    /// Similar to "send" but does not shutdown the channel if an error occurs.
5075    pub fn send_no_shutdown_on_err(
5076        self,
5077        mut result: Result<Flags, i32>,
5078    ) -> Result<(), fidl::Error> {
5079        let _result = self.send_raw(result);
5080        self.drop_without_shutdown();
5081        _result
5082    }
5083
5084    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
5085        self.control_handle
5086            .inner
5087            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
5088                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
5089                self.tx_id,
5090                0x176eb318f64ec23,
5091                fidl::encoding::DynamicFlags::FLEXIBLE,
5092            )
5093    }
5094}
5095
5096#[must_use = "FIDL methods require a response to be sent"]
5097#[derive(Debug)]
5098pub struct DirectorySetFlagsResponder {
5099    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5100    tx_id: u32,
5101}
5102
5103/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5104/// if the responder is dropped without sending a response, so that the client
5105/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5106impl std::ops::Drop for DirectorySetFlagsResponder {
5107    fn drop(&mut self) {
5108        self.control_handle.shutdown();
5109        // Safety: drops once, never accessed again
5110        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5111    }
5112}
5113
5114impl fidl::endpoints::Responder for DirectorySetFlagsResponder {
5115    type ControlHandle = DirectoryControlHandle;
5116
5117    fn control_handle(&self) -> &DirectoryControlHandle {
5118        &self.control_handle
5119    }
5120
5121    fn drop_without_shutdown(mut self) {
5122        // Safety: drops once, never accessed again due to mem::forget
5123        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5124        // Prevent Drop from running (which would shut down the channel)
5125        std::mem::forget(self);
5126    }
5127}
5128
5129impl DirectorySetFlagsResponder {
5130    /// Sends a response to the FIDL transaction.
5131    ///
5132    /// Sets the channel to shutdown if an error occurs.
5133    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5134        let _result = self.send_raw(result);
5135        if _result.is_err() {
5136            self.control_handle.shutdown();
5137        }
5138        self.drop_without_shutdown();
5139        _result
5140    }
5141
5142    /// Similar to "send" but does not shutdown the channel if an error occurs.
5143    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5144        let _result = self.send_raw(result);
5145        self.drop_without_shutdown();
5146        _result
5147    }
5148
5149    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5150        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5151            fidl::encoding::EmptyStruct,
5152            i32,
5153        >>(
5154            fidl::encoding::FlexibleResult::new(result),
5155            self.tx_id,
5156            0x55a8028685791ea8,
5157            fidl::encoding::DynamicFlags::FLEXIBLE,
5158        )
5159    }
5160}
5161
5162#[must_use = "FIDL methods require a response to be sent"]
5163#[derive(Debug)]
5164pub struct DirectoryQueryFilesystemResponder {
5165    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5166    tx_id: u32,
5167}
5168
5169/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5170/// if the responder is dropped without sending a response, so that the client
5171/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5172impl std::ops::Drop for DirectoryQueryFilesystemResponder {
5173    fn drop(&mut self) {
5174        self.control_handle.shutdown();
5175        // Safety: drops once, never accessed again
5176        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5177    }
5178}
5179
5180impl fidl::endpoints::Responder for DirectoryQueryFilesystemResponder {
5181    type ControlHandle = DirectoryControlHandle;
5182
5183    fn control_handle(&self) -> &DirectoryControlHandle {
5184        &self.control_handle
5185    }
5186
5187    fn drop_without_shutdown(mut self) {
5188        // Safety: drops once, never accessed again due to mem::forget
5189        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5190        // Prevent Drop from running (which would shut down the channel)
5191        std::mem::forget(self);
5192    }
5193}
5194
5195impl DirectoryQueryFilesystemResponder {
5196    /// Sends a response to the FIDL transaction.
5197    ///
5198    /// Sets the channel to shutdown if an error occurs.
5199    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5200        let _result = self.send_raw(s, info);
5201        if _result.is_err() {
5202            self.control_handle.shutdown();
5203        }
5204        self.drop_without_shutdown();
5205        _result
5206    }
5207
5208    /// Similar to "send" but does not shutdown the channel if an error occurs.
5209    pub fn send_no_shutdown_on_err(
5210        self,
5211        mut s: i32,
5212        mut info: Option<&FilesystemInfo>,
5213    ) -> Result<(), fidl::Error> {
5214        let _result = self.send_raw(s, info);
5215        self.drop_without_shutdown();
5216        _result
5217    }
5218
5219    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5220        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
5221            (s, info),
5222            self.tx_id,
5223            0x6f344a1c6b0a0610,
5224            fidl::encoding::DynamicFlags::empty(),
5225        )
5226    }
5227}
5228
5229#[must_use = "FIDL methods require a response to be sent"]
5230#[derive(Debug)]
5231pub struct DirectoryGetConnectionInfoResponder {
5232    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5233    tx_id: u32,
5234}
5235
5236/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5237/// if the responder is dropped without sending a response, so that the client
5238/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5239impl std::ops::Drop for DirectoryGetConnectionInfoResponder {
5240    fn drop(&mut self) {
5241        self.control_handle.shutdown();
5242        // Safety: drops once, never accessed again
5243        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5244    }
5245}
5246
5247impl fidl::endpoints::Responder for DirectoryGetConnectionInfoResponder {
5248    type ControlHandle = DirectoryControlHandle;
5249
5250    fn control_handle(&self) -> &DirectoryControlHandle {
5251        &self.control_handle
5252    }
5253
5254    fn drop_without_shutdown(mut self) {
5255        // Safety: drops once, never accessed again due to mem::forget
5256        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5257        // Prevent Drop from running (which would shut down the channel)
5258        std::mem::forget(self);
5259    }
5260}
5261
5262impl DirectoryGetConnectionInfoResponder {
5263    /// Sends a response to the FIDL transaction.
5264    ///
5265    /// Sets the channel to shutdown if an error occurs.
5266    pub fn send(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
5267        let _result = self.send_raw(payload);
5268        if _result.is_err() {
5269            self.control_handle.shutdown();
5270        }
5271        self.drop_without_shutdown();
5272        _result
5273    }
5274
5275    /// Similar to "send" but does not shutdown the channel if an error occurs.
5276    pub fn send_no_shutdown_on_err(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
5277        let _result = self.send_raw(payload);
5278        self.drop_without_shutdown();
5279        _result
5280    }
5281
5282    fn send_raw(&self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
5283        self.control_handle.inner.send::<ConnectionInfo>(
5284            &mut payload,
5285            self.tx_id,
5286            0x584c377c7c0a6d0b,
5287            fidl::encoding::DynamicFlags::empty(),
5288        )
5289    }
5290}
5291
5292#[must_use = "FIDL methods require a response to be sent"]
5293#[derive(Debug)]
5294pub struct DirectoryGetAttributesResponder {
5295    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5296    tx_id: u32,
5297}
5298
5299/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5300/// if the responder is dropped without sending a response, so that the client
5301/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5302impl std::ops::Drop for DirectoryGetAttributesResponder {
5303    fn drop(&mut self) {
5304        self.control_handle.shutdown();
5305        // Safety: drops once, never accessed again
5306        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5307    }
5308}
5309
5310impl fidl::endpoints::Responder for DirectoryGetAttributesResponder {
5311    type ControlHandle = DirectoryControlHandle;
5312
5313    fn control_handle(&self) -> &DirectoryControlHandle {
5314        &self.control_handle
5315    }
5316
5317    fn drop_without_shutdown(mut self) {
5318        // Safety: drops once, never accessed again due to mem::forget
5319        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5320        // Prevent Drop from running (which would shut down the channel)
5321        std::mem::forget(self);
5322    }
5323}
5324
5325impl DirectoryGetAttributesResponder {
5326    /// Sends a response to the FIDL transaction.
5327    ///
5328    /// Sets the channel to shutdown if an error occurs.
5329    pub fn send(
5330        self,
5331        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5332    ) -> Result<(), fidl::Error> {
5333        let _result = self.send_raw(result);
5334        if _result.is_err() {
5335            self.control_handle.shutdown();
5336        }
5337        self.drop_without_shutdown();
5338        _result
5339    }
5340
5341    /// Similar to "send" but does not shutdown the channel if an error occurs.
5342    pub fn send_no_shutdown_on_err(
5343        self,
5344        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5345    ) -> Result<(), fidl::Error> {
5346        let _result = self.send_raw(result);
5347        self.drop_without_shutdown();
5348        _result
5349    }
5350
5351    fn send_raw(
5352        &self,
5353        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5354    ) -> Result<(), fidl::Error> {
5355        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
5356            result,
5357            self.tx_id,
5358            0x3d4396a638ea053b,
5359            fidl::encoding::DynamicFlags::empty(),
5360        )
5361    }
5362}
5363
5364#[must_use = "FIDL methods require a response to be sent"]
5365#[derive(Debug)]
5366pub struct DirectoryUpdateAttributesResponder {
5367    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5368    tx_id: u32,
5369}
5370
5371/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5372/// if the responder is dropped without sending a response, so that the client
5373/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5374impl std::ops::Drop for DirectoryUpdateAttributesResponder {
5375    fn drop(&mut self) {
5376        self.control_handle.shutdown();
5377        // Safety: drops once, never accessed again
5378        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5379    }
5380}
5381
5382impl fidl::endpoints::Responder for DirectoryUpdateAttributesResponder {
5383    type ControlHandle = DirectoryControlHandle;
5384
5385    fn control_handle(&self) -> &DirectoryControlHandle {
5386        &self.control_handle
5387    }
5388
5389    fn drop_without_shutdown(mut self) {
5390        // Safety: drops once, never accessed again due to mem::forget
5391        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5392        // Prevent Drop from running (which would shut down the channel)
5393        std::mem::forget(self);
5394    }
5395}
5396
5397impl DirectoryUpdateAttributesResponder {
5398    /// Sends a response to the FIDL transaction.
5399    ///
5400    /// Sets the channel to shutdown if an error occurs.
5401    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5402        let _result = self.send_raw(result);
5403        if _result.is_err() {
5404            self.control_handle.shutdown();
5405        }
5406        self.drop_without_shutdown();
5407        _result
5408    }
5409
5410    /// Similar to "send" but does not shutdown the channel if an error occurs.
5411    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5412        let _result = self.send_raw(result);
5413        self.drop_without_shutdown();
5414        _result
5415    }
5416
5417    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5418        self.control_handle
5419            .inner
5420            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5421                result,
5422                self.tx_id,
5423                0x3308c1da5a89bf08,
5424                fidl::encoding::DynamicFlags::empty(),
5425            )
5426    }
5427}
5428
5429#[must_use = "FIDL methods require a response to be sent"]
5430#[derive(Debug)]
5431pub struct DirectorySyncResponder {
5432    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5433    tx_id: u32,
5434}
5435
5436/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5437/// if the responder is dropped without sending a response, so that the client
5438/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5439impl std::ops::Drop for DirectorySyncResponder {
5440    fn drop(&mut self) {
5441        self.control_handle.shutdown();
5442        // Safety: drops once, never accessed again
5443        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5444    }
5445}
5446
5447impl fidl::endpoints::Responder for DirectorySyncResponder {
5448    type ControlHandle = DirectoryControlHandle;
5449
5450    fn control_handle(&self) -> &DirectoryControlHandle {
5451        &self.control_handle
5452    }
5453
5454    fn drop_without_shutdown(mut self) {
5455        // Safety: drops once, never accessed again due to mem::forget
5456        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5457        // Prevent Drop from running (which would shut down the channel)
5458        std::mem::forget(self);
5459    }
5460}
5461
5462impl DirectorySyncResponder {
5463    /// Sends a response to the FIDL transaction.
5464    ///
5465    /// Sets the channel to shutdown if an error occurs.
5466    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5467        let _result = self.send_raw(result);
5468        if _result.is_err() {
5469            self.control_handle.shutdown();
5470        }
5471        self.drop_without_shutdown();
5472        _result
5473    }
5474
5475    /// Similar to "send" but does not shutdown the channel if an error occurs.
5476    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5477        let _result = self.send_raw(result);
5478        self.drop_without_shutdown();
5479        _result
5480    }
5481
5482    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5483        self.control_handle
5484            .inner
5485            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5486                result,
5487                self.tx_id,
5488                0x2c5c27ca0ab5dc49,
5489                fidl::encoding::DynamicFlags::empty(),
5490            )
5491    }
5492}
5493
5494#[must_use = "FIDL methods require a response to be sent"]
5495#[derive(Debug)]
5496pub struct DirectoryGetExtendedAttributeResponder {
5497    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5498    tx_id: u32,
5499}
5500
5501/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5502/// if the responder is dropped without sending a response, so that the client
5503/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5504impl std::ops::Drop for DirectoryGetExtendedAttributeResponder {
5505    fn drop(&mut self) {
5506        self.control_handle.shutdown();
5507        // Safety: drops once, never accessed again
5508        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5509    }
5510}
5511
5512impl fidl::endpoints::Responder for DirectoryGetExtendedAttributeResponder {
5513    type ControlHandle = DirectoryControlHandle;
5514
5515    fn control_handle(&self) -> &DirectoryControlHandle {
5516        &self.control_handle
5517    }
5518
5519    fn drop_without_shutdown(mut self) {
5520        // Safety: drops once, never accessed again due to mem::forget
5521        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5522        // Prevent Drop from running (which would shut down the channel)
5523        std::mem::forget(self);
5524    }
5525}
5526
5527impl DirectoryGetExtendedAttributeResponder {
5528    /// Sends a response to the FIDL transaction.
5529    ///
5530    /// Sets the channel to shutdown if an error occurs.
5531    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5532        let _result = self.send_raw(result);
5533        if _result.is_err() {
5534            self.control_handle.shutdown();
5535        }
5536        self.drop_without_shutdown();
5537        _result
5538    }
5539
5540    /// Similar to "send" but does not shutdown the channel if an error occurs.
5541    pub fn send_no_shutdown_on_err(
5542        self,
5543        mut result: Result<ExtendedAttributeValue, i32>,
5544    ) -> Result<(), fidl::Error> {
5545        let _result = self.send_raw(result);
5546        self.drop_without_shutdown();
5547        _result
5548    }
5549
5550    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5551        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
5552            result.as_mut().map_err(|e| *e),
5553            self.tx_id,
5554            0x45ffa3ccfdeb76db,
5555            fidl::encoding::DynamicFlags::empty(),
5556        )
5557    }
5558}
5559
5560#[must_use = "FIDL methods require a response to be sent"]
5561#[derive(Debug)]
5562pub struct DirectorySetExtendedAttributeResponder {
5563    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5564    tx_id: u32,
5565}
5566
5567/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5568/// if the responder is dropped without sending a response, so that the client
5569/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5570impl std::ops::Drop for DirectorySetExtendedAttributeResponder {
5571    fn drop(&mut self) {
5572        self.control_handle.shutdown();
5573        // Safety: drops once, never accessed again
5574        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5575    }
5576}
5577
5578impl fidl::endpoints::Responder for DirectorySetExtendedAttributeResponder {
5579    type ControlHandle = DirectoryControlHandle;
5580
5581    fn control_handle(&self) -> &DirectoryControlHandle {
5582        &self.control_handle
5583    }
5584
5585    fn drop_without_shutdown(mut self) {
5586        // Safety: drops once, never accessed again due to mem::forget
5587        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5588        // Prevent Drop from running (which would shut down the channel)
5589        std::mem::forget(self);
5590    }
5591}
5592
5593impl DirectorySetExtendedAttributeResponder {
5594    /// Sends a response to the FIDL transaction.
5595    ///
5596    /// Sets the channel to shutdown if an error occurs.
5597    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5598        let _result = self.send_raw(result);
5599        if _result.is_err() {
5600            self.control_handle.shutdown();
5601        }
5602        self.drop_without_shutdown();
5603        _result
5604    }
5605
5606    /// Similar to "send" but does not shutdown the channel if an error occurs.
5607    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5608        let _result = self.send_raw(result);
5609        self.drop_without_shutdown();
5610        _result
5611    }
5612
5613    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5614        self.control_handle
5615            .inner
5616            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5617                result,
5618                self.tx_id,
5619                0x4a951362f681f23c,
5620                fidl::encoding::DynamicFlags::empty(),
5621            )
5622    }
5623}
5624
5625#[must_use = "FIDL methods require a response to be sent"]
5626#[derive(Debug)]
5627pub struct DirectoryRemoveExtendedAttributeResponder {
5628    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5629    tx_id: u32,
5630}
5631
5632/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5633/// if the responder is dropped without sending a response, so that the client
5634/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5635impl std::ops::Drop for DirectoryRemoveExtendedAttributeResponder {
5636    fn drop(&mut self) {
5637        self.control_handle.shutdown();
5638        // Safety: drops once, never accessed again
5639        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5640    }
5641}
5642
5643impl fidl::endpoints::Responder for DirectoryRemoveExtendedAttributeResponder {
5644    type ControlHandle = DirectoryControlHandle;
5645
5646    fn control_handle(&self) -> &DirectoryControlHandle {
5647        &self.control_handle
5648    }
5649
5650    fn drop_without_shutdown(mut self) {
5651        // Safety: drops once, never accessed again due to mem::forget
5652        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5653        // Prevent Drop from running (which would shut down the channel)
5654        std::mem::forget(self);
5655    }
5656}
5657
5658impl DirectoryRemoveExtendedAttributeResponder {
5659    /// Sends a response to the FIDL transaction.
5660    ///
5661    /// Sets the channel to shutdown if an error occurs.
5662    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5663        let _result = self.send_raw(result);
5664        if _result.is_err() {
5665            self.control_handle.shutdown();
5666        }
5667        self.drop_without_shutdown();
5668        _result
5669    }
5670
5671    /// Similar to "send" but does not shutdown the channel if an error occurs.
5672    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5673        let _result = self.send_raw(result);
5674        self.drop_without_shutdown();
5675        _result
5676    }
5677
5678    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5679        self.control_handle
5680            .inner
5681            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5682                result,
5683                self.tx_id,
5684                0x7a0b9f3a9bf9032d,
5685                fidl::encoding::DynamicFlags::empty(),
5686            )
5687    }
5688}
5689
5690#[must_use = "FIDL methods require a response to be sent"]
5691#[derive(Debug)]
5692pub struct DirectoryReadDirentsResponder {
5693    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5694    tx_id: u32,
5695}
5696
5697/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5698/// if the responder is dropped without sending a response, so that the client
5699/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5700impl std::ops::Drop for DirectoryReadDirentsResponder {
5701    fn drop(&mut self) {
5702        self.control_handle.shutdown();
5703        // Safety: drops once, never accessed again
5704        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5705    }
5706}
5707
5708impl fidl::endpoints::Responder for DirectoryReadDirentsResponder {
5709    type ControlHandle = DirectoryControlHandle;
5710
5711    fn control_handle(&self) -> &DirectoryControlHandle {
5712        &self.control_handle
5713    }
5714
5715    fn drop_without_shutdown(mut self) {
5716        // Safety: drops once, never accessed again due to mem::forget
5717        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5718        // Prevent Drop from running (which would shut down the channel)
5719        std::mem::forget(self);
5720    }
5721}
5722
5723impl DirectoryReadDirentsResponder {
5724    /// Sends a response to the FIDL transaction.
5725    ///
5726    /// Sets the channel to shutdown if an error occurs.
5727    pub fn send(self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5728        let _result = self.send_raw(s, dirents);
5729        if _result.is_err() {
5730            self.control_handle.shutdown();
5731        }
5732        self.drop_without_shutdown();
5733        _result
5734    }
5735
5736    /// Similar to "send" but does not shutdown the channel if an error occurs.
5737    pub fn send_no_shutdown_on_err(
5738        self,
5739        mut s: i32,
5740        mut dirents: &[u8],
5741    ) -> Result<(), fidl::Error> {
5742        let _result = self.send_raw(s, dirents);
5743        self.drop_without_shutdown();
5744        _result
5745    }
5746
5747    fn send_raw(&self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5748        self.control_handle.inner.send::<DirectoryReadDirentsResponse>(
5749            (s, dirents),
5750            self.tx_id,
5751            0x3582806bf27faa0a,
5752            fidl::encoding::DynamicFlags::empty(),
5753        )
5754    }
5755}
5756
5757#[must_use = "FIDL methods require a response to be sent"]
5758#[derive(Debug)]
5759pub struct DirectoryRewindResponder {
5760    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5761    tx_id: u32,
5762}
5763
5764/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5765/// if the responder is dropped without sending a response, so that the client
5766/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5767impl std::ops::Drop for DirectoryRewindResponder {
5768    fn drop(&mut self) {
5769        self.control_handle.shutdown();
5770        // Safety: drops once, never accessed again
5771        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5772    }
5773}
5774
5775impl fidl::endpoints::Responder for DirectoryRewindResponder {
5776    type ControlHandle = DirectoryControlHandle;
5777
5778    fn control_handle(&self) -> &DirectoryControlHandle {
5779        &self.control_handle
5780    }
5781
5782    fn drop_without_shutdown(mut self) {
5783        // Safety: drops once, never accessed again due to mem::forget
5784        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5785        // Prevent Drop from running (which would shut down the channel)
5786        std::mem::forget(self);
5787    }
5788}
5789
5790impl DirectoryRewindResponder {
5791    /// Sends a response to the FIDL transaction.
5792    ///
5793    /// Sets the channel to shutdown if an error occurs.
5794    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5795        let _result = self.send_raw(s);
5796        if _result.is_err() {
5797            self.control_handle.shutdown();
5798        }
5799        self.drop_without_shutdown();
5800        _result
5801    }
5802
5803    /// Similar to "send" but does not shutdown the channel if an error occurs.
5804    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5805        let _result = self.send_raw(s);
5806        self.drop_without_shutdown();
5807        _result
5808    }
5809
5810    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5811        self.control_handle.inner.send::<DirectoryRewindResponse>(
5812            (s,),
5813            self.tx_id,
5814            0x16b1202af0f34c71,
5815            fidl::encoding::DynamicFlags::empty(),
5816        )
5817    }
5818}
5819
5820#[must_use = "FIDL methods require a response to be sent"]
5821#[derive(Debug)]
5822pub struct DirectoryGetTokenResponder {
5823    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5824    tx_id: u32,
5825}
5826
5827/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5828/// if the responder is dropped without sending a response, so that the client
5829/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5830impl std::ops::Drop for DirectoryGetTokenResponder {
5831    fn drop(&mut self) {
5832        self.control_handle.shutdown();
5833        // Safety: drops once, never accessed again
5834        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5835    }
5836}
5837
5838impl fidl::endpoints::Responder for DirectoryGetTokenResponder {
5839    type ControlHandle = DirectoryControlHandle;
5840
5841    fn control_handle(&self) -> &DirectoryControlHandle {
5842        &self.control_handle
5843    }
5844
5845    fn drop_without_shutdown(mut self) {
5846        // Safety: drops once, never accessed again due to mem::forget
5847        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5848        // Prevent Drop from running (which would shut down the channel)
5849        std::mem::forget(self);
5850    }
5851}
5852
5853impl DirectoryGetTokenResponder {
5854    /// Sends a response to the FIDL transaction.
5855    ///
5856    /// Sets the channel to shutdown if an error occurs.
5857    pub fn send(self, mut s: i32, mut token: Option<fidl::Handle>) -> Result<(), fidl::Error> {
5858        let _result = self.send_raw(s, token);
5859        if _result.is_err() {
5860            self.control_handle.shutdown();
5861        }
5862        self.drop_without_shutdown();
5863        _result
5864    }
5865
5866    /// Similar to "send" but does not shutdown the channel if an error occurs.
5867    pub fn send_no_shutdown_on_err(
5868        self,
5869        mut s: i32,
5870        mut token: Option<fidl::Handle>,
5871    ) -> Result<(), fidl::Error> {
5872        let _result = self.send_raw(s, token);
5873        self.drop_without_shutdown();
5874        _result
5875    }
5876
5877    fn send_raw(&self, mut s: i32, mut token: Option<fidl::Handle>) -> Result<(), fidl::Error> {
5878        self.control_handle.inner.send::<DirectoryGetTokenResponse>(
5879            (s, token),
5880            self.tx_id,
5881            0x26ae9d18763c8655,
5882            fidl::encoding::DynamicFlags::empty(),
5883        )
5884    }
5885}
5886
5887#[must_use = "FIDL methods require a response to be sent"]
5888#[derive(Debug)]
5889pub struct DirectoryLinkResponder {
5890    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5891    tx_id: u32,
5892}
5893
5894/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5895/// if the responder is dropped without sending a response, so that the client
5896/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5897impl std::ops::Drop for DirectoryLinkResponder {
5898    fn drop(&mut self) {
5899        self.control_handle.shutdown();
5900        // Safety: drops once, never accessed again
5901        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5902    }
5903}
5904
5905impl fidl::endpoints::Responder for DirectoryLinkResponder {
5906    type ControlHandle = DirectoryControlHandle;
5907
5908    fn control_handle(&self) -> &DirectoryControlHandle {
5909        &self.control_handle
5910    }
5911
5912    fn drop_without_shutdown(mut self) {
5913        // Safety: drops once, never accessed again due to mem::forget
5914        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5915        // Prevent Drop from running (which would shut down the channel)
5916        std::mem::forget(self);
5917    }
5918}
5919
5920impl DirectoryLinkResponder {
5921    /// Sends a response to the FIDL transaction.
5922    ///
5923    /// Sets the channel to shutdown if an error occurs.
5924    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5925        let _result = self.send_raw(s);
5926        if _result.is_err() {
5927            self.control_handle.shutdown();
5928        }
5929        self.drop_without_shutdown();
5930        _result
5931    }
5932
5933    /// Similar to "send" but does not shutdown the channel if an error occurs.
5934    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5935        let _result = self.send_raw(s);
5936        self.drop_without_shutdown();
5937        _result
5938    }
5939
5940    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5941        self.control_handle.inner.send::<DirectoryLinkResponse>(
5942            (s,),
5943            self.tx_id,
5944            0x740604c0c7c930e7,
5945            fidl::encoding::DynamicFlags::empty(),
5946        )
5947    }
5948}
5949
5950#[must_use = "FIDL methods require a response to be sent"]
5951#[derive(Debug)]
5952pub struct DirectoryUnlinkResponder {
5953    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5954    tx_id: u32,
5955}
5956
5957/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5958/// if the responder is dropped without sending a response, so that the client
5959/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5960impl std::ops::Drop for DirectoryUnlinkResponder {
5961    fn drop(&mut self) {
5962        self.control_handle.shutdown();
5963        // Safety: drops once, never accessed again
5964        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5965    }
5966}
5967
5968impl fidl::endpoints::Responder for DirectoryUnlinkResponder {
5969    type ControlHandle = DirectoryControlHandle;
5970
5971    fn control_handle(&self) -> &DirectoryControlHandle {
5972        &self.control_handle
5973    }
5974
5975    fn drop_without_shutdown(mut self) {
5976        // Safety: drops once, never accessed again due to mem::forget
5977        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5978        // Prevent Drop from running (which would shut down the channel)
5979        std::mem::forget(self);
5980    }
5981}
5982
5983impl DirectoryUnlinkResponder {
5984    /// Sends a response to the FIDL transaction.
5985    ///
5986    /// Sets the channel to shutdown if an error occurs.
5987    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5988        let _result = self.send_raw(result);
5989        if _result.is_err() {
5990            self.control_handle.shutdown();
5991        }
5992        self.drop_without_shutdown();
5993        _result
5994    }
5995
5996    /// Similar to "send" but does not shutdown the channel if an error occurs.
5997    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5998        let _result = self.send_raw(result);
5999        self.drop_without_shutdown();
6000        _result
6001    }
6002
6003    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6004        self.control_handle
6005            .inner
6006            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6007                result,
6008                self.tx_id,
6009                0x750a0326a78d7bed,
6010                fidl::encoding::DynamicFlags::empty(),
6011            )
6012    }
6013}
6014
6015#[must_use = "FIDL methods require a response to be sent"]
6016#[derive(Debug)]
6017pub struct DirectoryRenameResponder {
6018    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
6019    tx_id: u32,
6020}
6021
6022/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
6023/// if the responder is dropped without sending a response, so that the client
6024/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6025impl std::ops::Drop for DirectoryRenameResponder {
6026    fn drop(&mut self) {
6027        self.control_handle.shutdown();
6028        // Safety: drops once, never accessed again
6029        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6030    }
6031}
6032
6033impl fidl::endpoints::Responder for DirectoryRenameResponder {
6034    type ControlHandle = DirectoryControlHandle;
6035
6036    fn control_handle(&self) -> &DirectoryControlHandle {
6037        &self.control_handle
6038    }
6039
6040    fn drop_without_shutdown(mut self) {
6041        // Safety: drops once, never accessed again due to mem::forget
6042        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6043        // Prevent Drop from running (which would shut down the channel)
6044        std::mem::forget(self);
6045    }
6046}
6047
6048impl DirectoryRenameResponder {
6049    /// Sends a response to the FIDL transaction.
6050    ///
6051    /// Sets the channel to shutdown if an error occurs.
6052    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6053        let _result = self.send_raw(result);
6054        if _result.is_err() {
6055            self.control_handle.shutdown();
6056        }
6057        self.drop_without_shutdown();
6058        _result
6059    }
6060
6061    /// Similar to "send" but does not shutdown the channel if an error occurs.
6062    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6063        let _result = self.send_raw(result);
6064        self.drop_without_shutdown();
6065        _result
6066    }
6067
6068    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6069        self.control_handle
6070            .inner
6071            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6072                result,
6073                self.tx_id,
6074                0x7060e7723b9928de,
6075                fidl::encoding::DynamicFlags::empty(),
6076            )
6077    }
6078}
6079
6080#[must_use = "FIDL methods require a response to be sent"]
6081#[derive(Debug)]
6082pub struct DirectoryCreateSymlinkResponder {
6083    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
6084    tx_id: u32,
6085}
6086
6087/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
6088/// if the responder is dropped without sending a response, so that the client
6089/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6090impl std::ops::Drop for DirectoryCreateSymlinkResponder {
6091    fn drop(&mut self) {
6092        self.control_handle.shutdown();
6093        // Safety: drops once, never accessed again
6094        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6095    }
6096}
6097
6098impl fidl::endpoints::Responder for DirectoryCreateSymlinkResponder {
6099    type ControlHandle = DirectoryControlHandle;
6100
6101    fn control_handle(&self) -> &DirectoryControlHandle {
6102        &self.control_handle
6103    }
6104
6105    fn drop_without_shutdown(mut self) {
6106        // Safety: drops once, never accessed again due to mem::forget
6107        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6108        // Prevent Drop from running (which would shut down the channel)
6109        std::mem::forget(self);
6110    }
6111}
6112
6113impl DirectoryCreateSymlinkResponder {
6114    /// Sends a response to the FIDL transaction.
6115    ///
6116    /// Sets the channel to shutdown if an error occurs.
6117    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6118        let _result = self.send_raw(result);
6119        if _result.is_err() {
6120            self.control_handle.shutdown();
6121        }
6122        self.drop_without_shutdown();
6123        _result
6124    }
6125
6126    /// Similar to "send" but does not shutdown the channel if an error occurs.
6127    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6128        let _result = self.send_raw(result);
6129        self.drop_without_shutdown();
6130        _result
6131    }
6132
6133    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6134        self.control_handle
6135            .inner
6136            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6137                result,
6138                self.tx_id,
6139                0x21ce0f19ec043889,
6140                fidl::encoding::DynamicFlags::empty(),
6141            )
6142    }
6143}
6144
6145#[must_use = "FIDL methods require a response to be sent"]
6146#[derive(Debug)]
6147pub struct DirectoryWatchResponder {
6148    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
6149    tx_id: u32,
6150}
6151
6152/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
6153/// if the responder is dropped without sending a response, so that the client
6154/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6155impl std::ops::Drop for DirectoryWatchResponder {
6156    fn drop(&mut self) {
6157        self.control_handle.shutdown();
6158        // Safety: drops once, never accessed again
6159        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6160    }
6161}
6162
6163impl fidl::endpoints::Responder for DirectoryWatchResponder {
6164    type ControlHandle = DirectoryControlHandle;
6165
6166    fn control_handle(&self) -> &DirectoryControlHandle {
6167        &self.control_handle
6168    }
6169
6170    fn drop_without_shutdown(mut self) {
6171        // Safety: drops once, never accessed again due to mem::forget
6172        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6173        // Prevent Drop from running (which would shut down the channel)
6174        std::mem::forget(self);
6175    }
6176}
6177
6178impl DirectoryWatchResponder {
6179    /// Sends a response to the FIDL transaction.
6180    ///
6181    /// Sets the channel to shutdown if an error occurs.
6182    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
6183        let _result = self.send_raw(s);
6184        if _result.is_err() {
6185            self.control_handle.shutdown();
6186        }
6187        self.drop_without_shutdown();
6188        _result
6189    }
6190
6191    /// Similar to "send" but does not shutdown the channel if an error occurs.
6192    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
6193        let _result = self.send_raw(s);
6194        self.drop_without_shutdown();
6195        _result
6196    }
6197
6198    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
6199        self.control_handle.inner.send::<DirectoryWatchResponse>(
6200            (s,),
6201            self.tx_id,
6202            0x5717193a59d66d91,
6203            fidl::encoding::DynamicFlags::empty(),
6204        )
6205    }
6206}
6207
6208#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6209pub struct DirectoryWatcherMarker;
6210
6211impl fidl::endpoints::ProtocolMarker for DirectoryWatcherMarker {
6212    type Proxy = DirectoryWatcherProxy;
6213    type RequestStream = DirectoryWatcherRequestStream;
6214    #[cfg(target_os = "fuchsia")]
6215    type SynchronousProxy = DirectoryWatcherSynchronousProxy;
6216
6217    const DEBUG_NAME: &'static str = "(anonymous) DirectoryWatcher";
6218}
6219
6220pub trait DirectoryWatcherProxyInterface: Send + Sync {}
6221#[derive(Debug)]
6222#[cfg(target_os = "fuchsia")]
6223pub struct DirectoryWatcherSynchronousProxy {
6224    client: fidl::client::sync::Client,
6225}
6226
6227#[cfg(target_os = "fuchsia")]
6228impl fidl::endpoints::SynchronousProxy for DirectoryWatcherSynchronousProxy {
6229    type Proxy = DirectoryWatcherProxy;
6230    type Protocol = DirectoryWatcherMarker;
6231
6232    fn from_channel(inner: fidl::Channel) -> Self {
6233        Self::new(inner)
6234    }
6235
6236    fn into_channel(self) -> fidl::Channel {
6237        self.client.into_channel()
6238    }
6239
6240    fn as_channel(&self) -> &fidl::Channel {
6241        self.client.as_channel()
6242    }
6243}
6244
6245#[cfg(target_os = "fuchsia")]
6246impl DirectoryWatcherSynchronousProxy {
6247    pub fn new(channel: fidl::Channel) -> Self {
6248        let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6249        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6250    }
6251
6252    pub fn into_channel(self) -> fidl::Channel {
6253        self.client.into_channel()
6254    }
6255
6256    /// Waits until an event arrives and returns it. It is safe for other
6257    /// threads to make concurrent requests while waiting for an event.
6258    pub fn wait_for_event(
6259        &self,
6260        deadline: zx::MonotonicInstant,
6261    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6262        DirectoryWatcherEvent::decode(self.client.wait_for_event(deadline)?)
6263    }
6264}
6265
6266#[cfg(target_os = "fuchsia")]
6267impl From<DirectoryWatcherSynchronousProxy> for zx::Handle {
6268    fn from(value: DirectoryWatcherSynchronousProxy) -> Self {
6269        value.into_channel().into()
6270    }
6271}
6272
6273#[cfg(target_os = "fuchsia")]
6274impl From<fidl::Channel> for DirectoryWatcherSynchronousProxy {
6275    fn from(value: fidl::Channel) -> Self {
6276        Self::new(value)
6277    }
6278}
6279
6280#[derive(Debug, Clone)]
6281pub struct DirectoryWatcherProxy {
6282    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6283}
6284
6285impl fidl::endpoints::Proxy for DirectoryWatcherProxy {
6286    type Protocol = DirectoryWatcherMarker;
6287
6288    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6289        Self::new(inner)
6290    }
6291
6292    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6293        self.client.into_channel().map_err(|client| Self { client })
6294    }
6295
6296    fn as_channel(&self) -> &::fidl::AsyncChannel {
6297        self.client.as_channel()
6298    }
6299}
6300
6301impl DirectoryWatcherProxy {
6302    /// Create a new Proxy for fuchsia.io/DirectoryWatcher.
6303    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6304        let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6305        Self { client: fidl::client::Client::new(channel, protocol_name) }
6306    }
6307
6308    /// Get a Stream of events from the remote end of the protocol.
6309    ///
6310    /// # Panics
6311    ///
6312    /// Panics if the event stream was already taken.
6313    pub fn take_event_stream(&self) -> DirectoryWatcherEventStream {
6314        DirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
6315    }
6316}
6317
6318impl DirectoryWatcherProxyInterface for DirectoryWatcherProxy {}
6319
6320pub struct DirectoryWatcherEventStream {
6321    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6322}
6323
6324impl std::marker::Unpin for DirectoryWatcherEventStream {}
6325
6326impl futures::stream::FusedStream for DirectoryWatcherEventStream {
6327    fn is_terminated(&self) -> bool {
6328        self.event_receiver.is_terminated()
6329    }
6330}
6331
6332impl futures::Stream for DirectoryWatcherEventStream {
6333    type Item = Result<DirectoryWatcherEvent, fidl::Error>;
6334
6335    fn poll_next(
6336        mut self: std::pin::Pin<&mut Self>,
6337        cx: &mut std::task::Context<'_>,
6338    ) -> std::task::Poll<Option<Self::Item>> {
6339        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6340            &mut self.event_receiver,
6341            cx
6342        )?) {
6343            Some(buf) => std::task::Poll::Ready(Some(DirectoryWatcherEvent::decode(buf))),
6344            None => std::task::Poll::Ready(None),
6345        }
6346    }
6347}
6348
6349#[derive(Debug)]
6350pub enum DirectoryWatcherEvent {}
6351
6352impl DirectoryWatcherEvent {
6353    /// Decodes a message buffer as a [`DirectoryWatcherEvent`].
6354    fn decode(
6355        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6356    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6357        let (bytes, _handles) = buf.split_mut();
6358        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6359        debug_assert_eq!(tx_header.tx_id, 0);
6360        match tx_header.ordinal {
6361            _ => Err(fidl::Error::UnknownOrdinal {
6362                ordinal: tx_header.ordinal,
6363                protocol_name:
6364                    <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6365            }),
6366        }
6367    }
6368}
6369
6370/// A Stream of incoming requests for fuchsia.io/DirectoryWatcher.
6371pub struct DirectoryWatcherRequestStream {
6372    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6373    is_terminated: bool,
6374}
6375
6376impl std::marker::Unpin for DirectoryWatcherRequestStream {}
6377
6378impl futures::stream::FusedStream for DirectoryWatcherRequestStream {
6379    fn is_terminated(&self) -> bool {
6380        self.is_terminated
6381    }
6382}
6383
6384impl fidl::endpoints::RequestStream for DirectoryWatcherRequestStream {
6385    type Protocol = DirectoryWatcherMarker;
6386    type ControlHandle = DirectoryWatcherControlHandle;
6387
6388    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6389        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6390    }
6391
6392    fn control_handle(&self) -> Self::ControlHandle {
6393        DirectoryWatcherControlHandle { inner: self.inner.clone() }
6394    }
6395
6396    fn into_inner(
6397        self,
6398    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6399    {
6400        (self.inner, self.is_terminated)
6401    }
6402
6403    fn from_inner(
6404        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6405        is_terminated: bool,
6406    ) -> Self {
6407        Self { inner, is_terminated }
6408    }
6409}
6410
6411impl futures::Stream for DirectoryWatcherRequestStream {
6412    type Item = Result<DirectoryWatcherRequest, fidl::Error>;
6413
6414    fn poll_next(
6415        mut self: std::pin::Pin<&mut Self>,
6416        cx: &mut std::task::Context<'_>,
6417    ) -> std::task::Poll<Option<Self::Item>> {
6418        let this = &mut *self;
6419        if this.inner.check_shutdown(cx) {
6420            this.is_terminated = true;
6421            return std::task::Poll::Ready(None);
6422        }
6423        if this.is_terminated {
6424            panic!("polled DirectoryWatcherRequestStream after completion");
6425        }
6426        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6427            |bytes, handles| {
6428                match this.inner.channel().read_etc(cx, bytes, handles) {
6429                    std::task::Poll::Ready(Ok(())) => {}
6430                    std::task::Poll::Pending => return std::task::Poll::Pending,
6431                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6432                        this.is_terminated = true;
6433                        return std::task::Poll::Ready(None);
6434                    }
6435                    std::task::Poll::Ready(Err(e)) => {
6436                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6437                            e.into(),
6438                        ))))
6439                    }
6440                }
6441
6442                // A message has been received from the channel
6443                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6444
6445                std::task::Poll::Ready(Some(match header.ordinal {
6446                    _ => Err(fidl::Error::UnknownOrdinal {
6447                        ordinal: header.ordinal,
6448                        protocol_name:
6449                            <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6450                    }),
6451                }))
6452            },
6453        )
6454    }
6455}
6456
6457/// DirectoryWatcher transmits messages from a filesystem server
6458/// about events happening in the filesystem. Clients can register
6459/// new watchers using the `Directory.Watch` method, where they can
6460/// filter which events they want to receive notifications for.
6461///
6462/// The DirectoryWatcher will send messages of the form:
6463/// ```
6464/// struct {
6465///   uint8 event;
6466///   uint8 len;
6467///   char name[];
6468/// };
6469/// ```
6470/// Where names are NOT null-terminated. The name is the relative
6471/// path to the entry the event is refering to. It will be empty if
6472/// the event isn't referencing a particular entry (e.g. for the
6473/// `IDLE` event).
6474#[derive(Debug)]
6475pub enum DirectoryWatcherRequest {}
6476
6477impl DirectoryWatcherRequest {
6478    /// Name of the method defined in FIDL
6479    pub fn method_name(&self) -> &'static str {
6480        match *self {}
6481    }
6482}
6483
6484#[derive(Debug, Clone)]
6485pub struct DirectoryWatcherControlHandle {
6486    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6487}
6488
6489impl fidl::endpoints::ControlHandle for DirectoryWatcherControlHandle {
6490    fn shutdown(&self) {
6491        self.inner.shutdown()
6492    }
6493    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6494        self.inner.shutdown_with_epitaph(status)
6495    }
6496
6497    fn is_closed(&self) -> bool {
6498        self.inner.channel().is_closed()
6499    }
6500    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6501        self.inner.channel().on_closed()
6502    }
6503
6504    #[cfg(target_os = "fuchsia")]
6505    fn signal_peer(
6506        &self,
6507        clear_mask: zx::Signals,
6508        set_mask: zx::Signals,
6509    ) -> Result<(), zx_status::Status> {
6510        use fidl::Peered;
6511        self.inner.channel().signal_peer(clear_mask, set_mask)
6512    }
6513}
6514
6515impl DirectoryWatcherControlHandle {}
6516
6517#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6518pub struct ExtendedAttributeIteratorMarker;
6519
6520impl fidl::endpoints::ProtocolMarker for ExtendedAttributeIteratorMarker {
6521    type Proxy = ExtendedAttributeIteratorProxy;
6522    type RequestStream = ExtendedAttributeIteratorRequestStream;
6523    #[cfg(target_os = "fuchsia")]
6524    type SynchronousProxy = ExtendedAttributeIteratorSynchronousProxy;
6525
6526    const DEBUG_NAME: &'static str = "(anonymous) ExtendedAttributeIterator";
6527}
6528pub type ExtendedAttributeIteratorGetNextResult = Result<(Vec<Vec<u8>>, bool), i32>;
6529
6530pub trait ExtendedAttributeIteratorProxyInterface: Send + Sync {
6531    type GetNextResponseFut: std::future::Future<Output = Result<ExtendedAttributeIteratorGetNextResult, fidl::Error>>
6532        + Send;
6533    fn r#get_next(&self) -> Self::GetNextResponseFut;
6534}
6535#[derive(Debug)]
6536#[cfg(target_os = "fuchsia")]
6537pub struct ExtendedAttributeIteratorSynchronousProxy {
6538    client: fidl::client::sync::Client,
6539}
6540
6541#[cfg(target_os = "fuchsia")]
6542impl fidl::endpoints::SynchronousProxy for ExtendedAttributeIteratorSynchronousProxy {
6543    type Proxy = ExtendedAttributeIteratorProxy;
6544    type Protocol = ExtendedAttributeIteratorMarker;
6545
6546    fn from_channel(inner: fidl::Channel) -> Self {
6547        Self::new(inner)
6548    }
6549
6550    fn into_channel(self) -> fidl::Channel {
6551        self.client.into_channel()
6552    }
6553
6554    fn as_channel(&self) -> &fidl::Channel {
6555        self.client.as_channel()
6556    }
6557}
6558
6559#[cfg(target_os = "fuchsia")]
6560impl ExtendedAttributeIteratorSynchronousProxy {
6561    pub fn new(channel: fidl::Channel) -> Self {
6562        let protocol_name =
6563            <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6564        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6565    }
6566
6567    pub fn into_channel(self) -> fidl::Channel {
6568        self.client.into_channel()
6569    }
6570
6571    /// Waits until an event arrives and returns it. It is safe for other
6572    /// threads to make concurrent requests while waiting for an event.
6573    pub fn wait_for_event(
6574        &self,
6575        deadline: zx::MonotonicInstant,
6576    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6577        ExtendedAttributeIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6578    }
6579
6580    /// Get the next chunk of extended attribute names. If this is the last
6581    /// chunk, last will be true, and the channel will be closed after the
6582    /// call.
6583    pub fn r#get_next(
6584        &self,
6585        ___deadline: zx::MonotonicInstant,
6586    ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6587        let _response = self.client.send_query::<
6588            fidl::encoding::EmptyPayload,
6589            fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6590        >(
6591            (),
6592            0x3ba664a1c2e45a7,
6593            fidl::encoding::DynamicFlags::empty(),
6594            ___deadline,
6595        )?;
6596        Ok(_response.map(|x| (x.attributes, x.last)))
6597    }
6598}
6599
6600#[cfg(target_os = "fuchsia")]
6601impl From<ExtendedAttributeIteratorSynchronousProxy> for zx::Handle {
6602    fn from(value: ExtendedAttributeIteratorSynchronousProxy) -> Self {
6603        value.into_channel().into()
6604    }
6605}
6606
6607#[cfg(target_os = "fuchsia")]
6608impl From<fidl::Channel> for ExtendedAttributeIteratorSynchronousProxy {
6609    fn from(value: fidl::Channel) -> Self {
6610        Self::new(value)
6611    }
6612}
6613
6614#[derive(Debug, Clone)]
6615pub struct ExtendedAttributeIteratorProxy {
6616    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6617}
6618
6619impl fidl::endpoints::Proxy for ExtendedAttributeIteratorProxy {
6620    type Protocol = ExtendedAttributeIteratorMarker;
6621
6622    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6623        Self::new(inner)
6624    }
6625
6626    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6627        self.client.into_channel().map_err(|client| Self { client })
6628    }
6629
6630    fn as_channel(&self) -> &::fidl::AsyncChannel {
6631        self.client.as_channel()
6632    }
6633}
6634
6635impl ExtendedAttributeIteratorProxy {
6636    /// Create a new Proxy for fuchsia.io/ExtendedAttributeIterator.
6637    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6638        let protocol_name =
6639            <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6640        Self { client: fidl::client::Client::new(channel, protocol_name) }
6641    }
6642
6643    /// Get a Stream of events from the remote end of the protocol.
6644    ///
6645    /// # Panics
6646    ///
6647    /// Panics if the event stream was already taken.
6648    pub fn take_event_stream(&self) -> ExtendedAttributeIteratorEventStream {
6649        ExtendedAttributeIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6650    }
6651
6652    /// Get the next chunk of extended attribute names. If this is the last
6653    /// chunk, last will be true, and the channel will be closed after the
6654    /// call.
6655    pub fn r#get_next(
6656        &self,
6657    ) -> fidl::client::QueryResponseFut<
6658        ExtendedAttributeIteratorGetNextResult,
6659        fidl::encoding::DefaultFuchsiaResourceDialect,
6660    > {
6661        ExtendedAttributeIteratorProxyInterface::r#get_next(self)
6662    }
6663}
6664
6665impl ExtendedAttributeIteratorProxyInterface for ExtendedAttributeIteratorProxy {
6666    type GetNextResponseFut = fidl::client::QueryResponseFut<
6667        ExtendedAttributeIteratorGetNextResult,
6668        fidl::encoding::DefaultFuchsiaResourceDialect,
6669    >;
6670    fn r#get_next(&self) -> Self::GetNextResponseFut {
6671        fn _decode(
6672            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6673        ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6674            let _response = fidl::client::decode_transaction_body::<
6675                fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6676                fidl::encoding::DefaultFuchsiaResourceDialect,
6677                0x3ba664a1c2e45a7,
6678            >(_buf?)?;
6679            Ok(_response.map(|x| (x.attributes, x.last)))
6680        }
6681        self.client.send_query_and_decode::<
6682            fidl::encoding::EmptyPayload,
6683            ExtendedAttributeIteratorGetNextResult,
6684        >(
6685            (),
6686            0x3ba664a1c2e45a7,
6687            fidl::encoding::DynamicFlags::empty(),
6688            _decode,
6689        )
6690    }
6691}
6692
6693pub struct ExtendedAttributeIteratorEventStream {
6694    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6695}
6696
6697impl std::marker::Unpin for ExtendedAttributeIteratorEventStream {}
6698
6699impl futures::stream::FusedStream for ExtendedAttributeIteratorEventStream {
6700    fn is_terminated(&self) -> bool {
6701        self.event_receiver.is_terminated()
6702    }
6703}
6704
6705impl futures::Stream for ExtendedAttributeIteratorEventStream {
6706    type Item = Result<ExtendedAttributeIteratorEvent, fidl::Error>;
6707
6708    fn poll_next(
6709        mut self: std::pin::Pin<&mut Self>,
6710        cx: &mut std::task::Context<'_>,
6711    ) -> std::task::Poll<Option<Self::Item>> {
6712        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6713            &mut self.event_receiver,
6714            cx
6715        )?) {
6716            Some(buf) => std::task::Poll::Ready(Some(ExtendedAttributeIteratorEvent::decode(buf))),
6717            None => std::task::Poll::Ready(None),
6718        }
6719    }
6720}
6721
6722#[derive(Debug)]
6723pub enum ExtendedAttributeIteratorEvent {}
6724
6725impl ExtendedAttributeIteratorEvent {
6726    /// Decodes a message buffer as a [`ExtendedAttributeIteratorEvent`].
6727    fn decode(
6728        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6729    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6730        let (bytes, _handles) = buf.split_mut();
6731        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6732        debug_assert_eq!(tx_header.tx_id, 0);
6733        match tx_header.ordinal {
6734            _ => Err(fidl::Error::UnknownOrdinal {
6735                ordinal: tx_header.ordinal,
6736                protocol_name:
6737                    <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6738            }),
6739        }
6740    }
6741}
6742
6743/// A Stream of incoming requests for fuchsia.io/ExtendedAttributeIterator.
6744pub struct ExtendedAttributeIteratorRequestStream {
6745    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6746    is_terminated: bool,
6747}
6748
6749impl std::marker::Unpin for ExtendedAttributeIteratorRequestStream {}
6750
6751impl futures::stream::FusedStream for ExtendedAttributeIteratorRequestStream {
6752    fn is_terminated(&self) -> bool {
6753        self.is_terminated
6754    }
6755}
6756
6757impl fidl::endpoints::RequestStream for ExtendedAttributeIteratorRequestStream {
6758    type Protocol = ExtendedAttributeIteratorMarker;
6759    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6760
6761    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6762        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6763    }
6764
6765    fn control_handle(&self) -> Self::ControlHandle {
6766        ExtendedAttributeIteratorControlHandle { inner: self.inner.clone() }
6767    }
6768
6769    fn into_inner(
6770        self,
6771    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6772    {
6773        (self.inner, self.is_terminated)
6774    }
6775
6776    fn from_inner(
6777        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6778        is_terminated: bool,
6779    ) -> Self {
6780        Self { inner, is_terminated }
6781    }
6782}
6783
6784impl futures::Stream for ExtendedAttributeIteratorRequestStream {
6785    type Item = Result<ExtendedAttributeIteratorRequest, fidl::Error>;
6786
6787    fn poll_next(
6788        mut self: std::pin::Pin<&mut Self>,
6789        cx: &mut std::task::Context<'_>,
6790    ) -> std::task::Poll<Option<Self::Item>> {
6791        let this = &mut *self;
6792        if this.inner.check_shutdown(cx) {
6793            this.is_terminated = true;
6794            return std::task::Poll::Ready(None);
6795        }
6796        if this.is_terminated {
6797            panic!("polled ExtendedAttributeIteratorRequestStream after completion");
6798        }
6799        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6800            |bytes, handles| {
6801                match this.inner.channel().read_etc(cx, bytes, handles) {
6802                    std::task::Poll::Ready(Ok(())) => {}
6803                    std::task::Poll::Pending => return std::task::Poll::Pending,
6804                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6805                        this.is_terminated = true;
6806                        return std::task::Poll::Ready(None);
6807                    }
6808                    std::task::Poll::Ready(Err(e)) => {
6809                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6810                            e.into(),
6811                        ))))
6812                    }
6813                }
6814
6815                // A message has been received from the channel
6816                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6817
6818                std::task::Poll::Ready(Some(match header.ordinal {
6819                0x3ba664a1c2e45a7 => {
6820                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6821                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6822                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6823                    let control_handle = ExtendedAttributeIteratorControlHandle {
6824                        inner: this.inner.clone(),
6825                    };
6826                    Ok(ExtendedAttributeIteratorRequest::GetNext {
6827                        responder: ExtendedAttributeIteratorGetNextResponder {
6828                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6829                            tx_id: header.tx_id,
6830                        },
6831                    })
6832                }
6833                _ => Err(fidl::Error::UnknownOrdinal {
6834                    ordinal: header.ordinal,
6835                    protocol_name: <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6836                }),
6837            }))
6838            },
6839        )
6840    }
6841}
6842
6843#[derive(Debug)]
6844pub enum ExtendedAttributeIteratorRequest {
6845    /// Get the next chunk of extended attribute names. If this is the last
6846    /// chunk, last will be true, and the channel will be closed after the
6847    /// call.
6848    GetNext { responder: ExtendedAttributeIteratorGetNextResponder },
6849}
6850
6851impl ExtendedAttributeIteratorRequest {
6852    #[allow(irrefutable_let_patterns)]
6853    pub fn into_get_next(self) -> Option<(ExtendedAttributeIteratorGetNextResponder)> {
6854        if let ExtendedAttributeIteratorRequest::GetNext { responder } = self {
6855            Some((responder))
6856        } else {
6857            None
6858        }
6859    }
6860
6861    /// Name of the method defined in FIDL
6862    pub fn method_name(&self) -> &'static str {
6863        match *self {
6864            ExtendedAttributeIteratorRequest::GetNext { .. } => "get_next",
6865        }
6866    }
6867}
6868
6869#[derive(Debug, Clone)]
6870pub struct ExtendedAttributeIteratorControlHandle {
6871    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6872}
6873
6874impl fidl::endpoints::ControlHandle for ExtendedAttributeIteratorControlHandle {
6875    fn shutdown(&self) {
6876        self.inner.shutdown()
6877    }
6878    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6879        self.inner.shutdown_with_epitaph(status)
6880    }
6881
6882    fn is_closed(&self) -> bool {
6883        self.inner.channel().is_closed()
6884    }
6885    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6886        self.inner.channel().on_closed()
6887    }
6888
6889    #[cfg(target_os = "fuchsia")]
6890    fn signal_peer(
6891        &self,
6892        clear_mask: zx::Signals,
6893        set_mask: zx::Signals,
6894    ) -> Result<(), zx_status::Status> {
6895        use fidl::Peered;
6896        self.inner.channel().signal_peer(clear_mask, set_mask)
6897    }
6898}
6899
6900impl ExtendedAttributeIteratorControlHandle {}
6901
6902#[must_use = "FIDL methods require a response to be sent"]
6903#[derive(Debug)]
6904pub struct ExtendedAttributeIteratorGetNextResponder {
6905    control_handle: std::mem::ManuallyDrop<ExtendedAttributeIteratorControlHandle>,
6906    tx_id: u32,
6907}
6908
6909/// Set the the channel to be shutdown (see [`ExtendedAttributeIteratorControlHandle::shutdown`])
6910/// if the responder is dropped without sending a response, so that the client
6911/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6912impl std::ops::Drop for ExtendedAttributeIteratorGetNextResponder {
6913    fn drop(&mut self) {
6914        self.control_handle.shutdown();
6915        // Safety: drops once, never accessed again
6916        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6917    }
6918}
6919
6920impl fidl::endpoints::Responder for ExtendedAttributeIteratorGetNextResponder {
6921    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6922
6923    fn control_handle(&self) -> &ExtendedAttributeIteratorControlHandle {
6924        &self.control_handle
6925    }
6926
6927    fn drop_without_shutdown(mut self) {
6928        // Safety: drops once, never accessed again due to mem::forget
6929        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6930        // Prevent Drop from running (which would shut down the channel)
6931        std::mem::forget(self);
6932    }
6933}
6934
6935impl ExtendedAttributeIteratorGetNextResponder {
6936    /// Sends a response to the FIDL transaction.
6937    ///
6938    /// Sets the channel to shutdown if an error occurs.
6939    pub fn send(self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6940        let _result = self.send_raw(result);
6941        if _result.is_err() {
6942            self.control_handle.shutdown();
6943        }
6944        self.drop_without_shutdown();
6945        _result
6946    }
6947
6948    /// Similar to "send" but does not shutdown the channel if an error occurs.
6949    pub fn send_no_shutdown_on_err(
6950        self,
6951        mut result: Result<(&[Vec<u8>], bool), i32>,
6952    ) -> Result<(), fidl::Error> {
6953        let _result = self.send_raw(result);
6954        self.drop_without_shutdown();
6955        _result
6956    }
6957
6958    fn send_raw(&self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6959        self.control_handle.inner.send::<fidl::encoding::ResultType<
6960            ExtendedAttributeIteratorGetNextResponse,
6961            i32,
6962        >>(
6963            result,
6964            self.tx_id,
6965            0x3ba664a1c2e45a7,
6966            fidl::encoding::DynamicFlags::empty(),
6967        )
6968    }
6969}
6970
6971#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6972pub struct FileMarker;
6973
6974impl fidl::endpoints::ProtocolMarker for FileMarker {
6975    type Proxy = FileProxy;
6976    type RequestStream = FileRequestStream;
6977    #[cfg(target_os = "fuchsia")]
6978    type SynchronousProxy = FileSynchronousProxy;
6979
6980    const DEBUG_NAME: &'static str = "fuchsia.io.File";
6981}
6982impl fidl::endpoints::DiscoverableProtocolMarker for FileMarker {}
6983pub type FileSeekResult = Result<u64, i32>;
6984pub type FileReadAtResult = Result<Vec<u8>, i32>;
6985pub type FileWriteAtResult = Result<u64, i32>;
6986pub type FileResizeResult = Result<(), i32>;
6987pub type FileGetBackingMemoryResult = Result<fidl::Vmo, i32>;
6988pub type FileAllocateResult = Result<(), i32>;
6989pub type FileEnableVerityResult = Result<(), i32>;
6990
6991pub trait FileProxyInterface: Send + Sync {
6992    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
6993        + Send;
6994    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
6995    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
6996        + Send;
6997    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
6998    fn r#clone(
6999        &self,
7000        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7001    ) -> Result<(), fidl::Error>;
7002    type CloseResponseFut: std::future::Future<
7003            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
7004        > + Send;
7005    fn r#close(&self) -> Self::CloseResponseFut;
7006    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
7007    fn r#query(&self) -> Self::QueryResponseFut;
7008    fn r#deprecated_clone(
7009        &self,
7010        flags: OpenFlags,
7011        object: fidl::endpoints::ServerEnd<NodeMarker>,
7012    ) -> Result<(), fidl::Error>;
7013    type GetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
7014        + Send;
7015    fn r#get_attr(&self) -> Self::GetAttrResponseFut;
7016    type SetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
7017    fn r#set_attr(
7018        &self,
7019        flags: NodeAttributeFlags,
7020        attributes: &NodeAttributes,
7021    ) -> Self::SetAttrResponseFut;
7022    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
7023        + Send;
7024    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
7025    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
7026        + Send;
7027    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
7028    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
7029        + Send;
7030    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
7031    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
7032        + Send;
7033    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
7034    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
7035        + Send;
7036    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
7037    type GetConnectionInfoResponseFut: std::future::Future<Output = Result<ConnectionInfo, fidl::Error>>
7038        + Send;
7039    fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut;
7040    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
7041        + Send;
7042    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
7043    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
7044        + Send;
7045    fn r#update_attributes(
7046        &self,
7047        payload: &MutableNodeAttributes,
7048    ) -> Self::UpdateAttributesResponseFut;
7049    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
7050    fn r#sync(&self) -> Self::SyncResponseFut;
7051    fn r#list_extended_attributes(
7052        &self,
7053        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
7054    ) -> Result<(), fidl::Error>;
7055    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
7056        + Send;
7057    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
7058    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
7059        + Send;
7060    fn r#set_extended_attribute(
7061        &self,
7062        name: &[u8],
7063        value: ExtendedAttributeValue,
7064        mode: SetExtendedAttributeMode,
7065    ) -> Self::SetExtendedAttributeResponseFut;
7066    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
7067        + Send;
7068    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
7069    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
7070        + Send;
7071    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
7072    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
7073        + Send;
7074    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
7075    type DescribeResponseFut: std::future::Future<Output = Result<FileInfo, fidl::Error>> + Send;
7076    fn r#describe(&self) -> Self::DescribeResponseFut;
7077    type SeekResponseFut: std::future::Future<Output = Result<FileSeekResult, fidl::Error>> + Send;
7078    fn r#seek(&self, origin: SeekOrigin, offset: i64) -> Self::SeekResponseFut;
7079    type ReadAtResponseFut: std::future::Future<Output = Result<FileReadAtResult, fidl::Error>>
7080        + Send;
7081    fn r#read_at(&self, count: u64, offset: u64) -> Self::ReadAtResponseFut;
7082    type WriteAtResponseFut: std::future::Future<Output = Result<FileWriteAtResult, fidl::Error>>
7083        + Send;
7084    fn r#write_at(&self, data: &[u8], offset: u64) -> Self::WriteAtResponseFut;
7085    type ResizeResponseFut: std::future::Future<Output = Result<FileResizeResult, fidl::Error>>
7086        + Send;
7087    fn r#resize(&self, length: u64) -> Self::ResizeResponseFut;
7088    type GetBackingMemoryResponseFut: std::future::Future<Output = Result<FileGetBackingMemoryResult, fidl::Error>>
7089        + Send;
7090    fn r#get_backing_memory(&self, flags: VmoFlags) -> Self::GetBackingMemoryResponseFut;
7091    type AllocateResponseFut: std::future::Future<Output = Result<FileAllocateResult, fidl::Error>>
7092        + Send;
7093    fn r#allocate(&self, offset: u64, length: u64, mode: AllocateMode)
7094        -> Self::AllocateResponseFut;
7095    type EnableVerityResponseFut: std::future::Future<Output = Result<FileEnableVerityResult, fidl::Error>>
7096        + Send;
7097    fn r#enable_verity(&self, options: &VerificationOptions) -> Self::EnableVerityResponseFut;
7098}
7099#[derive(Debug)]
7100#[cfg(target_os = "fuchsia")]
7101pub struct FileSynchronousProxy {
7102    client: fidl::client::sync::Client,
7103}
7104
7105#[cfg(target_os = "fuchsia")]
7106impl fidl::endpoints::SynchronousProxy for FileSynchronousProxy {
7107    type Proxy = FileProxy;
7108    type Protocol = FileMarker;
7109
7110    fn from_channel(inner: fidl::Channel) -> Self {
7111        Self::new(inner)
7112    }
7113
7114    fn into_channel(self) -> fidl::Channel {
7115        self.client.into_channel()
7116    }
7117
7118    fn as_channel(&self) -> &fidl::Channel {
7119        self.client.as_channel()
7120    }
7121}
7122
7123#[cfg(target_os = "fuchsia")]
7124impl FileSynchronousProxy {
7125    pub fn new(channel: fidl::Channel) -> Self {
7126        let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7127        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7128    }
7129
7130    pub fn into_channel(self) -> fidl::Channel {
7131        self.client.into_channel()
7132    }
7133
7134    /// Waits until an event arrives and returns it. It is safe for other
7135    /// threads to make concurrent requests while waiting for an event.
7136    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<FileEvent, fidl::Error> {
7137        FileEvent::decode(self.client.wait_for_event(deadline)?)
7138    }
7139
7140    /// Acquires an advisory lock on the underlying file.
7141    ///
7142    /// The lock lasts until either this connection is closed or
7143    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7144    /// explicitly.
7145    ///
7146    /// Advisory locks are purely advisory. They do not prevent actual read or
7147    /// write operations from occurring on the file, either through this
7148    /// connection or through other connections.
7149    ///
7150    /// This method requires the following rights:
7151    ///
7152    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7153    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7154    ///   [`AdvisoryLockType.WRITE`].
7155    ///
7156    /// # Errors
7157    ///
7158    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7159    ///   example, another connection might hold a conflicting lock type.
7160    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7161    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7162    ///   to acquire the given type of lock.
7163    pub fn r#advisory_lock(
7164        &self,
7165        mut request: &AdvisoryLockRequest,
7166        ___deadline: zx::MonotonicInstant,
7167    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
7168        let _response = self.client.send_query::<
7169            AdvisoryLockingAdvisoryLockRequest,
7170            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7171        >(
7172            (request,),
7173            0x6ee9c0ad53ec87aa,
7174            fidl::encoding::DynamicFlags::empty(),
7175            ___deadline,
7176        )?;
7177        Ok(_response.map(|x| x))
7178    }
7179
7180    /// Creates a link to this this object with name `dst` in the directory represented by
7181    /// `dst_parent_token`.
7182    ///
7183    /// `dst` must be a resolved object name. Including "/" in the string will return
7184    /// `ZX_ERR_INVALID_ARGS`.
7185    ///
7186    /// This method requires the maximal set of rights supported by the filesystem for this object.
7187    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7188    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7189    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7190    /// `ZX_ERR_ACCESS_DENIED`.
7191    ///
7192    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7193    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7194    ///
7195    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7196    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7197    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7198    ///
7199    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7200    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7201    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7202    pub fn r#link_into(
7203        &self,
7204        mut dst_parent_token: fidl::Event,
7205        mut dst: &str,
7206        ___deadline: zx::MonotonicInstant,
7207    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
7208        let _response = self.client.send_query::<
7209            LinkableLinkIntoRequest,
7210            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7211        >(
7212            (dst_parent_token, dst,),
7213            0x54f3949246a03e74,
7214            fidl::encoding::DynamicFlags::empty(),
7215            ___deadline,
7216        )?;
7217        Ok(_response.map(|x| x))
7218    }
7219
7220    pub fn r#clone(
7221        &self,
7222        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7223    ) -> Result<(), fidl::Error> {
7224        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
7225            (request,),
7226            0x20d8a7aba2168a79,
7227            fidl::encoding::DynamicFlags::empty(),
7228        )
7229    }
7230
7231    /// Terminates the connection.
7232    ///
7233    /// After calling `Close`, the client must not send any other requests.
7234    ///
7235    /// Servers, after sending the status response, should close the connection
7236    /// regardless of status and without sending an epitaph.
7237    ///
7238    /// Closing the client end of the channel should be semantically equivalent
7239    /// to calling `Close` without knowing when the close has completed or its
7240    /// status.
7241    pub fn r#close(
7242        &self,
7243        ___deadline: zx::MonotonicInstant,
7244    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
7245        let _response = self.client.send_query::<
7246            fidl::encoding::EmptyPayload,
7247            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7248        >(
7249            (),
7250            0x5ac5d459ad7f657e,
7251            fidl::encoding::DynamicFlags::empty(),
7252            ___deadline,
7253        )?;
7254        Ok(_response.map(|x| x))
7255    }
7256
7257    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
7258        let _response = self.client.send_query::<
7259            fidl::encoding::EmptyPayload,
7260            fidl_fuchsia_unknown::QueryableQueryResponse,
7261        >(
7262            (),
7263            0x2658edee9decfc06,
7264            fidl::encoding::DynamicFlags::empty(),
7265            ___deadline,
7266        )?;
7267        Ok(_response.protocol)
7268    }
7269
7270    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7271    pub fn r#deprecated_clone(
7272        &self,
7273        mut flags: OpenFlags,
7274        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
7275    ) -> Result<(), fidl::Error> {
7276        self.client.send::<NodeDeprecatedCloneRequest>(
7277            (flags, object),
7278            0x5a61678f293ce16f,
7279            fidl::encoding::DynamicFlags::FLEXIBLE,
7280        )
7281    }
7282
7283    /// Acquires information about the node.
7284    ///
7285    /// This method does not require any rights.
7286    pub fn r#get_attr(
7287        &self,
7288        ___deadline: zx::MonotonicInstant,
7289    ) -> Result<(i32, NodeAttributes), fidl::Error> {
7290        let _response =
7291            self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetAttrResponse>(
7292                (),
7293                0x78985e216314dafd,
7294                fidl::encoding::DynamicFlags::empty(),
7295                ___deadline,
7296            )?;
7297        Ok((_response.s, _response.attributes))
7298    }
7299
7300    /// Updates information about the node.
7301    ///
7302    /// Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.
7303    ///
7304    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
7305    /// `ZX_ERR_BAD_HANDLE`.
7306    pub fn r#set_attr(
7307        &self,
7308        mut flags: NodeAttributeFlags,
7309        mut attributes: &NodeAttributes,
7310        ___deadline: zx::MonotonicInstant,
7311    ) -> Result<i32, fidl::Error> {
7312        let _response = self.client.send_query::<NodeSetAttrRequest, NodeSetAttrResponse>(
7313            (flags, attributes),
7314            0x4186c0f40d938f46,
7315            fidl::encoding::DynamicFlags::empty(),
7316            ___deadline,
7317        )?;
7318        Ok(_response.s)
7319    }
7320
7321    /// [DEPRECATED - Use new GetFlags method instead.]
7322    pub fn r#deprecated_get_flags(
7323        &self,
7324        ___deadline: zx::MonotonicInstant,
7325    ) -> Result<(i32, OpenFlags), fidl::Error> {
7326        let _response = self
7327            .client
7328            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
7329                (),
7330                0x5b88fffb8eda3aa1,
7331                fidl::encoding::DynamicFlags::empty(),
7332                ___deadline,
7333            )?;
7334        Ok((_response.s, _response.flags))
7335    }
7336
7337    /// [DEPRECATED - Use new SetFlags method instead.]
7338    pub fn r#deprecated_set_flags(
7339        &self,
7340        mut flags: OpenFlags,
7341        ___deadline: zx::MonotonicInstant,
7342    ) -> Result<i32, fidl::Error> {
7343        let _response = self
7344            .client
7345            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
7346                (flags,),
7347                0x5295b76c71fde733,
7348                fidl::encoding::DynamicFlags::empty(),
7349                ___deadline,
7350            )?;
7351        Ok(_response.s)
7352    }
7353
7354    /// Queries the flags that apply to this node after it has been opened/created. This method does
7355    /// not require any rights.
7356    ///
7357    /// Note that the final set of flags that apply to the connection may differ from those
7358    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
7359    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
7360    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
7361    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
7362    pub fn r#get_flags(
7363        &self,
7364        ___deadline: zx::MonotonicInstant,
7365    ) -> Result<NodeGetFlagsResult, fidl::Error> {
7366        let _response = self.client.send_query::<
7367            fidl::encoding::EmptyPayload,
7368            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
7369        >(
7370            (),
7371            0x176eb318f64ec23,
7372            fidl::encoding::DynamicFlags::FLEXIBLE,
7373            ___deadline,
7374        )?
7375        .into_result::<FileMarker>("get_flags")?;
7376        Ok(_response.map(|x| x.flags))
7377    }
7378
7379    /// Sets the flags that apply to this node after it has been opened. This method does not
7380    /// require any rights.
7381    ///
7382    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
7383    /// clear append mode.
7384    ///
7385    /// Errors:
7386    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
7387    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
7388    pub fn r#set_flags(
7389        &self,
7390        mut flags: Flags,
7391        ___deadline: zx::MonotonicInstant,
7392    ) -> Result<NodeSetFlagsResult, fidl::Error> {
7393        let _response = self.client.send_query::<
7394            NodeSetFlagsRequest,
7395            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7396        >(
7397            (flags,),
7398            0x55a8028685791ea8,
7399            fidl::encoding::DynamicFlags::FLEXIBLE,
7400            ___deadline,
7401        )?
7402        .into_result::<FileMarker>("set_flags")?;
7403        Ok(_response.map(|x| x))
7404    }
7405
7406    /// Query the filesystem for filesystem-specific information.
7407    pub fn r#query_filesystem(
7408        &self,
7409        ___deadline: zx::MonotonicInstant,
7410    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
7411        let _response =
7412            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
7413                (),
7414                0x6f344a1c6b0a0610,
7415                fidl::encoding::DynamicFlags::empty(),
7416                ___deadline,
7417            )?;
7418        Ok((_response.s, _response.info))
7419    }
7420
7421    /// Acquires information about the connection.
7422    ///
7423    /// This method does not require any rights.
7424    pub fn r#get_connection_info(
7425        &self,
7426        ___deadline: zx::MonotonicInstant,
7427    ) -> Result<ConnectionInfo, fidl::Error> {
7428        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, ConnectionInfo>(
7429            (),
7430            0x584c377c7c0a6d0b,
7431            fidl::encoding::DynamicFlags::empty(),
7432            ___deadline,
7433        )?;
7434        Ok(_response)
7435    }
7436
7437    /// Acquires information about the node.
7438    ///
7439    /// The attributes of a node should be stable, independent of the
7440    /// specific protocol used to access it.
7441    ///
7442    /// If a particular attribute is not applicable or not supported,
7443    /// filesystems should leave the corresponding field absent.
7444    ///
7445    /// + `query` a bit-mask specifying which attributes to fetch. The server
7446    ///   should not return more than necessary.
7447    /// - `attributes` the returned attributes.
7448    ///
7449    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7450    pub fn r#get_attributes(
7451        &self,
7452        mut query: NodeAttributesQuery,
7453        ___deadline: zx::MonotonicInstant,
7454    ) -> Result<NodeGetAttributesResult, fidl::Error> {
7455        let _response = self.client.send_query::<
7456            NodeGetAttributesRequest,
7457            fidl::encoding::ResultType<NodeAttributes2, i32>,
7458        >(
7459            (query,),
7460            0x3d4396a638ea053b,
7461            fidl::encoding::DynamicFlags::empty(),
7462            ___deadline,
7463        )?;
7464        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
7465    }
7466
7467    /// Updates information about the node.
7468    ///
7469    /// + `attributes` the presence of a table field in `attributes` indicates
7470    /// the intent to update the corresponding attribute.
7471    ///
7472    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
7473    ///
7474    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7475    pub fn r#update_attributes(
7476        &self,
7477        mut payload: &MutableNodeAttributes,
7478        ___deadline: zx::MonotonicInstant,
7479    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
7480        let _response = self.client.send_query::<
7481            MutableNodeAttributes,
7482            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7483        >(
7484            payload,
7485            0x3308c1da5a89bf08,
7486            fidl::encoding::DynamicFlags::empty(),
7487            ___deadline,
7488        )?;
7489        Ok(_response.map(|x| x))
7490    }
7491
7492    /// Synchronizes updates to the node to the underlying media, if it exists.
7493    ///
7494    /// This method will return when the filesystem server has flushed the
7495    /// relevant updates to the underlying media, but does not guarantee the
7496    /// underlying media has persisted the information, nor that any information
7497    /// is committed to hardware. Clients may use `Sync` to ensure ordering
7498    /// between operations.
7499    ///
7500    /// This method does not require any rights.
7501    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
7502        let _response = self.client.send_query::<
7503            fidl::encoding::EmptyPayload,
7504            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7505        >(
7506            (),
7507            0x2c5c27ca0ab5dc49,
7508            fidl::encoding::DynamicFlags::empty(),
7509            ___deadline,
7510        )?;
7511        Ok(_response.map(|x| x))
7512    }
7513
7514    /// Creates an iterator over all the extended attribute names associated
7515    /// with this node. If an error occurs it is returned as an epitaph on the
7516    /// iterator request channel, and then the channel is closed.
7517    ///
7518    /// GetExtendedAttributes can be used with any of these names to retrieve
7519    /// the associated value.
7520    ///
7521    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7522    pub fn r#list_extended_attributes(
7523        &self,
7524        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
7525    ) -> Result<(), fidl::Error> {
7526        self.client.send::<NodeListExtendedAttributesRequest>(
7527            (iterator,),
7528            0x4b61033de007fcd0,
7529            fidl::encoding::DynamicFlags::empty(),
7530        )
7531    }
7532
7533    /// Get the value associated with the given attribute `name` for this node.
7534    ///
7535    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
7536    /// particular structure is imposed on them.
7537    ///
7538    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7539    pub fn r#get_extended_attribute(
7540        &self,
7541        mut name: &[u8],
7542        ___deadline: zx::MonotonicInstant,
7543    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
7544        let _response = self.client.send_query::<
7545            NodeGetExtendedAttributeRequest,
7546            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
7547        >(
7548            (name,),
7549            0x45ffa3ccfdeb76db,
7550            fidl::encoding::DynamicFlags::empty(),
7551            ___deadline,
7552        )?;
7553        Ok(_response.map(|x| x))
7554    }
7555
7556    /// Set the value for the given attribute `name` to `value` for this node.
7557    ///
7558    /// The attribute name may exist, in which case the attribute is updated.
7559    /// If the attribute doesn't exist, it is created. The name should have no
7560    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
7561    ///
7562    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7563    pub fn r#set_extended_attribute(
7564        &self,
7565        mut name: &[u8],
7566        mut value: ExtendedAttributeValue,
7567        mut mode: SetExtendedAttributeMode,
7568        ___deadline: zx::MonotonicInstant,
7569    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
7570        let _response = self.client.send_query::<
7571            NodeSetExtendedAttributeRequest,
7572            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7573        >(
7574            (name, &mut value, mode,),
7575            0x4a951362f681f23c,
7576            fidl::encoding::DynamicFlags::empty(),
7577            ___deadline,
7578        )?;
7579        Ok(_response.map(|x| x))
7580    }
7581
7582    /// Remove the specified extended attribute.
7583    ///
7584    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
7585    ///
7586    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7587    pub fn r#remove_extended_attribute(
7588        &self,
7589        mut name: &[u8],
7590        ___deadline: zx::MonotonicInstant,
7591    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
7592        let _response = self.client.send_query::<
7593            NodeRemoveExtendedAttributeRequest,
7594            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7595        >(
7596            (name,),
7597            0x7a0b9f3a9bf9032d,
7598            fidl::encoding::DynamicFlags::empty(),
7599            ___deadline,
7600        )?;
7601        Ok(_response.map(|x| x))
7602    }
7603
7604    /// Reads up to 'count' bytes at the seek offset.
7605    /// The seek offset is moved forward by the number of bytes read.
7606    ///
7607    /// ## Invariants
7608    ///
7609    /// * The returned `data.length` will never be greater than `count`.
7610    /// * If `data.length` is less than `count`, it means that the seek offset
7611    ///   has reached the end of file as part of this operation.
7612    /// * If `data.length` is zero while `count` is not, it means that the
7613    ///   seek offset is already at or beyond the end of file, and no data could
7614    ///   be read.
7615    /// * If `count` is zero, the server should perform all the checks ensuring
7616    ///   read access without actually read anything, and return an empty
7617    ///   `data` vector.
7618    ///
7619    /// This method requires the [`Rights.READ_BYTES`] right.
7620    ///
7621    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7622    pub fn r#read(
7623        &self,
7624        mut count: u64,
7625        ___deadline: zx::MonotonicInstant,
7626    ) -> Result<ReadableReadResult, fidl::Error> {
7627        let _response = self.client.send_query::<
7628            ReadableReadRequest,
7629            fidl::encoding::ResultType<ReadableReadResponse, i32>,
7630        >(
7631            (count,),
7632            0x57e419a298c8ede,
7633            fidl::encoding::DynamicFlags::empty(),
7634            ___deadline,
7635        )?;
7636        Ok(_response.map(|x| x.data))
7637    }
7638
7639    /// Writes data at the seek offset.
7640    /// The seek offset is moved forward by the number of bytes written.
7641    /// If the file is in append mode, the seek offset is first set to the end
7642    /// of the file, followed by the write, in one atomic step.
7643    ///
7644    /// The file size may grow if the seek offset plus `data.length` is beyond
7645    /// the current end of file.
7646    ///
7647    /// + request `data` the byte buffer to write to the file.
7648    /// - response `actual_count` the number of bytes written.
7649    ///
7650    /// ## Invariants
7651    ///
7652    /// * The returned `actual_count` will never be greater than `data.length`.
7653    /// * If the server is unable to write all the data due to e.g. not enough
7654    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7655    ///   could be written, an error is returned.
7656    /// * If `data.length` is zero, the server should perform all the checks
7657    ///   ensuring write access without mutating the file and return a
7658    ///   successful write of zero bytes.  The seek offset is still updated if
7659    ///   in append mode.
7660    ///
7661    /// This method requires the [`Rights.WRITE_BYTES`] right.
7662    pub fn r#write(
7663        &self,
7664        mut data: &[u8],
7665        ___deadline: zx::MonotonicInstant,
7666    ) -> Result<WritableWriteResult, fidl::Error> {
7667        let _response = self.client.send_query::<
7668            WritableWriteRequest,
7669            fidl::encoding::ResultType<WritableWriteResponse, i32>,
7670        >(
7671            (data,),
7672            0x6a31437832469f82,
7673            fidl::encoding::DynamicFlags::empty(),
7674            ___deadline,
7675        )?;
7676        Ok(_response.map(|x| x.actual_count))
7677    }
7678
7679    pub fn r#describe(&self, ___deadline: zx::MonotonicInstant) -> Result<FileInfo, fidl::Error> {
7680        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, FileInfo>(
7681            (),
7682            0x68b5ac00c62906bc,
7683            fidl::encoding::DynamicFlags::empty(),
7684            ___deadline,
7685        )?;
7686        Ok(_response)
7687    }
7688
7689    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
7690    /// will occur. The seek offset is specific to each file connection.
7691    ///
7692    /// + request `origin` the reference point where `offset` will be based on.
7693    /// + request `offset` the number of bytes to seek.
7694    /// - response `offset_from_start` the adjusted seek offset, from the start
7695    ///   of the file.
7696    ///
7697    /// This method does not require any rights.
7698    pub fn r#seek(
7699        &self,
7700        mut origin: SeekOrigin,
7701        mut offset: i64,
7702        ___deadline: zx::MonotonicInstant,
7703    ) -> Result<FileSeekResult, fidl::Error> {
7704        let _response = self
7705            .client
7706            .send_query::<FileSeekRequest, fidl::encoding::ResultType<FileSeekResponse, i32>>(
7707                (origin, offset),
7708                0x78079168162c5207,
7709                fidl::encoding::DynamicFlags::empty(),
7710                ___deadline,
7711            )?;
7712        Ok(_response.map(|x| x.offset_from_start))
7713    }
7714
7715    /// Reads up to 'count' bytes at the provided offset.
7716    /// Does not affect the seek offset.
7717    ///
7718    /// ## Invariants
7719    ///
7720    /// * The returned `data.length` will never be greater than `count`.
7721    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
7722    ///   the end of file as part of this operation.
7723    /// * If `data.length` is zero while `count` is not, it means that `offset`
7724    ///   is at or past the end of file, and no data can be read.
7725    /// * If `count` is zero, the server should perform all the checks ensuring
7726    ///   read access without actually reading anything, and return an empty
7727    ///   `data` vector.
7728    ///
7729    /// This method requires the [`Rights.READ_BYTES`] right.
7730    ///
7731    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7732    pub fn r#read_at(
7733        &self,
7734        mut count: u64,
7735        mut offset: u64,
7736        ___deadline: zx::MonotonicInstant,
7737    ) -> Result<FileReadAtResult, fidl::Error> {
7738        let _response = self
7739            .client
7740            .send_query::<FileReadAtRequest, fidl::encoding::ResultType<FileReadAtResponse, i32>>(
7741                (count, offset),
7742                0x1607a293a60d723e,
7743                fidl::encoding::DynamicFlags::empty(),
7744                ___deadline,
7745            )?;
7746        Ok(_response.map(|x| x.data))
7747    }
7748
7749    /// Writes data at the provided offset.
7750    /// Does not affect the seek offset.
7751    ///
7752    /// The file size may grow if `offset` plus `data.length` is past the
7753    /// current end of file.
7754    ///
7755    /// + request `data` the byte buffer to write to the file.
7756    /// + request `offset` the offset from start of the file to begin writing.
7757    /// - response `actual_count` the number of bytes written.
7758    ///
7759    /// ## Invariants
7760    ///
7761    /// * The returned `actual_count` will never be greater than `data.length`.
7762    /// * If the server is unable to write all the data due to e.g. not enough
7763    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7764    ///   could be written, an error is returned.
7765    /// * If `data.length` is zero, the server should perform all the checks
7766    ///   ensuring write access without mutating the file, and will return a
7767    ///   successful write of zero bytes.
7768    ///
7769    /// This method requires the [`Rights.WRITE_BYTES`] right.
7770    pub fn r#write_at(
7771        &self,
7772        mut data: &[u8],
7773        mut offset: u64,
7774        ___deadline: zx::MonotonicInstant,
7775    ) -> Result<FileWriteAtResult, fidl::Error> {
7776        let _response = self
7777            .client
7778            .send_query::<FileWriteAtRequest, fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
7779                (data, offset),
7780                0x793eefc0045e792b,
7781                fidl::encoding::DynamicFlags::empty(),
7782                ___deadline,
7783            )?;
7784        Ok(_response.map(|x| x.actual_count))
7785    }
7786
7787    /// Shrinks or grows the file size to 'length' bytes.
7788    ///
7789    /// If file size is reduced by this operation, the extra trailing data'
7790    /// is discarded.
7791    /// If file size is increased by this operation, the extended area appears
7792    /// as if it was zeroed.
7793    ///
7794    /// This method requires the [`Rights.WRITE_BYTES`] right.
7795    pub fn r#resize(
7796        &self,
7797        mut length: u64,
7798        ___deadline: zx::MonotonicInstant,
7799    ) -> Result<FileResizeResult, fidl::Error> {
7800        let _response = self.client.send_query::<
7801            FileResizeRequest,
7802            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7803        >(
7804            (length,),
7805            0x2b80825f0535743a,
7806            fidl::encoding::DynamicFlags::empty(),
7807            ___deadline,
7808        )?;
7809        Ok(_response.map(|x| x))
7810    }
7811
7812    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
7813    /// with the requested access rights.
7814    ///
7815    /// Implementations are not required to implement files backed by VMOs so
7816    /// this request may fail. Additionally, implementations may only support
7817    /// a certain subset of the flags. Clients should be prepared with fallback
7818    /// behavior if this request fails.
7819    ///
7820    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
7821    /// implementation is free to choose the semantics of the returned VMO.
7822    ///
7823    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
7824    /// - response `vmo` the requested [`zx.Handle:VMO`].
7825    /// * error a [`zx.Status`] value indicating the failure.
7826    ///
7827    /// This method requires the following rights:
7828    ///
7829    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
7830    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
7831    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
7832    pub fn r#get_backing_memory(
7833        &self,
7834        mut flags: VmoFlags,
7835        ___deadline: zx::MonotonicInstant,
7836    ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
7837        let _response = self.client.send_query::<
7838            FileGetBackingMemoryRequest,
7839            fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
7840        >(
7841            (flags,),
7842            0xa6a9e654cbf62b,
7843            fidl::encoding::DynamicFlags::empty(),
7844            ___deadline,
7845        )?;
7846        Ok(_response.map(|x| x.vmo))
7847    }
7848
7849    /// Pre-allocate on-disk space for this file.
7850    pub fn r#allocate(
7851        &self,
7852        mut offset: u64,
7853        mut length: u64,
7854        mut mode: AllocateMode,
7855        ___deadline: zx::MonotonicInstant,
7856    ) -> Result<FileAllocateResult, fidl::Error> {
7857        let _response = self.client.send_query::<
7858            FileAllocateRequest,
7859            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7860        >(
7861            (offset, length, mode,),
7862            0x77fa0c330b57fd2e,
7863            fidl::encoding::DynamicFlags::FLEXIBLE,
7864            ___deadline,
7865        )?
7866        .into_result::<FileMarker>("allocate")?;
7867        Ok(_response.map(|x| x))
7868    }
7869
7870    /// Enables verification for the file (permanently) which involves computing a merkle tree for
7871    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
7872    /// captured. Future reads will be verified against the computed merkle tree and writes will be
7873    /// rejected. This method can take some time to complete as it depends on the size of the file.
7874    /// This method can be aborted by closing the connection that this method was issued on.
7875    ///
7876    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7877    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
7878    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
7879    /// Also returns any error that might arise from reading the file, or from flushing the file,
7880    /// such as `ZX_ERR_IO`.
7881    pub fn r#enable_verity(
7882        &self,
7883        mut options: &VerificationOptions,
7884        ___deadline: zx::MonotonicInstant,
7885    ) -> Result<FileEnableVerityResult, fidl::Error> {
7886        let _response = self.client.send_query::<
7887            FileEnableVerityRequest,
7888            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7889        >(
7890            (options,),
7891            0x2c421ec3faaeb8bb,
7892            fidl::encoding::DynamicFlags::FLEXIBLE,
7893            ___deadline,
7894        )?
7895        .into_result::<FileMarker>("enable_verity")?;
7896        Ok(_response.map(|x| x))
7897    }
7898}
7899
7900#[cfg(target_os = "fuchsia")]
7901impl From<FileSynchronousProxy> for zx::Handle {
7902    fn from(value: FileSynchronousProxy) -> Self {
7903        value.into_channel().into()
7904    }
7905}
7906
7907#[cfg(target_os = "fuchsia")]
7908impl From<fidl::Channel> for FileSynchronousProxy {
7909    fn from(value: fidl::Channel) -> Self {
7910        Self::new(value)
7911    }
7912}
7913
7914#[derive(Debug, Clone)]
7915pub struct FileProxy {
7916    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7917}
7918
7919impl fidl::endpoints::Proxy for FileProxy {
7920    type Protocol = FileMarker;
7921
7922    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7923        Self::new(inner)
7924    }
7925
7926    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7927        self.client.into_channel().map_err(|client| Self { client })
7928    }
7929
7930    fn as_channel(&self) -> &::fidl::AsyncChannel {
7931        self.client.as_channel()
7932    }
7933}
7934
7935impl FileProxy {
7936    /// Create a new Proxy for fuchsia.io/File.
7937    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7938        let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7939        Self { client: fidl::client::Client::new(channel, protocol_name) }
7940    }
7941
7942    /// Get a Stream of events from the remote end of the protocol.
7943    ///
7944    /// # Panics
7945    ///
7946    /// Panics if the event stream was already taken.
7947    pub fn take_event_stream(&self) -> FileEventStream {
7948        FileEventStream { event_receiver: self.client.take_event_receiver() }
7949    }
7950
7951    /// Acquires an advisory lock on the underlying file.
7952    ///
7953    /// The lock lasts until either this connection is closed or
7954    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7955    /// explicitly.
7956    ///
7957    /// Advisory locks are purely advisory. They do not prevent actual read or
7958    /// write operations from occurring on the file, either through this
7959    /// connection or through other connections.
7960    ///
7961    /// This method requires the following rights:
7962    ///
7963    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7964    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7965    ///   [`AdvisoryLockType.WRITE`].
7966    ///
7967    /// # Errors
7968    ///
7969    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7970    ///   example, another connection might hold a conflicting lock type.
7971    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7972    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7973    ///   to acquire the given type of lock.
7974    pub fn r#advisory_lock(
7975        &self,
7976        mut request: &AdvisoryLockRequest,
7977    ) -> fidl::client::QueryResponseFut<
7978        AdvisoryLockingAdvisoryLockResult,
7979        fidl::encoding::DefaultFuchsiaResourceDialect,
7980    > {
7981        FileProxyInterface::r#advisory_lock(self, request)
7982    }
7983
7984    /// Creates a link to this this object with name `dst` in the directory represented by
7985    /// `dst_parent_token`.
7986    ///
7987    /// `dst` must be a resolved object name. Including "/" in the string will return
7988    /// `ZX_ERR_INVALID_ARGS`.
7989    ///
7990    /// This method requires the maximal set of rights supported by the filesystem for this object.
7991    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7992    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7993    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7994    /// `ZX_ERR_ACCESS_DENIED`.
7995    ///
7996    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7997    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7998    ///
7999    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
8000    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
8001    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
8002    ///
8003    /// This method does not have the same atomicity properties has the `Directory::Link` method,
8004    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
8005    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
8006    pub fn r#link_into(
8007        &self,
8008        mut dst_parent_token: fidl::Event,
8009        mut dst: &str,
8010    ) -> fidl::client::QueryResponseFut<
8011        LinkableLinkIntoResult,
8012        fidl::encoding::DefaultFuchsiaResourceDialect,
8013    > {
8014        FileProxyInterface::r#link_into(self, dst_parent_token, dst)
8015    }
8016
8017    pub fn r#clone(
8018        &self,
8019        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8020    ) -> Result<(), fidl::Error> {
8021        FileProxyInterface::r#clone(self, request)
8022    }
8023
8024    /// Terminates the connection.
8025    ///
8026    /// After calling `Close`, the client must not send any other requests.
8027    ///
8028    /// Servers, after sending the status response, should close the connection
8029    /// regardless of status and without sending an epitaph.
8030    ///
8031    /// Closing the client end of the channel should be semantically equivalent
8032    /// to calling `Close` without knowing when the close has completed or its
8033    /// status.
8034    pub fn r#close(
8035        &self,
8036    ) -> fidl::client::QueryResponseFut<
8037        fidl_fuchsia_unknown::CloseableCloseResult,
8038        fidl::encoding::DefaultFuchsiaResourceDialect,
8039    > {
8040        FileProxyInterface::r#close(self)
8041    }
8042
8043    pub fn r#query(
8044        &self,
8045    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
8046    {
8047        FileProxyInterface::r#query(self)
8048    }
8049
8050    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
8051    pub fn r#deprecated_clone(
8052        &self,
8053        mut flags: OpenFlags,
8054        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
8055    ) -> Result<(), fidl::Error> {
8056        FileProxyInterface::r#deprecated_clone(self, flags, object)
8057    }
8058
8059    /// Acquires information about the node.
8060    ///
8061    /// This method does not require any rights.
8062    pub fn r#get_attr(
8063        &self,
8064    ) -> fidl::client::QueryResponseFut<
8065        (i32, NodeAttributes),
8066        fidl::encoding::DefaultFuchsiaResourceDialect,
8067    > {
8068        FileProxyInterface::r#get_attr(self)
8069    }
8070
8071    /// Updates information about the node.
8072    ///
8073    /// Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.
8074    ///
8075    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
8076    /// `ZX_ERR_BAD_HANDLE`.
8077    pub fn r#set_attr(
8078        &self,
8079        mut flags: NodeAttributeFlags,
8080        mut attributes: &NodeAttributes,
8081    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
8082        FileProxyInterface::r#set_attr(self, flags, attributes)
8083    }
8084
8085    /// [DEPRECATED - Use new GetFlags method instead.]
8086    pub fn r#deprecated_get_flags(
8087        &self,
8088    ) -> fidl::client::QueryResponseFut<
8089        (i32, OpenFlags),
8090        fidl::encoding::DefaultFuchsiaResourceDialect,
8091    > {
8092        FileProxyInterface::r#deprecated_get_flags(self)
8093    }
8094
8095    /// [DEPRECATED - Use new SetFlags method instead.]
8096    pub fn r#deprecated_set_flags(
8097        &self,
8098        mut flags: OpenFlags,
8099    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
8100        FileProxyInterface::r#deprecated_set_flags(self, flags)
8101    }
8102
8103    /// Queries the flags that apply to this node after it has been opened/created. This method does
8104    /// not require any rights.
8105    ///
8106    /// Note that the final set of flags that apply to the connection may differ from those
8107    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
8108    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
8109    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
8110    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
8111    pub fn r#get_flags(
8112        &self,
8113    ) -> fidl::client::QueryResponseFut<
8114        NodeGetFlagsResult,
8115        fidl::encoding::DefaultFuchsiaResourceDialect,
8116    > {
8117        FileProxyInterface::r#get_flags(self)
8118    }
8119
8120    /// Sets the flags that apply to this node after it has been opened. This method does not
8121    /// require any rights.
8122    ///
8123    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
8124    /// clear append mode.
8125    ///
8126    /// Errors:
8127    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
8128    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
8129    pub fn r#set_flags(
8130        &self,
8131        mut flags: Flags,
8132    ) -> fidl::client::QueryResponseFut<
8133        NodeSetFlagsResult,
8134        fidl::encoding::DefaultFuchsiaResourceDialect,
8135    > {
8136        FileProxyInterface::r#set_flags(self, flags)
8137    }
8138
8139    /// Query the filesystem for filesystem-specific information.
8140    pub fn r#query_filesystem(
8141        &self,
8142    ) -> fidl::client::QueryResponseFut<
8143        (i32, Option<Box<FilesystemInfo>>),
8144        fidl::encoding::DefaultFuchsiaResourceDialect,
8145    > {
8146        FileProxyInterface::r#query_filesystem(self)
8147    }
8148
8149    /// Acquires information about the connection.
8150    ///
8151    /// This method does not require any rights.
8152    pub fn r#get_connection_info(
8153        &self,
8154    ) -> fidl::client::QueryResponseFut<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
8155    {
8156        FileProxyInterface::r#get_connection_info(self)
8157    }
8158
8159    /// Acquires information about the node.
8160    ///
8161    /// The attributes of a node should be stable, independent of the
8162    /// specific protocol used to access it.
8163    ///
8164    /// If a particular attribute is not applicable or not supported,
8165    /// filesystems should leave the corresponding field absent.
8166    ///
8167    /// + `query` a bit-mask specifying which attributes to fetch. The server
8168    ///   should not return more than necessary.
8169    /// - `attributes` the returned attributes.
8170    ///
8171    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8172    pub fn r#get_attributes(
8173        &self,
8174        mut query: NodeAttributesQuery,
8175    ) -> fidl::client::QueryResponseFut<
8176        NodeGetAttributesResult,
8177        fidl::encoding::DefaultFuchsiaResourceDialect,
8178    > {
8179        FileProxyInterface::r#get_attributes(self, query)
8180    }
8181
8182    /// Updates information about the node.
8183    ///
8184    /// + `attributes` the presence of a table field in `attributes` indicates
8185    /// the intent to update the corresponding attribute.
8186    ///
8187    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
8188    ///
8189    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8190    pub fn r#update_attributes(
8191        &self,
8192        mut payload: &MutableNodeAttributes,
8193    ) -> fidl::client::QueryResponseFut<
8194        NodeUpdateAttributesResult,
8195        fidl::encoding::DefaultFuchsiaResourceDialect,
8196    > {
8197        FileProxyInterface::r#update_attributes(self, payload)
8198    }
8199
8200    /// Synchronizes updates to the node to the underlying media, if it exists.
8201    ///
8202    /// This method will return when the filesystem server has flushed the
8203    /// relevant updates to the underlying media, but does not guarantee the
8204    /// underlying media has persisted the information, nor that any information
8205    /// is committed to hardware. Clients may use `Sync` to ensure ordering
8206    /// between operations.
8207    ///
8208    /// This method does not require any rights.
8209    pub fn r#sync(
8210        &self,
8211    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8212    {
8213        FileProxyInterface::r#sync(self)
8214    }
8215
8216    /// Creates an iterator over all the extended attribute names associated
8217    /// with this node. If an error occurs it is returned as an epitaph on the
8218    /// iterator request channel, and then the channel is closed.
8219    ///
8220    /// GetExtendedAttributes can be used with any of these names to retrieve
8221    /// the associated value.
8222    ///
8223    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8224    pub fn r#list_extended_attributes(
8225        &self,
8226        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8227    ) -> Result<(), fidl::Error> {
8228        FileProxyInterface::r#list_extended_attributes(self, iterator)
8229    }
8230
8231    /// Get the value associated with the given attribute `name` for this node.
8232    ///
8233    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
8234    /// particular structure is imposed on them.
8235    ///
8236    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8237    pub fn r#get_extended_attribute(
8238        &self,
8239        mut name: &[u8],
8240    ) -> fidl::client::QueryResponseFut<
8241        NodeGetExtendedAttributeResult,
8242        fidl::encoding::DefaultFuchsiaResourceDialect,
8243    > {
8244        FileProxyInterface::r#get_extended_attribute(self, name)
8245    }
8246
8247    /// Set the value for the given attribute `name` to `value` for this node.
8248    ///
8249    /// The attribute name may exist, in which case the attribute is updated.
8250    /// If the attribute doesn't exist, it is created. The name should have no
8251    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
8252    ///
8253    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8254    pub fn r#set_extended_attribute(
8255        &self,
8256        mut name: &[u8],
8257        mut value: ExtendedAttributeValue,
8258        mut mode: SetExtendedAttributeMode,
8259    ) -> fidl::client::QueryResponseFut<
8260        NodeSetExtendedAttributeResult,
8261        fidl::encoding::DefaultFuchsiaResourceDialect,
8262    > {
8263        FileProxyInterface::r#set_extended_attribute(self, name, value, mode)
8264    }
8265
8266    /// Remove the specified extended attribute.
8267    ///
8268    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
8269    ///
8270    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8271    pub fn r#remove_extended_attribute(
8272        &self,
8273        mut name: &[u8],
8274    ) -> fidl::client::QueryResponseFut<
8275        NodeRemoveExtendedAttributeResult,
8276        fidl::encoding::DefaultFuchsiaResourceDialect,
8277    > {
8278        FileProxyInterface::r#remove_extended_attribute(self, name)
8279    }
8280
8281    /// Reads up to 'count' bytes at the seek offset.
8282    /// The seek offset is moved forward by the number of bytes read.
8283    ///
8284    /// ## Invariants
8285    ///
8286    /// * The returned `data.length` will never be greater than `count`.
8287    /// * If `data.length` is less than `count`, it means that the seek offset
8288    ///   has reached the end of file as part of this operation.
8289    /// * If `data.length` is zero while `count` is not, it means that the
8290    ///   seek offset is already at or beyond the end of file, and no data could
8291    ///   be read.
8292    /// * If `count` is zero, the server should perform all the checks ensuring
8293    ///   read access without actually read anything, and return an empty
8294    ///   `data` vector.
8295    ///
8296    /// This method requires the [`Rights.READ_BYTES`] right.
8297    ///
8298    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8299    pub fn r#read(
8300        &self,
8301        mut count: u64,
8302    ) -> fidl::client::QueryResponseFut<
8303        ReadableReadResult,
8304        fidl::encoding::DefaultFuchsiaResourceDialect,
8305    > {
8306        FileProxyInterface::r#read(self, count)
8307    }
8308
8309    /// Writes data at the seek offset.
8310    /// The seek offset is moved forward by the number of bytes written.
8311    /// If the file is in append mode, the seek offset is first set to the end
8312    /// of the file, followed by the write, in one atomic step.
8313    ///
8314    /// The file size may grow if the seek offset plus `data.length` is beyond
8315    /// the current end of file.
8316    ///
8317    /// + request `data` the byte buffer to write to the file.
8318    /// - response `actual_count` the number of bytes written.
8319    ///
8320    /// ## Invariants
8321    ///
8322    /// * The returned `actual_count` will never be greater than `data.length`.
8323    /// * If the server is unable to write all the data due to e.g. not enough
8324    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8325    ///   could be written, an error is returned.
8326    /// * If `data.length` is zero, the server should perform all the checks
8327    ///   ensuring write access without mutating the file and return a
8328    ///   successful write of zero bytes.  The seek offset is still updated if
8329    ///   in append mode.
8330    ///
8331    /// This method requires the [`Rights.WRITE_BYTES`] right.
8332    pub fn r#write(
8333        &self,
8334        mut data: &[u8],
8335    ) -> fidl::client::QueryResponseFut<
8336        WritableWriteResult,
8337        fidl::encoding::DefaultFuchsiaResourceDialect,
8338    > {
8339        FileProxyInterface::r#write(self, data)
8340    }
8341
8342    pub fn r#describe(
8343        &self,
8344    ) -> fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
8345    {
8346        FileProxyInterface::r#describe(self)
8347    }
8348
8349    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
8350    /// will occur. The seek offset is specific to each file connection.
8351    ///
8352    /// + request `origin` the reference point where `offset` will be based on.
8353    /// + request `offset` the number of bytes to seek.
8354    /// - response `offset_from_start` the adjusted seek offset, from the start
8355    ///   of the file.
8356    ///
8357    /// This method does not require any rights.
8358    pub fn r#seek(
8359        &self,
8360        mut origin: SeekOrigin,
8361        mut offset: i64,
8362    ) -> fidl::client::QueryResponseFut<FileSeekResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8363    {
8364        FileProxyInterface::r#seek(self, origin, offset)
8365    }
8366
8367    /// Reads up to 'count' bytes at the provided offset.
8368    /// Does not affect the seek offset.
8369    ///
8370    /// ## Invariants
8371    ///
8372    /// * The returned `data.length` will never be greater than `count`.
8373    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
8374    ///   the end of file as part of this operation.
8375    /// * If `data.length` is zero while `count` is not, it means that `offset`
8376    ///   is at or past the end of file, and no data can be read.
8377    /// * If `count` is zero, the server should perform all the checks ensuring
8378    ///   read access without actually reading anything, and return an empty
8379    ///   `data` vector.
8380    ///
8381    /// This method requires the [`Rights.READ_BYTES`] right.
8382    ///
8383    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8384    pub fn r#read_at(
8385        &self,
8386        mut count: u64,
8387        mut offset: u64,
8388    ) -> fidl::client::QueryResponseFut<
8389        FileReadAtResult,
8390        fidl::encoding::DefaultFuchsiaResourceDialect,
8391    > {
8392        FileProxyInterface::r#read_at(self, count, offset)
8393    }
8394
8395    /// Writes data at the provided offset.
8396    /// Does not affect the seek offset.
8397    ///
8398    /// The file size may grow if `offset` plus `data.length` is past the
8399    /// current end of file.
8400    ///
8401    /// + request `data` the byte buffer to write to the file.
8402    /// + request `offset` the offset from start of the file to begin writing.
8403    /// - response `actual_count` the number of bytes written.
8404    ///
8405    /// ## Invariants
8406    ///
8407    /// * The returned `actual_count` will never be greater than `data.length`.
8408    /// * If the server is unable to write all the data due to e.g. not enough
8409    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8410    ///   could be written, an error is returned.
8411    /// * If `data.length` is zero, the server should perform all the checks
8412    ///   ensuring write access without mutating the file, and will return a
8413    ///   successful write of zero bytes.
8414    ///
8415    /// This method requires the [`Rights.WRITE_BYTES`] right.
8416    pub fn r#write_at(
8417        &self,
8418        mut data: &[u8],
8419        mut offset: u64,
8420    ) -> fidl::client::QueryResponseFut<
8421        FileWriteAtResult,
8422        fidl::encoding::DefaultFuchsiaResourceDialect,
8423    > {
8424        FileProxyInterface::r#write_at(self, data, offset)
8425    }
8426
8427    /// Shrinks or grows the file size to 'length' bytes.
8428    ///
8429    /// If file size is reduced by this operation, the extra trailing data'
8430    /// is discarded.
8431    /// If file size is increased by this operation, the extended area appears
8432    /// as if it was zeroed.
8433    ///
8434    /// This method requires the [`Rights.WRITE_BYTES`] right.
8435    pub fn r#resize(
8436        &self,
8437        mut length: u64,
8438    ) -> fidl::client::QueryResponseFut<
8439        FileResizeResult,
8440        fidl::encoding::DefaultFuchsiaResourceDialect,
8441    > {
8442        FileProxyInterface::r#resize(self, length)
8443    }
8444
8445    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
8446    /// with the requested access rights.
8447    ///
8448    /// Implementations are not required to implement files backed by VMOs so
8449    /// this request may fail. Additionally, implementations may only support
8450    /// a certain subset of the flags. Clients should be prepared with fallback
8451    /// behavior if this request fails.
8452    ///
8453    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
8454    /// implementation is free to choose the semantics of the returned VMO.
8455    ///
8456    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
8457    /// - response `vmo` the requested [`zx.Handle:VMO`].
8458    /// * error a [`zx.Status`] value indicating the failure.
8459    ///
8460    /// This method requires the following rights:
8461    ///
8462    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
8463    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
8464    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
8465    pub fn r#get_backing_memory(
8466        &self,
8467        mut flags: VmoFlags,
8468    ) -> fidl::client::QueryResponseFut<
8469        FileGetBackingMemoryResult,
8470        fidl::encoding::DefaultFuchsiaResourceDialect,
8471    > {
8472        FileProxyInterface::r#get_backing_memory(self, flags)
8473    }
8474
8475    /// Pre-allocate on-disk space for this file.
8476    pub fn r#allocate(
8477        &self,
8478        mut offset: u64,
8479        mut length: u64,
8480        mut mode: AllocateMode,
8481    ) -> fidl::client::QueryResponseFut<
8482        FileAllocateResult,
8483        fidl::encoding::DefaultFuchsiaResourceDialect,
8484    > {
8485        FileProxyInterface::r#allocate(self, offset, length, mode)
8486    }
8487
8488    /// Enables verification for the file (permanently) which involves computing a merkle tree for
8489    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
8490    /// captured. Future reads will be verified against the computed merkle tree and writes will be
8491    /// rejected. This method can take some time to complete as it depends on the size of the file.
8492    /// This method can be aborted by closing the connection that this method was issued on.
8493    ///
8494    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8495    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
8496    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
8497    /// Also returns any error that might arise from reading the file, or from flushing the file,
8498    /// such as `ZX_ERR_IO`.
8499    pub fn r#enable_verity(
8500        &self,
8501        mut options: &VerificationOptions,
8502    ) -> fidl::client::QueryResponseFut<
8503        FileEnableVerityResult,
8504        fidl::encoding::DefaultFuchsiaResourceDialect,
8505    > {
8506        FileProxyInterface::r#enable_verity(self, options)
8507    }
8508}
8509
8510impl FileProxyInterface for FileProxy {
8511    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
8512        AdvisoryLockingAdvisoryLockResult,
8513        fidl::encoding::DefaultFuchsiaResourceDialect,
8514    >;
8515    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
8516        fn _decode(
8517            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8518        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
8519            let _response = fidl::client::decode_transaction_body::<
8520                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8521                fidl::encoding::DefaultFuchsiaResourceDialect,
8522                0x6ee9c0ad53ec87aa,
8523            >(_buf?)?;
8524            Ok(_response.map(|x| x))
8525        }
8526        self.client.send_query_and_decode::<
8527            AdvisoryLockingAdvisoryLockRequest,
8528            AdvisoryLockingAdvisoryLockResult,
8529        >(
8530            (request,),
8531            0x6ee9c0ad53ec87aa,
8532            fidl::encoding::DynamicFlags::empty(),
8533            _decode,
8534        )
8535    }
8536
8537    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
8538        LinkableLinkIntoResult,
8539        fidl::encoding::DefaultFuchsiaResourceDialect,
8540    >;
8541    fn r#link_into(
8542        &self,
8543        mut dst_parent_token: fidl::Event,
8544        mut dst: &str,
8545    ) -> Self::LinkIntoResponseFut {
8546        fn _decode(
8547            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8548        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
8549            let _response = fidl::client::decode_transaction_body::<
8550                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8551                fidl::encoding::DefaultFuchsiaResourceDialect,
8552                0x54f3949246a03e74,
8553            >(_buf?)?;
8554            Ok(_response.map(|x| x))
8555        }
8556        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
8557            (dst_parent_token, dst),
8558            0x54f3949246a03e74,
8559            fidl::encoding::DynamicFlags::empty(),
8560            _decode,
8561        )
8562    }
8563
8564    fn r#clone(
8565        &self,
8566        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8567    ) -> Result<(), fidl::Error> {
8568        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
8569            (request,),
8570            0x20d8a7aba2168a79,
8571            fidl::encoding::DynamicFlags::empty(),
8572        )
8573    }
8574
8575    type CloseResponseFut = fidl::client::QueryResponseFut<
8576        fidl_fuchsia_unknown::CloseableCloseResult,
8577        fidl::encoding::DefaultFuchsiaResourceDialect,
8578    >;
8579    fn r#close(&self) -> Self::CloseResponseFut {
8580        fn _decode(
8581            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8582        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
8583            let _response = fidl::client::decode_transaction_body::<
8584                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8585                fidl::encoding::DefaultFuchsiaResourceDialect,
8586                0x5ac5d459ad7f657e,
8587            >(_buf?)?;
8588            Ok(_response.map(|x| x))
8589        }
8590        self.client.send_query_and_decode::<
8591            fidl::encoding::EmptyPayload,
8592            fidl_fuchsia_unknown::CloseableCloseResult,
8593        >(
8594            (),
8595            0x5ac5d459ad7f657e,
8596            fidl::encoding::DynamicFlags::empty(),
8597            _decode,
8598        )
8599    }
8600
8601    type QueryResponseFut =
8602        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
8603    fn r#query(&self) -> Self::QueryResponseFut {
8604        fn _decode(
8605            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8606        ) -> Result<Vec<u8>, fidl::Error> {
8607            let _response = fidl::client::decode_transaction_body::<
8608                fidl_fuchsia_unknown::QueryableQueryResponse,
8609                fidl::encoding::DefaultFuchsiaResourceDialect,
8610                0x2658edee9decfc06,
8611            >(_buf?)?;
8612            Ok(_response.protocol)
8613        }
8614        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
8615            (),
8616            0x2658edee9decfc06,
8617            fidl::encoding::DynamicFlags::empty(),
8618            _decode,
8619        )
8620    }
8621
8622    fn r#deprecated_clone(
8623        &self,
8624        mut flags: OpenFlags,
8625        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
8626    ) -> Result<(), fidl::Error> {
8627        self.client.send::<NodeDeprecatedCloneRequest>(
8628            (flags, object),
8629            0x5a61678f293ce16f,
8630            fidl::encoding::DynamicFlags::FLEXIBLE,
8631        )
8632    }
8633
8634    type GetAttrResponseFut = fidl::client::QueryResponseFut<
8635        (i32, NodeAttributes),
8636        fidl::encoding::DefaultFuchsiaResourceDialect,
8637    >;
8638    fn r#get_attr(&self) -> Self::GetAttrResponseFut {
8639        fn _decode(
8640            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8641        ) -> Result<(i32, NodeAttributes), fidl::Error> {
8642            let _response = fidl::client::decode_transaction_body::<
8643                NodeGetAttrResponse,
8644                fidl::encoding::DefaultFuchsiaResourceDialect,
8645                0x78985e216314dafd,
8646            >(_buf?)?;
8647            Ok((_response.s, _response.attributes))
8648        }
8649        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
8650            (),
8651            0x78985e216314dafd,
8652            fidl::encoding::DynamicFlags::empty(),
8653            _decode,
8654        )
8655    }
8656
8657    type SetAttrResponseFut =
8658        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8659    fn r#set_attr(
8660        &self,
8661        mut flags: NodeAttributeFlags,
8662        mut attributes: &NodeAttributes,
8663    ) -> Self::SetAttrResponseFut {
8664        fn _decode(
8665            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8666        ) -> Result<i32, fidl::Error> {
8667            let _response = fidl::client::decode_transaction_body::<
8668                NodeSetAttrResponse,
8669                fidl::encoding::DefaultFuchsiaResourceDialect,
8670                0x4186c0f40d938f46,
8671            >(_buf?)?;
8672            Ok(_response.s)
8673        }
8674        self.client.send_query_and_decode::<NodeSetAttrRequest, i32>(
8675            (flags, attributes),
8676            0x4186c0f40d938f46,
8677            fidl::encoding::DynamicFlags::empty(),
8678            _decode,
8679        )
8680    }
8681
8682    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
8683        (i32, OpenFlags),
8684        fidl::encoding::DefaultFuchsiaResourceDialect,
8685    >;
8686    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
8687        fn _decode(
8688            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8689        ) -> Result<(i32, OpenFlags), fidl::Error> {
8690            let _response = fidl::client::decode_transaction_body::<
8691                NodeDeprecatedGetFlagsResponse,
8692                fidl::encoding::DefaultFuchsiaResourceDialect,
8693                0x5b88fffb8eda3aa1,
8694            >(_buf?)?;
8695            Ok((_response.s, _response.flags))
8696        }
8697        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
8698            (),
8699            0x5b88fffb8eda3aa1,
8700            fidl::encoding::DynamicFlags::empty(),
8701            _decode,
8702        )
8703    }
8704
8705    type DeprecatedSetFlagsResponseFut =
8706        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8707    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
8708        fn _decode(
8709            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8710        ) -> Result<i32, fidl::Error> {
8711            let _response = fidl::client::decode_transaction_body::<
8712                NodeDeprecatedSetFlagsResponse,
8713                fidl::encoding::DefaultFuchsiaResourceDialect,
8714                0x5295b76c71fde733,
8715            >(_buf?)?;
8716            Ok(_response.s)
8717        }
8718        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
8719            (flags,),
8720            0x5295b76c71fde733,
8721            fidl::encoding::DynamicFlags::empty(),
8722            _decode,
8723        )
8724    }
8725
8726    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
8727        NodeGetFlagsResult,
8728        fidl::encoding::DefaultFuchsiaResourceDialect,
8729    >;
8730    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
8731        fn _decode(
8732            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8733        ) -> Result<NodeGetFlagsResult, fidl::Error> {
8734            let _response = fidl::client::decode_transaction_body::<
8735                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
8736                fidl::encoding::DefaultFuchsiaResourceDialect,
8737                0x176eb318f64ec23,
8738            >(_buf?)?
8739            .into_result::<FileMarker>("get_flags")?;
8740            Ok(_response.map(|x| x.flags))
8741        }
8742        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
8743            (),
8744            0x176eb318f64ec23,
8745            fidl::encoding::DynamicFlags::FLEXIBLE,
8746            _decode,
8747        )
8748    }
8749
8750    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
8751        NodeSetFlagsResult,
8752        fidl::encoding::DefaultFuchsiaResourceDialect,
8753    >;
8754    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
8755        fn _decode(
8756            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8757        ) -> Result<NodeSetFlagsResult, fidl::Error> {
8758            let _response = fidl::client::decode_transaction_body::<
8759                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
8760                fidl::encoding::DefaultFuchsiaResourceDialect,
8761                0x55a8028685791ea8,
8762            >(_buf?)?
8763            .into_result::<FileMarker>("set_flags")?;
8764            Ok(_response.map(|x| x))
8765        }
8766        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
8767            (flags,),
8768            0x55a8028685791ea8,
8769            fidl::encoding::DynamicFlags::FLEXIBLE,
8770            _decode,
8771        )
8772    }
8773
8774    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
8775        (i32, Option<Box<FilesystemInfo>>),
8776        fidl::encoding::DefaultFuchsiaResourceDialect,
8777    >;
8778    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
8779        fn _decode(
8780            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8781        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
8782            let _response = fidl::client::decode_transaction_body::<
8783                NodeQueryFilesystemResponse,
8784                fidl::encoding::DefaultFuchsiaResourceDialect,
8785                0x6f344a1c6b0a0610,
8786            >(_buf?)?;
8787            Ok((_response.s, _response.info))
8788        }
8789        self.client.send_query_and_decode::<
8790            fidl::encoding::EmptyPayload,
8791            (i32, Option<Box<FilesystemInfo>>),
8792        >(
8793            (),
8794            0x6f344a1c6b0a0610,
8795            fidl::encoding::DynamicFlags::empty(),
8796            _decode,
8797        )
8798    }
8799
8800    type GetConnectionInfoResponseFut = fidl::client::QueryResponseFut<
8801        ConnectionInfo,
8802        fidl::encoding::DefaultFuchsiaResourceDialect,
8803    >;
8804    fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut {
8805        fn _decode(
8806            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8807        ) -> Result<ConnectionInfo, fidl::Error> {
8808            let _response = fidl::client::decode_transaction_body::<
8809                ConnectionInfo,
8810                fidl::encoding::DefaultFuchsiaResourceDialect,
8811                0x584c377c7c0a6d0b,
8812            >(_buf?)?;
8813            Ok(_response)
8814        }
8815        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ConnectionInfo>(
8816            (),
8817            0x584c377c7c0a6d0b,
8818            fidl::encoding::DynamicFlags::empty(),
8819            _decode,
8820        )
8821    }
8822
8823    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
8824        NodeGetAttributesResult,
8825        fidl::encoding::DefaultFuchsiaResourceDialect,
8826    >;
8827    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
8828        fn _decode(
8829            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8830        ) -> Result<NodeGetAttributesResult, fidl::Error> {
8831            let _response = fidl::client::decode_transaction_body::<
8832                fidl::encoding::ResultType<NodeAttributes2, i32>,
8833                fidl::encoding::DefaultFuchsiaResourceDialect,
8834                0x3d4396a638ea053b,
8835            >(_buf?)?;
8836            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
8837        }
8838        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
8839            (query,),
8840            0x3d4396a638ea053b,
8841            fidl::encoding::DynamicFlags::empty(),
8842            _decode,
8843        )
8844    }
8845
8846    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
8847        NodeUpdateAttributesResult,
8848        fidl::encoding::DefaultFuchsiaResourceDialect,
8849    >;
8850    fn r#update_attributes(
8851        &self,
8852        mut payload: &MutableNodeAttributes,
8853    ) -> Self::UpdateAttributesResponseFut {
8854        fn _decode(
8855            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8856        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
8857            let _response = fidl::client::decode_transaction_body::<
8858                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8859                fidl::encoding::DefaultFuchsiaResourceDialect,
8860                0x3308c1da5a89bf08,
8861            >(_buf?)?;
8862            Ok(_response.map(|x| x))
8863        }
8864        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
8865            payload,
8866            0x3308c1da5a89bf08,
8867            fidl::encoding::DynamicFlags::empty(),
8868            _decode,
8869        )
8870    }
8871
8872    type SyncResponseFut = fidl::client::QueryResponseFut<
8873        NodeSyncResult,
8874        fidl::encoding::DefaultFuchsiaResourceDialect,
8875    >;
8876    fn r#sync(&self) -> Self::SyncResponseFut {
8877        fn _decode(
8878            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8879        ) -> Result<NodeSyncResult, fidl::Error> {
8880            let _response = fidl::client::decode_transaction_body::<
8881                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8882                fidl::encoding::DefaultFuchsiaResourceDialect,
8883                0x2c5c27ca0ab5dc49,
8884            >(_buf?)?;
8885            Ok(_response.map(|x| x))
8886        }
8887        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
8888            (),
8889            0x2c5c27ca0ab5dc49,
8890            fidl::encoding::DynamicFlags::empty(),
8891            _decode,
8892        )
8893    }
8894
8895    fn r#list_extended_attributes(
8896        &self,
8897        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8898    ) -> Result<(), fidl::Error> {
8899        self.client.send::<NodeListExtendedAttributesRequest>(
8900            (iterator,),
8901            0x4b61033de007fcd0,
8902            fidl::encoding::DynamicFlags::empty(),
8903        )
8904    }
8905
8906    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8907        NodeGetExtendedAttributeResult,
8908        fidl::encoding::DefaultFuchsiaResourceDialect,
8909    >;
8910    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
8911        fn _decode(
8912            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8913        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
8914            let _response = fidl::client::decode_transaction_body::<
8915                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
8916                fidl::encoding::DefaultFuchsiaResourceDialect,
8917                0x45ffa3ccfdeb76db,
8918            >(_buf?)?;
8919            Ok(_response.map(|x| x))
8920        }
8921        self.client.send_query_and_decode::<
8922            NodeGetExtendedAttributeRequest,
8923            NodeGetExtendedAttributeResult,
8924        >(
8925            (name,),
8926            0x45ffa3ccfdeb76db,
8927            fidl::encoding::DynamicFlags::empty(),
8928            _decode,
8929        )
8930    }
8931
8932    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8933        NodeSetExtendedAttributeResult,
8934        fidl::encoding::DefaultFuchsiaResourceDialect,
8935    >;
8936    fn r#set_extended_attribute(
8937        &self,
8938        mut name: &[u8],
8939        mut value: ExtendedAttributeValue,
8940        mut mode: SetExtendedAttributeMode,
8941    ) -> Self::SetExtendedAttributeResponseFut {
8942        fn _decode(
8943            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8944        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
8945            let _response = fidl::client::decode_transaction_body::<
8946                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8947                fidl::encoding::DefaultFuchsiaResourceDialect,
8948                0x4a951362f681f23c,
8949            >(_buf?)?;
8950            Ok(_response.map(|x| x))
8951        }
8952        self.client.send_query_and_decode::<
8953            NodeSetExtendedAttributeRequest,
8954            NodeSetExtendedAttributeResult,
8955        >(
8956            (name, &mut value, mode,),
8957            0x4a951362f681f23c,
8958            fidl::encoding::DynamicFlags::empty(),
8959            _decode,
8960        )
8961    }
8962
8963    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8964        NodeRemoveExtendedAttributeResult,
8965        fidl::encoding::DefaultFuchsiaResourceDialect,
8966    >;
8967    fn r#remove_extended_attribute(
8968        &self,
8969        mut name: &[u8],
8970    ) -> Self::RemoveExtendedAttributeResponseFut {
8971        fn _decode(
8972            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8973        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
8974            let _response = fidl::client::decode_transaction_body::<
8975                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8976                fidl::encoding::DefaultFuchsiaResourceDialect,
8977                0x7a0b9f3a9bf9032d,
8978            >(_buf?)?;
8979            Ok(_response.map(|x| x))
8980        }
8981        self.client.send_query_and_decode::<
8982            NodeRemoveExtendedAttributeRequest,
8983            NodeRemoveExtendedAttributeResult,
8984        >(
8985            (name,),
8986            0x7a0b9f3a9bf9032d,
8987            fidl::encoding::DynamicFlags::empty(),
8988            _decode,
8989        )
8990    }
8991
8992    type ReadResponseFut = fidl::client::QueryResponseFut<
8993        ReadableReadResult,
8994        fidl::encoding::DefaultFuchsiaResourceDialect,
8995    >;
8996    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
8997        fn _decode(
8998            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8999        ) -> Result<ReadableReadResult, fidl::Error> {
9000            let _response = fidl::client::decode_transaction_body::<
9001                fidl::encoding::ResultType<ReadableReadResponse, i32>,
9002                fidl::encoding::DefaultFuchsiaResourceDialect,
9003                0x57e419a298c8ede,
9004            >(_buf?)?;
9005            Ok(_response.map(|x| x.data))
9006        }
9007        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
9008            (count,),
9009            0x57e419a298c8ede,
9010            fidl::encoding::DynamicFlags::empty(),
9011            _decode,
9012        )
9013    }
9014
9015    type WriteResponseFut = fidl::client::QueryResponseFut<
9016        WritableWriteResult,
9017        fidl::encoding::DefaultFuchsiaResourceDialect,
9018    >;
9019    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
9020        fn _decode(
9021            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9022        ) -> Result<WritableWriteResult, fidl::Error> {
9023            let _response = fidl::client::decode_transaction_body::<
9024                fidl::encoding::ResultType<WritableWriteResponse, i32>,
9025                fidl::encoding::DefaultFuchsiaResourceDialect,
9026                0x6a31437832469f82,
9027            >(_buf?)?;
9028            Ok(_response.map(|x| x.actual_count))
9029        }
9030        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
9031            (data,),
9032            0x6a31437832469f82,
9033            fidl::encoding::DynamicFlags::empty(),
9034            _decode,
9035        )
9036    }
9037
9038    type DescribeResponseFut =
9039        fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
9040    fn r#describe(&self) -> Self::DescribeResponseFut {
9041        fn _decode(
9042            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9043        ) -> Result<FileInfo, fidl::Error> {
9044            let _response = fidl::client::decode_transaction_body::<
9045                FileInfo,
9046                fidl::encoding::DefaultFuchsiaResourceDialect,
9047                0x68b5ac00c62906bc,
9048            >(_buf?)?;
9049            Ok(_response)
9050        }
9051        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FileInfo>(
9052            (),
9053            0x68b5ac00c62906bc,
9054            fidl::encoding::DynamicFlags::empty(),
9055            _decode,
9056        )
9057    }
9058
9059    type SeekResponseFut = fidl::client::QueryResponseFut<
9060        FileSeekResult,
9061        fidl::encoding::DefaultFuchsiaResourceDialect,
9062    >;
9063    fn r#seek(&self, mut origin: SeekOrigin, mut offset: i64) -> Self::SeekResponseFut {
9064        fn _decode(
9065            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9066        ) -> Result<FileSeekResult, fidl::Error> {
9067            let _response = fidl::client::decode_transaction_body::<
9068                fidl::encoding::ResultType<FileSeekResponse, i32>,
9069                fidl::encoding::DefaultFuchsiaResourceDialect,
9070                0x78079168162c5207,
9071            >(_buf?)?;
9072            Ok(_response.map(|x| x.offset_from_start))
9073        }
9074        self.client.send_query_and_decode::<FileSeekRequest, FileSeekResult>(
9075            (origin, offset),
9076            0x78079168162c5207,
9077            fidl::encoding::DynamicFlags::empty(),
9078            _decode,
9079        )
9080    }
9081
9082    type ReadAtResponseFut = fidl::client::QueryResponseFut<
9083        FileReadAtResult,
9084        fidl::encoding::DefaultFuchsiaResourceDialect,
9085    >;
9086    fn r#read_at(&self, mut count: u64, mut offset: u64) -> Self::ReadAtResponseFut {
9087        fn _decode(
9088            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9089        ) -> Result<FileReadAtResult, fidl::Error> {
9090            let _response = fidl::client::decode_transaction_body::<
9091                fidl::encoding::ResultType<FileReadAtResponse, i32>,
9092                fidl::encoding::DefaultFuchsiaResourceDialect,
9093                0x1607a293a60d723e,
9094            >(_buf?)?;
9095            Ok(_response.map(|x| x.data))
9096        }
9097        self.client.send_query_and_decode::<FileReadAtRequest, FileReadAtResult>(
9098            (count, offset),
9099            0x1607a293a60d723e,
9100            fidl::encoding::DynamicFlags::empty(),
9101            _decode,
9102        )
9103    }
9104
9105    type WriteAtResponseFut = fidl::client::QueryResponseFut<
9106        FileWriteAtResult,
9107        fidl::encoding::DefaultFuchsiaResourceDialect,
9108    >;
9109    fn r#write_at(&self, mut data: &[u8], mut offset: u64) -> Self::WriteAtResponseFut {
9110        fn _decode(
9111            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9112        ) -> Result<FileWriteAtResult, fidl::Error> {
9113            let _response = fidl::client::decode_transaction_body::<
9114                fidl::encoding::ResultType<FileWriteAtResponse, i32>,
9115                fidl::encoding::DefaultFuchsiaResourceDialect,
9116                0x793eefc0045e792b,
9117            >(_buf?)?;
9118            Ok(_response.map(|x| x.actual_count))
9119        }
9120        self.client.send_query_and_decode::<FileWriteAtRequest, FileWriteAtResult>(
9121            (data, offset),
9122            0x793eefc0045e792b,
9123            fidl::encoding::DynamicFlags::empty(),
9124            _decode,
9125        )
9126    }
9127
9128    type ResizeResponseFut = fidl::client::QueryResponseFut<
9129        FileResizeResult,
9130        fidl::encoding::DefaultFuchsiaResourceDialect,
9131    >;
9132    fn r#resize(&self, mut length: u64) -> Self::ResizeResponseFut {
9133        fn _decode(
9134            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9135        ) -> Result<FileResizeResult, fidl::Error> {
9136            let _response = fidl::client::decode_transaction_body::<
9137                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
9138                fidl::encoding::DefaultFuchsiaResourceDialect,
9139                0x2b80825f0535743a,
9140            >(_buf?)?;
9141            Ok(_response.map(|x| x))
9142        }
9143        self.client.send_query_and_decode::<FileResizeRequest, FileResizeResult>(
9144            (length,),
9145            0x2b80825f0535743a,
9146            fidl::encoding::DynamicFlags::empty(),
9147            _decode,
9148        )
9149    }
9150
9151    type GetBackingMemoryResponseFut = fidl::client::QueryResponseFut<
9152        FileGetBackingMemoryResult,
9153        fidl::encoding::DefaultFuchsiaResourceDialect,
9154    >;
9155    fn r#get_backing_memory(&self, mut flags: VmoFlags) -> Self::GetBackingMemoryResponseFut {
9156        fn _decode(
9157            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9158        ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
9159            let _response = fidl::client::decode_transaction_body::<
9160                fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
9161                fidl::encoding::DefaultFuchsiaResourceDialect,
9162                0xa6a9e654cbf62b,
9163            >(_buf?)?;
9164            Ok(_response.map(|x| x.vmo))
9165        }
9166        self.client
9167            .send_query_and_decode::<FileGetBackingMemoryRequest, FileGetBackingMemoryResult>(
9168                (flags,),
9169                0xa6a9e654cbf62b,
9170                fidl::encoding::DynamicFlags::empty(),
9171                _decode,
9172            )
9173    }
9174
9175    type AllocateResponseFut = fidl::client::QueryResponseFut<
9176        FileAllocateResult,
9177        fidl::encoding::DefaultFuchsiaResourceDialect,
9178    >;
9179    fn r#allocate(
9180        &self,
9181        mut offset: u64,
9182        mut length: u64,
9183        mut mode: AllocateMode,
9184    ) -> Self::AllocateResponseFut {
9185        fn _decode(
9186            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9187        ) -> Result<FileAllocateResult, fidl::Error> {
9188            let _response = fidl::client::decode_transaction_body::<
9189                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9190                fidl::encoding::DefaultFuchsiaResourceDialect,
9191                0x77fa0c330b57fd2e,
9192            >(_buf?)?
9193            .into_result::<FileMarker>("allocate")?;
9194            Ok(_response.map(|x| x))
9195        }
9196        self.client.send_query_and_decode::<FileAllocateRequest, FileAllocateResult>(
9197            (offset, length, mode),
9198            0x77fa0c330b57fd2e,
9199            fidl::encoding::DynamicFlags::FLEXIBLE,
9200            _decode,
9201        )
9202    }
9203
9204    type EnableVerityResponseFut = fidl::client::QueryResponseFut<
9205        FileEnableVerityResult,
9206        fidl::encoding::DefaultFuchsiaResourceDialect,
9207    >;
9208    fn r#enable_verity(&self, mut options: &VerificationOptions) -> Self::EnableVerityResponseFut {
9209        fn _decode(
9210            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9211        ) -> Result<FileEnableVerityResult, fidl::Error> {
9212            let _response = fidl::client::decode_transaction_body::<
9213                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9214                fidl::encoding::DefaultFuchsiaResourceDialect,
9215                0x2c421ec3faaeb8bb,
9216            >(_buf?)?
9217            .into_result::<FileMarker>("enable_verity")?;
9218            Ok(_response.map(|x| x))
9219        }
9220        self.client.send_query_and_decode::<FileEnableVerityRequest, FileEnableVerityResult>(
9221            (options,),
9222            0x2c421ec3faaeb8bb,
9223            fidl::encoding::DynamicFlags::FLEXIBLE,
9224            _decode,
9225        )
9226    }
9227}
9228
9229pub struct FileEventStream {
9230    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9231}
9232
9233impl std::marker::Unpin for FileEventStream {}
9234
9235impl futures::stream::FusedStream for FileEventStream {
9236    fn is_terminated(&self) -> bool {
9237        self.event_receiver.is_terminated()
9238    }
9239}
9240
9241impl futures::Stream for FileEventStream {
9242    type Item = Result<FileEvent, fidl::Error>;
9243
9244    fn poll_next(
9245        mut self: std::pin::Pin<&mut Self>,
9246        cx: &mut std::task::Context<'_>,
9247    ) -> std::task::Poll<Option<Self::Item>> {
9248        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9249            &mut self.event_receiver,
9250            cx
9251        )?) {
9252            Some(buf) => std::task::Poll::Ready(Some(FileEvent::decode(buf))),
9253            None => std::task::Poll::Ready(None),
9254        }
9255    }
9256}
9257
9258#[derive(Debug)]
9259pub enum FileEvent {
9260    OnOpen_ {
9261        s: i32,
9262        info: Option<Box<NodeInfoDeprecated>>,
9263    },
9264    OnRepresentation {
9265        payload: Representation,
9266    },
9267    #[non_exhaustive]
9268    _UnknownEvent {
9269        /// Ordinal of the event that was sent.
9270        ordinal: u64,
9271    },
9272}
9273
9274impl FileEvent {
9275    #[allow(irrefutable_let_patterns)]
9276    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
9277        if let FileEvent::OnOpen_ { s, info } = self {
9278            Some((s, info))
9279        } else {
9280            None
9281        }
9282    }
9283    #[allow(irrefutable_let_patterns)]
9284    pub fn into_on_representation(self) -> Option<Representation> {
9285        if let FileEvent::OnRepresentation { payload } = self {
9286            Some((payload))
9287        } else {
9288            None
9289        }
9290    }
9291
9292    /// Decodes a message buffer as a [`FileEvent`].
9293    fn decode(
9294        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9295    ) -> Result<FileEvent, fidl::Error> {
9296        let (bytes, _handles) = buf.split_mut();
9297        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9298        debug_assert_eq!(tx_header.tx_id, 0);
9299        match tx_header.ordinal {
9300            0x7fc7bbb1dbfd1972 => {
9301                let mut out = fidl::new_empty!(
9302                    NodeOnOpenRequest,
9303                    fidl::encoding::DefaultFuchsiaResourceDialect
9304                );
9305                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
9306                Ok((FileEvent::OnOpen_ { s: out.s, info: out.info }))
9307            }
9308            0x5cb40567d80a510c => {
9309                let mut out =
9310                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
9311                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
9312                Ok((FileEvent::OnRepresentation { payload: out }))
9313            }
9314            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9315                Ok(FileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9316            }
9317            _ => Err(fidl::Error::UnknownOrdinal {
9318                ordinal: tx_header.ordinal,
9319                protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9320            }),
9321        }
9322    }
9323}
9324
9325/// A Stream of incoming requests for fuchsia.io/File.
9326pub struct FileRequestStream {
9327    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9328    is_terminated: bool,
9329}
9330
9331impl std::marker::Unpin for FileRequestStream {}
9332
9333impl futures::stream::FusedStream for FileRequestStream {
9334    fn is_terminated(&self) -> bool {
9335        self.is_terminated
9336    }
9337}
9338
9339impl fidl::endpoints::RequestStream for FileRequestStream {
9340    type Protocol = FileMarker;
9341    type ControlHandle = FileControlHandle;
9342
9343    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9344        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9345    }
9346
9347    fn control_handle(&self) -> Self::ControlHandle {
9348        FileControlHandle { inner: self.inner.clone() }
9349    }
9350
9351    fn into_inner(
9352        self,
9353    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9354    {
9355        (self.inner, self.is_terminated)
9356    }
9357
9358    fn from_inner(
9359        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9360        is_terminated: bool,
9361    ) -> Self {
9362        Self { inner, is_terminated }
9363    }
9364}
9365
9366impl futures::Stream for FileRequestStream {
9367    type Item = Result<FileRequest, fidl::Error>;
9368
9369    fn poll_next(
9370        mut self: std::pin::Pin<&mut Self>,
9371        cx: &mut std::task::Context<'_>,
9372    ) -> std::task::Poll<Option<Self::Item>> {
9373        let this = &mut *self;
9374        if this.inner.check_shutdown(cx) {
9375            this.is_terminated = true;
9376            return std::task::Poll::Ready(None);
9377        }
9378        if this.is_terminated {
9379            panic!("polled FileRequestStream after completion");
9380        }
9381        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9382            |bytes, handles| {
9383                match this.inner.channel().read_etc(cx, bytes, handles) {
9384                    std::task::Poll::Ready(Ok(())) => {}
9385                    std::task::Poll::Pending => return std::task::Poll::Pending,
9386                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9387                        this.is_terminated = true;
9388                        return std::task::Poll::Ready(None);
9389                    }
9390                    std::task::Poll::Ready(Err(e)) => {
9391                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9392                            e.into(),
9393                        ))))
9394                    }
9395                }
9396
9397                // A message has been received from the channel
9398                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9399
9400                std::task::Poll::Ready(Some(match header.ordinal {
9401                    0x6ee9c0ad53ec87aa => {
9402                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9403                        let mut req = fidl::new_empty!(
9404                            AdvisoryLockingAdvisoryLockRequest,
9405                            fidl::encoding::DefaultFuchsiaResourceDialect
9406                        );
9407                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
9408                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9409                        Ok(FileRequest::AdvisoryLock {
9410                            request: req.request,
9411
9412                            responder: FileAdvisoryLockResponder {
9413                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9414                                tx_id: header.tx_id,
9415                            },
9416                        })
9417                    }
9418                    0x54f3949246a03e74 => {
9419                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9420                        let mut req = fidl::new_empty!(
9421                            LinkableLinkIntoRequest,
9422                            fidl::encoding::DefaultFuchsiaResourceDialect
9423                        );
9424                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
9425                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9426                        Ok(FileRequest::LinkInto {
9427                            dst_parent_token: req.dst_parent_token,
9428                            dst: req.dst,
9429
9430                            responder: FileLinkIntoResponder {
9431                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9432                                tx_id: header.tx_id,
9433                            },
9434                        })
9435                    }
9436                    0x20d8a7aba2168a79 => {
9437                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9438                        let mut req = fidl::new_empty!(
9439                            fidl_fuchsia_unknown::CloneableCloneRequest,
9440                            fidl::encoding::DefaultFuchsiaResourceDialect
9441                        );
9442                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9443                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9444                        Ok(FileRequest::Clone { request: req.request, control_handle })
9445                    }
9446                    0x5ac5d459ad7f657e => {
9447                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9448                        let mut req = fidl::new_empty!(
9449                            fidl::encoding::EmptyPayload,
9450                            fidl::encoding::DefaultFuchsiaResourceDialect
9451                        );
9452                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9453                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9454                        Ok(FileRequest::Close {
9455                            responder: FileCloseResponder {
9456                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9457                                tx_id: header.tx_id,
9458                            },
9459                        })
9460                    }
9461                    0x2658edee9decfc06 => {
9462                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9463                        let mut req = fidl::new_empty!(
9464                            fidl::encoding::EmptyPayload,
9465                            fidl::encoding::DefaultFuchsiaResourceDialect
9466                        );
9467                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9468                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9469                        Ok(FileRequest::Query {
9470                            responder: FileQueryResponder {
9471                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9472                                tx_id: header.tx_id,
9473                            },
9474                        })
9475                    }
9476                    0x5a61678f293ce16f => {
9477                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9478                        let mut req = fidl::new_empty!(
9479                            NodeDeprecatedCloneRequest,
9480                            fidl::encoding::DefaultFuchsiaResourceDialect
9481                        );
9482                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9483                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9484                        Ok(FileRequest::DeprecatedClone {
9485                            flags: req.flags,
9486                            object: req.object,
9487
9488                            control_handle,
9489                        })
9490                    }
9491                    0x78985e216314dafd => {
9492                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9493                        let mut req = fidl::new_empty!(
9494                            fidl::encoding::EmptyPayload,
9495                            fidl::encoding::DefaultFuchsiaResourceDialect
9496                        );
9497                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9498                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9499                        Ok(FileRequest::GetAttr {
9500                            responder: FileGetAttrResponder {
9501                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9502                                tx_id: header.tx_id,
9503                            },
9504                        })
9505                    }
9506                    0x4186c0f40d938f46 => {
9507                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9508                        let mut req = fidl::new_empty!(
9509                            NodeSetAttrRequest,
9510                            fidl::encoding::DefaultFuchsiaResourceDialect
9511                        );
9512                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
9513                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9514                        Ok(FileRequest::SetAttr {
9515                            flags: req.flags,
9516                            attributes: req.attributes,
9517
9518                            responder: FileSetAttrResponder {
9519                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9520                                tx_id: header.tx_id,
9521                            },
9522                        })
9523                    }
9524                    0x5b88fffb8eda3aa1 => {
9525                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9526                        let mut req = fidl::new_empty!(
9527                            fidl::encoding::EmptyPayload,
9528                            fidl::encoding::DefaultFuchsiaResourceDialect
9529                        );
9530                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9531                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9532                        Ok(FileRequest::DeprecatedGetFlags {
9533                            responder: FileDeprecatedGetFlagsResponder {
9534                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9535                                tx_id: header.tx_id,
9536                            },
9537                        })
9538                    }
9539                    0x5295b76c71fde733 => {
9540                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9541                        let mut req = fidl::new_empty!(
9542                            NodeDeprecatedSetFlagsRequest,
9543                            fidl::encoding::DefaultFuchsiaResourceDialect
9544                        );
9545                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9546                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9547                        Ok(FileRequest::DeprecatedSetFlags {
9548                            flags: req.flags,
9549
9550                            responder: FileDeprecatedSetFlagsResponder {
9551                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9552                                tx_id: header.tx_id,
9553                            },
9554                        })
9555                    }
9556                    0x176eb318f64ec23 => {
9557                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9558                        let mut req = fidl::new_empty!(
9559                            fidl::encoding::EmptyPayload,
9560                            fidl::encoding::DefaultFuchsiaResourceDialect
9561                        );
9562                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9563                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9564                        Ok(FileRequest::GetFlags {
9565                            responder: FileGetFlagsResponder {
9566                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9567                                tx_id: header.tx_id,
9568                            },
9569                        })
9570                    }
9571                    0x55a8028685791ea8 => {
9572                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9573                        let mut req = fidl::new_empty!(
9574                            NodeSetFlagsRequest,
9575                            fidl::encoding::DefaultFuchsiaResourceDialect
9576                        );
9577                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9578                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9579                        Ok(FileRequest::SetFlags {
9580                            flags: req.flags,
9581
9582                            responder: FileSetFlagsResponder {
9583                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9584                                tx_id: header.tx_id,
9585                            },
9586                        })
9587                    }
9588                    0x6f344a1c6b0a0610 => {
9589                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9590                        let mut req = fidl::new_empty!(
9591                            fidl::encoding::EmptyPayload,
9592                            fidl::encoding::DefaultFuchsiaResourceDialect
9593                        );
9594                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9595                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9596                        Ok(FileRequest::QueryFilesystem {
9597                            responder: FileQueryFilesystemResponder {
9598                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9599                                tx_id: header.tx_id,
9600                            },
9601                        })
9602                    }
9603                    0x584c377c7c0a6d0b => {
9604                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9605                        let mut req = fidl::new_empty!(
9606                            fidl::encoding::EmptyPayload,
9607                            fidl::encoding::DefaultFuchsiaResourceDialect
9608                        );
9609                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9610                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9611                        Ok(FileRequest::GetConnectionInfo {
9612                            responder: FileGetConnectionInfoResponder {
9613                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9614                                tx_id: header.tx_id,
9615                            },
9616                        })
9617                    }
9618                    0x3d4396a638ea053b => {
9619                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9620                        let mut req = fidl::new_empty!(
9621                            NodeGetAttributesRequest,
9622                            fidl::encoding::DefaultFuchsiaResourceDialect
9623                        );
9624                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9625                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9626                        Ok(FileRequest::GetAttributes {
9627                            query: req.query,
9628
9629                            responder: FileGetAttributesResponder {
9630                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9631                                tx_id: header.tx_id,
9632                            },
9633                        })
9634                    }
9635                    0x3308c1da5a89bf08 => {
9636                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9637                        let mut req = fidl::new_empty!(
9638                            MutableNodeAttributes,
9639                            fidl::encoding::DefaultFuchsiaResourceDialect
9640                        );
9641                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
9642                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9643                        Ok(FileRequest::UpdateAttributes {
9644                            payload: req,
9645                            responder: FileUpdateAttributesResponder {
9646                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9647                                tx_id: header.tx_id,
9648                            },
9649                        })
9650                    }
9651                    0x2c5c27ca0ab5dc49 => {
9652                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9653                        let mut req = fidl::new_empty!(
9654                            fidl::encoding::EmptyPayload,
9655                            fidl::encoding::DefaultFuchsiaResourceDialect
9656                        );
9657                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9658                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9659                        Ok(FileRequest::Sync {
9660                            responder: FileSyncResponder {
9661                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9662                                tx_id: header.tx_id,
9663                            },
9664                        })
9665                    }
9666                    0x4b61033de007fcd0 => {
9667                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9668                        let mut req = fidl::new_empty!(
9669                            NodeListExtendedAttributesRequest,
9670                            fidl::encoding::DefaultFuchsiaResourceDialect
9671                        );
9672                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9673                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9674                        Ok(FileRequest::ListExtendedAttributes {
9675                            iterator: req.iterator,
9676
9677                            control_handle,
9678                        })
9679                    }
9680                    0x45ffa3ccfdeb76db => {
9681                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9682                        let mut req = fidl::new_empty!(
9683                            NodeGetExtendedAttributeRequest,
9684                            fidl::encoding::DefaultFuchsiaResourceDialect
9685                        );
9686                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9687                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9688                        Ok(FileRequest::GetExtendedAttribute {
9689                            name: req.name,
9690
9691                            responder: FileGetExtendedAttributeResponder {
9692                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9693                                tx_id: header.tx_id,
9694                            },
9695                        })
9696                    }
9697                    0x4a951362f681f23c => {
9698                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9699                        let mut req = fidl::new_empty!(
9700                            NodeSetExtendedAttributeRequest,
9701                            fidl::encoding::DefaultFuchsiaResourceDialect
9702                        );
9703                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9704                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9705                        Ok(FileRequest::SetExtendedAttribute {
9706                            name: req.name,
9707                            value: req.value,
9708                            mode: req.mode,
9709
9710                            responder: FileSetExtendedAttributeResponder {
9711                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9712                                tx_id: header.tx_id,
9713                            },
9714                        })
9715                    }
9716                    0x7a0b9f3a9bf9032d => {
9717                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9718                        let mut req = fidl::new_empty!(
9719                            NodeRemoveExtendedAttributeRequest,
9720                            fidl::encoding::DefaultFuchsiaResourceDialect
9721                        );
9722                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9723                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9724                        Ok(FileRequest::RemoveExtendedAttribute {
9725                            name: req.name,
9726
9727                            responder: FileRemoveExtendedAttributeResponder {
9728                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9729                                tx_id: header.tx_id,
9730                            },
9731                        })
9732                    }
9733                    0x57e419a298c8ede => {
9734                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9735                        let mut req = fidl::new_empty!(
9736                            ReadableReadRequest,
9737                            fidl::encoding::DefaultFuchsiaResourceDialect
9738                        );
9739                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
9740                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9741                        Ok(FileRequest::Read {
9742                            count: req.count,
9743
9744                            responder: FileReadResponder {
9745                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9746                                tx_id: header.tx_id,
9747                            },
9748                        })
9749                    }
9750                    0x6a31437832469f82 => {
9751                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9752                        let mut req = fidl::new_empty!(
9753                            WritableWriteRequest,
9754                            fidl::encoding::DefaultFuchsiaResourceDialect
9755                        );
9756                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
9757                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9758                        Ok(FileRequest::Write {
9759                            data: req.data,
9760
9761                            responder: FileWriteResponder {
9762                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9763                                tx_id: header.tx_id,
9764                            },
9765                        })
9766                    }
9767                    0x68b5ac00c62906bc => {
9768                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9769                        let mut req = fidl::new_empty!(
9770                            fidl::encoding::EmptyPayload,
9771                            fidl::encoding::DefaultFuchsiaResourceDialect
9772                        );
9773                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9774                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9775                        Ok(FileRequest::Describe {
9776                            responder: FileDescribeResponder {
9777                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9778                                tx_id: header.tx_id,
9779                            },
9780                        })
9781                    }
9782                    0x78079168162c5207 => {
9783                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9784                        let mut req = fidl::new_empty!(
9785                            FileSeekRequest,
9786                            fidl::encoding::DefaultFuchsiaResourceDialect
9787                        );
9788                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileSeekRequest>(&header, _body_bytes, handles, &mut req)?;
9789                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9790                        Ok(FileRequest::Seek {
9791                            origin: req.origin,
9792                            offset: req.offset,
9793
9794                            responder: FileSeekResponder {
9795                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9796                                tx_id: header.tx_id,
9797                            },
9798                        })
9799                    }
9800                    0x1607a293a60d723e => {
9801                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9802                        let mut req = fidl::new_empty!(
9803                            FileReadAtRequest,
9804                            fidl::encoding::DefaultFuchsiaResourceDialect
9805                        );
9806                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileReadAtRequest>(&header, _body_bytes, handles, &mut req)?;
9807                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9808                        Ok(FileRequest::ReadAt {
9809                            count: req.count,
9810                            offset: req.offset,
9811
9812                            responder: FileReadAtResponder {
9813                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9814                                tx_id: header.tx_id,
9815                            },
9816                        })
9817                    }
9818                    0x793eefc0045e792b => {
9819                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9820                        let mut req = fidl::new_empty!(
9821                            FileWriteAtRequest,
9822                            fidl::encoding::DefaultFuchsiaResourceDialect
9823                        );
9824                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileWriteAtRequest>(&header, _body_bytes, handles, &mut req)?;
9825                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9826                        Ok(FileRequest::WriteAt {
9827                            data: req.data,
9828                            offset: req.offset,
9829
9830                            responder: FileWriteAtResponder {
9831                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9832                                tx_id: header.tx_id,
9833                            },
9834                        })
9835                    }
9836                    0x2b80825f0535743a => {
9837                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9838                        let mut req = fidl::new_empty!(
9839                            FileResizeRequest,
9840                            fidl::encoding::DefaultFuchsiaResourceDialect
9841                        );
9842                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileResizeRequest>(&header, _body_bytes, handles, &mut req)?;
9843                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9844                        Ok(FileRequest::Resize {
9845                            length: req.length,
9846
9847                            responder: FileResizeResponder {
9848                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9849                                tx_id: header.tx_id,
9850                            },
9851                        })
9852                    }
9853                    0xa6a9e654cbf62b => {
9854                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9855                        let mut req = fidl::new_empty!(
9856                            FileGetBackingMemoryRequest,
9857                            fidl::encoding::DefaultFuchsiaResourceDialect
9858                        );
9859                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileGetBackingMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
9860                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9861                        Ok(FileRequest::GetBackingMemory {
9862                            flags: req.flags,
9863
9864                            responder: FileGetBackingMemoryResponder {
9865                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9866                                tx_id: header.tx_id,
9867                            },
9868                        })
9869                    }
9870                    0x77fa0c330b57fd2e => {
9871                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9872                        let mut req = fidl::new_empty!(
9873                            FileAllocateRequest,
9874                            fidl::encoding::DefaultFuchsiaResourceDialect
9875                        );
9876                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileAllocateRequest>(&header, _body_bytes, handles, &mut req)?;
9877                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9878                        Ok(FileRequest::Allocate {
9879                            offset: req.offset,
9880                            length: req.length,
9881                            mode: req.mode,
9882
9883                            responder: FileAllocateResponder {
9884                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9885                                tx_id: header.tx_id,
9886                            },
9887                        })
9888                    }
9889                    0x2c421ec3faaeb8bb => {
9890                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9891                        let mut req = fidl::new_empty!(
9892                            FileEnableVerityRequest,
9893                            fidl::encoding::DefaultFuchsiaResourceDialect
9894                        );
9895                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileEnableVerityRequest>(&header, _body_bytes, handles, &mut req)?;
9896                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9897                        Ok(FileRequest::EnableVerity {
9898                            options: req.options,
9899
9900                            responder: FileEnableVerityResponder {
9901                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9902                                tx_id: header.tx_id,
9903                            },
9904                        })
9905                    }
9906                    _ if header.tx_id == 0
9907                        && header
9908                            .dynamic_flags()
9909                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9910                    {
9911                        Ok(FileRequest::_UnknownMethod {
9912                            ordinal: header.ordinal,
9913                            control_handle: FileControlHandle { inner: this.inner.clone() },
9914                            method_type: fidl::MethodType::OneWay,
9915                        })
9916                    }
9917                    _ if header
9918                        .dynamic_flags()
9919                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9920                    {
9921                        this.inner.send_framework_err(
9922                            fidl::encoding::FrameworkErr::UnknownMethod,
9923                            header.tx_id,
9924                            header.ordinal,
9925                            header.dynamic_flags(),
9926                            (bytes, handles),
9927                        )?;
9928                        Ok(FileRequest::_UnknownMethod {
9929                            ordinal: header.ordinal,
9930                            control_handle: FileControlHandle { inner: this.inner.clone() },
9931                            method_type: fidl::MethodType::TwoWay,
9932                        })
9933                    }
9934                    _ => Err(fidl::Error::UnknownOrdinal {
9935                        ordinal: header.ordinal,
9936                        protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9937                    }),
9938                }))
9939            },
9940        )
9941    }
9942}
9943
9944/// A [`Node`] which contains a sequence of bytes of definite length.
9945///
9946/// NOTE: cloned connections do not share their seek offset with their source
9947/// connection.
9948#[derive(Debug)]
9949pub enum FileRequest {
9950    /// Acquires an advisory lock on the underlying file.
9951    ///
9952    /// The lock lasts until either this connection is closed or
9953    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
9954    /// explicitly.
9955    ///
9956    /// Advisory locks are purely advisory. They do not prevent actual read or
9957    /// write operations from occurring on the file, either through this
9958    /// connection or through other connections.
9959    ///
9960    /// This method requires the following rights:
9961    ///
9962    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
9963    /// * [`Rights.WRITE_BYTES`] if `request.type` is
9964    ///   [`AdvisoryLockType.WRITE`].
9965    ///
9966    /// # Errors
9967    ///
9968    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
9969    ///   example, another connection might hold a conflicting lock type.
9970    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
9971    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
9972    ///   to acquire the given type of lock.
9973    AdvisoryLock {
9974        request: AdvisoryLockRequest,
9975        responder: FileAdvisoryLockResponder,
9976    },
9977    /// Creates a link to this this object with name `dst` in the directory represented by
9978    /// `dst_parent_token`.
9979    ///
9980    /// `dst` must be a resolved object name. Including "/" in the string will return
9981    /// `ZX_ERR_INVALID_ARGS`.
9982    ///
9983    /// This method requires the maximal set of rights supported by the filesystem for this object.
9984    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
9985    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
9986    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
9987    /// `ZX_ERR_ACCESS_DENIED`.
9988    ///
9989    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
9990    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
9991    ///
9992    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
9993    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
9994    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
9995    ///
9996    /// This method does not have the same atomicity properties has the `Directory::Link` method,
9997    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
9998    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
9999    LinkInto {
10000        dst_parent_token: fidl::Event,
10001        dst: String,
10002        responder: FileLinkIntoResponder,
10003    },
10004    Clone {
10005        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10006        control_handle: FileControlHandle,
10007    },
10008    /// Terminates the connection.
10009    ///
10010    /// After calling `Close`, the client must not send any other requests.
10011    ///
10012    /// Servers, after sending the status response, should close the connection
10013    /// regardless of status and without sending an epitaph.
10014    ///
10015    /// Closing the client end of the channel should be semantically equivalent
10016    /// to calling `Close` without knowing when the close has completed or its
10017    /// status.
10018    Close {
10019        responder: FileCloseResponder,
10020    },
10021    Query {
10022        responder: FileQueryResponder,
10023    },
10024    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
10025    DeprecatedClone {
10026        flags: OpenFlags,
10027        object: fidl::endpoints::ServerEnd<NodeMarker>,
10028        control_handle: FileControlHandle,
10029    },
10030    /// Acquires information about the node.
10031    ///
10032    /// This method does not require any rights.
10033    GetAttr {
10034        responder: FileGetAttrResponder,
10035    },
10036    /// Updates information about the node.
10037    ///
10038    /// Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.
10039    ///
10040    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
10041    /// `ZX_ERR_BAD_HANDLE`.
10042    SetAttr {
10043        flags: NodeAttributeFlags,
10044        attributes: NodeAttributes,
10045        responder: FileSetAttrResponder,
10046    },
10047    /// [DEPRECATED - Use new GetFlags method instead.]
10048    DeprecatedGetFlags {
10049        responder: FileDeprecatedGetFlagsResponder,
10050    },
10051    /// [DEPRECATED - Use new SetFlags method instead.]
10052    DeprecatedSetFlags {
10053        flags: OpenFlags,
10054        responder: FileDeprecatedSetFlagsResponder,
10055    },
10056    /// Queries the flags that apply to this node after it has been opened/created. This method does
10057    /// not require any rights.
10058    ///
10059    /// Note that the final set of flags that apply to the connection may differ from those
10060    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
10061    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
10062    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
10063    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
10064    GetFlags {
10065        responder: FileGetFlagsResponder,
10066    },
10067    /// Sets the flags that apply to this node after it has been opened. This method does not
10068    /// require any rights.
10069    ///
10070    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
10071    /// clear append mode.
10072    ///
10073    /// Errors:
10074    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
10075    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
10076    SetFlags {
10077        flags: Flags,
10078        responder: FileSetFlagsResponder,
10079    },
10080    /// Query the filesystem for filesystem-specific information.
10081    QueryFilesystem {
10082        responder: FileQueryFilesystemResponder,
10083    },
10084    /// Acquires information about the connection.
10085    ///
10086    /// This method does not require any rights.
10087    GetConnectionInfo {
10088        responder: FileGetConnectionInfoResponder,
10089    },
10090    /// Acquires information about the node.
10091    ///
10092    /// The attributes of a node should be stable, independent of the
10093    /// specific protocol used to access it.
10094    ///
10095    /// If a particular attribute is not applicable or not supported,
10096    /// filesystems should leave the corresponding field absent.
10097    ///
10098    /// + `query` a bit-mask specifying which attributes to fetch. The server
10099    ///   should not return more than necessary.
10100    /// - `attributes` the returned attributes.
10101    ///
10102    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
10103    GetAttributes {
10104        query: NodeAttributesQuery,
10105        responder: FileGetAttributesResponder,
10106    },
10107    /// Updates information about the node.
10108    ///
10109    /// + `attributes` the presence of a table field in `attributes` indicates
10110    /// the intent to update the corresponding attribute.
10111    ///
10112    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
10113    ///
10114    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
10115    UpdateAttributes {
10116        payload: MutableNodeAttributes,
10117        responder: FileUpdateAttributesResponder,
10118    },
10119    /// Synchronizes updates to the node to the underlying media, if it exists.
10120    ///
10121    /// This method will return when the filesystem server has flushed the
10122    /// relevant updates to the underlying media, but does not guarantee the
10123    /// underlying media has persisted the information, nor that any information
10124    /// is committed to hardware. Clients may use `Sync` to ensure ordering
10125    /// between operations.
10126    ///
10127    /// This method does not require any rights.
10128    Sync {
10129        responder: FileSyncResponder,
10130    },
10131    /// Creates an iterator over all the extended attribute names associated
10132    /// with this node. If an error occurs it is returned as an epitaph on the
10133    /// iterator request channel, and then the channel is closed.
10134    ///
10135    /// GetExtendedAttributes can be used with any of these names to retrieve
10136    /// the associated value.
10137    ///
10138    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
10139    ListExtendedAttributes {
10140        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
10141        control_handle: FileControlHandle,
10142    },
10143    /// Get the value associated with the given attribute `name` for this node.
10144    ///
10145    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
10146    /// particular structure is imposed on them.
10147    ///
10148    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
10149    GetExtendedAttribute {
10150        name: Vec<u8>,
10151        responder: FileGetExtendedAttributeResponder,
10152    },
10153    /// Set the value for the given attribute `name` to `value` for this node.
10154    ///
10155    /// The attribute name may exist, in which case the attribute is updated.
10156    /// If the attribute doesn't exist, it is created. The name should have no
10157    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
10158    ///
10159    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
10160    SetExtendedAttribute {
10161        name: Vec<u8>,
10162        value: ExtendedAttributeValue,
10163        mode: SetExtendedAttributeMode,
10164        responder: FileSetExtendedAttributeResponder,
10165    },
10166    /// Remove the specified extended attribute.
10167    ///
10168    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
10169    ///
10170    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
10171    RemoveExtendedAttribute {
10172        name: Vec<u8>,
10173        responder: FileRemoveExtendedAttributeResponder,
10174    },
10175    /// Reads up to 'count' bytes at the seek offset.
10176    /// The seek offset is moved forward by the number of bytes read.
10177    ///
10178    /// ## Invariants
10179    ///
10180    /// * The returned `data.length` will never be greater than `count`.
10181    /// * If `data.length` is less than `count`, it means that the seek offset
10182    ///   has reached the end of file as part of this operation.
10183    /// * If `data.length` is zero while `count` is not, it means that the
10184    ///   seek offset is already at or beyond the end of file, and no data could
10185    ///   be read.
10186    /// * If `count` is zero, the server should perform all the checks ensuring
10187    ///   read access without actually read anything, and return an empty
10188    ///   `data` vector.
10189    ///
10190    /// This method requires the [`Rights.READ_BYTES`] right.
10191    ///
10192    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
10193    Read {
10194        count: u64,
10195        responder: FileReadResponder,
10196    },
10197    /// Writes data at the seek offset.
10198    /// The seek offset is moved forward by the number of bytes written.
10199    /// If the file is in append mode, the seek offset is first set to the end
10200    /// of the file, followed by the write, in one atomic step.
10201    ///
10202    /// The file size may grow if the seek offset plus `data.length` is beyond
10203    /// the current end of file.
10204    ///
10205    /// + request `data` the byte buffer to write to the file.
10206    /// - response `actual_count` the number of bytes written.
10207    ///
10208    /// ## Invariants
10209    ///
10210    /// * The returned `actual_count` will never be greater than `data.length`.
10211    /// * If the server is unable to write all the data due to e.g. not enough
10212    ///   space, `actual_count` may be less than `data.length`.  If no bytes
10213    ///   could be written, an error is returned.
10214    /// * If `data.length` is zero, the server should perform all the checks
10215    ///   ensuring write access without mutating the file and return a
10216    ///   successful write of zero bytes.  The seek offset is still updated if
10217    ///   in append mode.
10218    ///
10219    /// This method requires the [`Rights.WRITE_BYTES`] right.
10220    Write {
10221        data: Vec<u8>,
10222        responder: FileWriteResponder,
10223    },
10224    Describe {
10225        responder: FileDescribeResponder,
10226    },
10227    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
10228    /// will occur. The seek offset is specific to each file connection.
10229    ///
10230    /// + request `origin` the reference point where `offset` will be based on.
10231    /// + request `offset` the number of bytes to seek.
10232    /// - response `offset_from_start` the adjusted seek offset, from the start
10233    ///   of the file.
10234    ///
10235    /// This method does not require any rights.
10236    Seek {
10237        origin: SeekOrigin,
10238        offset: i64,
10239        responder: FileSeekResponder,
10240    },
10241    /// Reads up to 'count' bytes at the provided offset.
10242    /// Does not affect the seek offset.
10243    ///
10244    /// ## Invariants
10245    ///
10246    /// * The returned `data.length` will never be greater than `count`.
10247    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
10248    ///   the end of file as part of this operation.
10249    /// * If `data.length` is zero while `count` is not, it means that `offset`
10250    ///   is at or past the end of file, and no data can be read.
10251    /// * If `count` is zero, the server should perform all the checks ensuring
10252    ///   read access without actually reading anything, and return an empty
10253    ///   `data` vector.
10254    ///
10255    /// This method requires the [`Rights.READ_BYTES`] right.
10256    ///
10257    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
10258    ReadAt {
10259        count: u64,
10260        offset: u64,
10261        responder: FileReadAtResponder,
10262    },
10263    /// Writes data at the provided offset.
10264    /// Does not affect the seek offset.
10265    ///
10266    /// The file size may grow if `offset` plus `data.length` is past the
10267    /// current end of file.
10268    ///
10269    /// + request `data` the byte buffer to write to the file.
10270    /// + request `offset` the offset from start of the file to begin writing.
10271    /// - response `actual_count` the number of bytes written.
10272    ///
10273    /// ## Invariants
10274    ///
10275    /// * The returned `actual_count` will never be greater than `data.length`.
10276    /// * If the server is unable to write all the data due to e.g. not enough
10277    ///   space, `actual_count` may be less than `data.length`.  If no bytes
10278    ///   could be written, an error is returned.
10279    /// * If `data.length` is zero, the server should perform all the checks
10280    ///   ensuring write access without mutating the file, and will return a
10281    ///   successful write of zero bytes.
10282    ///
10283    /// This method requires the [`Rights.WRITE_BYTES`] right.
10284    WriteAt {
10285        data: Vec<u8>,
10286        offset: u64,
10287        responder: FileWriteAtResponder,
10288    },
10289    /// Shrinks or grows the file size to 'length' bytes.
10290    ///
10291    /// If file size is reduced by this operation, the extra trailing data'
10292    /// is discarded.
10293    /// If file size is increased by this operation, the extended area appears
10294    /// as if it was zeroed.
10295    ///
10296    /// This method requires the [`Rights.WRITE_BYTES`] right.
10297    Resize {
10298        length: u64,
10299        responder: FileResizeResponder,
10300    },
10301    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
10302    /// with the requested access rights.
10303    ///
10304    /// Implementations are not required to implement files backed by VMOs so
10305    /// this request may fail. Additionally, implementations may only support
10306    /// a certain subset of the flags. Clients should be prepared with fallback
10307    /// behavior if this request fails.
10308    ///
10309    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
10310    /// implementation is free to choose the semantics of the returned VMO.
10311    ///
10312    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
10313    /// - response `vmo` the requested [`zx.Handle:VMO`].
10314    /// * error a [`zx.Status`] value indicating the failure.
10315    ///
10316    /// This method requires the following rights:
10317    ///
10318    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
10319    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
10320    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
10321    GetBackingMemory {
10322        flags: VmoFlags,
10323        responder: FileGetBackingMemoryResponder,
10324    },
10325    /// Pre-allocate on-disk space for this file.
10326    Allocate {
10327        offset: u64,
10328        length: u64,
10329        mode: AllocateMode,
10330        responder: FileAllocateResponder,
10331    },
10332    /// Enables verification for the file (permanently) which involves computing a merkle tree for
10333    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
10334    /// captured. Future reads will be verified against the computed merkle tree and writes will be
10335    /// rejected. This method can take some time to complete as it depends on the size of the file.
10336    /// This method can be aborted by closing the connection that this method was issued on.
10337    ///
10338    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
10339    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
10340    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
10341    /// Also returns any error that might arise from reading the file, or from flushing the file,
10342    /// such as `ZX_ERR_IO`.
10343    EnableVerity {
10344        options: VerificationOptions,
10345        responder: FileEnableVerityResponder,
10346    },
10347    /// An interaction was received which does not match any known method.
10348    #[non_exhaustive]
10349    _UnknownMethod {
10350        /// Ordinal of the method that was called.
10351        ordinal: u64,
10352        control_handle: FileControlHandle,
10353        method_type: fidl::MethodType,
10354    },
10355}
10356
10357impl FileRequest {
10358    #[allow(irrefutable_let_patterns)]
10359    pub fn into_advisory_lock(self) -> Option<(AdvisoryLockRequest, FileAdvisoryLockResponder)> {
10360        if let FileRequest::AdvisoryLock { request, responder } = self {
10361            Some((request, responder))
10362        } else {
10363            None
10364        }
10365    }
10366
10367    #[allow(irrefutable_let_patterns)]
10368    pub fn into_link_into(self) -> Option<(fidl::Event, String, FileLinkIntoResponder)> {
10369        if let FileRequest::LinkInto { dst_parent_token, dst, responder } = self {
10370            Some((dst_parent_token, dst, responder))
10371        } else {
10372            None
10373        }
10374    }
10375
10376    #[allow(irrefutable_let_patterns)]
10377    pub fn into_clone(
10378        self,
10379    ) -> Option<(
10380        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10381        FileControlHandle,
10382    )> {
10383        if let FileRequest::Clone { request, control_handle } = self {
10384            Some((request, control_handle))
10385        } else {
10386            None
10387        }
10388    }
10389
10390    #[allow(irrefutable_let_patterns)]
10391    pub fn into_close(self) -> Option<(FileCloseResponder)> {
10392        if let FileRequest::Close { responder } = self {
10393            Some((responder))
10394        } else {
10395            None
10396        }
10397    }
10398
10399    #[allow(irrefutable_let_patterns)]
10400    pub fn into_query(self) -> Option<(FileQueryResponder)> {
10401        if let FileRequest::Query { responder } = self {
10402            Some((responder))
10403        } else {
10404            None
10405        }
10406    }
10407
10408    #[allow(irrefutable_let_patterns)]
10409    pub fn into_deprecated_clone(
10410        self,
10411    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, FileControlHandle)> {
10412        if let FileRequest::DeprecatedClone { flags, object, control_handle } = self {
10413            Some((flags, object, control_handle))
10414        } else {
10415            None
10416        }
10417    }
10418
10419    #[allow(irrefutable_let_patterns)]
10420    pub fn into_get_attr(self) -> Option<(FileGetAttrResponder)> {
10421        if let FileRequest::GetAttr { responder } = self {
10422            Some((responder))
10423        } else {
10424            None
10425        }
10426    }
10427
10428    #[allow(irrefutable_let_patterns)]
10429    pub fn into_set_attr(
10430        self,
10431    ) -> Option<(NodeAttributeFlags, NodeAttributes, FileSetAttrResponder)> {
10432        if let FileRequest::SetAttr { flags, attributes, responder } = self {
10433            Some((flags, attributes, responder))
10434        } else {
10435            None
10436        }
10437    }
10438
10439    #[allow(irrefutable_let_patterns)]
10440    pub fn into_deprecated_get_flags(self) -> Option<(FileDeprecatedGetFlagsResponder)> {
10441        if let FileRequest::DeprecatedGetFlags { responder } = self {
10442            Some((responder))
10443        } else {
10444            None
10445        }
10446    }
10447
10448    #[allow(irrefutable_let_patterns)]
10449    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, FileDeprecatedSetFlagsResponder)> {
10450        if let FileRequest::DeprecatedSetFlags { flags, responder } = self {
10451            Some((flags, responder))
10452        } else {
10453            None
10454        }
10455    }
10456
10457    #[allow(irrefutable_let_patterns)]
10458    pub fn into_get_flags(self) -> Option<(FileGetFlagsResponder)> {
10459        if let FileRequest::GetFlags { responder } = self {
10460            Some((responder))
10461        } else {
10462            None
10463        }
10464    }
10465
10466    #[allow(irrefutable_let_patterns)]
10467    pub fn into_set_flags(self) -> Option<(Flags, FileSetFlagsResponder)> {
10468        if let FileRequest::SetFlags { flags, responder } = self {
10469            Some((flags, responder))
10470        } else {
10471            None
10472        }
10473    }
10474
10475    #[allow(irrefutable_let_patterns)]
10476    pub fn into_query_filesystem(self) -> Option<(FileQueryFilesystemResponder)> {
10477        if let FileRequest::QueryFilesystem { responder } = self {
10478            Some((responder))
10479        } else {
10480            None
10481        }
10482    }
10483
10484    #[allow(irrefutable_let_patterns)]
10485    pub fn into_get_connection_info(self) -> Option<(FileGetConnectionInfoResponder)> {
10486        if let FileRequest::GetConnectionInfo { responder } = self {
10487            Some((responder))
10488        } else {
10489            None
10490        }
10491    }
10492
10493    #[allow(irrefutable_let_patterns)]
10494    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, FileGetAttributesResponder)> {
10495        if let FileRequest::GetAttributes { query, responder } = self {
10496            Some((query, responder))
10497        } else {
10498            None
10499        }
10500    }
10501
10502    #[allow(irrefutable_let_patterns)]
10503    pub fn into_update_attributes(
10504        self,
10505    ) -> Option<(MutableNodeAttributes, FileUpdateAttributesResponder)> {
10506        if let FileRequest::UpdateAttributes { payload, responder } = self {
10507            Some((payload, responder))
10508        } else {
10509            None
10510        }
10511    }
10512
10513    #[allow(irrefutable_let_patterns)]
10514    pub fn into_sync(self) -> Option<(FileSyncResponder)> {
10515        if let FileRequest::Sync { responder } = self {
10516            Some((responder))
10517        } else {
10518            None
10519        }
10520    }
10521
10522    #[allow(irrefutable_let_patterns)]
10523    pub fn into_list_extended_attributes(
10524        self,
10525    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, FileControlHandle)>
10526    {
10527        if let FileRequest::ListExtendedAttributes { iterator, control_handle } = self {
10528            Some((iterator, control_handle))
10529        } else {
10530            None
10531        }
10532    }
10533
10534    #[allow(irrefutable_let_patterns)]
10535    pub fn into_get_extended_attribute(
10536        self,
10537    ) -> Option<(Vec<u8>, FileGetExtendedAttributeResponder)> {
10538        if let FileRequest::GetExtendedAttribute { name, responder } = self {
10539            Some((name, responder))
10540        } else {
10541            None
10542        }
10543    }
10544
10545    #[allow(irrefutable_let_patterns)]
10546    pub fn into_set_extended_attribute(
10547        self,
10548    ) -> Option<(
10549        Vec<u8>,
10550        ExtendedAttributeValue,
10551        SetExtendedAttributeMode,
10552        FileSetExtendedAttributeResponder,
10553    )> {
10554        if let FileRequest::SetExtendedAttribute { name, value, mode, responder } = self {
10555            Some((name, value, mode, responder))
10556        } else {
10557            None
10558        }
10559    }
10560
10561    #[allow(irrefutable_let_patterns)]
10562    pub fn into_remove_extended_attribute(
10563        self,
10564    ) -> Option<(Vec<u8>, FileRemoveExtendedAttributeResponder)> {
10565        if let FileRequest::RemoveExtendedAttribute { name, responder } = self {
10566            Some((name, responder))
10567        } else {
10568            None
10569        }
10570    }
10571
10572    #[allow(irrefutable_let_patterns)]
10573    pub fn into_read(self) -> Option<(u64, FileReadResponder)> {
10574        if let FileRequest::Read { count, responder } = self {
10575            Some((count, responder))
10576        } else {
10577            None
10578        }
10579    }
10580
10581    #[allow(irrefutable_let_patterns)]
10582    pub fn into_write(self) -> Option<(Vec<u8>, FileWriteResponder)> {
10583        if let FileRequest::Write { data, responder } = self {
10584            Some((data, responder))
10585        } else {
10586            None
10587        }
10588    }
10589
10590    #[allow(irrefutable_let_patterns)]
10591    pub fn into_describe(self) -> Option<(FileDescribeResponder)> {
10592        if let FileRequest::Describe { responder } = self {
10593            Some((responder))
10594        } else {
10595            None
10596        }
10597    }
10598
10599    #[allow(irrefutable_let_patterns)]
10600    pub fn into_seek(self) -> Option<(SeekOrigin, i64, FileSeekResponder)> {
10601        if let FileRequest::Seek { origin, offset, responder } = self {
10602            Some((origin, offset, responder))
10603        } else {
10604            None
10605        }
10606    }
10607
10608    #[allow(irrefutable_let_patterns)]
10609    pub fn into_read_at(self) -> Option<(u64, u64, FileReadAtResponder)> {
10610        if let FileRequest::ReadAt { count, offset, responder } = self {
10611            Some((count, offset, responder))
10612        } else {
10613            None
10614        }
10615    }
10616
10617    #[allow(irrefutable_let_patterns)]
10618    pub fn into_write_at(self) -> Option<(Vec<u8>, u64, FileWriteAtResponder)> {
10619        if let FileRequest::WriteAt { data, offset, responder } = self {
10620            Some((data, offset, responder))
10621        } else {
10622            None
10623        }
10624    }
10625
10626    #[allow(irrefutable_let_patterns)]
10627    pub fn into_resize(self) -> Option<(u64, FileResizeResponder)> {
10628        if let FileRequest::Resize { length, responder } = self {
10629            Some((length, responder))
10630        } else {
10631            None
10632        }
10633    }
10634
10635    #[allow(irrefutable_let_patterns)]
10636    pub fn into_get_backing_memory(self) -> Option<(VmoFlags, FileGetBackingMemoryResponder)> {
10637        if let FileRequest::GetBackingMemory { flags, responder } = self {
10638            Some((flags, responder))
10639        } else {
10640            None
10641        }
10642    }
10643
10644    #[allow(irrefutable_let_patterns)]
10645    pub fn into_allocate(self) -> Option<(u64, u64, AllocateMode, FileAllocateResponder)> {
10646        if let FileRequest::Allocate { offset, length, mode, responder } = self {
10647            Some((offset, length, mode, responder))
10648        } else {
10649            None
10650        }
10651    }
10652
10653    #[allow(irrefutable_let_patterns)]
10654    pub fn into_enable_verity(self) -> Option<(VerificationOptions, FileEnableVerityResponder)> {
10655        if let FileRequest::EnableVerity { options, responder } = self {
10656            Some((options, responder))
10657        } else {
10658            None
10659        }
10660    }
10661
10662    /// Name of the method defined in FIDL
10663    pub fn method_name(&self) -> &'static str {
10664        match *self {
10665            FileRequest::AdvisoryLock { .. } => "advisory_lock",
10666            FileRequest::LinkInto { .. } => "link_into",
10667            FileRequest::Clone { .. } => "clone",
10668            FileRequest::Close { .. } => "close",
10669            FileRequest::Query { .. } => "query",
10670            FileRequest::DeprecatedClone { .. } => "deprecated_clone",
10671            FileRequest::GetAttr { .. } => "get_attr",
10672            FileRequest::SetAttr { .. } => "set_attr",
10673            FileRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
10674            FileRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
10675            FileRequest::GetFlags { .. } => "get_flags",
10676            FileRequest::SetFlags { .. } => "set_flags",
10677            FileRequest::QueryFilesystem { .. } => "query_filesystem",
10678            FileRequest::GetConnectionInfo { .. } => "get_connection_info",
10679            FileRequest::GetAttributes { .. } => "get_attributes",
10680            FileRequest::UpdateAttributes { .. } => "update_attributes",
10681            FileRequest::Sync { .. } => "sync",
10682            FileRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
10683            FileRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
10684            FileRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
10685            FileRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
10686            FileRequest::Read { .. } => "read",
10687            FileRequest::Write { .. } => "write",
10688            FileRequest::Describe { .. } => "describe",
10689            FileRequest::Seek { .. } => "seek",
10690            FileRequest::ReadAt { .. } => "read_at",
10691            FileRequest::WriteAt { .. } => "write_at",
10692            FileRequest::Resize { .. } => "resize",
10693            FileRequest::GetBackingMemory { .. } => "get_backing_memory",
10694            FileRequest::Allocate { .. } => "allocate",
10695            FileRequest::EnableVerity { .. } => "enable_verity",
10696            FileRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10697                "unknown one-way method"
10698            }
10699            FileRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10700                "unknown two-way method"
10701            }
10702        }
10703    }
10704}
10705
10706#[derive(Debug, Clone)]
10707pub struct FileControlHandle {
10708    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10709}
10710
10711impl fidl::endpoints::ControlHandle for FileControlHandle {
10712    fn shutdown(&self) {
10713        self.inner.shutdown()
10714    }
10715    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10716        self.inner.shutdown_with_epitaph(status)
10717    }
10718
10719    fn is_closed(&self) -> bool {
10720        self.inner.channel().is_closed()
10721    }
10722    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10723        self.inner.channel().on_closed()
10724    }
10725
10726    #[cfg(target_os = "fuchsia")]
10727    fn signal_peer(
10728        &self,
10729        clear_mask: zx::Signals,
10730        set_mask: zx::Signals,
10731    ) -> Result<(), zx_status::Status> {
10732        use fidl::Peered;
10733        self.inner.channel().signal_peer(clear_mask, set_mask)
10734    }
10735}
10736
10737impl FileControlHandle {
10738    pub fn send_on_open_(
10739        &self,
10740        mut s: i32,
10741        mut info: Option<NodeInfoDeprecated>,
10742    ) -> Result<(), fidl::Error> {
10743        self.inner.send::<NodeOnOpenRequest>(
10744            (s, info.as_mut()),
10745            0,
10746            0x7fc7bbb1dbfd1972,
10747            fidl::encoding::DynamicFlags::empty(),
10748        )
10749    }
10750
10751    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
10752        self.inner.send::<Representation>(
10753            &mut payload,
10754            0,
10755            0x5cb40567d80a510c,
10756            fidl::encoding::DynamicFlags::empty(),
10757        )
10758    }
10759}
10760
10761#[must_use = "FIDL methods require a response to be sent"]
10762#[derive(Debug)]
10763pub struct FileAdvisoryLockResponder {
10764    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10765    tx_id: u32,
10766}
10767
10768/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10769/// if the responder is dropped without sending a response, so that the client
10770/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10771impl std::ops::Drop for FileAdvisoryLockResponder {
10772    fn drop(&mut self) {
10773        self.control_handle.shutdown();
10774        // Safety: drops once, never accessed again
10775        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10776    }
10777}
10778
10779impl fidl::endpoints::Responder for FileAdvisoryLockResponder {
10780    type ControlHandle = FileControlHandle;
10781
10782    fn control_handle(&self) -> &FileControlHandle {
10783        &self.control_handle
10784    }
10785
10786    fn drop_without_shutdown(mut self) {
10787        // Safety: drops once, never accessed again due to mem::forget
10788        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10789        // Prevent Drop from running (which would shut down the channel)
10790        std::mem::forget(self);
10791    }
10792}
10793
10794impl FileAdvisoryLockResponder {
10795    /// Sends a response to the FIDL transaction.
10796    ///
10797    /// Sets the channel to shutdown if an error occurs.
10798    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10799        let _result = self.send_raw(result);
10800        if _result.is_err() {
10801            self.control_handle.shutdown();
10802        }
10803        self.drop_without_shutdown();
10804        _result
10805    }
10806
10807    /// Similar to "send" but does not shutdown the channel if an error occurs.
10808    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10809        let _result = self.send_raw(result);
10810        self.drop_without_shutdown();
10811        _result
10812    }
10813
10814    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10815        self.control_handle
10816            .inner
10817            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10818                result,
10819                self.tx_id,
10820                0x6ee9c0ad53ec87aa,
10821                fidl::encoding::DynamicFlags::empty(),
10822            )
10823    }
10824}
10825
10826#[must_use = "FIDL methods require a response to be sent"]
10827#[derive(Debug)]
10828pub struct FileLinkIntoResponder {
10829    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10830    tx_id: u32,
10831}
10832
10833/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10834/// if the responder is dropped without sending a response, so that the client
10835/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10836impl std::ops::Drop for FileLinkIntoResponder {
10837    fn drop(&mut self) {
10838        self.control_handle.shutdown();
10839        // Safety: drops once, never accessed again
10840        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10841    }
10842}
10843
10844impl fidl::endpoints::Responder for FileLinkIntoResponder {
10845    type ControlHandle = FileControlHandle;
10846
10847    fn control_handle(&self) -> &FileControlHandle {
10848        &self.control_handle
10849    }
10850
10851    fn drop_without_shutdown(mut self) {
10852        // Safety: drops once, never accessed again due to mem::forget
10853        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10854        // Prevent Drop from running (which would shut down the channel)
10855        std::mem::forget(self);
10856    }
10857}
10858
10859impl FileLinkIntoResponder {
10860    /// Sends a response to the FIDL transaction.
10861    ///
10862    /// Sets the channel to shutdown if an error occurs.
10863    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10864        let _result = self.send_raw(result);
10865        if _result.is_err() {
10866            self.control_handle.shutdown();
10867        }
10868        self.drop_without_shutdown();
10869        _result
10870    }
10871
10872    /// Similar to "send" but does not shutdown the channel if an error occurs.
10873    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10874        let _result = self.send_raw(result);
10875        self.drop_without_shutdown();
10876        _result
10877    }
10878
10879    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10880        self.control_handle
10881            .inner
10882            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10883                result,
10884                self.tx_id,
10885                0x54f3949246a03e74,
10886                fidl::encoding::DynamicFlags::empty(),
10887            )
10888    }
10889}
10890
10891#[must_use = "FIDL methods require a response to be sent"]
10892#[derive(Debug)]
10893pub struct FileCloseResponder {
10894    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10895    tx_id: u32,
10896}
10897
10898/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10899/// if the responder is dropped without sending a response, so that the client
10900/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10901impl std::ops::Drop for FileCloseResponder {
10902    fn drop(&mut self) {
10903        self.control_handle.shutdown();
10904        // Safety: drops once, never accessed again
10905        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10906    }
10907}
10908
10909impl fidl::endpoints::Responder for FileCloseResponder {
10910    type ControlHandle = FileControlHandle;
10911
10912    fn control_handle(&self) -> &FileControlHandle {
10913        &self.control_handle
10914    }
10915
10916    fn drop_without_shutdown(mut self) {
10917        // Safety: drops once, never accessed again due to mem::forget
10918        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10919        // Prevent Drop from running (which would shut down the channel)
10920        std::mem::forget(self);
10921    }
10922}
10923
10924impl FileCloseResponder {
10925    /// Sends a response to the FIDL transaction.
10926    ///
10927    /// Sets the channel to shutdown if an error occurs.
10928    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10929        let _result = self.send_raw(result);
10930        if _result.is_err() {
10931            self.control_handle.shutdown();
10932        }
10933        self.drop_without_shutdown();
10934        _result
10935    }
10936
10937    /// Similar to "send" but does not shutdown the channel if an error occurs.
10938    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10939        let _result = self.send_raw(result);
10940        self.drop_without_shutdown();
10941        _result
10942    }
10943
10944    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10945        self.control_handle
10946            .inner
10947            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10948                result,
10949                self.tx_id,
10950                0x5ac5d459ad7f657e,
10951                fidl::encoding::DynamicFlags::empty(),
10952            )
10953    }
10954}
10955
10956#[must_use = "FIDL methods require a response to be sent"]
10957#[derive(Debug)]
10958pub struct FileQueryResponder {
10959    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10960    tx_id: u32,
10961}
10962
10963/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10964/// if the responder is dropped without sending a response, so that the client
10965/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10966impl std::ops::Drop for FileQueryResponder {
10967    fn drop(&mut self) {
10968        self.control_handle.shutdown();
10969        // Safety: drops once, never accessed again
10970        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10971    }
10972}
10973
10974impl fidl::endpoints::Responder for FileQueryResponder {
10975    type ControlHandle = FileControlHandle;
10976
10977    fn control_handle(&self) -> &FileControlHandle {
10978        &self.control_handle
10979    }
10980
10981    fn drop_without_shutdown(mut self) {
10982        // Safety: drops once, never accessed again due to mem::forget
10983        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10984        // Prevent Drop from running (which would shut down the channel)
10985        std::mem::forget(self);
10986    }
10987}
10988
10989impl FileQueryResponder {
10990    /// Sends a response to the FIDL transaction.
10991    ///
10992    /// Sets the channel to shutdown if an error occurs.
10993    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10994        let _result = self.send_raw(protocol);
10995        if _result.is_err() {
10996            self.control_handle.shutdown();
10997        }
10998        self.drop_without_shutdown();
10999        _result
11000    }
11001
11002    /// Similar to "send" but does not shutdown the channel if an error occurs.
11003    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
11004        let _result = self.send_raw(protocol);
11005        self.drop_without_shutdown();
11006        _result
11007    }
11008
11009    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
11010        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
11011            (protocol,),
11012            self.tx_id,
11013            0x2658edee9decfc06,
11014            fidl::encoding::DynamicFlags::empty(),
11015        )
11016    }
11017}
11018
11019#[must_use = "FIDL methods require a response to be sent"]
11020#[derive(Debug)]
11021pub struct FileGetAttrResponder {
11022    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11023    tx_id: u32,
11024}
11025
11026/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11027/// if the responder is dropped without sending a response, so that the client
11028/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11029impl std::ops::Drop for FileGetAttrResponder {
11030    fn drop(&mut self) {
11031        self.control_handle.shutdown();
11032        // Safety: drops once, never accessed again
11033        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11034    }
11035}
11036
11037impl fidl::endpoints::Responder for FileGetAttrResponder {
11038    type ControlHandle = FileControlHandle;
11039
11040    fn control_handle(&self) -> &FileControlHandle {
11041        &self.control_handle
11042    }
11043
11044    fn drop_without_shutdown(mut self) {
11045        // Safety: drops once, never accessed again due to mem::forget
11046        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11047        // Prevent Drop from running (which would shut down the channel)
11048        std::mem::forget(self);
11049    }
11050}
11051
11052impl FileGetAttrResponder {
11053    /// Sends a response to the FIDL transaction.
11054    ///
11055    /// Sets the channel to shutdown if an error occurs.
11056    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
11057        let _result = self.send_raw(s, attributes);
11058        if _result.is_err() {
11059            self.control_handle.shutdown();
11060        }
11061        self.drop_without_shutdown();
11062        _result
11063    }
11064
11065    /// Similar to "send" but does not shutdown the channel if an error occurs.
11066    pub fn send_no_shutdown_on_err(
11067        self,
11068        mut s: i32,
11069        mut attributes: &NodeAttributes,
11070    ) -> Result<(), fidl::Error> {
11071        let _result = self.send_raw(s, attributes);
11072        self.drop_without_shutdown();
11073        _result
11074    }
11075
11076    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
11077        self.control_handle.inner.send::<NodeGetAttrResponse>(
11078            (s, attributes),
11079            self.tx_id,
11080            0x78985e216314dafd,
11081            fidl::encoding::DynamicFlags::empty(),
11082        )
11083    }
11084}
11085
11086#[must_use = "FIDL methods require a response to be sent"]
11087#[derive(Debug)]
11088pub struct FileSetAttrResponder {
11089    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11090    tx_id: u32,
11091}
11092
11093/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11094/// if the responder is dropped without sending a response, so that the client
11095/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11096impl std::ops::Drop for FileSetAttrResponder {
11097    fn drop(&mut self) {
11098        self.control_handle.shutdown();
11099        // Safety: drops once, never accessed again
11100        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11101    }
11102}
11103
11104impl fidl::endpoints::Responder for FileSetAttrResponder {
11105    type ControlHandle = FileControlHandle;
11106
11107    fn control_handle(&self) -> &FileControlHandle {
11108        &self.control_handle
11109    }
11110
11111    fn drop_without_shutdown(mut self) {
11112        // Safety: drops once, never accessed again due to mem::forget
11113        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11114        // Prevent Drop from running (which would shut down the channel)
11115        std::mem::forget(self);
11116    }
11117}
11118
11119impl FileSetAttrResponder {
11120    /// Sends a response to the FIDL transaction.
11121    ///
11122    /// Sets the channel to shutdown if an error occurs.
11123    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
11124        let _result = self.send_raw(s);
11125        if _result.is_err() {
11126            self.control_handle.shutdown();
11127        }
11128        self.drop_without_shutdown();
11129        _result
11130    }
11131
11132    /// Similar to "send" but does not shutdown the channel if an error occurs.
11133    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
11134        let _result = self.send_raw(s);
11135        self.drop_without_shutdown();
11136        _result
11137    }
11138
11139    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
11140        self.control_handle.inner.send::<NodeSetAttrResponse>(
11141            (s,),
11142            self.tx_id,
11143            0x4186c0f40d938f46,
11144            fidl::encoding::DynamicFlags::empty(),
11145        )
11146    }
11147}
11148
11149#[must_use = "FIDL methods require a response to be sent"]
11150#[derive(Debug)]
11151pub struct FileDeprecatedGetFlagsResponder {
11152    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11153    tx_id: u32,
11154}
11155
11156/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11157/// if the responder is dropped without sending a response, so that the client
11158/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11159impl std::ops::Drop for FileDeprecatedGetFlagsResponder {
11160    fn drop(&mut self) {
11161        self.control_handle.shutdown();
11162        // Safety: drops once, never accessed again
11163        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11164    }
11165}
11166
11167impl fidl::endpoints::Responder for FileDeprecatedGetFlagsResponder {
11168    type ControlHandle = FileControlHandle;
11169
11170    fn control_handle(&self) -> &FileControlHandle {
11171        &self.control_handle
11172    }
11173
11174    fn drop_without_shutdown(mut self) {
11175        // Safety: drops once, never accessed again due to mem::forget
11176        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11177        // Prevent Drop from running (which would shut down the channel)
11178        std::mem::forget(self);
11179    }
11180}
11181
11182impl FileDeprecatedGetFlagsResponder {
11183    /// Sends a response to the FIDL transaction.
11184    ///
11185    /// Sets the channel to shutdown if an error occurs.
11186    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
11187        let _result = self.send_raw(s, flags);
11188        if _result.is_err() {
11189            self.control_handle.shutdown();
11190        }
11191        self.drop_without_shutdown();
11192        _result
11193    }
11194
11195    /// Similar to "send" but does not shutdown the channel if an error occurs.
11196    pub fn send_no_shutdown_on_err(
11197        self,
11198        mut s: i32,
11199        mut flags: OpenFlags,
11200    ) -> Result<(), fidl::Error> {
11201        let _result = self.send_raw(s, flags);
11202        self.drop_without_shutdown();
11203        _result
11204    }
11205
11206    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
11207        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
11208            (s, flags),
11209            self.tx_id,
11210            0x5b88fffb8eda3aa1,
11211            fidl::encoding::DynamicFlags::empty(),
11212        )
11213    }
11214}
11215
11216#[must_use = "FIDL methods require a response to be sent"]
11217#[derive(Debug)]
11218pub struct FileDeprecatedSetFlagsResponder {
11219    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11220    tx_id: u32,
11221}
11222
11223/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11224/// if the responder is dropped without sending a response, so that the client
11225/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11226impl std::ops::Drop for FileDeprecatedSetFlagsResponder {
11227    fn drop(&mut self) {
11228        self.control_handle.shutdown();
11229        // Safety: drops once, never accessed again
11230        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11231    }
11232}
11233
11234impl fidl::endpoints::Responder for FileDeprecatedSetFlagsResponder {
11235    type ControlHandle = FileControlHandle;
11236
11237    fn control_handle(&self) -> &FileControlHandle {
11238        &self.control_handle
11239    }
11240
11241    fn drop_without_shutdown(mut self) {
11242        // Safety: drops once, never accessed again due to mem::forget
11243        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11244        // Prevent Drop from running (which would shut down the channel)
11245        std::mem::forget(self);
11246    }
11247}
11248
11249impl FileDeprecatedSetFlagsResponder {
11250    /// Sends a response to the FIDL transaction.
11251    ///
11252    /// Sets the channel to shutdown if an error occurs.
11253    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
11254        let _result = self.send_raw(s);
11255        if _result.is_err() {
11256            self.control_handle.shutdown();
11257        }
11258        self.drop_without_shutdown();
11259        _result
11260    }
11261
11262    /// Similar to "send" but does not shutdown the channel if an error occurs.
11263    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
11264        let _result = self.send_raw(s);
11265        self.drop_without_shutdown();
11266        _result
11267    }
11268
11269    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
11270        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
11271            (s,),
11272            self.tx_id,
11273            0x5295b76c71fde733,
11274            fidl::encoding::DynamicFlags::empty(),
11275        )
11276    }
11277}
11278
11279#[must_use = "FIDL methods require a response to be sent"]
11280#[derive(Debug)]
11281pub struct FileGetFlagsResponder {
11282    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11283    tx_id: u32,
11284}
11285
11286/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11287/// if the responder is dropped without sending a response, so that the client
11288/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11289impl std::ops::Drop for FileGetFlagsResponder {
11290    fn drop(&mut self) {
11291        self.control_handle.shutdown();
11292        // Safety: drops once, never accessed again
11293        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11294    }
11295}
11296
11297impl fidl::endpoints::Responder for FileGetFlagsResponder {
11298    type ControlHandle = FileControlHandle;
11299
11300    fn control_handle(&self) -> &FileControlHandle {
11301        &self.control_handle
11302    }
11303
11304    fn drop_without_shutdown(mut self) {
11305        // Safety: drops once, never accessed again due to mem::forget
11306        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11307        // Prevent Drop from running (which would shut down the channel)
11308        std::mem::forget(self);
11309    }
11310}
11311
11312impl FileGetFlagsResponder {
11313    /// Sends a response to the FIDL transaction.
11314    ///
11315    /// Sets the channel to shutdown if an error occurs.
11316    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11317        let _result = self.send_raw(result);
11318        if _result.is_err() {
11319            self.control_handle.shutdown();
11320        }
11321        self.drop_without_shutdown();
11322        _result
11323    }
11324
11325    /// Similar to "send" but does not shutdown the channel if an error occurs.
11326    pub fn send_no_shutdown_on_err(
11327        self,
11328        mut result: Result<Flags, i32>,
11329    ) -> Result<(), fidl::Error> {
11330        let _result = self.send_raw(result);
11331        self.drop_without_shutdown();
11332        _result
11333    }
11334
11335    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11336        self.control_handle
11337            .inner
11338            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
11339                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
11340                self.tx_id,
11341                0x176eb318f64ec23,
11342                fidl::encoding::DynamicFlags::FLEXIBLE,
11343            )
11344    }
11345}
11346
11347#[must_use = "FIDL methods require a response to be sent"]
11348#[derive(Debug)]
11349pub struct FileSetFlagsResponder {
11350    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11351    tx_id: u32,
11352}
11353
11354/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11355/// if the responder is dropped without sending a response, so that the client
11356/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11357impl std::ops::Drop for FileSetFlagsResponder {
11358    fn drop(&mut self) {
11359        self.control_handle.shutdown();
11360        // Safety: drops once, never accessed again
11361        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11362    }
11363}
11364
11365impl fidl::endpoints::Responder for FileSetFlagsResponder {
11366    type ControlHandle = FileControlHandle;
11367
11368    fn control_handle(&self) -> &FileControlHandle {
11369        &self.control_handle
11370    }
11371
11372    fn drop_without_shutdown(mut self) {
11373        // Safety: drops once, never accessed again due to mem::forget
11374        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11375        // Prevent Drop from running (which would shut down the channel)
11376        std::mem::forget(self);
11377    }
11378}
11379
11380impl FileSetFlagsResponder {
11381    /// Sends a response to the FIDL transaction.
11382    ///
11383    /// Sets the channel to shutdown if an error occurs.
11384    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11385        let _result = self.send_raw(result);
11386        if _result.is_err() {
11387            self.control_handle.shutdown();
11388        }
11389        self.drop_without_shutdown();
11390        _result
11391    }
11392
11393    /// Similar to "send" but does not shutdown the channel if an error occurs.
11394    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11395        let _result = self.send_raw(result);
11396        self.drop_without_shutdown();
11397        _result
11398    }
11399
11400    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11401        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11402            fidl::encoding::EmptyStruct,
11403            i32,
11404        >>(
11405            fidl::encoding::FlexibleResult::new(result),
11406            self.tx_id,
11407            0x55a8028685791ea8,
11408            fidl::encoding::DynamicFlags::FLEXIBLE,
11409        )
11410    }
11411}
11412
11413#[must_use = "FIDL methods require a response to be sent"]
11414#[derive(Debug)]
11415pub struct FileQueryFilesystemResponder {
11416    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11417    tx_id: u32,
11418}
11419
11420/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11421/// if the responder is dropped without sending a response, so that the client
11422/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11423impl std::ops::Drop for FileQueryFilesystemResponder {
11424    fn drop(&mut self) {
11425        self.control_handle.shutdown();
11426        // Safety: drops once, never accessed again
11427        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11428    }
11429}
11430
11431impl fidl::endpoints::Responder for FileQueryFilesystemResponder {
11432    type ControlHandle = FileControlHandle;
11433
11434    fn control_handle(&self) -> &FileControlHandle {
11435        &self.control_handle
11436    }
11437
11438    fn drop_without_shutdown(mut self) {
11439        // Safety: drops once, never accessed again due to mem::forget
11440        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11441        // Prevent Drop from running (which would shut down the channel)
11442        std::mem::forget(self);
11443    }
11444}
11445
11446impl FileQueryFilesystemResponder {
11447    /// Sends a response to the FIDL transaction.
11448    ///
11449    /// Sets the channel to shutdown if an error occurs.
11450    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11451        let _result = self.send_raw(s, info);
11452        if _result.is_err() {
11453            self.control_handle.shutdown();
11454        }
11455        self.drop_without_shutdown();
11456        _result
11457    }
11458
11459    /// Similar to "send" but does not shutdown the channel if an error occurs.
11460    pub fn send_no_shutdown_on_err(
11461        self,
11462        mut s: i32,
11463        mut info: Option<&FilesystemInfo>,
11464    ) -> Result<(), fidl::Error> {
11465        let _result = self.send_raw(s, info);
11466        self.drop_without_shutdown();
11467        _result
11468    }
11469
11470    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11471        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
11472            (s, info),
11473            self.tx_id,
11474            0x6f344a1c6b0a0610,
11475            fidl::encoding::DynamicFlags::empty(),
11476        )
11477    }
11478}
11479
11480#[must_use = "FIDL methods require a response to be sent"]
11481#[derive(Debug)]
11482pub struct FileGetConnectionInfoResponder {
11483    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11484    tx_id: u32,
11485}
11486
11487/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11488/// if the responder is dropped without sending a response, so that the client
11489/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11490impl std::ops::Drop for FileGetConnectionInfoResponder {
11491    fn drop(&mut self) {
11492        self.control_handle.shutdown();
11493        // Safety: drops once, never accessed again
11494        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11495    }
11496}
11497
11498impl fidl::endpoints::Responder for FileGetConnectionInfoResponder {
11499    type ControlHandle = FileControlHandle;
11500
11501    fn control_handle(&self) -> &FileControlHandle {
11502        &self.control_handle
11503    }
11504
11505    fn drop_without_shutdown(mut self) {
11506        // Safety: drops once, never accessed again due to mem::forget
11507        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11508        // Prevent Drop from running (which would shut down the channel)
11509        std::mem::forget(self);
11510    }
11511}
11512
11513impl FileGetConnectionInfoResponder {
11514    /// Sends a response to the FIDL transaction.
11515    ///
11516    /// Sets the channel to shutdown if an error occurs.
11517    pub fn send(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
11518        let _result = self.send_raw(payload);
11519        if _result.is_err() {
11520            self.control_handle.shutdown();
11521        }
11522        self.drop_without_shutdown();
11523        _result
11524    }
11525
11526    /// Similar to "send" but does not shutdown the channel if an error occurs.
11527    pub fn send_no_shutdown_on_err(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
11528        let _result = self.send_raw(payload);
11529        self.drop_without_shutdown();
11530        _result
11531    }
11532
11533    fn send_raw(&self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
11534        self.control_handle.inner.send::<ConnectionInfo>(
11535            &mut payload,
11536            self.tx_id,
11537            0x584c377c7c0a6d0b,
11538            fidl::encoding::DynamicFlags::empty(),
11539        )
11540    }
11541}
11542
11543#[must_use = "FIDL methods require a response to be sent"]
11544#[derive(Debug)]
11545pub struct FileGetAttributesResponder {
11546    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11547    tx_id: u32,
11548}
11549
11550/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11551/// if the responder is dropped without sending a response, so that the client
11552/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11553impl std::ops::Drop for FileGetAttributesResponder {
11554    fn drop(&mut self) {
11555        self.control_handle.shutdown();
11556        // Safety: drops once, never accessed again
11557        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11558    }
11559}
11560
11561impl fidl::endpoints::Responder for FileGetAttributesResponder {
11562    type ControlHandle = FileControlHandle;
11563
11564    fn control_handle(&self) -> &FileControlHandle {
11565        &self.control_handle
11566    }
11567
11568    fn drop_without_shutdown(mut self) {
11569        // Safety: drops once, never accessed again due to mem::forget
11570        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11571        // Prevent Drop from running (which would shut down the channel)
11572        std::mem::forget(self);
11573    }
11574}
11575
11576impl FileGetAttributesResponder {
11577    /// Sends a response to the FIDL transaction.
11578    ///
11579    /// Sets the channel to shutdown if an error occurs.
11580    pub fn send(
11581        self,
11582        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11583    ) -> Result<(), fidl::Error> {
11584        let _result = self.send_raw(result);
11585        if _result.is_err() {
11586            self.control_handle.shutdown();
11587        }
11588        self.drop_without_shutdown();
11589        _result
11590    }
11591
11592    /// Similar to "send" but does not shutdown the channel if an error occurs.
11593    pub fn send_no_shutdown_on_err(
11594        self,
11595        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11596    ) -> Result<(), fidl::Error> {
11597        let _result = self.send_raw(result);
11598        self.drop_without_shutdown();
11599        _result
11600    }
11601
11602    fn send_raw(
11603        &self,
11604        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11605    ) -> Result<(), fidl::Error> {
11606        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
11607            result,
11608            self.tx_id,
11609            0x3d4396a638ea053b,
11610            fidl::encoding::DynamicFlags::empty(),
11611        )
11612    }
11613}
11614
11615#[must_use = "FIDL methods require a response to be sent"]
11616#[derive(Debug)]
11617pub struct FileUpdateAttributesResponder {
11618    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11619    tx_id: u32,
11620}
11621
11622/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11623/// if the responder is dropped without sending a response, so that the client
11624/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11625impl std::ops::Drop for FileUpdateAttributesResponder {
11626    fn drop(&mut self) {
11627        self.control_handle.shutdown();
11628        // Safety: drops once, never accessed again
11629        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11630    }
11631}
11632
11633impl fidl::endpoints::Responder for FileUpdateAttributesResponder {
11634    type ControlHandle = FileControlHandle;
11635
11636    fn control_handle(&self) -> &FileControlHandle {
11637        &self.control_handle
11638    }
11639
11640    fn drop_without_shutdown(mut self) {
11641        // Safety: drops once, never accessed again due to mem::forget
11642        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11643        // Prevent Drop from running (which would shut down the channel)
11644        std::mem::forget(self);
11645    }
11646}
11647
11648impl FileUpdateAttributesResponder {
11649    /// Sends a response to the FIDL transaction.
11650    ///
11651    /// Sets the channel to shutdown if an error occurs.
11652    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11653        let _result = self.send_raw(result);
11654        if _result.is_err() {
11655            self.control_handle.shutdown();
11656        }
11657        self.drop_without_shutdown();
11658        _result
11659    }
11660
11661    /// Similar to "send" but does not shutdown the channel if an error occurs.
11662    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11663        let _result = self.send_raw(result);
11664        self.drop_without_shutdown();
11665        _result
11666    }
11667
11668    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11669        self.control_handle
11670            .inner
11671            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11672                result,
11673                self.tx_id,
11674                0x3308c1da5a89bf08,
11675                fidl::encoding::DynamicFlags::empty(),
11676            )
11677    }
11678}
11679
11680#[must_use = "FIDL methods require a response to be sent"]
11681#[derive(Debug)]
11682pub struct FileSyncResponder {
11683    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11684    tx_id: u32,
11685}
11686
11687/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11688/// if the responder is dropped without sending a response, so that the client
11689/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11690impl std::ops::Drop for FileSyncResponder {
11691    fn drop(&mut self) {
11692        self.control_handle.shutdown();
11693        // Safety: drops once, never accessed again
11694        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11695    }
11696}
11697
11698impl fidl::endpoints::Responder for FileSyncResponder {
11699    type ControlHandle = FileControlHandle;
11700
11701    fn control_handle(&self) -> &FileControlHandle {
11702        &self.control_handle
11703    }
11704
11705    fn drop_without_shutdown(mut self) {
11706        // Safety: drops once, never accessed again due to mem::forget
11707        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11708        // Prevent Drop from running (which would shut down the channel)
11709        std::mem::forget(self);
11710    }
11711}
11712
11713impl FileSyncResponder {
11714    /// Sends a response to the FIDL transaction.
11715    ///
11716    /// Sets the channel to shutdown if an error occurs.
11717    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11718        let _result = self.send_raw(result);
11719        if _result.is_err() {
11720            self.control_handle.shutdown();
11721        }
11722        self.drop_without_shutdown();
11723        _result
11724    }
11725
11726    /// Similar to "send" but does not shutdown the channel if an error occurs.
11727    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11728        let _result = self.send_raw(result);
11729        self.drop_without_shutdown();
11730        _result
11731    }
11732
11733    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11734        self.control_handle
11735            .inner
11736            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11737                result,
11738                self.tx_id,
11739                0x2c5c27ca0ab5dc49,
11740                fidl::encoding::DynamicFlags::empty(),
11741            )
11742    }
11743}
11744
11745#[must_use = "FIDL methods require a response to be sent"]
11746#[derive(Debug)]
11747pub struct FileGetExtendedAttributeResponder {
11748    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11749    tx_id: u32,
11750}
11751
11752/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11753/// if the responder is dropped without sending a response, so that the client
11754/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11755impl std::ops::Drop for FileGetExtendedAttributeResponder {
11756    fn drop(&mut self) {
11757        self.control_handle.shutdown();
11758        // Safety: drops once, never accessed again
11759        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11760    }
11761}
11762
11763impl fidl::endpoints::Responder for FileGetExtendedAttributeResponder {
11764    type ControlHandle = FileControlHandle;
11765
11766    fn control_handle(&self) -> &FileControlHandle {
11767        &self.control_handle
11768    }
11769
11770    fn drop_without_shutdown(mut self) {
11771        // Safety: drops once, never accessed again due to mem::forget
11772        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11773        // Prevent Drop from running (which would shut down the channel)
11774        std::mem::forget(self);
11775    }
11776}
11777
11778impl FileGetExtendedAttributeResponder {
11779    /// Sends a response to the FIDL transaction.
11780    ///
11781    /// Sets the channel to shutdown if an error occurs.
11782    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11783        let _result = self.send_raw(result);
11784        if _result.is_err() {
11785            self.control_handle.shutdown();
11786        }
11787        self.drop_without_shutdown();
11788        _result
11789    }
11790
11791    /// Similar to "send" but does not shutdown the channel if an error occurs.
11792    pub fn send_no_shutdown_on_err(
11793        self,
11794        mut result: Result<ExtendedAttributeValue, i32>,
11795    ) -> Result<(), fidl::Error> {
11796        let _result = self.send_raw(result);
11797        self.drop_without_shutdown();
11798        _result
11799    }
11800
11801    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11802        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
11803            result.as_mut().map_err(|e| *e),
11804            self.tx_id,
11805            0x45ffa3ccfdeb76db,
11806            fidl::encoding::DynamicFlags::empty(),
11807        )
11808    }
11809}
11810
11811#[must_use = "FIDL methods require a response to be sent"]
11812#[derive(Debug)]
11813pub struct FileSetExtendedAttributeResponder {
11814    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11815    tx_id: u32,
11816}
11817
11818/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11819/// if the responder is dropped without sending a response, so that the client
11820/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11821impl std::ops::Drop for FileSetExtendedAttributeResponder {
11822    fn drop(&mut self) {
11823        self.control_handle.shutdown();
11824        // Safety: drops once, never accessed again
11825        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11826    }
11827}
11828
11829impl fidl::endpoints::Responder for FileSetExtendedAttributeResponder {
11830    type ControlHandle = FileControlHandle;
11831
11832    fn control_handle(&self) -> &FileControlHandle {
11833        &self.control_handle
11834    }
11835
11836    fn drop_without_shutdown(mut self) {
11837        // Safety: drops once, never accessed again due to mem::forget
11838        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11839        // Prevent Drop from running (which would shut down the channel)
11840        std::mem::forget(self);
11841    }
11842}
11843
11844impl FileSetExtendedAttributeResponder {
11845    /// Sends a response to the FIDL transaction.
11846    ///
11847    /// Sets the channel to shutdown if an error occurs.
11848    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11849        let _result = self.send_raw(result);
11850        if _result.is_err() {
11851            self.control_handle.shutdown();
11852        }
11853        self.drop_without_shutdown();
11854        _result
11855    }
11856
11857    /// Similar to "send" but does not shutdown the channel if an error occurs.
11858    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11859        let _result = self.send_raw(result);
11860        self.drop_without_shutdown();
11861        _result
11862    }
11863
11864    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11865        self.control_handle
11866            .inner
11867            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11868                result,
11869                self.tx_id,
11870                0x4a951362f681f23c,
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 FileRemoveExtendedAttributeResponder {
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 FileRemoveExtendedAttributeResponder {
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 FileRemoveExtendedAttributeResponder {
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 FileRemoveExtendedAttributeResponder {
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<(), 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(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11924        let _result = self.send_raw(result);
11925        self.drop_without_shutdown();
11926        _result
11927    }
11928
11929    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11930        self.control_handle
11931            .inner
11932            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11933                result,
11934                self.tx_id,
11935                0x7a0b9f3a9bf9032d,
11936                fidl::encoding::DynamicFlags::empty(),
11937            )
11938    }
11939}
11940
11941#[must_use = "FIDL methods require a response to be sent"]
11942#[derive(Debug)]
11943pub struct FileReadResponder {
11944    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11945    tx_id: u32,
11946}
11947
11948/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11949/// if the responder is dropped without sending a response, so that the client
11950/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11951impl std::ops::Drop for FileReadResponder {
11952    fn drop(&mut self) {
11953        self.control_handle.shutdown();
11954        // Safety: drops once, never accessed again
11955        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11956    }
11957}
11958
11959impl fidl::endpoints::Responder for FileReadResponder {
11960    type ControlHandle = FileControlHandle;
11961
11962    fn control_handle(&self) -> &FileControlHandle {
11963        &self.control_handle
11964    }
11965
11966    fn drop_without_shutdown(mut self) {
11967        // Safety: drops once, never accessed again due to mem::forget
11968        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11969        // Prevent Drop from running (which would shut down the channel)
11970        std::mem::forget(self);
11971    }
11972}
11973
11974impl FileReadResponder {
11975    /// Sends a response to the FIDL transaction.
11976    ///
11977    /// Sets the channel to shutdown if an error occurs.
11978    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11979        let _result = self.send_raw(result);
11980        if _result.is_err() {
11981            self.control_handle.shutdown();
11982        }
11983        self.drop_without_shutdown();
11984        _result
11985    }
11986
11987    /// Similar to "send" but does not shutdown the channel if an error occurs.
11988    pub fn send_no_shutdown_on_err(
11989        self,
11990        mut result: Result<&[u8], i32>,
11991    ) -> Result<(), fidl::Error> {
11992        let _result = self.send_raw(result);
11993        self.drop_without_shutdown();
11994        _result
11995    }
11996
11997    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11998        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
11999            result.map(|data| (data,)),
12000            self.tx_id,
12001            0x57e419a298c8ede,
12002            fidl::encoding::DynamicFlags::empty(),
12003        )
12004    }
12005}
12006
12007#[must_use = "FIDL methods require a response to be sent"]
12008#[derive(Debug)]
12009pub struct FileWriteResponder {
12010    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12011    tx_id: u32,
12012}
12013
12014/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12015/// if the responder is dropped without sending a response, so that the client
12016/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12017impl std::ops::Drop for FileWriteResponder {
12018    fn drop(&mut self) {
12019        self.control_handle.shutdown();
12020        // Safety: drops once, never accessed again
12021        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12022    }
12023}
12024
12025impl fidl::endpoints::Responder for FileWriteResponder {
12026    type ControlHandle = FileControlHandle;
12027
12028    fn control_handle(&self) -> &FileControlHandle {
12029        &self.control_handle
12030    }
12031
12032    fn drop_without_shutdown(mut self) {
12033        // Safety: drops once, never accessed again due to mem::forget
12034        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12035        // Prevent Drop from running (which would shut down the channel)
12036        std::mem::forget(self);
12037    }
12038}
12039
12040impl FileWriteResponder {
12041    /// Sends a response to the FIDL transaction.
12042    ///
12043    /// Sets the channel to shutdown if an error occurs.
12044    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12045        let _result = self.send_raw(result);
12046        if _result.is_err() {
12047            self.control_handle.shutdown();
12048        }
12049        self.drop_without_shutdown();
12050        _result
12051    }
12052
12053    /// Similar to "send" but does not shutdown the channel if an error occurs.
12054    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12055        let _result = self.send_raw(result);
12056        self.drop_without_shutdown();
12057        _result
12058    }
12059
12060    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12061        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
12062            result.map(|actual_count| (actual_count,)),
12063            self.tx_id,
12064            0x6a31437832469f82,
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 FileDescribeResponder {
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 FileDescribeResponder {
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 FileDescribeResponder {
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 FileDescribeResponder {
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 payload: FileInfo) -> Result<(), fidl::Error> {
12108        let _result = self.send_raw(payload);
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(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
12118        let _result = self.send_raw(payload);
12119        self.drop_without_shutdown();
12120        _result
12121    }
12122
12123    fn send_raw(&self, mut payload: FileInfo) -> Result<(), fidl::Error> {
12124        self.control_handle.inner.send::<FileInfo>(
12125            &mut payload,
12126            self.tx_id,
12127            0x68b5ac00c62906bc,
12128            fidl::encoding::DynamicFlags::empty(),
12129        )
12130    }
12131}
12132
12133#[must_use = "FIDL methods require a response to be sent"]
12134#[derive(Debug)]
12135pub struct FileSeekResponder {
12136    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12137    tx_id: u32,
12138}
12139
12140/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12141/// if the responder is dropped without sending a response, so that the client
12142/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12143impl std::ops::Drop for FileSeekResponder {
12144    fn drop(&mut self) {
12145        self.control_handle.shutdown();
12146        // Safety: drops once, never accessed again
12147        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12148    }
12149}
12150
12151impl fidl::endpoints::Responder for FileSeekResponder {
12152    type ControlHandle = FileControlHandle;
12153
12154    fn control_handle(&self) -> &FileControlHandle {
12155        &self.control_handle
12156    }
12157
12158    fn drop_without_shutdown(mut self) {
12159        // Safety: drops once, never accessed again due to mem::forget
12160        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12161        // Prevent Drop from running (which would shut down the channel)
12162        std::mem::forget(self);
12163    }
12164}
12165
12166impl FileSeekResponder {
12167    /// Sends a response to the FIDL transaction.
12168    ///
12169    /// Sets the channel to shutdown if an error occurs.
12170    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12171        let _result = self.send_raw(result);
12172        if _result.is_err() {
12173            self.control_handle.shutdown();
12174        }
12175        self.drop_without_shutdown();
12176        _result
12177    }
12178
12179    /// Similar to "send" but does not shutdown the channel if an error occurs.
12180    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12181        let _result = self.send_raw(result);
12182        self.drop_without_shutdown();
12183        _result
12184    }
12185
12186    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12187        self.control_handle.inner.send::<fidl::encoding::ResultType<FileSeekResponse, i32>>(
12188            result.map(|offset_from_start| (offset_from_start,)),
12189            self.tx_id,
12190            0x78079168162c5207,
12191            fidl::encoding::DynamicFlags::empty(),
12192        )
12193    }
12194}
12195
12196#[must_use = "FIDL methods require a response to be sent"]
12197#[derive(Debug)]
12198pub struct FileReadAtResponder {
12199    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12200    tx_id: u32,
12201}
12202
12203/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12204/// if the responder is dropped without sending a response, so that the client
12205/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12206impl std::ops::Drop for FileReadAtResponder {
12207    fn drop(&mut self) {
12208        self.control_handle.shutdown();
12209        // Safety: drops once, never accessed again
12210        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12211    }
12212}
12213
12214impl fidl::endpoints::Responder for FileReadAtResponder {
12215    type ControlHandle = FileControlHandle;
12216
12217    fn control_handle(&self) -> &FileControlHandle {
12218        &self.control_handle
12219    }
12220
12221    fn drop_without_shutdown(mut self) {
12222        // Safety: drops once, never accessed again due to mem::forget
12223        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12224        // Prevent Drop from running (which would shut down the channel)
12225        std::mem::forget(self);
12226    }
12227}
12228
12229impl FileReadAtResponder {
12230    /// Sends a response to the FIDL transaction.
12231    ///
12232    /// Sets the channel to shutdown if an error occurs.
12233    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
12234        let _result = self.send_raw(result);
12235        if _result.is_err() {
12236            self.control_handle.shutdown();
12237        }
12238        self.drop_without_shutdown();
12239        _result
12240    }
12241
12242    /// Similar to "send" but does not shutdown the channel if an error occurs.
12243    pub fn send_no_shutdown_on_err(
12244        self,
12245        mut result: Result<&[u8], i32>,
12246    ) -> Result<(), fidl::Error> {
12247        let _result = self.send_raw(result);
12248        self.drop_without_shutdown();
12249        _result
12250    }
12251
12252    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
12253        self.control_handle.inner.send::<fidl::encoding::ResultType<FileReadAtResponse, i32>>(
12254            result.map(|data| (data,)),
12255            self.tx_id,
12256            0x1607a293a60d723e,
12257            fidl::encoding::DynamicFlags::empty(),
12258        )
12259    }
12260}
12261
12262#[must_use = "FIDL methods require a response to be sent"]
12263#[derive(Debug)]
12264pub struct FileWriteAtResponder {
12265    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12266    tx_id: u32,
12267}
12268
12269/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12270/// if the responder is dropped without sending a response, so that the client
12271/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12272impl std::ops::Drop for FileWriteAtResponder {
12273    fn drop(&mut self) {
12274        self.control_handle.shutdown();
12275        // Safety: drops once, never accessed again
12276        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12277    }
12278}
12279
12280impl fidl::endpoints::Responder for FileWriteAtResponder {
12281    type ControlHandle = FileControlHandle;
12282
12283    fn control_handle(&self) -> &FileControlHandle {
12284        &self.control_handle
12285    }
12286
12287    fn drop_without_shutdown(mut self) {
12288        // Safety: drops once, never accessed again due to mem::forget
12289        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12290        // Prevent Drop from running (which would shut down the channel)
12291        std::mem::forget(self);
12292    }
12293}
12294
12295impl FileWriteAtResponder {
12296    /// Sends a response to the FIDL transaction.
12297    ///
12298    /// Sets the channel to shutdown if an error occurs.
12299    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12300        let _result = self.send_raw(result);
12301        if _result.is_err() {
12302            self.control_handle.shutdown();
12303        }
12304        self.drop_without_shutdown();
12305        _result
12306    }
12307
12308    /// Similar to "send" but does not shutdown the channel if an error occurs.
12309    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12310        let _result = self.send_raw(result);
12311        self.drop_without_shutdown();
12312        _result
12313    }
12314
12315    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12316        self.control_handle.inner.send::<fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
12317            result.map(|actual_count| (actual_count,)),
12318            self.tx_id,
12319            0x793eefc0045e792b,
12320            fidl::encoding::DynamicFlags::empty(),
12321        )
12322    }
12323}
12324
12325#[must_use = "FIDL methods require a response to be sent"]
12326#[derive(Debug)]
12327pub struct FileResizeResponder {
12328    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12329    tx_id: u32,
12330}
12331
12332/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12333/// if the responder is dropped without sending a response, so that the client
12334/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12335impl std::ops::Drop for FileResizeResponder {
12336    fn drop(&mut self) {
12337        self.control_handle.shutdown();
12338        // Safety: drops once, never accessed again
12339        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12340    }
12341}
12342
12343impl fidl::endpoints::Responder for FileResizeResponder {
12344    type ControlHandle = FileControlHandle;
12345
12346    fn control_handle(&self) -> &FileControlHandle {
12347        &self.control_handle
12348    }
12349
12350    fn drop_without_shutdown(mut self) {
12351        // Safety: drops once, never accessed again due to mem::forget
12352        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12353        // Prevent Drop from running (which would shut down the channel)
12354        std::mem::forget(self);
12355    }
12356}
12357
12358impl FileResizeResponder {
12359    /// Sends a response to the FIDL transaction.
12360    ///
12361    /// Sets the channel to shutdown if an error occurs.
12362    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12363        let _result = self.send_raw(result);
12364        if _result.is_err() {
12365            self.control_handle.shutdown();
12366        }
12367        self.drop_without_shutdown();
12368        _result
12369    }
12370
12371    /// Similar to "send" but does not shutdown the channel if an error occurs.
12372    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12373        let _result = self.send_raw(result);
12374        self.drop_without_shutdown();
12375        _result
12376    }
12377
12378    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12379        self.control_handle
12380            .inner
12381            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12382                result,
12383                self.tx_id,
12384                0x2b80825f0535743a,
12385                fidl::encoding::DynamicFlags::empty(),
12386            )
12387    }
12388}
12389
12390#[must_use = "FIDL methods require a response to be sent"]
12391#[derive(Debug)]
12392pub struct FileGetBackingMemoryResponder {
12393    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12394    tx_id: u32,
12395}
12396
12397/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12398/// if the responder is dropped without sending a response, so that the client
12399/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12400impl std::ops::Drop for FileGetBackingMemoryResponder {
12401    fn drop(&mut self) {
12402        self.control_handle.shutdown();
12403        // Safety: drops once, never accessed again
12404        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12405    }
12406}
12407
12408impl fidl::endpoints::Responder for FileGetBackingMemoryResponder {
12409    type ControlHandle = FileControlHandle;
12410
12411    fn control_handle(&self) -> &FileControlHandle {
12412        &self.control_handle
12413    }
12414
12415    fn drop_without_shutdown(mut self) {
12416        // Safety: drops once, never accessed again due to mem::forget
12417        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12418        // Prevent Drop from running (which would shut down the channel)
12419        std::mem::forget(self);
12420    }
12421}
12422
12423impl FileGetBackingMemoryResponder {
12424    /// Sends a response to the FIDL transaction.
12425    ///
12426    /// Sets the channel to shutdown if an error occurs.
12427    pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12428        let _result = self.send_raw(result);
12429        if _result.is_err() {
12430            self.control_handle.shutdown();
12431        }
12432        self.drop_without_shutdown();
12433        _result
12434    }
12435
12436    /// Similar to "send" but does not shutdown the channel if an error occurs.
12437    pub fn send_no_shutdown_on_err(
12438        self,
12439        mut result: Result<fidl::Vmo, i32>,
12440    ) -> Result<(), fidl::Error> {
12441        let _result = self.send_raw(result);
12442        self.drop_without_shutdown();
12443        _result
12444    }
12445
12446    fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12447        self.control_handle
12448            .inner
12449            .send::<fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>>(
12450                result.map(|vmo| (vmo,)),
12451                self.tx_id,
12452                0xa6a9e654cbf62b,
12453                fidl::encoding::DynamicFlags::empty(),
12454            )
12455    }
12456}
12457
12458#[must_use = "FIDL methods require a response to be sent"]
12459#[derive(Debug)]
12460pub struct FileAllocateResponder {
12461    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12462    tx_id: u32,
12463}
12464
12465/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12466/// if the responder is dropped without sending a response, so that the client
12467/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12468impl std::ops::Drop for FileAllocateResponder {
12469    fn drop(&mut self) {
12470        self.control_handle.shutdown();
12471        // Safety: drops once, never accessed again
12472        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12473    }
12474}
12475
12476impl fidl::endpoints::Responder for FileAllocateResponder {
12477    type ControlHandle = FileControlHandle;
12478
12479    fn control_handle(&self) -> &FileControlHandle {
12480        &self.control_handle
12481    }
12482
12483    fn drop_without_shutdown(mut self) {
12484        // Safety: drops once, never accessed again due to mem::forget
12485        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12486        // Prevent Drop from running (which would shut down the channel)
12487        std::mem::forget(self);
12488    }
12489}
12490
12491impl FileAllocateResponder {
12492    /// Sends a response to the FIDL transaction.
12493    ///
12494    /// Sets the channel to shutdown if an error occurs.
12495    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12496        let _result = self.send_raw(result);
12497        if _result.is_err() {
12498            self.control_handle.shutdown();
12499        }
12500        self.drop_without_shutdown();
12501        _result
12502    }
12503
12504    /// Similar to "send" but does not shutdown the channel if an error occurs.
12505    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12506        let _result = self.send_raw(result);
12507        self.drop_without_shutdown();
12508        _result
12509    }
12510
12511    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12512        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12513            fidl::encoding::EmptyStruct,
12514            i32,
12515        >>(
12516            fidl::encoding::FlexibleResult::new(result),
12517            self.tx_id,
12518            0x77fa0c330b57fd2e,
12519            fidl::encoding::DynamicFlags::FLEXIBLE,
12520        )
12521    }
12522}
12523
12524#[must_use = "FIDL methods require a response to be sent"]
12525#[derive(Debug)]
12526pub struct FileEnableVerityResponder {
12527    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12528    tx_id: u32,
12529}
12530
12531/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12532/// if the responder is dropped without sending a response, so that the client
12533/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12534impl std::ops::Drop for FileEnableVerityResponder {
12535    fn drop(&mut self) {
12536        self.control_handle.shutdown();
12537        // Safety: drops once, never accessed again
12538        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12539    }
12540}
12541
12542impl fidl::endpoints::Responder for FileEnableVerityResponder {
12543    type ControlHandle = FileControlHandle;
12544
12545    fn control_handle(&self) -> &FileControlHandle {
12546        &self.control_handle
12547    }
12548
12549    fn drop_without_shutdown(mut self) {
12550        // Safety: drops once, never accessed again due to mem::forget
12551        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12552        // Prevent Drop from running (which would shut down the channel)
12553        std::mem::forget(self);
12554    }
12555}
12556
12557impl FileEnableVerityResponder {
12558    /// Sends a response to the FIDL transaction.
12559    ///
12560    /// Sets the channel to shutdown if an error occurs.
12561    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12562        let _result = self.send_raw(result);
12563        if _result.is_err() {
12564            self.control_handle.shutdown();
12565        }
12566        self.drop_without_shutdown();
12567        _result
12568    }
12569
12570    /// Similar to "send" but does not shutdown the channel if an error occurs.
12571    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12572        let _result = self.send_raw(result);
12573        self.drop_without_shutdown();
12574        _result
12575    }
12576
12577    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12578        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12579            fidl::encoding::EmptyStruct,
12580            i32,
12581        >>(
12582            fidl::encoding::FlexibleResult::new(result),
12583            self.tx_id,
12584            0x2c421ec3faaeb8bb,
12585            fidl::encoding::DynamicFlags::FLEXIBLE,
12586        )
12587    }
12588}
12589
12590#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12591pub struct LinkableMarker;
12592
12593impl fidl::endpoints::ProtocolMarker for LinkableMarker {
12594    type Proxy = LinkableProxy;
12595    type RequestStream = LinkableRequestStream;
12596    #[cfg(target_os = "fuchsia")]
12597    type SynchronousProxy = LinkableSynchronousProxy;
12598
12599    const DEBUG_NAME: &'static str = "(anonymous) Linkable";
12600}
12601pub type LinkableLinkIntoResult = Result<(), i32>;
12602
12603pub trait LinkableProxyInterface: Send + Sync {
12604    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
12605        + Send;
12606    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
12607}
12608#[derive(Debug)]
12609#[cfg(target_os = "fuchsia")]
12610pub struct LinkableSynchronousProxy {
12611    client: fidl::client::sync::Client,
12612}
12613
12614#[cfg(target_os = "fuchsia")]
12615impl fidl::endpoints::SynchronousProxy for LinkableSynchronousProxy {
12616    type Proxy = LinkableProxy;
12617    type Protocol = LinkableMarker;
12618
12619    fn from_channel(inner: fidl::Channel) -> Self {
12620        Self::new(inner)
12621    }
12622
12623    fn into_channel(self) -> fidl::Channel {
12624        self.client.into_channel()
12625    }
12626
12627    fn as_channel(&self) -> &fidl::Channel {
12628        self.client.as_channel()
12629    }
12630}
12631
12632#[cfg(target_os = "fuchsia")]
12633impl LinkableSynchronousProxy {
12634    pub fn new(channel: fidl::Channel) -> Self {
12635        let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12636        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
12637    }
12638
12639    pub fn into_channel(self) -> fidl::Channel {
12640        self.client.into_channel()
12641    }
12642
12643    /// Waits until an event arrives and returns it. It is safe for other
12644    /// threads to make concurrent requests while waiting for an event.
12645    pub fn wait_for_event(
12646        &self,
12647        deadline: zx::MonotonicInstant,
12648    ) -> Result<LinkableEvent, fidl::Error> {
12649        LinkableEvent::decode(self.client.wait_for_event(deadline)?)
12650    }
12651
12652    /// Creates a link to this this object with name `dst` in the directory represented by
12653    /// `dst_parent_token`.
12654    ///
12655    /// `dst` must be a resolved object name. Including "/" in the string will return
12656    /// `ZX_ERR_INVALID_ARGS`.
12657    ///
12658    /// This method requires the maximal set of rights supported by the filesystem for this object.
12659    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12660    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12661    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12662    /// `ZX_ERR_ACCESS_DENIED`.
12663    ///
12664    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12665    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12666    ///
12667    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12668    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12669    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12670    ///
12671    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12672    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12673    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12674    pub fn r#link_into(
12675        &self,
12676        mut dst_parent_token: fidl::Event,
12677        mut dst: &str,
12678        ___deadline: zx::MonotonicInstant,
12679    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12680        let _response = self.client.send_query::<
12681            LinkableLinkIntoRequest,
12682            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12683        >(
12684            (dst_parent_token, dst,),
12685            0x54f3949246a03e74,
12686            fidl::encoding::DynamicFlags::empty(),
12687            ___deadline,
12688        )?;
12689        Ok(_response.map(|x| x))
12690    }
12691}
12692
12693#[cfg(target_os = "fuchsia")]
12694impl From<LinkableSynchronousProxy> for zx::Handle {
12695    fn from(value: LinkableSynchronousProxy) -> Self {
12696        value.into_channel().into()
12697    }
12698}
12699
12700#[cfg(target_os = "fuchsia")]
12701impl From<fidl::Channel> for LinkableSynchronousProxy {
12702    fn from(value: fidl::Channel) -> Self {
12703        Self::new(value)
12704    }
12705}
12706
12707#[derive(Debug, Clone)]
12708pub struct LinkableProxy {
12709    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
12710}
12711
12712impl fidl::endpoints::Proxy for LinkableProxy {
12713    type Protocol = LinkableMarker;
12714
12715    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
12716        Self::new(inner)
12717    }
12718
12719    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
12720        self.client.into_channel().map_err(|client| Self { client })
12721    }
12722
12723    fn as_channel(&self) -> &::fidl::AsyncChannel {
12724        self.client.as_channel()
12725    }
12726}
12727
12728impl LinkableProxy {
12729    /// Create a new Proxy for fuchsia.io/Linkable.
12730    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
12731        let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12732        Self { client: fidl::client::Client::new(channel, protocol_name) }
12733    }
12734
12735    /// Get a Stream of events from the remote end of the protocol.
12736    ///
12737    /// # Panics
12738    ///
12739    /// Panics if the event stream was already taken.
12740    pub fn take_event_stream(&self) -> LinkableEventStream {
12741        LinkableEventStream { event_receiver: self.client.take_event_receiver() }
12742    }
12743
12744    /// Creates a link to this this object with name `dst` in the directory represented by
12745    /// `dst_parent_token`.
12746    ///
12747    /// `dst` must be a resolved object name. Including "/" in the string will return
12748    /// `ZX_ERR_INVALID_ARGS`.
12749    ///
12750    /// This method requires the maximal set of rights supported by the filesystem for this object.
12751    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12752    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12753    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12754    /// `ZX_ERR_ACCESS_DENIED`.
12755    ///
12756    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12757    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12758    ///
12759    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12760    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12761    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12762    ///
12763    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12764    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12765    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12766    pub fn r#link_into(
12767        &self,
12768        mut dst_parent_token: fidl::Event,
12769        mut dst: &str,
12770    ) -> fidl::client::QueryResponseFut<
12771        LinkableLinkIntoResult,
12772        fidl::encoding::DefaultFuchsiaResourceDialect,
12773    > {
12774        LinkableProxyInterface::r#link_into(self, dst_parent_token, dst)
12775    }
12776}
12777
12778impl LinkableProxyInterface for LinkableProxy {
12779    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
12780        LinkableLinkIntoResult,
12781        fidl::encoding::DefaultFuchsiaResourceDialect,
12782    >;
12783    fn r#link_into(
12784        &self,
12785        mut dst_parent_token: fidl::Event,
12786        mut dst: &str,
12787    ) -> Self::LinkIntoResponseFut {
12788        fn _decode(
12789            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
12790        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12791            let _response = fidl::client::decode_transaction_body::<
12792                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12793                fidl::encoding::DefaultFuchsiaResourceDialect,
12794                0x54f3949246a03e74,
12795            >(_buf?)?;
12796            Ok(_response.map(|x| x))
12797        }
12798        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
12799            (dst_parent_token, dst),
12800            0x54f3949246a03e74,
12801            fidl::encoding::DynamicFlags::empty(),
12802            _decode,
12803        )
12804    }
12805}
12806
12807pub struct LinkableEventStream {
12808    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
12809}
12810
12811impl std::marker::Unpin for LinkableEventStream {}
12812
12813impl futures::stream::FusedStream for LinkableEventStream {
12814    fn is_terminated(&self) -> bool {
12815        self.event_receiver.is_terminated()
12816    }
12817}
12818
12819impl futures::Stream for LinkableEventStream {
12820    type Item = Result<LinkableEvent, fidl::Error>;
12821
12822    fn poll_next(
12823        mut self: std::pin::Pin<&mut Self>,
12824        cx: &mut std::task::Context<'_>,
12825    ) -> std::task::Poll<Option<Self::Item>> {
12826        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
12827            &mut self.event_receiver,
12828            cx
12829        )?) {
12830            Some(buf) => std::task::Poll::Ready(Some(LinkableEvent::decode(buf))),
12831            None => std::task::Poll::Ready(None),
12832        }
12833    }
12834}
12835
12836#[derive(Debug)]
12837pub enum LinkableEvent {}
12838
12839impl LinkableEvent {
12840    /// Decodes a message buffer as a [`LinkableEvent`].
12841    fn decode(
12842        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
12843    ) -> Result<LinkableEvent, fidl::Error> {
12844        let (bytes, _handles) = buf.split_mut();
12845        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12846        debug_assert_eq!(tx_header.tx_id, 0);
12847        match tx_header.ordinal {
12848            _ => Err(fidl::Error::UnknownOrdinal {
12849                ordinal: tx_header.ordinal,
12850                protocol_name: <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12851            }),
12852        }
12853    }
12854}
12855
12856/// A Stream of incoming requests for fuchsia.io/Linkable.
12857pub struct LinkableRequestStream {
12858    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12859    is_terminated: bool,
12860}
12861
12862impl std::marker::Unpin for LinkableRequestStream {}
12863
12864impl futures::stream::FusedStream for LinkableRequestStream {
12865    fn is_terminated(&self) -> bool {
12866        self.is_terminated
12867    }
12868}
12869
12870impl fidl::endpoints::RequestStream for LinkableRequestStream {
12871    type Protocol = LinkableMarker;
12872    type ControlHandle = LinkableControlHandle;
12873
12874    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
12875        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
12876    }
12877
12878    fn control_handle(&self) -> Self::ControlHandle {
12879        LinkableControlHandle { inner: self.inner.clone() }
12880    }
12881
12882    fn into_inner(
12883        self,
12884    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
12885    {
12886        (self.inner, self.is_terminated)
12887    }
12888
12889    fn from_inner(
12890        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12891        is_terminated: bool,
12892    ) -> Self {
12893        Self { inner, is_terminated }
12894    }
12895}
12896
12897impl futures::Stream for LinkableRequestStream {
12898    type Item = Result<LinkableRequest, fidl::Error>;
12899
12900    fn poll_next(
12901        mut self: std::pin::Pin<&mut Self>,
12902        cx: &mut std::task::Context<'_>,
12903    ) -> std::task::Poll<Option<Self::Item>> {
12904        let this = &mut *self;
12905        if this.inner.check_shutdown(cx) {
12906            this.is_terminated = true;
12907            return std::task::Poll::Ready(None);
12908        }
12909        if this.is_terminated {
12910            panic!("polled LinkableRequestStream after completion");
12911        }
12912        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
12913            |bytes, handles| {
12914                match this.inner.channel().read_etc(cx, bytes, handles) {
12915                    std::task::Poll::Ready(Ok(())) => {}
12916                    std::task::Poll::Pending => return std::task::Poll::Pending,
12917                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
12918                        this.is_terminated = true;
12919                        return std::task::Poll::Ready(None);
12920                    }
12921                    std::task::Poll::Ready(Err(e)) => {
12922                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
12923                            e.into(),
12924                        ))))
12925                    }
12926                }
12927
12928                // A message has been received from the channel
12929                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12930
12931                std::task::Poll::Ready(Some(match header.ordinal {
12932                    0x54f3949246a03e74 => {
12933                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12934                        let mut req = fidl::new_empty!(
12935                            LinkableLinkIntoRequest,
12936                            fidl::encoding::DefaultFuchsiaResourceDialect
12937                        );
12938                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
12939                        let control_handle = LinkableControlHandle { inner: this.inner.clone() };
12940                        Ok(LinkableRequest::LinkInto {
12941                            dst_parent_token: req.dst_parent_token,
12942                            dst: req.dst,
12943
12944                            responder: LinkableLinkIntoResponder {
12945                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12946                                tx_id: header.tx_id,
12947                            },
12948                        })
12949                    }
12950                    _ => Err(fidl::Error::UnknownOrdinal {
12951                        ordinal: header.ordinal,
12952                        protocol_name:
12953                            <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12954                    }),
12955                }))
12956            },
12957        )
12958    }
12959}
12960
12961#[derive(Debug)]
12962pub enum LinkableRequest {
12963    /// Creates a link to this this object with name `dst` in the directory represented by
12964    /// `dst_parent_token`.
12965    ///
12966    /// `dst` must be a resolved object name. Including "/" in the string will return
12967    /// `ZX_ERR_INVALID_ARGS`.
12968    ///
12969    /// This method requires the maximal set of rights supported by the filesystem for this object.
12970    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12971    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12972    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12973    /// `ZX_ERR_ACCESS_DENIED`.
12974    ///
12975    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12976    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12977    ///
12978    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12979    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12980    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12981    ///
12982    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12983    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12984    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12985    LinkInto { dst_parent_token: fidl::Event, dst: String, responder: LinkableLinkIntoResponder },
12986}
12987
12988impl LinkableRequest {
12989    #[allow(irrefutable_let_patterns)]
12990    pub fn into_link_into(self) -> Option<(fidl::Event, String, LinkableLinkIntoResponder)> {
12991        if let LinkableRequest::LinkInto { dst_parent_token, dst, responder } = self {
12992            Some((dst_parent_token, dst, responder))
12993        } else {
12994            None
12995        }
12996    }
12997
12998    /// Name of the method defined in FIDL
12999    pub fn method_name(&self) -> &'static str {
13000        match *self {
13001            LinkableRequest::LinkInto { .. } => "link_into",
13002        }
13003    }
13004}
13005
13006#[derive(Debug, Clone)]
13007pub struct LinkableControlHandle {
13008    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
13009}
13010
13011impl fidl::endpoints::ControlHandle for LinkableControlHandle {
13012    fn shutdown(&self) {
13013        self.inner.shutdown()
13014    }
13015    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
13016        self.inner.shutdown_with_epitaph(status)
13017    }
13018
13019    fn is_closed(&self) -> bool {
13020        self.inner.channel().is_closed()
13021    }
13022    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
13023        self.inner.channel().on_closed()
13024    }
13025
13026    #[cfg(target_os = "fuchsia")]
13027    fn signal_peer(
13028        &self,
13029        clear_mask: zx::Signals,
13030        set_mask: zx::Signals,
13031    ) -> Result<(), zx_status::Status> {
13032        use fidl::Peered;
13033        self.inner.channel().signal_peer(clear_mask, set_mask)
13034    }
13035}
13036
13037impl LinkableControlHandle {}
13038
13039#[must_use = "FIDL methods require a response to be sent"]
13040#[derive(Debug)]
13041pub struct LinkableLinkIntoResponder {
13042    control_handle: std::mem::ManuallyDrop<LinkableControlHandle>,
13043    tx_id: u32,
13044}
13045
13046/// Set the the channel to be shutdown (see [`LinkableControlHandle::shutdown`])
13047/// if the responder is dropped without sending a response, so that the client
13048/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13049impl std::ops::Drop for LinkableLinkIntoResponder {
13050    fn drop(&mut self) {
13051        self.control_handle.shutdown();
13052        // Safety: drops once, never accessed again
13053        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13054    }
13055}
13056
13057impl fidl::endpoints::Responder for LinkableLinkIntoResponder {
13058    type ControlHandle = LinkableControlHandle;
13059
13060    fn control_handle(&self) -> &LinkableControlHandle {
13061        &self.control_handle
13062    }
13063
13064    fn drop_without_shutdown(mut self) {
13065        // Safety: drops once, never accessed again due to mem::forget
13066        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13067        // Prevent Drop from running (which would shut down the channel)
13068        std::mem::forget(self);
13069    }
13070}
13071
13072impl LinkableLinkIntoResponder {
13073    /// Sends a response to the FIDL transaction.
13074    ///
13075    /// Sets the channel to shutdown if an error occurs.
13076    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13077        let _result = self.send_raw(result);
13078        if _result.is_err() {
13079            self.control_handle.shutdown();
13080        }
13081        self.drop_without_shutdown();
13082        _result
13083    }
13084
13085    /// Similar to "send" but does not shutdown the channel if an error occurs.
13086    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13087        let _result = self.send_raw(result);
13088        self.drop_without_shutdown();
13089        _result
13090    }
13091
13092    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13093        self.control_handle
13094            .inner
13095            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13096                result,
13097                self.tx_id,
13098                0x54f3949246a03e74,
13099                fidl::encoding::DynamicFlags::empty(),
13100            )
13101    }
13102}
13103
13104#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
13105pub struct NodeMarker;
13106
13107impl fidl::endpoints::ProtocolMarker for NodeMarker {
13108    type Proxy = NodeProxy;
13109    type RequestStream = NodeRequestStream;
13110    #[cfg(target_os = "fuchsia")]
13111    type SynchronousProxy = NodeSynchronousProxy;
13112
13113    const DEBUG_NAME: &'static str = "fuchsia.io.Node";
13114}
13115impl fidl::endpoints::DiscoverableProtocolMarker for NodeMarker {}
13116pub type NodeGetFlagsResult = Result<Flags, i32>;
13117pub type NodeSetFlagsResult = Result<(), i32>;
13118pub type NodeGetAttributesResult = Result<(MutableNodeAttributes, ImmutableNodeAttributes), i32>;
13119pub type NodeUpdateAttributesResult = Result<(), i32>;
13120pub type NodeSyncResult = Result<(), i32>;
13121pub type NodeGetExtendedAttributeResult = Result<ExtendedAttributeValue, i32>;
13122pub type NodeSetExtendedAttributeResult = Result<(), i32>;
13123pub type NodeRemoveExtendedAttributeResult = Result<(), i32>;
13124
13125pub trait NodeProxyInterface: Send + Sync {
13126    fn r#clone(
13127        &self,
13128        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13129    ) -> Result<(), fidl::Error>;
13130    type CloseResponseFut: std::future::Future<
13131            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
13132        > + Send;
13133    fn r#close(&self) -> Self::CloseResponseFut;
13134    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
13135    fn r#query(&self) -> Self::QueryResponseFut;
13136    fn r#deprecated_clone(
13137        &self,
13138        flags: OpenFlags,
13139        object: fidl::endpoints::ServerEnd<NodeMarker>,
13140    ) -> Result<(), fidl::Error>;
13141    type GetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
13142        + Send;
13143    fn r#get_attr(&self) -> Self::GetAttrResponseFut;
13144    type SetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
13145    fn r#set_attr(
13146        &self,
13147        flags: NodeAttributeFlags,
13148        attributes: &NodeAttributes,
13149    ) -> Self::SetAttrResponseFut;
13150    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
13151        + Send;
13152    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
13153    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
13154        + Send;
13155    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
13156    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
13157        + Send;
13158    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
13159    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
13160        + Send;
13161    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
13162    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
13163        + Send;
13164    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
13165    type GetConnectionInfoResponseFut: std::future::Future<Output = Result<ConnectionInfo, fidl::Error>>
13166        + Send;
13167    fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut;
13168    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
13169        + Send;
13170    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
13171    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
13172        + Send;
13173    fn r#update_attributes(
13174        &self,
13175        payload: &MutableNodeAttributes,
13176    ) -> Self::UpdateAttributesResponseFut;
13177    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
13178    fn r#sync(&self) -> Self::SyncResponseFut;
13179    fn r#list_extended_attributes(
13180        &self,
13181        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13182    ) -> Result<(), fidl::Error>;
13183    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
13184        + Send;
13185    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
13186    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
13187        + Send;
13188    fn r#set_extended_attribute(
13189        &self,
13190        name: &[u8],
13191        value: ExtendedAttributeValue,
13192        mode: SetExtendedAttributeMode,
13193    ) -> Self::SetExtendedAttributeResponseFut;
13194    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
13195        + Send;
13196    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
13197}
13198#[derive(Debug)]
13199#[cfg(target_os = "fuchsia")]
13200pub struct NodeSynchronousProxy {
13201    client: fidl::client::sync::Client,
13202}
13203
13204#[cfg(target_os = "fuchsia")]
13205impl fidl::endpoints::SynchronousProxy for NodeSynchronousProxy {
13206    type Proxy = NodeProxy;
13207    type Protocol = NodeMarker;
13208
13209    fn from_channel(inner: fidl::Channel) -> Self {
13210        Self::new(inner)
13211    }
13212
13213    fn into_channel(self) -> fidl::Channel {
13214        self.client.into_channel()
13215    }
13216
13217    fn as_channel(&self) -> &fidl::Channel {
13218        self.client.as_channel()
13219    }
13220}
13221
13222#[cfg(target_os = "fuchsia")]
13223impl NodeSynchronousProxy {
13224    pub fn new(channel: fidl::Channel) -> Self {
13225        let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
13226        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
13227    }
13228
13229    pub fn into_channel(self) -> fidl::Channel {
13230        self.client.into_channel()
13231    }
13232
13233    /// Waits until an event arrives and returns it. It is safe for other
13234    /// threads to make concurrent requests while waiting for an event.
13235    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<NodeEvent, fidl::Error> {
13236        NodeEvent::decode(self.client.wait_for_event(deadline)?)
13237    }
13238
13239    pub fn r#clone(
13240        &self,
13241        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13242    ) -> Result<(), fidl::Error> {
13243        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
13244            (request,),
13245            0x20d8a7aba2168a79,
13246            fidl::encoding::DynamicFlags::empty(),
13247        )
13248    }
13249
13250    /// Terminates the connection.
13251    ///
13252    /// After calling `Close`, the client must not send any other requests.
13253    ///
13254    /// Servers, after sending the status response, should close the connection
13255    /// regardless of status and without sending an epitaph.
13256    ///
13257    /// Closing the client end of the channel should be semantically equivalent
13258    /// to calling `Close` without knowing when the close has completed or its
13259    /// status.
13260    pub fn r#close(
13261        &self,
13262        ___deadline: zx::MonotonicInstant,
13263    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
13264        let _response = self.client.send_query::<
13265            fidl::encoding::EmptyPayload,
13266            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13267        >(
13268            (),
13269            0x5ac5d459ad7f657e,
13270            fidl::encoding::DynamicFlags::empty(),
13271            ___deadline,
13272        )?;
13273        Ok(_response.map(|x| x))
13274    }
13275
13276    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
13277        let _response = self.client.send_query::<
13278            fidl::encoding::EmptyPayload,
13279            fidl_fuchsia_unknown::QueryableQueryResponse,
13280        >(
13281            (),
13282            0x2658edee9decfc06,
13283            fidl::encoding::DynamicFlags::empty(),
13284            ___deadline,
13285        )?;
13286        Ok(_response.protocol)
13287    }
13288
13289    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
13290    pub fn r#deprecated_clone(
13291        &self,
13292        mut flags: OpenFlags,
13293        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13294    ) -> Result<(), fidl::Error> {
13295        self.client.send::<NodeDeprecatedCloneRequest>(
13296            (flags, object),
13297            0x5a61678f293ce16f,
13298            fidl::encoding::DynamicFlags::FLEXIBLE,
13299        )
13300    }
13301
13302    /// Acquires information about the node.
13303    ///
13304    /// This method does not require any rights.
13305    pub fn r#get_attr(
13306        &self,
13307        ___deadline: zx::MonotonicInstant,
13308    ) -> Result<(i32, NodeAttributes), fidl::Error> {
13309        let _response =
13310            self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetAttrResponse>(
13311                (),
13312                0x78985e216314dafd,
13313                fidl::encoding::DynamicFlags::empty(),
13314                ___deadline,
13315            )?;
13316        Ok((_response.s, _response.attributes))
13317    }
13318
13319    /// Updates information about the node.
13320    ///
13321    /// Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.
13322    ///
13323    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
13324    /// `ZX_ERR_BAD_HANDLE`.
13325    pub fn r#set_attr(
13326        &self,
13327        mut flags: NodeAttributeFlags,
13328        mut attributes: &NodeAttributes,
13329        ___deadline: zx::MonotonicInstant,
13330    ) -> Result<i32, fidl::Error> {
13331        let _response = self.client.send_query::<NodeSetAttrRequest, NodeSetAttrResponse>(
13332            (flags, attributes),
13333            0x4186c0f40d938f46,
13334            fidl::encoding::DynamicFlags::empty(),
13335            ___deadline,
13336        )?;
13337        Ok(_response.s)
13338    }
13339
13340    /// [DEPRECATED - Use new GetFlags method instead.]
13341    pub fn r#deprecated_get_flags(
13342        &self,
13343        ___deadline: zx::MonotonicInstant,
13344    ) -> Result<(i32, OpenFlags), fidl::Error> {
13345        let _response = self
13346            .client
13347            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
13348                (),
13349                0x5b88fffb8eda3aa1,
13350                fidl::encoding::DynamicFlags::empty(),
13351                ___deadline,
13352            )?;
13353        Ok((_response.s, _response.flags))
13354    }
13355
13356    /// [DEPRECATED - Use new SetFlags method instead.]
13357    pub fn r#deprecated_set_flags(
13358        &self,
13359        mut flags: OpenFlags,
13360        ___deadline: zx::MonotonicInstant,
13361    ) -> Result<i32, fidl::Error> {
13362        let _response = self
13363            .client
13364            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
13365                (flags,),
13366                0x5295b76c71fde733,
13367                fidl::encoding::DynamicFlags::empty(),
13368                ___deadline,
13369            )?;
13370        Ok(_response.s)
13371    }
13372
13373    /// Queries the flags that apply to this node after it has been opened/created. This method does
13374    /// not require any rights.
13375    ///
13376    /// Note that the final set of flags that apply to the connection may differ from those
13377    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13378    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13379    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13380    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13381    pub fn r#get_flags(
13382        &self,
13383        ___deadline: zx::MonotonicInstant,
13384    ) -> Result<NodeGetFlagsResult, fidl::Error> {
13385        let _response = self.client.send_query::<
13386            fidl::encoding::EmptyPayload,
13387            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
13388        >(
13389            (),
13390            0x176eb318f64ec23,
13391            fidl::encoding::DynamicFlags::FLEXIBLE,
13392            ___deadline,
13393        )?
13394        .into_result::<NodeMarker>("get_flags")?;
13395        Ok(_response.map(|x| x.flags))
13396    }
13397
13398    /// Sets the flags that apply to this node after it has been opened. This method does not
13399    /// require any rights.
13400    ///
13401    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13402    /// clear append mode.
13403    ///
13404    /// Errors:
13405    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13406    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13407    pub fn r#set_flags(
13408        &self,
13409        mut flags: Flags,
13410        ___deadline: zx::MonotonicInstant,
13411    ) -> Result<NodeSetFlagsResult, fidl::Error> {
13412        let _response = self.client.send_query::<
13413            NodeSetFlagsRequest,
13414            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
13415        >(
13416            (flags,),
13417            0x55a8028685791ea8,
13418            fidl::encoding::DynamicFlags::FLEXIBLE,
13419            ___deadline,
13420        )?
13421        .into_result::<NodeMarker>("set_flags")?;
13422        Ok(_response.map(|x| x))
13423    }
13424
13425    /// Query the filesystem for filesystem-specific information.
13426    pub fn r#query_filesystem(
13427        &self,
13428        ___deadline: zx::MonotonicInstant,
13429    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
13430        let _response =
13431            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
13432                (),
13433                0x6f344a1c6b0a0610,
13434                fidl::encoding::DynamicFlags::empty(),
13435                ___deadline,
13436            )?;
13437        Ok((_response.s, _response.info))
13438    }
13439
13440    /// Acquires information about the connection.
13441    ///
13442    /// This method does not require any rights.
13443    pub fn r#get_connection_info(
13444        &self,
13445        ___deadline: zx::MonotonicInstant,
13446    ) -> Result<ConnectionInfo, fidl::Error> {
13447        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, ConnectionInfo>(
13448            (),
13449            0x584c377c7c0a6d0b,
13450            fidl::encoding::DynamicFlags::empty(),
13451            ___deadline,
13452        )?;
13453        Ok(_response)
13454    }
13455
13456    /// Acquires information about the node.
13457    ///
13458    /// The attributes of a node should be stable, independent of the
13459    /// specific protocol used to access it.
13460    ///
13461    /// If a particular attribute is not applicable or not supported,
13462    /// filesystems should leave the corresponding field absent.
13463    ///
13464    /// + `query` a bit-mask specifying which attributes to fetch. The server
13465    ///   should not return more than necessary.
13466    /// - `attributes` the returned attributes.
13467    ///
13468    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13469    pub fn r#get_attributes(
13470        &self,
13471        mut query: NodeAttributesQuery,
13472        ___deadline: zx::MonotonicInstant,
13473    ) -> Result<NodeGetAttributesResult, fidl::Error> {
13474        let _response = self.client.send_query::<
13475            NodeGetAttributesRequest,
13476            fidl::encoding::ResultType<NodeAttributes2, i32>,
13477        >(
13478            (query,),
13479            0x3d4396a638ea053b,
13480            fidl::encoding::DynamicFlags::empty(),
13481            ___deadline,
13482        )?;
13483        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
13484    }
13485
13486    /// Updates information about the node.
13487    ///
13488    /// + `attributes` the presence of a table field in `attributes` indicates
13489    /// the intent to update the corresponding attribute.
13490    ///
13491    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13492    ///
13493    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13494    pub fn r#update_attributes(
13495        &self,
13496        mut payload: &MutableNodeAttributes,
13497        ___deadline: zx::MonotonicInstant,
13498    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
13499        let _response = self.client.send_query::<
13500            MutableNodeAttributes,
13501            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13502        >(
13503            payload,
13504            0x3308c1da5a89bf08,
13505            fidl::encoding::DynamicFlags::empty(),
13506            ___deadline,
13507        )?;
13508        Ok(_response.map(|x| x))
13509    }
13510
13511    /// Synchronizes updates to the node to the underlying media, if it exists.
13512    ///
13513    /// This method will return when the filesystem server has flushed the
13514    /// relevant updates to the underlying media, but does not guarantee the
13515    /// underlying media has persisted the information, nor that any information
13516    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13517    /// between operations.
13518    ///
13519    /// This method does not require any rights.
13520    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
13521        let _response = self.client.send_query::<
13522            fidl::encoding::EmptyPayload,
13523            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13524        >(
13525            (),
13526            0x2c5c27ca0ab5dc49,
13527            fidl::encoding::DynamicFlags::empty(),
13528            ___deadline,
13529        )?;
13530        Ok(_response.map(|x| x))
13531    }
13532
13533    /// Creates an iterator over all the extended attribute names associated
13534    /// with this node. If an error occurs it is returned as an epitaph on the
13535    /// iterator request channel, and then the channel is closed.
13536    ///
13537    /// GetExtendedAttributes can be used with any of these names to retrieve
13538    /// the associated value.
13539    ///
13540    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13541    pub fn r#list_extended_attributes(
13542        &self,
13543        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13544    ) -> Result<(), fidl::Error> {
13545        self.client.send::<NodeListExtendedAttributesRequest>(
13546            (iterator,),
13547            0x4b61033de007fcd0,
13548            fidl::encoding::DynamicFlags::empty(),
13549        )
13550    }
13551
13552    /// Get the value associated with the given attribute `name` for this node.
13553    ///
13554    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13555    /// particular structure is imposed on them.
13556    ///
13557    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13558    pub fn r#get_extended_attribute(
13559        &self,
13560        mut name: &[u8],
13561        ___deadline: zx::MonotonicInstant,
13562    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
13563        let _response = self.client.send_query::<
13564            NodeGetExtendedAttributeRequest,
13565            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
13566        >(
13567            (name,),
13568            0x45ffa3ccfdeb76db,
13569            fidl::encoding::DynamicFlags::empty(),
13570            ___deadline,
13571        )?;
13572        Ok(_response.map(|x| x))
13573    }
13574
13575    /// Set the value for the given attribute `name` to `value` for this node.
13576    ///
13577    /// The attribute name may exist, in which case the attribute is updated.
13578    /// If the attribute doesn't exist, it is created. The name should have no
13579    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13580    ///
13581    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13582    pub fn r#set_extended_attribute(
13583        &self,
13584        mut name: &[u8],
13585        mut value: ExtendedAttributeValue,
13586        mut mode: SetExtendedAttributeMode,
13587        ___deadline: zx::MonotonicInstant,
13588    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
13589        let _response = self.client.send_query::<
13590            NodeSetExtendedAttributeRequest,
13591            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13592        >(
13593            (name, &mut value, mode,),
13594            0x4a951362f681f23c,
13595            fidl::encoding::DynamicFlags::empty(),
13596            ___deadline,
13597        )?;
13598        Ok(_response.map(|x| x))
13599    }
13600
13601    /// Remove the specified extended attribute.
13602    ///
13603    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13604    ///
13605    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13606    pub fn r#remove_extended_attribute(
13607        &self,
13608        mut name: &[u8],
13609        ___deadline: zx::MonotonicInstant,
13610    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
13611        let _response = self.client.send_query::<
13612            NodeRemoveExtendedAttributeRequest,
13613            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13614        >(
13615            (name,),
13616            0x7a0b9f3a9bf9032d,
13617            fidl::encoding::DynamicFlags::empty(),
13618            ___deadline,
13619        )?;
13620        Ok(_response.map(|x| x))
13621    }
13622}
13623
13624#[cfg(target_os = "fuchsia")]
13625impl From<NodeSynchronousProxy> for zx::Handle {
13626    fn from(value: NodeSynchronousProxy) -> Self {
13627        value.into_channel().into()
13628    }
13629}
13630
13631#[cfg(target_os = "fuchsia")]
13632impl From<fidl::Channel> for NodeSynchronousProxy {
13633    fn from(value: fidl::Channel) -> Self {
13634        Self::new(value)
13635    }
13636}
13637
13638#[derive(Debug, Clone)]
13639pub struct NodeProxy {
13640    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
13641}
13642
13643impl fidl::endpoints::Proxy for NodeProxy {
13644    type Protocol = NodeMarker;
13645
13646    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
13647        Self::new(inner)
13648    }
13649
13650    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
13651        self.client.into_channel().map_err(|client| Self { client })
13652    }
13653
13654    fn as_channel(&self) -> &::fidl::AsyncChannel {
13655        self.client.as_channel()
13656    }
13657}
13658
13659impl NodeProxy {
13660    /// Create a new Proxy for fuchsia.io/Node.
13661    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
13662        let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
13663        Self { client: fidl::client::Client::new(channel, protocol_name) }
13664    }
13665
13666    /// Get a Stream of events from the remote end of the protocol.
13667    ///
13668    /// # Panics
13669    ///
13670    /// Panics if the event stream was already taken.
13671    pub fn take_event_stream(&self) -> NodeEventStream {
13672        NodeEventStream { event_receiver: self.client.take_event_receiver() }
13673    }
13674
13675    pub fn r#clone(
13676        &self,
13677        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13678    ) -> Result<(), fidl::Error> {
13679        NodeProxyInterface::r#clone(self, request)
13680    }
13681
13682    /// Terminates the connection.
13683    ///
13684    /// After calling `Close`, the client must not send any other requests.
13685    ///
13686    /// Servers, after sending the status response, should close the connection
13687    /// regardless of status and without sending an epitaph.
13688    ///
13689    /// Closing the client end of the channel should be semantically equivalent
13690    /// to calling `Close` without knowing when the close has completed or its
13691    /// status.
13692    pub fn r#close(
13693        &self,
13694    ) -> fidl::client::QueryResponseFut<
13695        fidl_fuchsia_unknown::CloseableCloseResult,
13696        fidl::encoding::DefaultFuchsiaResourceDialect,
13697    > {
13698        NodeProxyInterface::r#close(self)
13699    }
13700
13701    pub fn r#query(
13702        &self,
13703    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
13704    {
13705        NodeProxyInterface::r#query(self)
13706    }
13707
13708    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
13709    pub fn r#deprecated_clone(
13710        &self,
13711        mut flags: OpenFlags,
13712        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13713    ) -> Result<(), fidl::Error> {
13714        NodeProxyInterface::r#deprecated_clone(self, flags, object)
13715    }
13716
13717    /// Acquires information about the node.
13718    ///
13719    /// This method does not require any rights.
13720    pub fn r#get_attr(
13721        &self,
13722    ) -> fidl::client::QueryResponseFut<
13723        (i32, NodeAttributes),
13724        fidl::encoding::DefaultFuchsiaResourceDialect,
13725    > {
13726        NodeProxyInterface::r#get_attr(self)
13727    }
13728
13729    /// Updates information about the node.
13730    ///
13731    /// Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.
13732    ///
13733    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
13734    /// `ZX_ERR_BAD_HANDLE`.
13735    pub fn r#set_attr(
13736        &self,
13737        mut flags: NodeAttributeFlags,
13738        mut attributes: &NodeAttributes,
13739    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13740        NodeProxyInterface::r#set_attr(self, flags, attributes)
13741    }
13742
13743    /// [DEPRECATED - Use new GetFlags method instead.]
13744    pub fn r#deprecated_get_flags(
13745        &self,
13746    ) -> fidl::client::QueryResponseFut<
13747        (i32, OpenFlags),
13748        fidl::encoding::DefaultFuchsiaResourceDialect,
13749    > {
13750        NodeProxyInterface::r#deprecated_get_flags(self)
13751    }
13752
13753    /// [DEPRECATED - Use new SetFlags method instead.]
13754    pub fn r#deprecated_set_flags(
13755        &self,
13756        mut flags: OpenFlags,
13757    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13758        NodeProxyInterface::r#deprecated_set_flags(self, flags)
13759    }
13760
13761    /// Queries the flags that apply to this node after it has been opened/created. This method does
13762    /// not require any rights.
13763    ///
13764    /// Note that the final set of flags that apply to the connection may differ from those
13765    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13766    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13767    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13768    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13769    pub fn r#get_flags(
13770        &self,
13771    ) -> fidl::client::QueryResponseFut<
13772        NodeGetFlagsResult,
13773        fidl::encoding::DefaultFuchsiaResourceDialect,
13774    > {
13775        NodeProxyInterface::r#get_flags(self)
13776    }
13777
13778    /// Sets the flags that apply to this node after it has been opened. This method does not
13779    /// require any rights.
13780    ///
13781    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13782    /// clear append mode.
13783    ///
13784    /// Errors:
13785    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13786    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13787    pub fn r#set_flags(
13788        &self,
13789        mut flags: Flags,
13790    ) -> fidl::client::QueryResponseFut<
13791        NodeSetFlagsResult,
13792        fidl::encoding::DefaultFuchsiaResourceDialect,
13793    > {
13794        NodeProxyInterface::r#set_flags(self, flags)
13795    }
13796
13797    /// Query the filesystem for filesystem-specific information.
13798    pub fn r#query_filesystem(
13799        &self,
13800    ) -> fidl::client::QueryResponseFut<
13801        (i32, Option<Box<FilesystemInfo>>),
13802        fidl::encoding::DefaultFuchsiaResourceDialect,
13803    > {
13804        NodeProxyInterface::r#query_filesystem(self)
13805    }
13806
13807    /// Acquires information about the connection.
13808    ///
13809    /// This method does not require any rights.
13810    pub fn r#get_connection_info(
13811        &self,
13812    ) -> fidl::client::QueryResponseFut<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
13813    {
13814        NodeProxyInterface::r#get_connection_info(self)
13815    }
13816
13817    /// Acquires information about the node.
13818    ///
13819    /// The attributes of a node should be stable, independent of the
13820    /// specific protocol used to access it.
13821    ///
13822    /// If a particular attribute is not applicable or not supported,
13823    /// filesystems should leave the corresponding field absent.
13824    ///
13825    /// + `query` a bit-mask specifying which attributes to fetch. The server
13826    ///   should not return more than necessary.
13827    /// - `attributes` the returned attributes.
13828    ///
13829    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13830    pub fn r#get_attributes(
13831        &self,
13832        mut query: NodeAttributesQuery,
13833    ) -> fidl::client::QueryResponseFut<
13834        NodeGetAttributesResult,
13835        fidl::encoding::DefaultFuchsiaResourceDialect,
13836    > {
13837        NodeProxyInterface::r#get_attributes(self, query)
13838    }
13839
13840    /// Updates information about the node.
13841    ///
13842    /// + `attributes` the presence of a table field in `attributes` indicates
13843    /// the intent to update the corresponding attribute.
13844    ///
13845    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13846    ///
13847    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13848    pub fn r#update_attributes(
13849        &self,
13850        mut payload: &MutableNodeAttributes,
13851    ) -> fidl::client::QueryResponseFut<
13852        NodeUpdateAttributesResult,
13853        fidl::encoding::DefaultFuchsiaResourceDialect,
13854    > {
13855        NodeProxyInterface::r#update_attributes(self, payload)
13856    }
13857
13858    /// Synchronizes updates to the node to the underlying media, if it exists.
13859    ///
13860    /// This method will return when the filesystem server has flushed the
13861    /// relevant updates to the underlying media, but does not guarantee the
13862    /// underlying media has persisted the information, nor that any information
13863    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13864    /// between operations.
13865    ///
13866    /// This method does not require any rights.
13867    pub fn r#sync(
13868        &self,
13869    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
13870    {
13871        NodeProxyInterface::r#sync(self)
13872    }
13873
13874    /// Creates an iterator over all the extended attribute names associated
13875    /// with this node. If an error occurs it is returned as an epitaph on the
13876    /// iterator request channel, and then the channel is closed.
13877    ///
13878    /// GetExtendedAttributes can be used with any of these names to retrieve
13879    /// the associated value.
13880    ///
13881    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13882    pub fn r#list_extended_attributes(
13883        &self,
13884        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13885    ) -> Result<(), fidl::Error> {
13886        NodeProxyInterface::r#list_extended_attributes(self, iterator)
13887    }
13888
13889    /// Get the value associated with the given attribute `name` for this node.
13890    ///
13891    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13892    /// particular structure is imposed on them.
13893    ///
13894    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13895    pub fn r#get_extended_attribute(
13896        &self,
13897        mut name: &[u8],
13898    ) -> fidl::client::QueryResponseFut<
13899        NodeGetExtendedAttributeResult,
13900        fidl::encoding::DefaultFuchsiaResourceDialect,
13901    > {
13902        NodeProxyInterface::r#get_extended_attribute(self, name)
13903    }
13904
13905    /// Set the value for the given attribute `name` to `value` for this node.
13906    ///
13907    /// The attribute name may exist, in which case the attribute is updated.
13908    /// If the attribute doesn't exist, it is created. The name should have no
13909    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13910    ///
13911    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13912    pub fn r#set_extended_attribute(
13913        &self,
13914        mut name: &[u8],
13915        mut value: ExtendedAttributeValue,
13916        mut mode: SetExtendedAttributeMode,
13917    ) -> fidl::client::QueryResponseFut<
13918        NodeSetExtendedAttributeResult,
13919        fidl::encoding::DefaultFuchsiaResourceDialect,
13920    > {
13921        NodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
13922    }
13923
13924    /// Remove the specified extended attribute.
13925    ///
13926    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13927    ///
13928    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13929    pub fn r#remove_extended_attribute(
13930        &self,
13931        mut name: &[u8],
13932    ) -> fidl::client::QueryResponseFut<
13933        NodeRemoveExtendedAttributeResult,
13934        fidl::encoding::DefaultFuchsiaResourceDialect,
13935    > {
13936        NodeProxyInterface::r#remove_extended_attribute(self, name)
13937    }
13938}
13939
13940impl NodeProxyInterface for NodeProxy {
13941    fn r#clone(
13942        &self,
13943        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13944    ) -> Result<(), fidl::Error> {
13945        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
13946            (request,),
13947            0x20d8a7aba2168a79,
13948            fidl::encoding::DynamicFlags::empty(),
13949        )
13950    }
13951
13952    type CloseResponseFut = fidl::client::QueryResponseFut<
13953        fidl_fuchsia_unknown::CloseableCloseResult,
13954        fidl::encoding::DefaultFuchsiaResourceDialect,
13955    >;
13956    fn r#close(&self) -> Self::CloseResponseFut {
13957        fn _decode(
13958            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13959        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
13960            let _response = fidl::client::decode_transaction_body::<
13961                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13962                fidl::encoding::DefaultFuchsiaResourceDialect,
13963                0x5ac5d459ad7f657e,
13964            >(_buf?)?;
13965            Ok(_response.map(|x| x))
13966        }
13967        self.client.send_query_and_decode::<
13968            fidl::encoding::EmptyPayload,
13969            fidl_fuchsia_unknown::CloseableCloseResult,
13970        >(
13971            (),
13972            0x5ac5d459ad7f657e,
13973            fidl::encoding::DynamicFlags::empty(),
13974            _decode,
13975        )
13976    }
13977
13978    type QueryResponseFut =
13979        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
13980    fn r#query(&self) -> Self::QueryResponseFut {
13981        fn _decode(
13982            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13983        ) -> Result<Vec<u8>, fidl::Error> {
13984            let _response = fidl::client::decode_transaction_body::<
13985                fidl_fuchsia_unknown::QueryableQueryResponse,
13986                fidl::encoding::DefaultFuchsiaResourceDialect,
13987                0x2658edee9decfc06,
13988            >(_buf?)?;
13989            Ok(_response.protocol)
13990        }
13991        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
13992            (),
13993            0x2658edee9decfc06,
13994            fidl::encoding::DynamicFlags::empty(),
13995            _decode,
13996        )
13997    }
13998
13999    fn r#deprecated_clone(
14000        &self,
14001        mut flags: OpenFlags,
14002        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
14003    ) -> Result<(), fidl::Error> {
14004        self.client.send::<NodeDeprecatedCloneRequest>(
14005            (flags, object),
14006            0x5a61678f293ce16f,
14007            fidl::encoding::DynamicFlags::FLEXIBLE,
14008        )
14009    }
14010
14011    type GetAttrResponseFut = fidl::client::QueryResponseFut<
14012        (i32, NodeAttributes),
14013        fidl::encoding::DefaultFuchsiaResourceDialect,
14014    >;
14015    fn r#get_attr(&self) -> Self::GetAttrResponseFut {
14016        fn _decode(
14017            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14018        ) -> Result<(i32, NodeAttributes), fidl::Error> {
14019            let _response = fidl::client::decode_transaction_body::<
14020                NodeGetAttrResponse,
14021                fidl::encoding::DefaultFuchsiaResourceDialect,
14022                0x78985e216314dafd,
14023            >(_buf?)?;
14024            Ok((_response.s, _response.attributes))
14025        }
14026        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
14027            (),
14028            0x78985e216314dafd,
14029            fidl::encoding::DynamicFlags::empty(),
14030            _decode,
14031        )
14032    }
14033
14034    type SetAttrResponseFut =
14035        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
14036    fn r#set_attr(
14037        &self,
14038        mut flags: NodeAttributeFlags,
14039        mut attributes: &NodeAttributes,
14040    ) -> Self::SetAttrResponseFut {
14041        fn _decode(
14042            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14043        ) -> Result<i32, fidl::Error> {
14044            let _response = fidl::client::decode_transaction_body::<
14045                NodeSetAttrResponse,
14046                fidl::encoding::DefaultFuchsiaResourceDialect,
14047                0x4186c0f40d938f46,
14048            >(_buf?)?;
14049            Ok(_response.s)
14050        }
14051        self.client.send_query_and_decode::<NodeSetAttrRequest, i32>(
14052            (flags, attributes),
14053            0x4186c0f40d938f46,
14054            fidl::encoding::DynamicFlags::empty(),
14055            _decode,
14056        )
14057    }
14058
14059    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
14060        (i32, OpenFlags),
14061        fidl::encoding::DefaultFuchsiaResourceDialect,
14062    >;
14063    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
14064        fn _decode(
14065            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14066        ) -> Result<(i32, OpenFlags), fidl::Error> {
14067            let _response = fidl::client::decode_transaction_body::<
14068                NodeDeprecatedGetFlagsResponse,
14069                fidl::encoding::DefaultFuchsiaResourceDialect,
14070                0x5b88fffb8eda3aa1,
14071            >(_buf?)?;
14072            Ok((_response.s, _response.flags))
14073        }
14074        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
14075            (),
14076            0x5b88fffb8eda3aa1,
14077            fidl::encoding::DynamicFlags::empty(),
14078            _decode,
14079        )
14080    }
14081
14082    type DeprecatedSetFlagsResponseFut =
14083        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
14084    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
14085        fn _decode(
14086            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14087        ) -> Result<i32, fidl::Error> {
14088            let _response = fidl::client::decode_transaction_body::<
14089                NodeDeprecatedSetFlagsResponse,
14090                fidl::encoding::DefaultFuchsiaResourceDialect,
14091                0x5295b76c71fde733,
14092            >(_buf?)?;
14093            Ok(_response.s)
14094        }
14095        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
14096            (flags,),
14097            0x5295b76c71fde733,
14098            fidl::encoding::DynamicFlags::empty(),
14099            _decode,
14100        )
14101    }
14102
14103    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
14104        NodeGetFlagsResult,
14105        fidl::encoding::DefaultFuchsiaResourceDialect,
14106    >;
14107    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
14108        fn _decode(
14109            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14110        ) -> Result<NodeGetFlagsResult, fidl::Error> {
14111            let _response = fidl::client::decode_transaction_body::<
14112                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
14113                fidl::encoding::DefaultFuchsiaResourceDialect,
14114                0x176eb318f64ec23,
14115            >(_buf?)?
14116            .into_result::<NodeMarker>("get_flags")?;
14117            Ok(_response.map(|x| x.flags))
14118        }
14119        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
14120            (),
14121            0x176eb318f64ec23,
14122            fidl::encoding::DynamicFlags::FLEXIBLE,
14123            _decode,
14124        )
14125    }
14126
14127    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
14128        NodeSetFlagsResult,
14129        fidl::encoding::DefaultFuchsiaResourceDialect,
14130    >;
14131    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
14132        fn _decode(
14133            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14134        ) -> Result<NodeSetFlagsResult, fidl::Error> {
14135            let _response = fidl::client::decode_transaction_body::<
14136                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
14137                fidl::encoding::DefaultFuchsiaResourceDialect,
14138                0x55a8028685791ea8,
14139            >(_buf?)?
14140            .into_result::<NodeMarker>("set_flags")?;
14141            Ok(_response.map(|x| x))
14142        }
14143        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
14144            (flags,),
14145            0x55a8028685791ea8,
14146            fidl::encoding::DynamicFlags::FLEXIBLE,
14147            _decode,
14148        )
14149    }
14150
14151    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
14152        (i32, Option<Box<FilesystemInfo>>),
14153        fidl::encoding::DefaultFuchsiaResourceDialect,
14154    >;
14155    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
14156        fn _decode(
14157            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14158        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
14159            let _response = fidl::client::decode_transaction_body::<
14160                NodeQueryFilesystemResponse,
14161                fidl::encoding::DefaultFuchsiaResourceDialect,
14162                0x6f344a1c6b0a0610,
14163            >(_buf?)?;
14164            Ok((_response.s, _response.info))
14165        }
14166        self.client.send_query_and_decode::<
14167            fidl::encoding::EmptyPayload,
14168            (i32, Option<Box<FilesystemInfo>>),
14169        >(
14170            (),
14171            0x6f344a1c6b0a0610,
14172            fidl::encoding::DynamicFlags::empty(),
14173            _decode,
14174        )
14175    }
14176
14177    type GetConnectionInfoResponseFut = fidl::client::QueryResponseFut<
14178        ConnectionInfo,
14179        fidl::encoding::DefaultFuchsiaResourceDialect,
14180    >;
14181    fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut {
14182        fn _decode(
14183            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14184        ) -> Result<ConnectionInfo, fidl::Error> {
14185            let _response = fidl::client::decode_transaction_body::<
14186                ConnectionInfo,
14187                fidl::encoding::DefaultFuchsiaResourceDialect,
14188                0x584c377c7c0a6d0b,
14189            >(_buf?)?;
14190            Ok(_response)
14191        }
14192        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ConnectionInfo>(
14193            (),
14194            0x584c377c7c0a6d0b,
14195            fidl::encoding::DynamicFlags::empty(),
14196            _decode,
14197        )
14198    }
14199
14200    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
14201        NodeGetAttributesResult,
14202        fidl::encoding::DefaultFuchsiaResourceDialect,
14203    >;
14204    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
14205        fn _decode(
14206            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14207        ) -> Result<NodeGetAttributesResult, fidl::Error> {
14208            let _response = fidl::client::decode_transaction_body::<
14209                fidl::encoding::ResultType<NodeAttributes2, i32>,
14210                fidl::encoding::DefaultFuchsiaResourceDialect,
14211                0x3d4396a638ea053b,
14212            >(_buf?)?;
14213            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
14214        }
14215        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
14216            (query,),
14217            0x3d4396a638ea053b,
14218            fidl::encoding::DynamicFlags::empty(),
14219            _decode,
14220        )
14221    }
14222
14223    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
14224        NodeUpdateAttributesResult,
14225        fidl::encoding::DefaultFuchsiaResourceDialect,
14226    >;
14227    fn r#update_attributes(
14228        &self,
14229        mut payload: &MutableNodeAttributes,
14230    ) -> Self::UpdateAttributesResponseFut {
14231        fn _decode(
14232            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14233        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
14234            let _response = fidl::client::decode_transaction_body::<
14235                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14236                fidl::encoding::DefaultFuchsiaResourceDialect,
14237                0x3308c1da5a89bf08,
14238            >(_buf?)?;
14239            Ok(_response.map(|x| x))
14240        }
14241        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
14242            payload,
14243            0x3308c1da5a89bf08,
14244            fidl::encoding::DynamicFlags::empty(),
14245            _decode,
14246        )
14247    }
14248
14249    type SyncResponseFut = fidl::client::QueryResponseFut<
14250        NodeSyncResult,
14251        fidl::encoding::DefaultFuchsiaResourceDialect,
14252    >;
14253    fn r#sync(&self) -> Self::SyncResponseFut {
14254        fn _decode(
14255            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14256        ) -> Result<NodeSyncResult, fidl::Error> {
14257            let _response = fidl::client::decode_transaction_body::<
14258                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14259                fidl::encoding::DefaultFuchsiaResourceDialect,
14260                0x2c5c27ca0ab5dc49,
14261            >(_buf?)?;
14262            Ok(_response.map(|x| x))
14263        }
14264        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
14265            (),
14266            0x2c5c27ca0ab5dc49,
14267            fidl::encoding::DynamicFlags::empty(),
14268            _decode,
14269        )
14270    }
14271
14272    fn r#list_extended_attributes(
14273        &self,
14274        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
14275    ) -> Result<(), fidl::Error> {
14276        self.client.send::<NodeListExtendedAttributesRequest>(
14277            (iterator,),
14278            0x4b61033de007fcd0,
14279            fidl::encoding::DynamicFlags::empty(),
14280        )
14281    }
14282
14283    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14284        NodeGetExtendedAttributeResult,
14285        fidl::encoding::DefaultFuchsiaResourceDialect,
14286    >;
14287    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
14288        fn _decode(
14289            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14290        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
14291            let _response = fidl::client::decode_transaction_body::<
14292                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
14293                fidl::encoding::DefaultFuchsiaResourceDialect,
14294                0x45ffa3ccfdeb76db,
14295            >(_buf?)?;
14296            Ok(_response.map(|x| x))
14297        }
14298        self.client.send_query_and_decode::<
14299            NodeGetExtendedAttributeRequest,
14300            NodeGetExtendedAttributeResult,
14301        >(
14302            (name,),
14303            0x45ffa3ccfdeb76db,
14304            fidl::encoding::DynamicFlags::empty(),
14305            _decode,
14306        )
14307    }
14308
14309    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14310        NodeSetExtendedAttributeResult,
14311        fidl::encoding::DefaultFuchsiaResourceDialect,
14312    >;
14313    fn r#set_extended_attribute(
14314        &self,
14315        mut name: &[u8],
14316        mut value: ExtendedAttributeValue,
14317        mut mode: SetExtendedAttributeMode,
14318    ) -> Self::SetExtendedAttributeResponseFut {
14319        fn _decode(
14320            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14321        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
14322            let _response = fidl::client::decode_transaction_body::<
14323                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14324                fidl::encoding::DefaultFuchsiaResourceDialect,
14325                0x4a951362f681f23c,
14326            >(_buf?)?;
14327            Ok(_response.map(|x| x))
14328        }
14329        self.client.send_query_and_decode::<
14330            NodeSetExtendedAttributeRequest,
14331            NodeSetExtendedAttributeResult,
14332        >(
14333            (name, &mut value, mode,),
14334            0x4a951362f681f23c,
14335            fidl::encoding::DynamicFlags::empty(),
14336            _decode,
14337        )
14338    }
14339
14340    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14341        NodeRemoveExtendedAttributeResult,
14342        fidl::encoding::DefaultFuchsiaResourceDialect,
14343    >;
14344    fn r#remove_extended_attribute(
14345        &self,
14346        mut name: &[u8],
14347    ) -> Self::RemoveExtendedAttributeResponseFut {
14348        fn _decode(
14349            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14350        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
14351            let _response = fidl::client::decode_transaction_body::<
14352                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14353                fidl::encoding::DefaultFuchsiaResourceDialect,
14354                0x7a0b9f3a9bf9032d,
14355            >(_buf?)?;
14356            Ok(_response.map(|x| x))
14357        }
14358        self.client.send_query_and_decode::<
14359            NodeRemoveExtendedAttributeRequest,
14360            NodeRemoveExtendedAttributeResult,
14361        >(
14362            (name,),
14363            0x7a0b9f3a9bf9032d,
14364            fidl::encoding::DynamicFlags::empty(),
14365            _decode,
14366        )
14367    }
14368}
14369
14370pub struct NodeEventStream {
14371    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
14372}
14373
14374impl std::marker::Unpin for NodeEventStream {}
14375
14376impl futures::stream::FusedStream for NodeEventStream {
14377    fn is_terminated(&self) -> bool {
14378        self.event_receiver.is_terminated()
14379    }
14380}
14381
14382impl futures::Stream for NodeEventStream {
14383    type Item = Result<NodeEvent, fidl::Error>;
14384
14385    fn poll_next(
14386        mut self: std::pin::Pin<&mut Self>,
14387        cx: &mut std::task::Context<'_>,
14388    ) -> std::task::Poll<Option<Self::Item>> {
14389        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
14390            &mut self.event_receiver,
14391            cx
14392        )?) {
14393            Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
14394            None => std::task::Poll::Ready(None),
14395        }
14396    }
14397}
14398
14399#[derive(Debug)]
14400pub enum NodeEvent {
14401    OnOpen_ {
14402        s: i32,
14403        info: Option<Box<NodeInfoDeprecated>>,
14404    },
14405    OnRepresentation {
14406        payload: Representation,
14407    },
14408    #[non_exhaustive]
14409    _UnknownEvent {
14410        /// Ordinal of the event that was sent.
14411        ordinal: u64,
14412    },
14413}
14414
14415impl NodeEvent {
14416    #[allow(irrefutable_let_patterns)]
14417    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
14418        if let NodeEvent::OnOpen_ { s, info } = self {
14419            Some((s, info))
14420        } else {
14421            None
14422        }
14423    }
14424    #[allow(irrefutable_let_patterns)]
14425    pub fn into_on_representation(self) -> Option<Representation> {
14426        if let NodeEvent::OnRepresentation { payload } = self {
14427            Some((payload))
14428        } else {
14429            None
14430        }
14431    }
14432
14433    /// Decodes a message buffer as a [`NodeEvent`].
14434    fn decode(
14435        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
14436    ) -> Result<NodeEvent, fidl::Error> {
14437        let (bytes, _handles) = buf.split_mut();
14438        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14439        debug_assert_eq!(tx_header.tx_id, 0);
14440        match tx_header.ordinal {
14441            0x7fc7bbb1dbfd1972 => {
14442                let mut out = fidl::new_empty!(
14443                    NodeOnOpenRequest,
14444                    fidl::encoding::DefaultFuchsiaResourceDialect
14445                );
14446                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
14447                Ok((NodeEvent::OnOpen_ { s: out.s, info: out.info }))
14448            }
14449            0x5cb40567d80a510c => {
14450                let mut out =
14451                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
14452                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
14453                Ok((NodeEvent::OnRepresentation { payload: out }))
14454            }
14455            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
14456                Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
14457            }
14458            _ => Err(fidl::Error::UnknownOrdinal {
14459                ordinal: tx_header.ordinal,
14460                protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14461            }),
14462        }
14463    }
14464}
14465
14466/// A Stream of incoming requests for fuchsia.io/Node.
14467pub struct NodeRequestStream {
14468    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14469    is_terminated: bool,
14470}
14471
14472impl std::marker::Unpin for NodeRequestStream {}
14473
14474impl futures::stream::FusedStream for NodeRequestStream {
14475    fn is_terminated(&self) -> bool {
14476        self.is_terminated
14477    }
14478}
14479
14480impl fidl::endpoints::RequestStream for NodeRequestStream {
14481    type Protocol = NodeMarker;
14482    type ControlHandle = NodeControlHandle;
14483
14484    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
14485        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
14486    }
14487
14488    fn control_handle(&self) -> Self::ControlHandle {
14489        NodeControlHandle { inner: self.inner.clone() }
14490    }
14491
14492    fn into_inner(
14493        self,
14494    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
14495    {
14496        (self.inner, self.is_terminated)
14497    }
14498
14499    fn from_inner(
14500        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14501        is_terminated: bool,
14502    ) -> Self {
14503        Self { inner, is_terminated }
14504    }
14505}
14506
14507impl futures::Stream for NodeRequestStream {
14508    type Item = Result<NodeRequest, fidl::Error>;
14509
14510    fn poll_next(
14511        mut self: std::pin::Pin<&mut Self>,
14512        cx: &mut std::task::Context<'_>,
14513    ) -> std::task::Poll<Option<Self::Item>> {
14514        let this = &mut *self;
14515        if this.inner.check_shutdown(cx) {
14516            this.is_terminated = true;
14517            return std::task::Poll::Ready(None);
14518        }
14519        if this.is_terminated {
14520            panic!("polled NodeRequestStream after completion");
14521        }
14522        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
14523            |bytes, handles| {
14524                match this.inner.channel().read_etc(cx, bytes, handles) {
14525                    std::task::Poll::Ready(Ok(())) => {}
14526                    std::task::Poll::Pending => return std::task::Poll::Pending,
14527                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
14528                        this.is_terminated = true;
14529                        return std::task::Poll::Ready(None);
14530                    }
14531                    std::task::Poll::Ready(Err(e)) => {
14532                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
14533                            e.into(),
14534                        ))))
14535                    }
14536                }
14537
14538                // A message has been received from the channel
14539                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14540
14541                std::task::Poll::Ready(Some(match header.ordinal {
14542                    0x20d8a7aba2168a79 => {
14543                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14544                        let mut req = fidl::new_empty!(
14545                            fidl_fuchsia_unknown::CloneableCloneRequest,
14546                            fidl::encoding::DefaultFuchsiaResourceDialect
14547                        );
14548                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14549                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14550                        Ok(NodeRequest::Clone { request: req.request, control_handle })
14551                    }
14552                    0x5ac5d459ad7f657e => {
14553                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14554                        let mut req = fidl::new_empty!(
14555                            fidl::encoding::EmptyPayload,
14556                            fidl::encoding::DefaultFuchsiaResourceDialect
14557                        );
14558                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14559                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14560                        Ok(NodeRequest::Close {
14561                            responder: NodeCloseResponder {
14562                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14563                                tx_id: header.tx_id,
14564                            },
14565                        })
14566                    }
14567                    0x2658edee9decfc06 => {
14568                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14569                        let mut req = fidl::new_empty!(
14570                            fidl::encoding::EmptyPayload,
14571                            fidl::encoding::DefaultFuchsiaResourceDialect
14572                        );
14573                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14574                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14575                        Ok(NodeRequest::Query {
14576                            responder: NodeQueryResponder {
14577                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14578                                tx_id: header.tx_id,
14579                            },
14580                        })
14581                    }
14582                    0x5a61678f293ce16f => {
14583                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14584                        let mut req = fidl::new_empty!(
14585                            NodeDeprecatedCloneRequest,
14586                            fidl::encoding::DefaultFuchsiaResourceDialect
14587                        );
14588                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14589                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14590                        Ok(NodeRequest::DeprecatedClone {
14591                            flags: req.flags,
14592                            object: req.object,
14593
14594                            control_handle,
14595                        })
14596                    }
14597                    0x78985e216314dafd => {
14598                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14599                        let mut req = fidl::new_empty!(
14600                            fidl::encoding::EmptyPayload,
14601                            fidl::encoding::DefaultFuchsiaResourceDialect
14602                        );
14603                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14604                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14605                        Ok(NodeRequest::GetAttr {
14606                            responder: NodeGetAttrResponder {
14607                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14608                                tx_id: header.tx_id,
14609                            },
14610                        })
14611                    }
14612                    0x4186c0f40d938f46 => {
14613                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14614                        let mut req = fidl::new_empty!(
14615                            NodeSetAttrRequest,
14616                            fidl::encoding::DefaultFuchsiaResourceDialect
14617                        );
14618                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
14619                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14620                        Ok(NodeRequest::SetAttr {
14621                            flags: req.flags,
14622                            attributes: req.attributes,
14623
14624                            responder: NodeSetAttrResponder {
14625                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14626                                tx_id: header.tx_id,
14627                            },
14628                        })
14629                    }
14630                    0x5b88fffb8eda3aa1 => {
14631                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14632                        let mut req = fidl::new_empty!(
14633                            fidl::encoding::EmptyPayload,
14634                            fidl::encoding::DefaultFuchsiaResourceDialect
14635                        );
14636                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14637                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14638                        Ok(NodeRequest::DeprecatedGetFlags {
14639                            responder: NodeDeprecatedGetFlagsResponder {
14640                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14641                                tx_id: header.tx_id,
14642                            },
14643                        })
14644                    }
14645                    0x5295b76c71fde733 => {
14646                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14647                        let mut req = fidl::new_empty!(
14648                            NodeDeprecatedSetFlagsRequest,
14649                            fidl::encoding::DefaultFuchsiaResourceDialect
14650                        );
14651                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14652                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14653                        Ok(NodeRequest::DeprecatedSetFlags {
14654                            flags: req.flags,
14655
14656                            responder: NodeDeprecatedSetFlagsResponder {
14657                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14658                                tx_id: header.tx_id,
14659                            },
14660                        })
14661                    }
14662                    0x176eb318f64ec23 => {
14663                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14664                        let mut req = fidl::new_empty!(
14665                            fidl::encoding::EmptyPayload,
14666                            fidl::encoding::DefaultFuchsiaResourceDialect
14667                        );
14668                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14669                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14670                        Ok(NodeRequest::GetFlags {
14671                            responder: NodeGetFlagsResponder {
14672                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14673                                tx_id: header.tx_id,
14674                            },
14675                        })
14676                    }
14677                    0x55a8028685791ea8 => {
14678                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14679                        let mut req = fidl::new_empty!(
14680                            NodeSetFlagsRequest,
14681                            fidl::encoding::DefaultFuchsiaResourceDialect
14682                        );
14683                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14684                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14685                        Ok(NodeRequest::SetFlags {
14686                            flags: req.flags,
14687
14688                            responder: NodeSetFlagsResponder {
14689                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14690                                tx_id: header.tx_id,
14691                            },
14692                        })
14693                    }
14694                    0x6f344a1c6b0a0610 => {
14695                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14696                        let mut req = fidl::new_empty!(
14697                            fidl::encoding::EmptyPayload,
14698                            fidl::encoding::DefaultFuchsiaResourceDialect
14699                        );
14700                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14701                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14702                        Ok(NodeRequest::QueryFilesystem {
14703                            responder: NodeQueryFilesystemResponder {
14704                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14705                                tx_id: header.tx_id,
14706                            },
14707                        })
14708                    }
14709                    0x584c377c7c0a6d0b => {
14710                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14711                        let mut req = fidl::new_empty!(
14712                            fidl::encoding::EmptyPayload,
14713                            fidl::encoding::DefaultFuchsiaResourceDialect
14714                        );
14715                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14716                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14717                        Ok(NodeRequest::GetConnectionInfo {
14718                            responder: NodeGetConnectionInfoResponder {
14719                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14720                                tx_id: header.tx_id,
14721                            },
14722                        })
14723                    }
14724                    0x3d4396a638ea053b => {
14725                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14726                        let mut req = fidl::new_empty!(
14727                            NodeGetAttributesRequest,
14728                            fidl::encoding::DefaultFuchsiaResourceDialect
14729                        );
14730                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14731                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14732                        Ok(NodeRequest::GetAttributes {
14733                            query: req.query,
14734
14735                            responder: NodeGetAttributesResponder {
14736                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14737                                tx_id: header.tx_id,
14738                            },
14739                        })
14740                    }
14741                    0x3308c1da5a89bf08 => {
14742                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14743                        let mut req = fidl::new_empty!(
14744                            MutableNodeAttributes,
14745                            fidl::encoding::DefaultFuchsiaResourceDialect
14746                        );
14747                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
14748                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14749                        Ok(NodeRequest::UpdateAttributes {
14750                            payload: req,
14751                            responder: NodeUpdateAttributesResponder {
14752                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14753                                tx_id: header.tx_id,
14754                            },
14755                        })
14756                    }
14757                    0x2c5c27ca0ab5dc49 => {
14758                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14759                        let mut req = fidl::new_empty!(
14760                            fidl::encoding::EmptyPayload,
14761                            fidl::encoding::DefaultFuchsiaResourceDialect
14762                        );
14763                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14764                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14765                        Ok(NodeRequest::Sync {
14766                            responder: NodeSyncResponder {
14767                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14768                                tx_id: header.tx_id,
14769                            },
14770                        })
14771                    }
14772                    0x4b61033de007fcd0 => {
14773                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14774                        let mut req = fidl::new_empty!(
14775                            NodeListExtendedAttributesRequest,
14776                            fidl::encoding::DefaultFuchsiaResourceDialect
14777                        );
14778                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14779                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14780                        Ok(NodeRequest::ListExtendedAttributes {
14781                            iterator: req.iterator,
14782
14783                            control_handle,
14784                        })
14785                    }
14786                    0x45ffa3ccfdeb76db => {
14787                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14788                        let mut req = fidl::new_empty!(
14789                            NodeGetExtendedAttributeRequest,
14790                            fidl::encoding::DefaultFuchsiaResourceDialect
14791                        );
14792                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14793                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14794                        Ok(NodeRequest::GetExtendedAttribute {
14795                            name: req.name,
14796
14797                            responder: NodeGetExtendedAttributeResponder {
14798                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14799                                tx_id: header.tx_id,
14800                            },
14801                        })
14802                    }
14803                    0x4a951362f681f23c => {
14804                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14805                        let mut req = fidl::new_empty!(
14806                            NodeSetExtendedAttributeRequest,
14807                            fidl::encoding::DefaultFuchsiaResourceDialect
14808                        );
14809                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14810                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14811                        Ok(NodeRequest::SetExtendedAttribute {
14812                            name: req.name,
14813                            value: req.value,
14814                            mode: req.mode,
14815
14816                            responder: NodeSetExtendedAttributeResponder {
14817                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14818                                tx_id: header.tx_id,
14819                            },
14820                        })
14821                    }
14822                    0x7a0b9f3a9bf9032d => {
14823                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14824                        let mut req = fidl::new_empty!(
14825                            NodeRemoveExtendedAttributeRequest,
14826                            fidl::encoding::DefaultFuchsiaResourceDialect
14827                        );
14828                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14829                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14830                        Ok(NodeRequest::RemoveExtendedAttribute {
14831                            name: req.name,
14832
14833                            responder: NodeRemoveExtendedAttributeResponder {
14834                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14835                                tx_id: header.tx_id,
14836                            },
14837                        })
14838                    }
14839                    _ if header.tx_id == 0
14840                        && header
14841                            .dynamic_flags()
14842                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14843                    {
14844                        Ok(NodeRequest::_UnknownMethod {
14845                            ordinal: header.ordinal,
14846                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14847                            method_type: fidl::MethodType::OneWay,
14848                        })
14849                    }
14850                    _ if header
14851                        .dynamic_flags()
14852                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14853                    {
14854                        this.inner.send_framework_err(
14855                            fidl::encoding::FrameworkErr::UnknownMethod,
14856                            header.tx_id,
14857                            header.ordinal,
14858                            header.dynamic_flags(),
14859                            (bytes, handles),
14860                        )?;
14861                        Ok(NodeRequest::_UnknownMethod {
14862                            ordinal: header.ordinal,
14863                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14864                            method_type: fidl::MethodType::TwoWay,
14865                        })
14866                    }
14867                    _ => Err(fidl::Error::UnknownOrdinal {
14868                        ordinal: header.ordinal,
14869                        protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14870                    }),
14871                }))
14872            },
14873        )
14874    }
14875}
14876
14877/// Node defines the minimal interface for entities which can be accessed in a filesystem.
14878#[derive(Debug)]
14879pub enum NodeRequest {
14880    Clone {
14881        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
14882        control_handle: NodeControlHandle,
14883    },
14884    /// Terminates the connection.
14885    ///
14886    /// After calling `Close`, the client must not send any other requests.
14887    ///
14888    /// Servers, after sending the status response, should close the connection
14889    /// regardless of status and without sending an epitaph.
14890    ///
14891    /// Closing the client end of the channel should be semantically equivalent
14892    /// to calling `Close` without knowing when the close has completed or its
14893    /// status.
14894    Close {
14895        responder: NodeCloseResponder,
14896    },
14897    Query {
14898        responder: NodeQueryResponder,
14899    },
14900    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
14901    DeprecatedClone {
14902        flags: OpenFlags,
14903        object: fidl::endpoints::ServerEnd<NodeMarker>,
14904        control_handle: NodeControlHandle,
14905    },
14906    /// Acquires information about the node.
14907    ///
14908    /// This method does not require any rights.
14909    GetAttr {
14910        responder: NodeGetAttrResponder,
14911    },
14912    /// Updates information about the node.
14913    ///
14914    /// Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.
14915    ///
14916    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
14917    /// `ZX_ERR_BAD_HANDLE`.
14918    SetAttr {
14919        flags: NodeAttributeFlags,
14920        attributes: NodeAttributes,
14921        responder: NodeSetAttrResponder,
14922    },
14923    /// [DEPRECATED - Use new GetFlags method instead.]
14924    DeprecatedGetFlags {
14925        responder: NodeDeprecatedGetFlagsResponder,
14926    },
14927    /// [DEPRECATED - Use new SetFlags method instead.]
14928    DeprecatedSetFlags {
14929        flags: OpenFlags,
14930        responder: NodeDeprecatedSetFlagsResponder,
14931    },
14932    /// Queries the flags that apply to this node after it has been opened/created. This method does
14933    /// not require any rights.
14934    ///
14935    /// Note that the final set of flags that apply to the connection may differ from those
14936    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
14937    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
14938    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
14939    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
14940    GetFlags {
14941        responder: NodeGetFlagsResponder,
14942    },
14943    /// Sets the flags that apply to this node after it has been opened. This method does not
14944    /// require any rights.
14945    ///
14946    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
14947    /// clear append mode.
14948    ///
14949    /// Errors:
14950    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
14951    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
14952    SetFlags {
14953        flags: Flags,
14954        responder: NodeSetFlagsResponder,
14955    },
14956    /// Query the filesystem for filesystem-specific information.
14957    QueryFilesystem {
14958        responder: NodeQueryFilesystemResponder,
14959    },
14960    /// Acquires information about the connection.
14961    ///
14962    /// This method does not require any rights.
14963    GetConnectionInfo {
14964        responder: NodeGetConnectionInfoResponder,
14965    },
14966    /// Acquires information about the node.
14967    ///
14968    /// The attributes of a node should be stable, independent of the
14969    /// specific protocol used to access it.
14970    ///
14971    /// If a particular attribute is not applicable or not supported,
14972    /// filesystems should leave the corresponding field absent.
14973    ///
14974    /// + `query` a bit-mask specifying which attributes to fetch. The server
14975    ///   should not return more than necessary.
14976    /// - `attributes` the returned attributes.
14977    ///
14978    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14979    GetAttributes {
14980        query: NodeAttributesQuery,
14981        responder: NodeGetAttributesResponder,
14982    },
14983    /// Updates information about the node.
14984    ///
14985    /// + `attributes` the presence of a table field in `attributes` indicates
14986    /// the intent to update the corresponding attribute.
14987    ///
14988    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
14989    ///
14990    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14991    UpdateAttributes {
14992        payload: MutableNodeAttributes,
14993        responder: NodeUpdateAttributesResponder,
14994    },
14995    /// Synchronizes updates to the node to the underlying media, if it exists.
14996    ///
14997    /// This method will return when the filesystem server has flushed the
14998    /// relevant updates to the underlying media, but does not guarantee the
14999    /// underlying media has persisted the information, nor that any information
15000    /// is committed to hardware. Clients may use `Sync` to ensure ordering
15001    /// between operations.
15002    ///
15003    /// This method does not require any rights.
15004    Sync {
15005        responder: NodeSyncResponder,
15006    },
15007    /// Creates an iterator over all the extended attribute names associated
15008    /// with this node. If an error occurs it is returned as an epitaph on the
15009    /// iterator request channel, and then the channel is closed.
15010    ///
15011    /// GetExtendedAttributes can be used with any of these names to retrieve
15012    /// the associated value.
15013    ///
15014    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
15015    ListExtendedAttributes {
15016        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
15017        control_handle: NodeControlHandle,
15018    },
15019    /// Get the value associated with the given attribute `name` for this node.
15020    ///
15021    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
15022    /// particular structure is imposed on them.
15023    ///
15024    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
15025    GetExtendedAttribute {
15026        name: Vec<u8>,
15027        responder: NodeGetExtendedAttributeResponder,
15028    },
15029    /// Set the value for the given attribute `name` to `value` for this node.
15030    ///
15031    /// The attribute name may exist, in which case the attribute is updated.
15032    /// If the attribute doesn't exist, it is created. The name should have no
15033    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
15034    ///
15035    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
15036    SetExtendedAttribute {
15037        name: Vec<u8>,
15038        value: ExtendedAttributeValue,
15039        mode: SetExtendedAttributeMode,
15040        responder: NodeSetExtendedAttributeResponder,
15041    },
15042    /// Remove the specified extended attribute.
15043    ///
15044    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
15045    ///
15046    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
15047    RemoveExtendedAttribute {
15048        name: Vec<u8>,
15049        responder: NodeRemoveExtendedAttributeResponder,
15050    },
15051    /// An interaction was received which does not match any known method.
15052    #[non_exhaustive]
15053    _UnknownMethod {
15054        /// Ordinal of the method that was called.
15055        ordinal: u64,
15056        control_handle: NodeControlHandle,
15057        method_type: fidl::MethodType,
15058    },
15059}
15060
15061impl NodeRequest {
15062    #[allow(irrefutable_let_patterns)]
15063    pub fn into_clone(
15064        self,
15065    ) -> Option<(
15066        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
15067        NodeControlHandle,
15068    )> {
15069        if let NodeRequest::Clone { request, control_handle } = self {
15070            Some((request, control_handle))
15071        } else {
15072            None
15073        }
15074    }
15075
15076    #[allow(irrefutable_let_patterns)]
15077    pub fn into_close(self) -> Option<(NodeCloseResponder)> {
15078        if let NodeRequest::Close { responder } = self {
15079            Some((responder))
15080        } else {
15081            None
15082        }
15083    }
15084
15085    #[allow(irrefutable_let_patterns)]
15086    pub fn into_query(self) -> Option<(NodeQueryResponder)> {
15087        if let NodeRequest::Query { responder } = self {
15088            Some((responder))
15089        } else {
15090            None
15091        }
15092    }
15093
15094    #[allow(irrefutable_let_patterns)]
15095    pub fn into_deprecated_clone(
15096        self,
15097    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, NodeControlHandle)> {
15098        if let NodeRequest::DeprecatedClone { flags, object, control_handle } = self {
15099            Some((flags, object, control_handle))
15100        } else {
15101            None
15102        }
15103    }
15104
15105    #[allow(irrefutable_let_patterns)]
15106    pub fn into_get_attr(self) -> Option<(NodeGetAttrResponder)> {
15107        if let NodeRequest::GetAttr { responder } = self {
15108            Some((responder))
15109        } else {
15110            None
15111        }
15112    }
15113
15114    #[allow(irrefutable_let_patterns)]
15115    pub fn into_set_attr(
15116        self,
15117    ) -> Option<(NodeAttributeFlags, NodeAttributes, NodeSetAttrResponder)> {
15118        if let NodeRequest::SetAttr { flags, attributes, responder } = self {
15119            Some((flags, attributes, responder))
15120        } else {
15121            None
15122        }
15123    }
15124
15125    #[allow(irrefutable_let_patterns)]
15126    pub fn into_deprecated_get_flags(self) -> Option<(NodeDeprecatedGetFlagsResponder)> {
15127        if let NodeRequest::DeprecatedGetFlags { responder } = self {
15128            Some((responder))
15129        } else {
15130            None
15131        }
15132    }
15133
15134    #[allow(irrefutable_let_patterns)]
15135    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, NodeDeprecatedSetFlagsResponder)> {
15136        if let NodeRequest::DeprecatedSetFlags { flags, responder } = self {
15137            Some((flags, responder))
15138        } else {
15139            None
15140        }
15141    }
15142
15143    #[allow(irrefutable_let_patterns)]
15144    pub fn into_get_flags(self) -> Option<(NodeGetFlagsResponder)> {
15145        if let NodeRequest::GetFlags { responder } = self {
15146            Some((responder))
15147        } else {
15148            None
15149        }
15150    }
15151
15152    #[allow(irrefutable_let_patterns)]
15153    pub fn into_set_flags(self) -> Option<(Flags, NodeSetFlagsResponder)> {
15154        if let NodeRequest::SetFlags { flags, responder } = self {
15155            Some((flags, responder))
15156        } else {
15157            None
15158        }
15159    }
15160
15161    #[allow(irrefutable_let_patterns)]
15162    pub fn into_query_filesystem(self) -> Option<(NodeQueryFilesystemResponder)> {
15163        if let NodeRequest::QueryFilesystem { responder } = self {
15164            Some((responder))
15165        } else {
15166            None
15167        }
15168    }
15169
15170    #[allow(irrefutable_let_patterns)]
15171    pub fn into_get_connection_info(self) -> Option<(NodeGetConnectionInfoResponder)> {
15172        if let NodeRequest::GetConnectionInfo { responder } = self {
15173            Some((responder))
15174        } else {
15175            None
15176        }
15177    }
15178
15179    #[allow(irrefutable_let_patterns)]
15180    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, NodeGetAttributesResponder)> {
15181        if let NodeRequest::GetAttributes { query, responder } = self {
15182            Some((query, responder))
15183        } else {
15184            None
15185        }
15186    }
15187
15188    #[allow(irrefutable_let_patterns)]
15189    pub fn into_update_attributes(
15190        self,
15191    ) -> Option<(MutableNodeAttributes, NodeUpdateAttributesResponder)> {
15192        if let NodeRequest::UpdateAttributes { payload, responder } = self {
15193            Some((payload, responder))
15194        } else {
15195            None
15196        }
15197    }
15198
15199    #[allow(irrefutable_let_patterns)]
15200    pub fn into_sync(self) -> Option<(NodeSyncResponder)> {
15201        if let NodeRequest::Sync { responder } = self {
15202            Some((responder))
15203        } else {
15204            None
15205        }
15206    }
15207
15208    #[allow(irrefutable_let_patterns)]
15209    pub fn into_list_extended_attributes(
15210        self,
15211    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, NodeControlHandle)>
15212    {
15213        if let NodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
15214            Some((iterator, control_handle))
15215        } else {
15216            None
15217        }
15218    }
15219
15220    #[allow(irrefutable_let_patterns)]
15221    pub fn into_get_extended_attribute(
15222        self,
15223    ) -> Option<(Vec<u8>, NodeGetExtendedAttributeResponder)> {
15224        if let NodeRequest::GetExtendedAttribute { name, responder } = self {
15225            Some((name, responder))
15226        } else {
15227            None
15228        }
15229    }
15230
15231    #[allow(irrefutable_let_patterns)]
15232    pub fn into_set_extended_attribute(
15233        self,
15234    ) -> Option<(
15235        Vec<u8>,
15236        ExtendedAttributeValue,
15237        SetExtendedAttributeMode,
15238        NodeSetExtendedAttributeResponder,
15239    )> {
15240        if let NodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
15241            Some((name, value, mode, responder))
15242        } else {
15243            None
15244        }
15245    }
15246
15247    #[allow(irrefutable_let_patterns)]
15248    pub fn into_remove_extended_attribute(
15249        self,
15250    ) -> Option<(Vec<u8>, NodeRemoveExtendedAttributeResponder)> {
15251        if let NodeRequest::RemoveExtendedAttribute { name, responder } = self {
15252            Some((name, responder))
15253        } else {
15254            None
15255        }
15256    }
15257
15258    /// Name of the method defined in FIDL
15259    pub fn method_name(&self) -> &'static str {
15260        match *self {
15261            NodeRequest::Clone { .. } => "clone",
15262            NodeRequest::Close { .. } => "close",
15263            NodeRequest::Query { .. } => "query",
15264            NodeRequest::DeprecatedClone { .. } => "deprecated_clone",
15265            NodeRequest::GetAttr { .. } => "get_attr",
15266            NodeRequest::SetAttr { .. } => "set_attr",
15267            NodeRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
15268            NodeRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
15269            NodeRequest::GetFlags { .. } => "get_flags",
15270            NodeRequest::SetFlags { .. } => "set_flags",
15271            NodeRequest::QueryFilesystem { .. } => "query_filesystem",
15272            NodeRequest::GetConnectionInfo { .. } => "get_connection_info",
15273            NodeRequest::GetAttributes { .. } => "get_attributes",
15274            NodeRequest::UpdateAttributes { .. } => "update_attributes",
15275            NodeRequest::Sync { .. } => "sync",
15276            NodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
15277            NodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
15278            NodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
15279            NodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
15280            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
15281                "unknown one-way method"
15282            }
15283            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
15284                "unknown two-way method"
15285            }
15286        }
15287    }
15288}
15289
15290#[derive(Debug, Clone)]
15291pub struct NodeControlHandle {
15292    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
15293}
15294
15295impl fidl::endpoints::ControlHandle for NodeControlHandle {
15296    fn shutdown(&self) {
15297        self.inner.shutdown()
15298    }
15299    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
15300        self.inner.shutdown_with_epitaph(status)
15301    }
15302
15303    fn is_closed(&self) -> bool {
15304        self.inner.channel().is_closed()
15305    }
15306    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
15307        self.inner.channel().on_closed()
15308    }
15309
15310    #[cfg(target_os = "fuchsia")]
15311    fn signal_peer(
15312        &self,
15313        clear_mask: zx::Signals,
15314        set_mask: zx::Signals,
15315    ) -> Result<(), zx_status::Status> {
15316        use fidl::Peered;
15317        self.inner.channel().signal_peer(clear_mask, set_mask)
15318    }
15319}
15320
15321impl NodeControlHandle {
15322    pub fn send_on_open_(
15323        &self,
15324        mut s: i32,
15325        mut info: Option<NodeInfoDeprecated>,
15326    ) -> Result<(), fidl::Error> {
15327        self.inner.send::<NodeOnOpenRequest>(
15328            (s, info.as_mut()),
15329            0,
15330            0x7fc7bbb1dbfd1972,
15331            fidl::encoding::DynamicFlags::empty(),
15332        )
15333    }
15334
15335    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
15336        self.inner.send::<Representation>(
15337            &mut payload,
15338            0,
15339            0x5cb40567d80a510c,
15340            fidl::encoding::DynamicFlags::empty(),
15341        )
15342    }
15343}
15344
15345#[must_use = "FIDL methods require a response to be sent"]
15346#[derive(Debug)]
15347pub struct NodeCloseResponder {
15348    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15349    tx_id: u32,
15350}
15351
15352/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15353/// if the responder is dropped without sending a response, so that the client
15354/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15355impl std::ops::Drop for NodeCloseResponder {
15356    fn drop(&mut self) {
15357        self.control_handle.shutdown();
15358        // Safety: drops once, never accessed again
15359        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15360    }
15361}
15362
15363impl fidl::endpoints::Responder for NodeCloseResponder {
15364    type ControlHandle = NodeControlHandle;
15365
15366    fn control_handle(&self) -> &NodeControlHandle {
15367        &self.control_handle
15368    }
15369
15370    fn drop_without_shutdown(mut self) {
15371        // Safety: drops once, never accessed again due to mem::forget
15372        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15373        // Prevent Drop from running (which would shut down the channel)
15374        std::mem::forget(self);
15375    }
15376}
15377
15378impl NodeCloseResponder {
15379    /// Sends a response to the FIDL transaction.
15380    ///
15381    /// Sets the channel to shutdown if an error occurs.
15382    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15383        let _result = self.send_raw(result);
15384        if _result.is_err() {
15385            self.control_handle.shutdown();
15386        }
15387        self.drop_without_shutdown();
15388        _result
15389    }
15390
15391    /// Similar to "send" but does not shutdown the channel if an error occurs.
15392    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15393        let _result = self.send_raw(result);
15394        self.drop_without_shutdown();
15395        _result
15396    }
15397
15398    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15399        self.control_handle
15400            .inner
15401            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15402                result,
15403                self.tx_id,
15404                0x5ac5d459ad7f657e,
15405                fidl::encoding::DynamicFlags::empty(),
15406            )
15407    }
15408}
15409
15410#[must_use = "FIDL methods require a response to be sent"]
15411#[derive(Debug)]
15412pub struct NodeQueryResponder {
15413    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15414    tx_id: u32,
15415}
15416
15417/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15418/// if the responder is dropped without sending a response, so that the client
15419/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15420impl std::ops::Drop for NodeQueryResponder {
15421    fn drop(&mut self) {
15422        self.control_handle.shutdown();
15423        // Safety: drops once, never accessed again
15424        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15425    }
15426}
15427
15428impl fidl::endpoints::Responder for NodeQueryResponder {
15429    type ControlHandle = NodeControlHandle;
15430
15431    fn control_handle(&self) -> &NodeControlHandle {
15432        &self.control_handle
15433    }
15434
15435    fn drop_without_shutdown(mut self) {
15436        // Safety: drops once, never accessed again due to mem::forget
15437        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15438        // Prevent Drop from running (which would shut down the channel)
15439        std::mem::forget(self);
15440    }
15441}
15442
15443impl NodeQueryResponder {
15444    /// Sends a response to the FIDL transaction.
15445    ///
15446    /// Sets the channel to shutdown if an error occurs.
15447    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15448        let _result = self.send_raw(protocol);
15449        if _result.is_err() {
15450            self.control_handle.shutdown();
15451        }
15452        self.drop_without_shutdown();
15453        _result
15454    }
15455
15456    /// Similar to "send" but does not shutdown the channel if an error occurs.
15457    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15458        let _result = self.send_raw(protocol);
15459        self.drop_without_shutdown();
15460        _result
15461    }
15462
15463    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15464        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
15465            (protocol,),
15466            self.tx_id,
15467            0x2658edee9decfc06,
15468            fidl::encoding::DynamicFlags::empty(),
15469        )
15470    }
15471}
15472
15473#[must_use = "FIDL methods require a response to be sent"]
15474#[derive(Debug)]
15475pub struct NodeGetAttrResponder {
15476    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15477    tx_id: u32,
15478}
15479
15480/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15481/// if the responder is dropped without sending a response, so that the client
15482/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15483impl std::ops::Drop for NodeGetAttrResponder {
15484    fn drop(&mut self) {
15485        self.control_handle.shutdown();
15486        // Safety: drops once, never accessed again
15487        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15488    }
15489}
15490
15491impl fidl::endpoints::Responder for NodeGetAttrResponder {
15492    type ControlHandle = NodeControlHandle;
15493
15494    fn control_handle(&self) -> &NodeControlHandle {
15495        &self.control_handle
15496    }
15497
15498    fn drop_without_shutdown(mut self) {
15499        // Safety: drops once, never accessed again due to mem::forget
15500        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15501        // Prevent Drop from running (which would shut down the channel)
15502        std::mem::forget(self);
15503    }
15504}
15505
15506impl NodeGetAttrResponder {
15507    /// Sends a response to the FIDL transaction.
15508    ///
15509    /// Sets the channel to shutdown if an error occurs.
15510    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15511        let _result = self.send_raw(s, attributes);
15512        if _result.is_err() {
15513            self.control_handle.shutdown();
15514        }
15515        self.drop_without_shutdown();
15516        _result
15517    }
15518
15519    /// Similar to "send" but does not shutdown the channel if an error occurs.
15520    pub fn send_no_shutdown_on_err(
15521        self,
15522        mut s: i32,
15523        mut attributes: &NodeAttributes,
15524    ) -> Result<(), fidl::Error> {
15525        let _result = self.send_raw(s, attributes);
15526        self.drop_without_shutdown();
15527        _result
15528    }
15529
15530    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15531        self.control_handle.inner.send::<NodeGetAttrResponse>(
15532            (s, attributes),
15533            self.tx_id,
15534            0x78985e216314dafd,
15535            fidl::encoding::DynamicFlags::empty(),
15536        )
15537    }
15538}
15539
15540#[must_use = "FIDL methods require a response to be sent"]
15541#[derive(Debug)]
15542pub struct NodeSetAttrResponder {
15543    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15544    tx_id: u32,
15545}
15546
15547/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15548/// if the responder is dropped without sending a response, so that the client
15549/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15550impl std::ops::Drop for NodeSetAttrResponder {
15551    fn drop(&mut self) {
15552        self.control_handle.shutdown();
15553        // Safety: drops once, never accessed again
15554        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15555    }
15556}
15557
15558impl fidl::endpoints::Responder for NodeSetAttrResponder {
15559    type ControlHandle = NodeControlHandle;
15560
15561    fn control_handle(&self) -> &NodeControlHandle {
15562        &self.control_handle
15563    }
15564
15565    fn drop_without_shutdown(mut self) {
15566        // Safety: drops once, never accessed again due to mem::forget
15567        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15568        // Prevent Drop from running (which would shut down the channel)
15569        std::mem::forget(self);
15570    }
15571}
15572
15573impl NodeSetAttrResponder {
15574    /// Sends a response to the FIDL transaction.
15575    ///
15576    /// Sets the channel to shutdown if an error occurs.
15577    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15578        let _result = self.send_raw(s);
15579        if _result.is_err() {
15580            self.control_handle.shutdown();
15581        }
15582        self.drop_without_shutdown();
15583        _result
15584    }
15585
15586    /// Similar to "send" but does not shutdown the channel if an error occurs.
15587    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15588        let _result = self.send_raw(s);
15589        self.drop_without_shutdown();
15590        _result
15591    }
15592
15593    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15594        self.control_handle.inner.send::<NodeSetAttrResponse>(
15595            (s,),
15596            self.tx_id,
15597            0x4186c0f40d938f46,
15598            fidl::encoding::DynamicFlags::empty(),
15599        )
15600    }
15601}
15602
15603#[must_use = "FIDL methods require a response to be sent"]
15604#[derive(Debug)]
15605pub struct NodeDeprecatedGetFlagsResponder {
15606    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15607    tx_id: u32,
15608}
15609
15610/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15611/// if the responder is dropped without sending a response, so that the client
15612/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15613impl std::ops::Drop for NodeDeprecatedGetFlagsResponder {
15614    fn drop(&mut self) {
15615        self.control_handle.shutdown();
15616        // Safety: drops once, never accessed again
15617        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15618    }
15619}
15620
15621impl fidl::endpoints::Responder for NodeDeprecatedGetFlagsResponder {
15622    type ControlHandle = NodeControlHandle;
15623
15624    fn control_handle(&self) -> &NodeControlHandle {
15625        &self.control_handle
15626    }
15627
15628    fn drop_without_shutdown(mut self) {
15629        // Safety: drops once, never accessed again due to mem::forget
15630        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15631        // Prevent Drop from running (which would shut down the channel)
15632        std::mem::forget(self);
15633    }
15634}
15635
15636impl NodeDeprecatedGetFlagsResponder {
15637    /// Sends a response to the FIDL transaction.
15638    ///
15639    /// Sets the channel to shutdown if an error occurs.
15640    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15641        let _result = self.send_raw(s, flags);
15642        if _result.is_err() {
15643            self.control_handle.shutdown();
15644        }
15645        self.drop_without_shutdown();
15646        _result
15647    }
15648
15649    /// Similar to "send" but does not shutdown the channel if an error occurs.
15650    pub fn send_no_shutdown_on_err(
15651        self,
15652        mut s: i32,
15653        mut flags: OpenFlags,
15654    ) -> Result<(), fidl::Error> {
15655        let _result = self.send_raw(s, flags);
15656        self.drop_without_shutdown();
15657        _result
15658    }
15659
15660    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15661        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
15662            (s, flags),
15663            self.tx_id,
15664            0x5b88fffb8eda3aa1,
15665            fidl::encoding::DynamicFlags::empty(),
15666        )
15667    }
15668}
15669
15670#[must_use = "FIDL methods require a response to be sent"]
15671#[derive(Debug)]
15672pub struct NodeDeprecatedSetFlagsResponder {
15673    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15674    tx_id: u32,
15675}
15676
15677/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15678/// if the responder is dropped without sending a response, so that the client
15679/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15680impl std::ops::Drop for NodeDeprecatedSetFlagsResponder {
15681    fn drop(&mut self) {
15682        self.control_handle.shutdown();
15683        // Safety: drops once, never accessed again
15684        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15685    }
15686}
15687
15688impl fidl::endpoints::Responder for NodeDeprecatedSetFlagsResponder {
15689    type ControlHandle = NodeControlHandle;
15690
15691    fn control_handle(&self) -> &NodeControlHandle {
15692        &self.control_handle
15693    }
15694
15695    fn drop_without_shutdown(mut self) {
15696        // Safety: drops once, never accessed again due to mem::forget
15697        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15698        // Prevent Drop from running (which would shut down the channel)
15699        std::mem::forget(self);
15700    }
15701}
15702
15703impl NodeDeprecatedSetFlagsResponder {
15704    /// Sends a response to the FIDL transaction.
15705    ///
15706    /// Sets the channel to shutdown if an error occurs.
15707    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15708        let _result = self.send_raw(s);
15709        if _result.is_err() {
15710            self.control_handle.shutdown();
15711        }
15712        self.drop_without_shutdown();
15713        _result
15714    }
15715
15716    /// Similar to "send" but does not shutdown the channel if an error occurs.
15717    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15718        let _result = self.send_raw(s);
15719        self.drop_without_shutdown();
15720        _result
15721    }
15722
15723    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15724        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
15725            (s,),
15726            self.tx_id,
15727            0x5295b76c71fde733,
15728            fidl::encoding::DynamicFlags::empty(),
15729        )
15730    }
15731}
15732
15733#[must_use = "FIDL methods require a response to be sent"]
15734#[derive(Debug)]
15735pub struct NodeGetFlagsResponder {
15736    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15737    tx_id: u32,
15738}
15739
15740/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15741/// if the responder is dropped without sending a response, so that the client
15742/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15743impl std::ops::Drop for NodeGetFlagsResponder {
15744    fn drop(&mut self) {
15745        self.control_handle.shutdown();
15746        // Safety: drops once, never accessed again
15747        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15748    }
15749}
15750
15751impl fidl::endpoints::Responder for NodeGetFlagsResponder {
15752    type ControlHandle = NodeControlHandle;
15753
15754    fn control_handle(&self) -> &NodeControlHandle {
15755        &self.control_handle
15756    }
15757
15758    fn drop_without_shutdown(mut self) {
15759        // Safety: drops once, never accessed again due to mem::forget
15760        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15761        // Prevent Drop from running (which would shut down the channel)
15762        std::mem::forget(self);
15763    }
15764}
15765
15766impl NodeGetFlagsResponder {
15767    /// Sends a response to the FIDL transaction.
15768    ///
15769    /// Sets the channel to shutdown if an error occurs.
15770    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15771        let _result = self.send_raw(result);
15772        if _result.is_err() {
15773            self.control_handle.shutdown();
15774        }
15775        self.drop_without_shutdown();
15776        _result
15777    }
15778
15779    /// Similar to "send" but does not shutdown the channel if an error occurs.
15780    pub fn send_no_shutdown_on_err(
15781        self,
15782        mut result: Result<Flags, i32>,
15783    ) -> Result<(), fidl::Error> {
15784        let _result = self.send_raw(result);
15785        self.drop_without_shutdown();
15786        _result
15787    }
15788
15789    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15790        self.control_handle
15791            .inner
15792            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
15793                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
15794                self.tx_id,
15795                0x176eb318f64ec23,
15796                fidl::encoding::DynamicFlags::FLEXIBLE,
15797            )
15798    }
15799}
15800
15801#[must_use = "FIDL methods require a response to be sent"]
15802#[derive(Debug)]
15803pub struct NodeSetFlagsResponder {
15804    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15805    tx_id: u32,
15806}
15807
15808/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15809/// if the responder is dropped without sending a response, so that the client
15810/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15811impl std::ops::Drop for NodeSetFlagsResponder {
15812    fn drop(&mut self) {
15813        self.control_handle.shutdown();
15814        // Safety: drops once, never accessed again
15815        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15816    }
15817}
15818
15819impl fidl::endpoints::Responder for NodeSetFlagsResponder {
15820    type ControlHandle = NodeControlHandle;
15821
15822    fn control_handle(&self) -> &NodeControlHandle {
15823        &self.control_handle
15824    }
15825
15826    fn drop_without_shutdown(mut self) {
15827        // Safety: drops once, never accessed again due to mem::forget
15828        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15829        // Prevent Drop from running (which would shut down the channel)
15830        std::mem::forget(self);
15831    }
15832}
15833
15834impl NodeSetFlagsResponder {
15835    /// Sends a response to the FIDL transaction.
15836    ///
15837    /// Sets the channel to shutdown if an error occurs.
15838    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15839        let _result = self.send_raw(result);
15840        if _result.is_err() {
15841            self.control_handle.shutdown();
15842        }
15843        self.drop_without_shutdown();
15844        _result
15845    }
15846
15847    /// Similar to "send" but does not shutdown the channel if an error occurs.
15848    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15849        let _result = self.send_raw(result);
15850        self.drop_without_shutdown();
15851        _result
15852    }
15853
15854    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15855        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
15856            fidl::encoding::EmptyStruct,
15857            i32,
15858        >>(
15859            fidl::encoding::FlexibleResult::new(result),
15860            self.tx_id,
15861            0x55a8028685791ea8,
15862            fidl::encoding::DynamicFlags::FLEXIBLE,
15863        )
15864    }
15865}
15866
15867#[must_use = "FIDL methods require a response to be sent"]
15868#[derive(Debug)]
15869pub struct NodeQueryFilesystemResponder {
15870    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15871    tx_id: u32,
15872}
15873
15874/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15875/// if the responder is dropped without sending a response, so that the client
15876/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15877impl std::ops::Drop for NodeQueryFilesystemResponder {
15878    fn drop(&mut self) {
15879        self.control_handle.shutdown();
15880        // Safety: drops once, never accessed again
15881        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15882    }
15883}
15884
15885impl fidl::endpoints::Responder for NodeQueryFilesystemResponder {
15886    type ControlHandle = NodeControlHandle;
15887
15888    fn control_handle(&self) -> &NodeControlHandle {
15889        &self.control_handle
15890    }
15891
15892    fn drop_without_shutdown(mut self) {
15893        // Safety: drops once, never accessed again due to mem::forget
15894        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15895        // Prevent Drop from running (which would shut down the channel)
15896        std::mem::forget(self);
15897    }
15898}
15899
15900impl NodeQueryFilesystemResponder {
15901    /// Sends a response to the FIDL transaction.
15902    ///
15903    /// Sets the channel to shutdown if an error occurs.
15904    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15905        let _result = self.send_raw(s, info);
15906        if _result.is_err() {
15907            self.control_handle.shutdown();
15908        }
15909        self.drop_without_shutdown();
15910        _result
15911    }
15912
15913    /// Similar to "send" but does not shutdown the channel if an error occurs.
15914    pub fn send_no_shutdown_on_err(
15915        self,
15916        mut s: i32,
15917        mut info: Option<&FilesystemInfo>,
15918    ) -> Result<(), fidl::Error> {
15919        let _result = self.send_raw(s, info);
15920        self.drop_without_shutdown();
15921        _result
15922    }
15923
15924    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15925        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
15926            (s, info),
15927            self.tx_id,
15928            0x6f344a1c6b0a0610,
15929            fidl::encoding::DynamicFlags::empty(),
15930        )
15931    }
15932}
15933
15934#[must_use = "FIDL methods require a response to be sent"]
15935#[derive(Debug)]
15936pub struct NodeGetConnectionInfoResponder {
15937    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15938    tx_id: u32,
15939}
15940
15941/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15942/// if the responder is dropped without sending a response, so that the client
15943/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15944impl std::ops::Drop for NodeGetConnectionInfoResponder {
15945    fn drop(&mut self) {
15946        self.control_handle.shutdown();
15947        // Safety: drops once, never accessed again
15948        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15949    }
15950}
15951
15952impl fidl::endpoints::Responder for NodeGetConnectionInfoResponder {
15953    type ControlHandle = NodeControlHandle;
15954
15955    fn control_handle(&self) -> &NodeControlHandle {
15956        &self.control_handle
15957    }
15958
15959    fn drop_without_shutdown(mut self) {
15960        // Safety: drops once, never accessed again due to mem::forget
15961        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15962        // Prevent Drop from running (which would shut down the channel)
15963        std::mem::forget(self);
15964    }
15965}
15966
15967impl NodeGetConnectionInfoResponder {
15968    /// Sends a response to the FIDL transaction.
15969    ///
15970    /// Sets the channel to shutdown if an error occurs.
15971    pub fn send(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
15972        let _result = self.send_raw(payload);
15973        if _result.is_err() {
15974            self.control_handle.shutdown();
15975        }
15976        self.drop_without_shutdown();
15977        _result
15978    }
15979
15980    /// Similar to "send" but does not shutdown the channel if an error occurs.
15981    pub fn send_no_shutdown_on_err(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
15982        let _result = self.send_raw(payload);
15983        self.drop_without_shutdown();
15984        _result
15985    }
15986
15987    fn send_raw(&self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
15988        self.control_handle.inner.send::<ConnectionInfo>(
15989            &mut payload,
15990            self.tx_id,
15991            0x584c377c7c0a6d0b,
15992            fidl::encoding::DynamicFlags::empty(),
15993        )
15994    }
15995}
15996
15997#[must_use = "FIDL methods require a response to be sent"]
15998#[derive(Debug)]
15999pub struct NodeGetAttributesResponder {
16000    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
16001    tx_id: u32,
16002}
16003
16004/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
16005/// if the responder is dropped without sending a response, so that the client
16006/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16007impl std::ops::Drop for NodeGetAttributesResponder {
16008    fn drop(&mut self) {
16009        self.control_handle.shutdown();
16010        // Safety: drops once, never accessed again
16011        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16012    }
16013}
16014
16015impl fidl::endpoints::Responder for NodeGetAttributesResponder {
16016    type ControlHandle = NodeControlHandle;
16017
16018    fn control_handle(&self) -> &NodeControlHandle {
16019        &self.control_handle
16020    }
16021
16022    fn drop_without_shutdown(mut self) {
16023        // Safety: drops once, never accessed again due to mem::forget
16024        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16025        // Prevent Drop from running (which would shut down the channel)
16026        std::mem::forget(self);
16027    }
16028}
16029
16030impl NodeGetAttributesResponder {
16031    /// Sends a response to the FIDL transaction.
16032    ///
16033    /// Sets the channel to shutdown if an error occurs.
16034    pub fn send(
16035        self,
16036        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16037    ) -> Result<(), fidl::Error> {
16038        let _result = self.send_raw(result);
16039        if _result.is_err() {
16040            self.control_handle.shutdown();
16041        }
16042        self.drop_without_shutdown();
16043        _result
16044    }
16045
16046    /// Similar to "send" but does not shutdown the channel if an error occurs.
16047    pub fn send_no_shutdown_on_err(
16048        self,
16049        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16050    ) -> Result<(), fidl::Error> {
16051        let _result = self.send_raw(result);
16052        self.drop_without_shutdown();
16053        _result
16054    }
16055
16056    fn send_raw(
16057        &self,
16058        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16059    ) -> Result<(), fidl::Error> {
16060        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
16061            result,
16062            self.tx_id,
16063            0x3d4396a638ea053b,
16064            fidl::encoding::DynamicFlags::empty(),
16065        )
16066    }
16067}
16068
16069#[must_use = "FIDL methods require a response to be sent"]
16070#[derive(Debug)]
16071pub struct NodeUpdateAttributesResponder {
16072    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
16073    tx_id: u32,
16074}
16075
16076/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
16077/// if the responder is dropped without sending a response, so that the client
16078/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16079impl std::ops::Drop for NodeUpdateAttributesResponder {
16080    fn drop(&mut self) {
16081        self.control_handle.shutdown();
16082        // Safety: drops once, never accessed again
16083        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16084    }
16085}
16086
16087impl fidl::endpoints::Responder for NodeUpdateAttributesResponder {
16088    type ControlHandle = NodeControlHandle;
16089
16090    fn control_handle(&self) -> &NodeControlHandle {
16091        &self.control_handle
16092    }
16093
16094    fn drop_without_shutdown(mut self) {
16095        // Safety: drops once, never accessed again due to mem::forget
16096        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16097        // Prevent Drop from running (which would shut down the channel)
16098        std::mem::forget(self);
16099    }
16100}
16101
16102impl NodeUpdateAttributesResponder {
16103    /// Sends a response to the FIDL transaction.
16104    ///
16105    /// Sets the channel to shutdown if an error occurs.
16106    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16107        let _result = self.send_raw(result);
16108        if _result.is_err() {
16109            self.control_handle.shutdown();
16110        }
16111        self.drop_without_shutdown();
16112        _result
16113    }
16114
16115    /// Similar to "send" but does not shutdown the channel if an error occurs.
16116    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16117        let _result = self.send_raw(result);
16118        self.drop_without_shutdown();
16119        _result
16120    }
16121
16122    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16123        self.control_handle
16124            .inner
16125            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16126                result,
16127                self.tx_id,
16128                0x3308c1da5a89bf08,
16129                fidl::encoding::DynamicFlags::empty(),
16130            )
16131    }
16132}
16133
16134#[must_use = "FIDL methods require a response to be sent"]
16135#[derive(Debug)]
16136pub struct NodeSyncResponder {
16137    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
16138    tx_id: u32,
16139}
16140
16141/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
16142/// if the responder is dropped without sending a response, so that the client
16143/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16144impl std::ops::Drop for NodeSyncResponder {
16145    fn drop(&mut self) {
16146        self.control_handle.shutdown();
16147        // Safety: drops once, never accessed again
16148        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16149    }
16150}
16151
16152impl fidl::endpoints::Responder for NodeSyncResponder {
16153    type ControlHandle = NodeControlHandle;
16154
16155    fn control_handle(&self) -> &NodeControlHandle {
16156        &self.control_handle
16157    }
16158
16159    fn drop_without_shutdown(mut self) {
16160        // Safety: drops once, never accessed again due to mem::forget
16161        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16162        // Prevent Drop from running (which would shut down the channel)
16163        std::mem::forget(self);
16164    }
16165}
16166
16167impl NodeSyncResponder {
16168    /// Sends a response to the FIDL transaction.
16169    ///
16170    /// Sets the channel to shutdown if an error occurs.
16171    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16172        let _result = self.send_raw(result);
16173        if _result.is_err() {
16174            self.control_handle.shutdown();
16175        }
16176        self.drop_without_shutdown();
16177        _result
16178    }
16179
16180    /// Similar to "send" but does not shutdown the channel if an error occurs.
16181    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16182        let _result = self.send_raw(result);
16183        self.drop_without_shutdown();
16184        _result
16185    }
16186
16187    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16188        self.control_handle
16189            .inner
16190            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16191                result,
16192                self.tx_id,
16193                0x2c5c27ca0ab5dc49,
16194                fidl::encoding::DynamicFlags::empty(),
16195            )
16196    }
16197}
16198
16199#[must_use = "FIDL methods require a response to be sent"]
16200#[derive(Debug)]
16201pub struct NodeGetExtendedAttributeResponder {
16202    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
16203    tx_id: u32,
16204}
16205
16206/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
16207/// if the responder is dropped without sending a response, so that the client
16208/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16209impl std::ops::Drop for NodeGetExtendedAttributeResponder {
16210    fn drop(&mut self) {
16211        self.control_handle.shutdown();
16212        // Safety: drops once, never accessed again
16213        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16214    }
16215}
16216
16217impl fidl::endpoints::Responder for NodeGetExtendedAttributeResponder {
16218    type ControlHandle = NodeControlHandle;
16219
16220    fn control_handle(&self) -> &NodeControlHandle {
16221        &self.control_handle
16222    }
16223
16224    fn drop_without_shutdown(mut self) {
16225        // Safety: drops once, never accessed again due to mem::forget
16226        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16227        // Prevent Drop from running (which would shut down the channel)
16228        std::mem::forget(self);
16229    }
16230}
16231
16232impl NodeGetExtendedAttributeResponder {
16233    /// Sends a response to the FIDL transaction.
16234    ///
16235    /// Sets the channel to shutdown if an error occurs.
16236    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
16237        let _result = self.send_raw(result);
16238        if _result.is_err() {
16239            self.control_handle.shutdown();
16240        }
16241        self.drop_without_shutdown();
16242        _result
16243    }
16244
16245    /// Similar to "send" but does not shutdown the channel if an error occurs.
16246    pub fn send_no_shutdown_on_err(
16247        self,
16248        mut result: Result<ExtendedAttributeValue, i32>,
16249    ) -> Result<(), fidl::Error> {
16250        let _result = self.send_raw(result);
16251        self.drop_without_shutdown();
16252        _result
16253    }
16254
16255    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
16256        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
16257            result.as_mut().map_err(|e| *e),
16258            self.tx_id,
16259            0x45ffa3ccfdeb76db,
16260            fidl::encoding::DynamicFlags::empty(),
16261        )
16262    }
16263}
16264
16265#[must_use = "FIDL methods require a response to be sent"]
16266#[derive(Debug)]
16267pub struct NodeSetExtendedAttributeResponder {
16268    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
16269    tx_id: u32,
16270}
16271
16272/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
16273/// if the responder is dropped without sending a response, so that the client
16274/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16275impl std::ops::Drop for NodeSetExtendedAttributeResponder {
16276    fn drop(&mut self) {
16277        self.control_handle.shutdown();
16278        // Safety: drops once, never accessed again
16279        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16280    }
16281}
16282
16283impl fidl::endpoints::Responder for NodeSetExtendedAttributeResponder {
16284    type ControlHandle = NodeControlHandle;
16285
16286    fn control_handle(&self) -> &NodeControlHandle {
16287        &self.control_handle
16288    }
16289
16290    fn drop_without_shutdown(mut self) {
16291        // Safety: drops once, never accessed again due to mem::forget
16292        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16293        // Prevent Drop from running (which would shut down the channel)
16294        std::mem::forget(self);
16295    }
16296}
16297
16298impl NodeSetExtendedAttributeResponder {
16299    /// Sends a response to the FIDL transaction.
16300    ///
16301    /// Sets the channel to shutdown if an error occurs.
16302    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16303        let _result = self.send_raw(result);
16304        if _result.is_err() {
16305            self.control_handle.shutdown();
16306        }
16307        self.drop_without_shutdown();
16308        _result
16309    }
16310
16311    /// Similar to "send" but does not shutdown the channel if an error occurs.
16312    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16313        let _result = self.send_raw(result);
16314        self.drop_without_shutdown();
16315        _result
16316    }
16317
16318    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16319        self.control_handle
16320            .inner
16321            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16322                result,
16323                self.tx_id,
16324                0x4a951362f681f23c,
16325                fidl::encoding::DynamicFlags::empty(),
16326            )
16327    }
16328}
16329
16330#[must_use = "FIDL methods require a response to be sent"]
16331#[derive(Debug)]
16332pub struct NodeRemoveExtendedAttributeResponder {
16333    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
16334    tx_id: u32,
16335}
16336
16337/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
16338/// if the responder is dropped without sending a response, so that the client
16339/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16340impl std::ops::Drop for NodeRemoveExtendedAttributeResponder {
16341    fn drop(&mut self) {
16342        self.control_handle.shutdown();
16343        // Safety: drops once, never accessed again
16344        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16345    }
16346}
16347
16348impl fidl::endpoints::Responder for NodeRemoveExtendedAttributeResponder {
16349    type ControlHandle = NodeControlHandle;
16350
16351    fn control_handle(&self) -> &NodeControlHandle {
16352        &self.control_handle
16353    }
16354
16355    fn drop_without_shutdown(mut self) {
16356        // Safety: drops once, never accessed again due to mem::forget
16357        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16358        // Prevent Drop from running (which would shut down the channel)
16359        std::mem::forget(self);
16360    }
16361}
16362
16363impl NodeRemoveExtendedAttributeResponder {
16364    /// Sends a response to the FIDL transaction.
16365    ///
16366    /// Sets the channel to shutdown if an error occurs.
16367    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16368        let _result = self.send_raw(result);
16369        if _result.is_err() {
16370            self.control_handle.shutdown();
16371        }
16372        self.drop_without_shutdown();
16373        _result
16374    }
16375
16376    /// Similar to "send" but does not shutdown the channel if an error occurs.
16377    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16378        let _result = self.send_raw(result);
16379        self.drop_without_shutdown();
16380        _result
16381    }
16382
16383    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16384        self.control_handle
16385            .inner
16386            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16387                result,
16388                self.tx_id,
16389                0x7a0b9f3a9bf9032d,
16390                fidl::encoding::DynamicFlags::empty(),
16391            )
16392    }
16393}
16394
16395#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
16396pub struct ReadableMarker;
16397
16398impl fidl::endpoints::ProtocolMarker for ReadableMarker {
16399    type Proxy = ReadableProxy;
16400    type RequestStream = ReadableRequestStream;
16401    #[cfg(target_os = "fuchsia")]
16402    type SynchronousProxy = ReadableSynchronousProxy;
16403
16404    const DEBUG_NAME: &'static str = "(anonymous) Readable";
16405}
16406pub type ReadableReadResult = Result<Vec<u8>, i32>;
16407
16408pub trait ReadableProxyInterface: Send + Sync {
16409    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
16410        + Send;
16411    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
16412}
16413#[derive(Debug)]
16414#[cfg(target_os = "fuchsia")]
16415pub struct ReadableSynchronousProxy {
16416    client: fidl::client::sync::Client,
16417}
16418
16419#[cfg(target_os = "fuchsia")]
16420impl fidl::endpoints::SynchronousProxy for ReadableSynchronousProxy {
16421    type Proxy = ReadableProxy;
16422    type Protocol = ReadableMarker;
16423
16424    fn from_channel(inner: fidl::Channel) -> Self {
16425        Self::new(inner)
16426    }
16427
16428    fn into_channel(self) -> fidl::Channel {
16429        self.client.into_channel()
16430    }
16431
16432    fn as_channel(&self) -> &fidl::Channel {
16433        self.client.as_channel()
16434    }
16435}
16436
16437#[cfg(target_os = "fuchsia")]
16438impl ReadableSynchronousProxy {
16439    pub fn new(channel: fidl::Channel) -> Self {
16440        let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16441        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
16442    }
16443
16444    pub fn into_channel(self) -> fidl::Channel {
16445        self.client.into_channel()
16446    }
16447
16448    /// Waits until an event arrives and returns it. It is safe for other
16449    /// threads to make concurrent requests while waiting for an event.
16450    pub fn wait_for_event(
16451        &self,
16452        deadline: zx::MonotonicInstant,
16453    ) -> Result<ReadableEvent, fidl::Error> {
16454        ReadableEvent::decode(self.client.wait_for_event(deadline)?)
16455    }
16456
16457    /// Reads up to 'count' bytes at the seek offset.
16458    /// The seek offset is moved forward by the number of bytes read.
16459    ///
16460    /// ## Invariants
16461    ///
16462    /// * The returned `data.length` will never be greater than `count`.
16463    /// * If `data.length` is less than `count`, it means that the seek offset
16464    ///   has reached the end of file as part of this operation.
16465    /// * If `data.length` is zero while `count` is not, it means that the
16466    ///   seek offset is already at or beyond the end of file, and no data could
16467    ///   be read.
16468    /// * If `count` is zero, the server should perform all the checks ensuring
16469    ///   read access without actually read anything, and return an empty
16470    ///   `data` vector.
16471    ///
16472    /// This method requires the [`Rights.READ_BYTES`] right.
16473    ///
16474    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16475    pub fn r#read(
16476        &self,
16477        mut count: u64,
16478        ___deadline: zx::MonotonicInstant,
16479    ) -> Result<ReadableReadResult, fidl::Error> {
16480        let _response = self.client.send_query::<
16481            ReadableReadRequest,
16482            fidl::encoding::ResultType<ReadableReadResponse, i32>,
16483        >(
16484            (count,),
16485            0x57e419a298c8ede,
16486            fidl::encoding::DynamicFlags::empty(),
16487            ___deadline,
16488        )?;
16489        Ok(_response.map(|x| x.data))
16490    }
16491}
16492
16493#[cfg(target_os = "fuchsia")]
16494impl From<ReadableSynchronousProxy> for zx::Handle {
16495    fn from(value: ReadableSynchronousProxy) -> Self {
16496        value.into_channel().into()
16497    }
16498}
16499
16500#[cfg(target_os = "fuchsia")]
16501impl From<fidl::Channel> for ReadableSynchronousProxy {
16502    fn from(value: fidl::Channel) -> Self {
16503        Self::new(value)
16504    }
16505}
16506
16507#[derive(Debug, Clone)]
16508pub struct ReadableProxy {
16509    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
16510}
16511
16512impl fidl::endpoints::Proxy for ReadableProxy {
16513    type Protocol = ReadableMarker;
16514
16515    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
16516        Self::new(inner)
16517    }
16518
16519    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
16520        self.client.into_channel().map_err(|client| Self { client })
16521    }
16522
16523    fn as_channel(&self) -> &::fidl::AsyncChannel {
16524        self.client.as_channel()
16525    }
16526}
16527
16528impl ReadableProxy {
16529    /// Create a new Proxy for fuchsia.io/Readable.
16530    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
16531        let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16532        Self { client: fidl::client::Client::new(channel, protocol_name) }
16533    }
16534
16535    /// Get a Stream of events from the remote end of the protocol.
16536    ///
16537    /// # Panics
16538    ///
16539    /// Panics if the event stream was already taken.
16540    pub fn take_event_stream(&self) -> ReadableEventStream {
16541        ReadableEventStream { event_receiver: self.client.take_event_receiver() }
16542    }
16543
16544    /// Reads up to 'count' bytes at the seek offset.
16545    /// The seek offset is moved forward by the number of bytes read.
16546    ///
16547    /// ## Invariants
16548    ///
16549    /// * The returned `data.length` will never be greater than `count`.
16550    /// * If `data.length` is less than `count`, it means that the seek offset
16551    ///   has reached the end of file as part of this operation.
16552    /// * If `data.length` is zero while `count` is not, it means that the
16553    ///   seek offset is already at or beyond the end of file, and no data could
16554    ///   be read.
16555    /// * If `count` is zero, the server should perform all the checks ensuring
16556    ///   read access without actually read anything, and return an empty
16557    ///   `data` vector.
16558    ///
16559    /// This method requires the [`Rights.READ_BYTES`] right.
16560    ///
16561    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16562    pub fn r#read(
16563        &self,
16564        mut count: u64,
16565    ) -> fidl::client::QueryResponseFut<
16566        ReadableReadResult,
16567        fidl::encoding::DefaultFuchsiaResourceDialect,
16568    > {
16569        ReadableProxyInterface::r#read(self, count)
16570    }
16571}
16572
16573impl ReadableProxyInterface for ReadableProxy {
16574    type ReadResponseFut = fidl::client::QueryResponseFut<
16575        ReadableReadResult,
16576        fidl::encoding::DefaultFuchsiaResourceDialect,
16577    >;
16578    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
16579        fn _decode(
16580            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
16581        ) -> Result<ReadableReadResult, fidl::Error> {
16582            let _response = fidl::client::decode_transaction_body::<
16583                fidl::encoding::ResultType<ReadableReadResponse, i32>,
16584                fidl::encoding::DefaultFuchsiaResourceDialect,
16585                0x57e419a298c8ede,
16586            >(_buf?)?;
16587            Ok(_response.map(|x| x.data))
16588        }
16589        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
16590            (count,),
16591            0x57e419a298c8ede,
16592            fidl::encoding::DynamicFlags::empty(),
16593            _decode,
16594        )
16595    }
16596}
16597
16598pub struct ReadableEventStream {
16599    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
16600}
16601
16602impl std::marker::Unpin for ReadableEventStream {}
16603
16604impl futures::stream::FusedStream for ReadableEventStream {
16605    fn is_terminated(&self) -> bool {
16606        self.event_receiver.is_terminated()
16607    }
16608}
16609
16610impl futures::Stream for ReadableEventStream {
16611    type Item = Result<ReadableEvent, fidl::Error>;
16612
16613    fn poll_next(
16614        mut self: std::pin::Pin<&mut Self>,
16615        cx: &mut std::task::Context<'_>,
16616    ) -> std::task::Poll<Option<Self::Item>> {
16617        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
16618            &mut self.event_receiver,
16619            cx
16620        )?) {
16621            Some(buf) => std::task::Poll::Ready(Some(ReadableEvent::decode(buf))),
16622            None => std::task::Poll::Ready(None),
16623        }
16624    }
16625}
16626
16627#[derive(Debug)]
16628pub enum ReadableEvent {}
16629
16630impl ReadableEvent {
16631    /// Decodes a message buffer as a [`ReadableEvent`].
16632    fn decode(
16633        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
16634    ) -> Result<ReadableEvent, fidl::Error> {
16635        let (bytes, _handles) = buf.split_mut();
16636        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16637        debug_assert_eq!(tx_header.tx_id, 0);
16638        match tx_header.ordinal {
16639            _ => Err(fidl::Error::UnknownOrdinal {
16640                ordinal: tx_header.ordinal,
16641                protocol_name: <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16642            }),
16643        }
16644    }
16645}
16646
16647/// A Stream of incoming requests for fuchsia.io/Readable.
16648pub struct ReadableRequestStream {
16649    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16650    is_terminated: bool,
16651}
16652
16653impl std::marker::Unpin for ReadableRequestStream {}
16654
16655impl futures::stream::FusedStream for ReadableRequestStream {
16656    fn is_terminated(&self) -> bool {
16657        self.is_terminated
16658    }
16659}
16660
16661impl fidl::endpoints::RequestStream for ReadableRequestStream {
16662    type Protocol = ReadableMarker;
16663    type ControlHandle = ReadableControlHandle;
16664
16665    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
16666        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
16667    }
16668
16669    fn control_handle(&self) -> Self::ControlHandle {
16670        ReadableControlHandle { inner: self.inner.clone() }
16671    }
16672
16673    fn into_inner(
16674        self,
16675    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
16676    {
16677        (self.inner, self.is_terminated)
16678    }
16679
16680    fn from_inner(
16681        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16682        is_terminated: bool,
16683    ) -> Self {
16684        Self { inner, is_terminated }
16685    }
16686}
16687
16688impl futures::Stream for ReadableRequestStream {
16689    type Item = Result<ReadableRequest, fidl::Error>;
16690
16691    fn poll_next(
16692        mut self: std::pin::Pin<&mut Self>,
16693        cx: &mut std::task::Context<'_>,
16694    ) -> std::task::Poll<Option<Self::Item>> {
16695        let this = &mut *self;
16696        if this.inner.check_shutdown(cx) {
16697            this.is_terminated = true;
16698            return std::task::Poll::Ready(None);
16699        }
16700        if this.is_terminated {
16701            panic!("polled ReadableRequestStream after completion");
16702        }
16703        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
16704            |bytes, handles| {
16705                match this.inner.channel().read_etc(cx, bytes, handles) {
16706                    std::task::Poll::Ready(Ok(())) => {}
16707                    std::task::Poll::Pending => return std::task::Poll::Pending,
16708                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
16709                        this.is_terminated = true;
16710                        return std::task::Poll::Ready(None);
16711                    }
16712                    std::task::Poll::Ready(Err(e)) => {
16713                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
16714                            e.into(),
16715                        ))))
16716                    }
16717                }
16718
16719                // A message has been received from the channel
16720                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16721
16722                std::task::Poll::Ready(Some(match header.ordinal {
16723                    0x57e419a298c8ede => {
16724                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
16725                        let mut req = fidl::new_empty!(
16726                            ReadableReadRequest,
16727                            fidl::encoding::DefaultFuchsiaResourceDialect
16728                        );
16729                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
16730                        let control_handle = ReadableControlHandle { inner: this.inner.clone() };
16731                        Ok(ReadableRequest::Read {
16732                            count: req.count,
16733
16734                            responder: ReadableReadResponder {
16735                                control_handle: std::mem::ManuallyDrop::new(control_handle),
16736                                tx_id: header.tx_id,
16737                            },
16738                        })
16739                    }
16740                    _ => Err(fidl::Error::UnknownOrdinal {
16741                        ordinal: header.ordinal,
16742                        protocol_name:
16743                            <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16744                    }),
16745                }))
16746            },
16747        )
16748    }
16749}
16750
16751#[derive(Debug)]
16752pub enum ReadableRequest {
16753    /// Reads up to 'count' bytes at the seek offset.
16754    /// The seek offset is moved forward by the number of bytes read.
16755    ///
16756    /// ## Invariants
16757    ///
16758    /// * The returned `data.length` will never be greater than `count`.
16759    /// * If `data.length` is less than `count`, it means that the seek offset
16760    ///   has reached the end of file as part of this operation.
16761    /// * If `data.length` is zero while `count` is not, it means that the
16762    ///   seek offset is already at or beyond the end of file, and no data could
16763    ///   be read.
16764    /// * If `count` is zero, the server should perform all the checks ensuring
16765    ///   read access without actually read anything, and return an empty
16766    ///   `data` vector.
16767    ///
16768    /// This method requires the [`Rights.READ_BYTES`] right.
16769    ///
16770    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16771    Read { count: u64, responder: ReadableReadResponder },
16772}
16773
16774impl ReadableRequest {
16775    #[allow(irrefutable_let_patterns)]
16776    pub fn into_read(self) -> Option<(u64, ReadableReadResponder)> {
16777        if let ReadableRequest::Read { count, responder } = self {
16778            Some((count, responder))
16779        } else {
16780            None
16781        }
16782    }
16783
16784    /// Name of the method defined in FIDL
16785    pub fn method_name(&self) -> &'static str {
16786        match *self {
16787            ReadableRequest::Read { .. } => "read",
16788        }
16789    }
16790}
16791
16792#[derive(Debug, Clone)]
16793pub struct ReadableControlHandle {
16794    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16795}
16796
16797impl fidl::endpoints::ControlHandle for ReadableControlHandle {
16798    fn shutdown(&self) {
16799        self.inner.shutdown()
16800    }
16801    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
16802        self.inner.shutdown_with_epitaph(status)
16803    }
16804
16805    fn is_closed(&self) -> bool {
16806        self.inner.channel().is_closed()
16807    }
16808    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
16809        self.inner.channel().on_closed()
16810    }
16811
16812    #[cfg(target_os = "fuchsia")]
16813    fn signal_peer(
16814        &self,
16815        clear_mask: zx::Signals,
16816        set_mask: zx::Signals,
16817    ) -> Result<(), zx_status::Status> {
16818        use fidl::Peered;
16819        self.inner.channel().signal_peer(clear_mask, set_mask)
16820    }
16821}
16822
16823impl ReadableControlHandle {}
16824
16825#[must_use = "FIDL methods require a response to be sent"]
16826#[derive(Debug)]
16827pub struct ReadableReadResponder {
16828    control_handle: std::mem::ManuallyDrop<ReadableControlHandle>,
16829    tx_id: u32,
16830}
16831
16832/// Set the the channel to be shutdown (see [`ReadableControlHandle::shutdown`])
16833/// if the responder is dropped without sending a response, so that the client
16834/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16835impl std::ops::Drop for ReadableReadResponder {
16836    fn drop(&mut self) {
16837        self.control_handle.shutdown();
16838        // Safety: drops once, never accessed again
16839        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16840    }
16841}
16842
16843impl fidl::endpoints::Responder for ReadableReadResponder {
16844    type ControlHandle = ReadableControlHandle;
16845
16846    fn control_handle(&self) -> &ReadableControlHandle {
16847        &self.control_handle
16848    }
16849
16850    fn drop_without_shutdown(mut self) {
16851        // Safety: drops once, never accessed again due to mem::forget
16852        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16853        // Prevent Drop from running (which would shut down the channel)
16854        std::mem::forget(self);
16855    }
16856}
16857
16858impl ReadableReadResponder {
16859    /// Sends a response to the FIDL transaction.
16860    ///
16861    /// Sets the channel to shutdown if an error occurs.
16862    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
16863        let _result = self.send_raw(result);
16864        if _result.is_err() {
16865            self.control_handle.shutdown();
16866        }
16867        self.drop_without_shutdown();
16868        _result
16869    }
16870
16871    /// Similar to "send" but does not shutdown the channel if an error occurs.
16872    pub fn send_no_shutdown_on_err(
16873        self,
16874        mut result: Result<&[u8], i32>,
16875    ) -> Result<(), fidl::Error> {
16876        let _result = self.send_raw(result);
16877        self.drop_without_shutdown();
16878        _result
16879    }
16880
16881    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
16882        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
16883            result.map(|data| (data,)),
16884            self.tx_id,
16885            0x57e419a298c8ede,
16886            fidl::encoding::DynamicFlags::empty(),
16887        )
16888    }
16889}
16890
16891#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
16892pub struct SymlinkMarker;
16893
16894impl fidl::endpoints::ProtocolMarker for SymlinkMarker {
16895    type Proxy = SymlinkProxy;
16896    type RequestStream = SymlinkRequestStream;
16897    #[cfg(target_os = "fuchsia")]
16898    type SynchronousProxy = SymlinkSynchronousProxy;
16899
16900    const DEBUG_NAME: &'static str = "fuchsia.io.Symlink";
16901}
16902impl fidl::endpoints::DiscoverableProtocolMarker for SymlinkMarker {}
16903
16904pub trait SymlinkProxyInterface: Send + Sync {
16905    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
16906        + Send;
16907    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
16908    fn r#clone(
16909        &self,
16910        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
16911    ) -> Result<(), fidl::Error>;
16912    type CloseResponseFut: std::future::Future<
16913            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
16914        > + Send;
16915    fn r#close(&self) -> Self::CloseResponseFut;
16916    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
16917    fn r#query(&self) -> Self::QueryResponseFut;
16918    fn r#deprecated_clone(
16919        &self,
16920        flags: OpenFlags,
16921        object: fidl::endpoints::ServerEnd<NodeMarker>,
16922    ) -> Result<(), fidl::Error>;
16923    type GetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
16924        + Send;
16925    fn r#get_attr(&self) -> Self::GetAttrResponseFut;
16926    type SetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
16927    fn r#set_attr(
16928        &self,
16929        flags: NodeAttributeFlags,
16930        attributes: &NodeAttributes,
16931    ) -> Self::SetAttrResponseFut;
16932    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
16933        + Send;
16934    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
16935    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
16936        + Send;
16937    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
16938    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
16939        + Send;
16940    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
16941    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
16942        + Send;
16943    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
16944    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
16945        + Send;
16946    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
16947    type GetConnectionInfoResponseFut: std::future::Future<Output = Result<ConnectionInfo, fidl::Error>>
16948        + Send;
16949    fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut;
16950    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
16951        + Send;
16952    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
16953    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
16954        + Send;
16955    fn r#update_attributes(
16956        &self,
16957        payload: &MutableNodeAttributes,
16958    ) -> Self::UpdateAttributesResponseFut;
16959    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
16960    fn r#sync(&self) -> Self::SyncResponseFut;
16961    fn r#list_extended_attributes(
16962        &self,
16963        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
16964    ) -> Result<(), fidl::Error>;
16965    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
16966        + Send;
16967    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
16968    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
16969        + Send;
16970    fn r#set_extended_attribute(
16971        &self,
16972        name: &[u8],
16973        value: ExtendedAttributeValue,
16974        mode: SetExtendedAttributeMode,
16975    ) -> Self::SetExtendedAttributeResponseFut;
16976    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
16977        + Send;
16978    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
16979    type DescribeResponseFut: std::future::Future<Output = Result<SymlinkInfo, fidl::Error>> + Send;
16980    fn r#describe(&self) -> Self::DescribeResponseFut;
16981}
16982#[derive(Debug)]
16983#[cfg(target_os = "fuchsia")]
16984pub struct SymlinkSynchronousProxy {
16985    client: fidl::client::sync::Client,
16986}
16987
16988#[cfg(target_os = "fuchsia")]
16989impl fidl::endpoints::SynchronousProxy for SymlinkSynchronousProxy {
16990    type Proxy = SymlinkProxy;
16991    type Protocol = SymlinkMarker;
16992
16993    fn from_channel(inner: fidl::Channel) -> Self {
16994        Self::new(inner)
16995    }
16996
16997    fn into_channel(self) -> fidl::Channel {
16998        self.client.into_channel()
16999    }
17000
17001    fn as_channel(&self) -> &fidl::Channel {
17002        self.client.as_channel()
17003    }
17004}
17005
17006#[cfg(target_os = "fuchsia")]
17007impl SymlinkSynchronousProxy {
17008    pub fn new(channel: fidl::Channel) -> Self {
17009        let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
17010        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
17011    }
17012
17013    pub fn into_channel(self) -> fidl::Channel {
17014        self.client.into_channel()
17015    }
17016
17017    /// Waits until an event arrives and returns it. It is safe for other
17018    /// threads to make concurrent requests while waiting for an event.
17019    pub fn wait_for_event(
17020        &self,
17021        deadline: zx::MonotonicInstant,
17022    ) -> Result<SymlinkEvent, fidl::Error> {
17023        SymlinkEvent::decode(self.client.wait_for_event(deadline)?)
17024    }
17025
17026    /// Creates a link to this this object with name `dst` in the directory represented by
17027    /// `dst_parent_token`.
17028    ///
17029    /// `dst` must be a resolved object name. Including "/" in the string will return
17030    /// `ZX_ERR_INVALID_ARGS`.
17031    ///
17032    /// This method requires the maximal set of rights supported by the filesystem for this object.
17033    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
17034    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
17035    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
17036    /// `ZX_ERR_ACCESS_DENIED`.
17037    ///
17038    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
17039    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
17040    ///
17041    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
17042    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
17043    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
17044    ///
17045    /// This method does not have the same atomicity properties has the `Directory::Link` method,
17046    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
17047    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
17048    pub fn r#link_into(
17049        &self,
17050        mut dst_parent_token: fidl::Event,
17051        mut dst: &str,
17052        ___deadline: zx::MonotonicInstant,
17053    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
17054        let _response = self.client.send_query::<
17055            LinkableLinkIntoRequest,
17056            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17057        >(
17058            (dst_parent_token, dst,),
17059            0x54f3949246a03e74,
17060            fidl::encoding::DynamicFlags::empty(),
17061            ___deadline,
17062        )?;
17063        Ok(_response.map(|x| x))
17064    }
17065
17066    pub fn r#clone(
17067        &self,
17068        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17069    ) -> Result<(), fidl::Error> {
17070        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
17071            (request,),
17072            0x20d8a7aba2168a79,
17073            fidl::encoding::DynamicFlags::empty(),
17074        )
17075    }
17076
17077    /// Terminates the connection.
17078    ///
17079    /// After calling `Close`, the client must not send any other requests.
17080    ///
17081    /// Servers, after sending the status response, should close the connection
17082    /// regardless of status and without sending an epitaph.
17083    ///
17084    /// Closing the client end of the channel should be semantically equivalent
17085    /// to calling `Close` without knowing when the close has completed or its
17086    /// status.
17087    pub fn r#close(
17088        &self,
17089        ___deadline: zx::MonotonicInstant,
17090    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
17091        let _response = self.client.send_query::<
17092            fidl::encoding::EmptyPayload,
17093            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17094        >(
17095            (),
17096            0x5ac5d459ad7f657e,
17097            fidl::encoding::DynamicFlags::empty(),
17098            ___deadline,
17099        )?;
17100        Ok(_response.map(|x| x))
17101    }
17102
17103    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
17104        let _response = self.client.send_query::<
17105            fidl::encoding::EmptyPayload,
17106            fidl_fuchsia_unknown::QueryableQueryResponse,
17107        >(
17108            (),
17109            0x2658edee9decfc06,
17110            fidl::encoding::DynamicFlags::empty(),
17111            ___deadline,
17112        )?;
17113        Ok(_response.protocol)
17114    }
17115
17116    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
17117    pub fn r#deprecated_clone(
17118        &self,
17119        mut flags: OpenFlags,
17120        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17121    ) -> Result<(), fidl::Error> {
17122        self.client.send::<NodeDeprecatedCloneRequest>(
17123            (flags, object),
17124            0x5a61678f293ce16f,
17125            fidl::encoding::DynamicFlags::FLEXIBLE,
17126        )
17127    }
17128
17129    /// Acquires information about the node.
17130    ///
17131    /// This method does not require any rights.
17132    pub fn r#get_attr(
17133        &self,
17134        ___deadline: zx::MonotonicInstant,
17135    ) -> Result<(i32, NodeAttributes), fidl::Error> {
17136        let _response =
17137            self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetAttrResponse>(
17138                (),
17139                0x78985e216314dafd,
17140                fidl::encoding::DynamicFlags::empty(),
17141                ___deadline,
17142            )?;
17143        Ok((_response.s, _response.attributes))
17144    }
17145
17146    /// Updates information about the node.
17147    ///
17148    /// Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.
17149    ///
17150    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
17151    /// `ZX_ERR_BAD_HANDLE`.
17152    pub fn r#set_attr(
17153        &self,
17154        mut flags: NodeAttributeFlags,
17155        mut attributes: &NodeAttributes,
17156        ___deadline: zx::MonotonicInstant,
17157    ) -> Result<i32, fidl::Error> {
17158        let _response = self.client.send_query::<NodeSetAttrRequest, NodeSetAttrResponse>(
17159            (flags, attributes),
17160            0x4186c0f40d938f46,
17161            fidl::encoding::DynamicFlags::empty(),
17162            ___deadline,
17163        )?;
17164        Ok(_response.s)
17165    }
17166
17167    /// [DEPRECATED - Use new GetFlags method instead.]
17168    pub fn r#deprecated_get_flags(
17169        &self,
17170        ___deadline: zx::MonotonicInstant,
17171    ) -> Result<(i32, OpenFlags), fidl::Error> {
17172        let _response = self
17173            .client
17174            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse>(
17175                (),
17176                0x5b88fffb8eda3aa1,
17177                fidl::encoding::DynamicFlags::empty(),
17178                ___deadline,
17179            )?;
17180        Ok((_response.s, _response.flags))
17181    }
17182
17183    /// [DEPRECATED - Use new SetFlags method instead.]
17184    pub fn r#deprecated_set_flags(
17185        &self,
17186        mut flags: OpenFlags,
17187        ___deadline: zx::MonotonicInstant,
17188    ) -> Result<i32, fidl::Error> {
17189        let _response = self
17190            .client
17191            .send_query::<NodeDeprecatedSetFlagsRequest, NodeDeprecatedSetFlagsResponse>(
17192                (flags,),
17193                0x5295b76c71fde733,
17194                fidl::encoding::DynamicFlags::empty(),
17195                ___deadline,
17196            )?;
17197        Ok(_response.s)
17198    }
17199
17200    /// Queries the flags that apply to this node after it has been opened/created. This method does
17201    /// not require any rights.
17202    ///
17203    /// Note that the final set of flags that apply to the connection may differ from those
17204    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
17205    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
17206    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
17207    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
17208    pub fn r#get_flags(
17209        &self,
17210        ___deadline: zx::MonotonicInstant,
17211    ) -> Result<NodeGetFlagsResult, fidl::Error> {
17212        let _response = self.client.send_query::<
17213            fidl::encoding::EmptyPayload,
17214            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
17215        >(
17216            (),
17217            0x176eb318f64ec23,
17218            fidl::encoding::DynamicFlags::FLEXIBLE,
17219            ___deadline,
17220        )?
17221        .into_result::<SymlinkMarker>("get_flags")?;
17222        Ok(_response.map(|x| x.flags))
17223    }
17224
17225    /// Sets the flags that apply to this node after it has been opened. This method does not
17226    /// require any rights.
17227    ///
17228    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
17229    /// clear append mode.
17230    ///
17231    /// Errors:
17232    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
17233    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
17234    pub fn r#set_flags(
17235        &self,
17236        mut flags: Flags,
17237        ___deadline: zx::MonotonicInstant,
17238    ) -> Result<NodeSetFlagsResult, fidl::Error> {
17239        let _response = self.client.send_query::<
17240            NodeSetFlagsRequest,
17241            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
17242        >(
17243            (flags,),
17244            0x55a8028685791ea8,
17245            fidl::encoding::DynamicFlags::FLEXIBLE,
17246            ___deadline,
17247        )?
17248        .into_result::<SymlinkMarker>("set_flags")?;
17249        Ok(_response.map(|x| x))
17250    }
17251
17252    /// Query the filesystem for filesystem-specific information.
17253    pub fn r#query_filesystem(
17254        &self,
17255        ___deadline: zx::MonotonicInstant,
17256    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
17257        let _response =
17258            self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
17259                (),
17260                0x6f344a1c6b0a0610,
17261                fidl::encoding::DynamicFlags::empty(),
17262                ___deadline,
17263            )?;
17264        Ok((_response.s, _response.info))
17265    }
17266
17267    /// Acquires information about the connection.
17268    ///
17269    /// This method does not require any rights.
17270    pub fn r#get_connection_info(
17271        &self,
17272        ___deadline: zx::MonotonicInstant,
17273    ) -> Result<ConnectionInfo, fidl::Error> {
17274        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, ConnectionInfo>(
17275            (),
17276            0x584c377c7c0a6d0b,
17277            fidl::encoding::DynamicFlags::empty(),
17278            ___deadline,
17279        )?;
17280        Ok(_response)
17281    }
17282
17283    /// Acquires information about the node.
17284    ///
17285    /// The attributes of a node should be stable, independent of the
17286    /// specific protocol used to access it.
17287    ///
17288    /// If a particular attribute is not applicable or not supported,
17289    /// filesystems should leave the corresponding field absent.
17290    ///
17291    /// + `query` a bit-mask specifying which attributes to fetch. The server
17292    ///   should not return more than necessary.
17293    /// - `attributes` the returned attributes.
17294    ///
17295    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17296    pub fn r#get_attributes(
17297        &self,
17298        mut query: NodeAttributesQuery,
17299        ___deadline: zx::MonotonicInstant,
17300    ) -> Result<NodeGetAttributesResult, fidl::Error> {
17301        let _response = self.client.send_query::<
17302            NodeGetAttributesRequest,
17303            fidl::encoding::ResultType<NodeAttributes2, i32>,
17304        >(
17305            (query,),
17306            0x3d4396a638ea053b,
17307            fidl::encoding::DynamicFlags::empty(),
17308            ___deadline,
17309        )?;
17310        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
17311    }
17312
17313    /// Updates information about the node.
17314    ///
17315    /// + `attributes` the presence of a table field in `attributes` indicates
17316    /// the intent to update the corresponding attribute.
17317    ///
17318    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
17319    ///
17320    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17321    pub fn r#update_attributes(
17322        &self,
17323        mut payload: &MutableNodeAttributes,
17324        ___deadline: zx::MonotonicInstant,
17325    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
17326        let _response = self.client.send_query::<
17327            MutableNodeAttributes,
17328            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17329        >(
17330            payload,
17331            0x3308c1da5a89bf08,
17332            fidl::encoding::DynamicFlags::empty(),
17333            ___deadline,
17334        )?;
17335        Ok(_response.map(|x| x))
17336    }
17337
17338    /// Synchronizes updates to the node to the underlying media, if it exists.
17339    ///
17340    /// This method will return when the filesystem server has flushed the
17341    /// relevant updates to the underlying media, but does not guarantee the
17342    /// underlying media has persisted the information, nor that any information
17343    /// is committed to hardware. Clients may use `Sync` to ensure ordering
17344    /// between operations.
17345    ///
17346    /// This method does not require any rights.
17347    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
17348        let _response = self.client.send_query::<
17349            fidl::encoding::EmptyPayload,
17350            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17351        >(
17352            (),
17353            0x2c5c27ca0ab5dc49,
17354            fidl::encoding::DynamicFlags::empty(),
17355            ___deadline,
17356        )?;
17357        Ok(_response.map(|x| x))
17358    }
17359
17360    /// Creates an iterator over all the extended attribute names associated
17361    /// with this node. If an error occurs it is returned as an epitaph on the
17362    /// iterator request channel, and then the channel is closed.
17363    ///
17364    /// GetExtendedAttributes can be used with any of these names to retrieve
17365    /// the associated value.
17366    ///
17367    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17368    pub fn r#list_extended_attributes(
17369        &self,
17370        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17371    ) -> Result<(), fidl::Error> {
17372        self.client.send::<NodeListExtendedAttributesRequest>(
17373            (iterator,),
17374            0x4b61033de007fcd0,
17375            fidl::encoding::DynamicFlags::empty(),
17376        )
17377    }
17378
17379    /// Get the value associated with the given attribute `name` for this node.
17380    ///
17381    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
17382    /// particular structure is imposed on them.
17383    ///
17384    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17385    pub fn r#get_extended_attribute(
17386        &self,
17387        mut name: &[u8],
17388        ___deadline: zx::MonotonicInstant,
17389    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
17390        let _response = self.client.send_query::<
17391            NodeGetExtendedAttributeRequest,
17392            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
17393        >(
17394            (name,),
17395            0x45ffa3ccfdeb76db,
17396            fidl::encoding::DynamicFlags::empty(),
17397            ___deadline,
17398        )?;
17399        Ok(_response.map(|x| x))
17400    }
17401
17402    /// Set the value for the given attribute `name` to `value` for this node.
17403    ///
17404    /// The attribute name may exist, in which case the attribute is updated.
17405    /// If the attribute doesn't exist, it is created. The name should have no
17406    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
17407    ///
17408    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17409    pub fn r#set_extended_attribute(
17410        &self,
17411        mut name: &[u8],
17412        mut value: ExtendedAttributeValue,
17413        mut mode: SetExtendedAttributeMode,
17414        ___deadline: zx::MonotonicInstant,
17415    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
17416        let _response = self.client.send_query::<
17417            NodeSetExtendedAttributeRequest,
17418            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17419        >(
17420            (name, &mut value, mode,),
17421            0x4a951362f681f23c,
17422            fidl::encoding::DynamicFlags::empty(),
17423            ___deadline,
17424        )?;
17425        Ok(_response.map(|x| x))
17426    }
17427
17428    /// Remove the specified extended attribute.
17429    ///
17430    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
17431    ///
17432    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17433    pub fn r#remove_extended_attribute(
17434        &self,
17435        mut name: &[u8],
17436        ___deadline: zx::MonotonicInstant,
17437    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
17438        let _response = self.client.send_query::<
17439            NodeRemoveExtendedAttributeRequest,
17440            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17441        >(
17442            (name,),
17443            0x7a0b9f3a9bf9032d,
17444            fidl::encoding::DynamicFlags::empty(),
17445            ___deadline,
17446        )?;
17447        Ok(_response.map(|x| x))
17448    }
17449
17450    pub fn r#describe(
17451        &self,
17452        ___deadline: zx::MonotonicInstant,
17453    ) -> Result<SymlinkInfo, fidl::Error> {
17454        let _response = self
17455            .client
17456            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleType<SymlinkInfo>>(
17457                (),
17458                0x742c2ea5e89831f3,
17459                fidl::encoding::DynamicFlags::FLEXIBLE,
17460                ___deadline,
17461            )?
17462            .into_result::<SymlinkMarker>("describe")?;
17463        Ok(_response)
17464    }
17465}
17466
17467#[cfg(target_os = "fuchsia")]
17468impl From<SymlinkSynchronousProxy> for zx::Handle {
17469    fn from(value: SymlinkSynchronousProxy) -> Self {
17470        value.into_channel().into()
17471    }
17472}
17473
17474#[cfg(target_os = "fuchsia")]
17475impl From<fidl::Channel> for SymlinkSynchronousProxy {
17476    fn from(value: fidl::Channel) -> Self {
17477        Self::new(value)
17478    }
17479}
17480
17481#[derive(Debug, Clone)]
17482pub struct SymlinkProxy {
17483    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
17484}
17485
17486impl fidl::endpoints::Proxy for SymlinkProxy {
17487    type Protocol = SymlinkMarker;
17488
17489    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
17490        Self::new(inner)
17491    }
17492
17493    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
17494        self.client.into_channel().map_err(|client| Self { client })
17495    }
17496
17497    fn as_channel(&self) -> &::fidl::AsyncChannel {
17498        self.client.as_channel()
17499    }
17500}
17501
17502impl SymlinkProxy {
17503    /// Create a new Proxy for fuchsia.io/Symlink.
17504    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
17505        let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
17506        Self { client: fidl::client::Client::new(channel, protocol_name) }
17507    }
17508
17509    /// Get a Stream of events from the remote end of the protocol.
17510    ///
17511    /// # Panics
17512    ///
17513    /// Panics if the event stream was already taken.
17514    pub fn take_event_stream(&self) -> SymlinkEventStream {
17515        SymlinkEventStream { event_receiver: self.client.take_event_receiver() }
17516    }
17517
17518    /// Creates a link to this this object with name `dst` in the directory represented by
17519    /// `dst_parent_token`.
17520    ///
17521    /// `dst` must be a resolved object name. Including "/" in the string will return
17522    /// `ZX_ERR_INVALID_ARGS`.
17523    ///
17524    /// This method requires the maximal set of rights supported by the filesystem for this object.
17525    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
17526    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
17527    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
17528    /// `ZX_ERR_ACCESS_DENIED`.
17529    ///
17530    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
17531    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
17532    ///
17533    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
17534    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
17535    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
17536    ///
17537    /// This method does not have the same atomicity properties has the `Directory::Link` method,
17538    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
17539    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
17540    pub fn r#link_into(
17541        &self,
17542        mut dst_parent_token: fidl::Event,
17543        mut dst: &str,
17544    ) -> fidl::client::QueryResponseFut<
17545        LinkableLinkIntoResult,
17546        fidl::encoding::DefaultFuchsiaResourceDialect,
17547    > {
17548        SymlinkProxyInterface::r#link_into(self, dst_parent_token, dst)
17549    }
17550
17551    pub fn r#clone(
17552        &self,
17553        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17554    ) -> Result<(), fidl::Error> {
17555        SymlinkProxyInterface::r#clone(self, request)
17556    }
17557
17558    /// Terminates the connection.
17559    ///
17560    /// After calling `Close`, the client must not send any other requests.
17561    ///
17562    /// Servers, after sending the status response, should close the connection
17563    /// regardless of status and without sending an epitaph.
17564    ///
17565    /// Closing the client end of the channel should be semantically equivalent
17566    /// to calling `Close` without knowing when the close has completed or its
17567    /// status.
17568    pub fn r#close(
17569        &self,
17570    ) -> fidl::client::QueryResponseFut<
17571        fidl_fuchsia_unknown::CloseableCloseResult,
17572        fidl::encoding::DefaultFuchsiaResourceDialect,
17573    > {
17574        SymlinkProxyInterface::r#close(self)
17575    }
17576
17577    pub fn r#query(
17578        &self,
17579    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
17580    {
17581        SymlinkProxyInterface::r#query(self)
17582    }
17583
17584    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
17585    pub fn r#deprecated_clone(
17586        &self,
17587        mut flags: OpenFlags,
17588        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17589    ) -> Result<(), fidl::Error> {
17590        SymlinkProxyInterface::r#deprecated_clone(self, flags, object)
17591    }
17592
17593    /// Acquires information about the node.
17594    ///
17595    /// This method does not require any rights.
17596    pub fn r#get_attr(
17597        &self,
17598    ) -> fidl::client::QueryResponseFut<
17599        (i32, NodeAttributes),
17600        fidl::encoding::DefaultFuchsiaResourceDialect,
17601    > {
17602        SymlinkProxyInterface::r#get_attr(self)
17603    }
17604
17605    /// Updates information about the node.
17606    ///
17607    /// Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.
17608    ///
17609    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
17610    /// `ZX_ERR_BAD_HANDLE`.
17611    pub fn r#set_attr(
17612        &self,
17613        mut flags: NodeAttributeFlags,
17614        mut attributes: &NodeAttributes,
17615    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
17616        SymlinkProxyInterface::r#set_attr(self, flags, attributes)
17617    }
17618
17619    /// [DEPRECATED - Use new GetFlags method instead.]
17620    pub fn r#deprecated_get_flags(
17621        &self,
17622    ) -> fidl::client::QueryResponseFut<
17623        (i32, OpenFlags),
17624        fidl::encoding::DefaultFuchsiaResourceDialect,
17625    > {
17626        SymlinkProxyInterface::r#deprecated_get_flags(self)
17627    }
17628
17629    /// [DEPRECATED - Use new SetFlags method instead.]
17630    pub fn r#deprecated_set_flags(
17631        &self,
17632        mut flags: OpenFlags,
17633    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
17634        SymlinkProxyInterface::r#deprecated_set_flags(self, flags)
17635    }
17636
17637    /// Queries the flags that apply to this node after it has been opened/created. This method does
17638    /// not require any rights.
17639    ///
17640    /// Note that the final set of flags that apply to the connection may differ from those
17641    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
17642    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
17643    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
17644    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
17645    pub fn r#get_flags(
17646        &self,
17647    ) -> fidl::client::QueryResponseFut<
17648        NodeGetFlagsResult,
17649        fidl::encoding::DefaultFuchsiaResourceDialect,
17650    > {
17651        SymlinkProxyInterface::r#get_flags(self)
17652    }
17653
17654    /// Sets the flags that apply to this node after it has been opened. This method does not
17655    /// require any rights.
17656    ///
17657    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
17658    /// clear append mode.
17659    ///
17660    /// Errors:
17661    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
17662    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
17663    pub fn r#set_flags(
17664        &self,
17665        mut flags: Flags,
17666    ) -> fidl::client::QueryResponseFut<
17667        NodeSetFlagsResult,
17668        fidl::encoding::DefaultFuchsiaResourceDialect,
17669    > {
17670        SymlinkProxyInterface::r#set_flags(self, flags)
17671    }
17672
17673    /// Query the filesystem for filesystem-specific information.
17674    pub fn r#query_filesystem(
17675        &self,
17676    ) -> fidl::client::QueryResponseFut<
17677        (i32, Option<Box<FilesystemInfo>>),
17678        fidl::encoding::DefaultFuchsiaResourceDialect,
17679    > {
17680        SymlinkProxyInterface::r#query_filesystem(self)
17681    }
17682
17683    /// Acquires information about the connection.
17684    ///
17685    /// This method does not require any rights.
17686    pub fn r#get_connection_info(
17687        &self,
17688    ) -> fidl::client::QueryResponseFut<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
17689    {
17690        SymlinkProxyInterface::r#get_connection_info(self)
17691    }
17692
17693    /// Acquires information about the node.
17694    ///
17695    /// The attributes of a node should be stable, independent of the
17696    /// specific protocol used to access it.
17697    ///
17698    /// If a particular attribute is not applicable or not supported,
17699    /// filesystems should leave the corresponding field absent.
17700    ///
17701    /// + `query` a bit-mask specifying which attributes to fetch. The server
17702    ///   should not return more than necessary.
17703    /// - `attributes` the returned attributes.
17704    ///
17705    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17706    pub fn r#get_attributes(
17707        &self,
17708        mut query: NodeAttributesQuery,
17709    ) -> fidl::client::QueryResponseFut<
17710        NodeGetAttributesResult,
17711        fidl::encoding::DefaultFuchsiaResourceDialect,
17712    > {
17713        SymlinkProxyInterface::r#get_attributes(self, query)
17714    }
17715
17716    /// Updates information about the node.
17717    ///
17718    /// + `attributes` the presence of a table field in `attributes` indicates
17719    /// the intent to update the corresponding attribute.
17720    ///
17721    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
17722    ///
17723    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17724    pub fn r#update_attributes(
17725        &self,
17726        mut payload: &MutableNodeAttributes,
17727    ) -> fidl::client::QueryResponseFut<
17728        NodeUpdateAttributesResult,
17729        fidl::encoding::DefaultFuchsiaResourceDialect,
17730    > {
17731        SymlinkProxyInterface::r#update_attributes(self, payload)
17732    }
17733
17734    /// Synchronizes updates to the node to the underlying media, if it exists.
17735    ///
17736    /// This method will return when the filesystem server has flushed the
17737    /// relevant updates to the underlying media, but does not guarantee the
17738    /// underlying media has persisted the information, nor that any information
17739    /// is committed to hardware. Clients may use `Sync` to ensure ordering
17740    /// between operations.
17741    ///
17742    /// This method does not require any rights.
17743    pub fn r#sync(
17744        &self,
17745    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
17746    {
17747        SymlinkProxyInterface::r#sync(self)
17748    }
17749
17750    /// Creates an iterator over all the extended attribute names associated
17751    /// with this node. If an error occurs it is returned as an epitaph on the
17752    /// iterator request channel, and then the channel is closed.
17753    ///
17754    /// GetExtendedAttributes can be used with any of these names to retrieve
17755    /// the associated value.
17756    ///
17757    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17758    pub fn r#list_extended_attributes(
17759        &self,
17760        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17761    ) -> Result<(), fidl::Error> {
17762        SymlinkProxyInterface::r#list_extended_attributes(self, iterator)
17763    }
17764
17765    /// Get the value associated with the given attribute `name` for this node.
17766    ///
17767    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
17768    /// particular structure is imposed on them.
17769    ///
17770    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17771    pub fn r#get_extended_attribute(
17772        &self,
17773        mut name: &[u8],
17774    ) -> fidl::client::QueryResponseFut<
17775        NodeGetExtendedAttributeResult,
17776        fidl::encoding::DefaultFuchsiaResourceDialect,
17777    > {
17778        SymlinkProxyInterface::r#get_extended_attribute(self, name)
17779    }
17780
17781    /// Set the value for the given attribute `name` to `value` for this node.
17782    ///
17783    /// The attribute name may exist, in which case the attribute is updated.
17784    /// If the attribute doesn't exist, it is created. The name should have no
17785    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
17786    ///
17787    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17788    pub fn r#set_extended_attribute(
17789        &self,
17790        mut name: &[u8],
17791        mut value: ExtendedAttributeValue,
17792        mut mode: SetExtendedAttributeMode,
17793    ) -> fidl::client::QueryResponseFut<
17794        NodeSetExtendedAttributeResult,
17795        fidl::encoding::DefaultFuchsiaResourceDialect,
17796    > {
17797        SymlinkProxyInterface::r#set_extended_attribute(self, name, value, mode)
17798    }
17799
17800    /// Remove the specified extended attribute.
17801    ///
17802    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
17803    ///
17804    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17805    pub fn r#remove_extended_attribute(
17806        &self,
17807        mut name: &[u8],
17808    ) -> fidl::client::QueryResponseFut<
17809        NodeRemoveExtendedAttributeResult,
17810        fidl::encoding::DefaultFuchsiaResourceDialect,
17811    > {
17812        SymlinkProxyInterface::r#remove_extended_attribute(self, name)
17813    }
17814
17815    pub fn r#describe(
17816        &self,
17817    ) -> fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
17818    {
17819        SymlinkProxyInterface::r#describe(self)
17820    }
17821}
17822
17823impl SymlinkProxyInterface for SymlinkProxy {
17824    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
17825        LinkableLinkIntoResult,
17826        fidl::encoding::DefaultFuchsiaResourceDialect,
17827    >;
17828    fn r#link_into(
17829        &self,
17830        mut dst_parent_token: fidl::Event,
17831        mut dst: &str,
17832    ) -> Self::LinkIntoResponseFut {
17833        fn _decode(
17834            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17835        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
17836            let _response = fidl::client::decode_transaction_body::<
17837                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17838                fidl::encoding::DefaultFuchsiaResourceDialect,
17839                0x54f3949246a03e74,
17840            >(_buf?)?;
17841            Ok(_response.map(|x| x))
17842        }
17843        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
17844            (dst_parent_token, dst),
17845            0x54f3949246a03e74,
17846            fidl::encoding::DynamicFlags::empty(),
17847            _decode,
17848        )
17849    }
17850
17851    fn r#clone(
17852        &self,
17853        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17854    ) -> Result<(), fidl::Error> {
17855        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
17856            (request,),
17857            0x20d8a7aba2168a79,
17858            fidl::encoding::DynamicFlags::empty(),
17859        )
17860    }
17861
17862    type CloseResponseFut = fidl::client::QueryResponseFut<
17863        fidl_fuchsia_unknown::CloseableCloseResult,
17864        fidl::encoding::DefaultFuchsiaResourceDialect,
17865    >;
17866    fn r#close(&self) -> Self::CloseResponseFut {
17867        fn _decode(
17868            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17869        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
17870            let _response = fidl::client::decode_transaction_body::<
17871                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17872                fidl::encoding::DefaultFuchsiaResourceDialect,
17873                0x5ac5d459ad7f657e,
17874            >(_buf?)?;
17875            Ok(_response.map(|x| x))
17876        }
17877        self.client.send_query_and_decode::<
17878            fidl::encoding::EmptyPayload,
17879            fidl_fuchsia_unknown::CloseableCloseResult,
17880        >(
17881            (),
17882            0x5ac5d459ad7f657e,
17883            fidl::encoding::DynamicFlags::empty(),
17884            _decode,
17885        )
17886    }
17887
17888    type QueryResponseFut =
17889        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
17890    fn r#query(&self) -> Self::QueryResponseFut {
17891        fn _decode(
17892            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17893        ) -> Result<Vec<u8>, fidl::Error> {
17894            let _response = fidl::client::decode_transaction_body::<
17895                fidl_fuchsia_unknown::QueryableQueryResponse,
17896                fidl::encoding::DefaultFuchsiaResourceDialect,
17897                0x2658edee9decfc06,
17898            >(_buf?)?;
17899            Ok(_response.protocol)
17900        }
17901        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
17902            (),
17903            0x2658edee9decfc06,
17904            fidl::encoding::DynamicFlags::empty(),
17905            _decode,
17906        )
17907    }
17908
17909    fn r#deprecated_clone(
17910        &self,
17911        mut flags: OpenFlags,
17912        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17913    ) -> Result<(), fidl::Error> {
17914        self.client.send::<NodeDeprecatedCloneRequest>(
17915            (flags, object),
17916            0x5a61678f293ce16f,
17917            fidl::encoding::DynamicFlags::FLEXIBLE,
17918        )
17919    }
17920
17921    type GetAttrResponseFut = fidl::client::QueryResponseFut<
17922        (i32, NodeAttributes),
17923        fidl::encoding::DefaultFuchsiaResourceDialect,
17924    >;
17925    fn r#get_attr(&self) -> Self::GetAttrResponseFut {
17926        fn _decode(
17927            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17928        ) -> Result<(i32, NodeAttributes), fidl::Error> {
17929            let _response = fidl::client::decode_transaction_body::<
17930                NodeGetAttrResponse,
17931                fidl::encoding::DefaultFuchsiaResourceDialect,
17932                0x78985e216314dafd,
17933            >(_buf?)?;
17934            Ok((_response.s, _response.attributes))
17935        }
17936        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
17937            (),
17938            0x78985e216314dafd,
17939            fidl::encoding::DynamicFlags::empty(),
17940            _decode,
17941        )
17942    }
17943
17944    type SetAttrResponseFut =
17945        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
17946    fn r#set_attr(
17947        &self,
17948        mut flags: NodeAttributeFlags,
17949        mut attributes: &NodeAttributes,
17950    ) -> Self::SetAttrResponseFut {
17951        fn _decode(
17952            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17953        ) -> Result<i32, fidl::Error> {
17954            let _response = fidl::client::decode_transaction_body::<
17955                NodeSetAttrResponse,
17956                fidl::encoding::DefaultFuchsiaResourceDialect,
17957                0x4186c0f40d938f46,
17958            >(_buf?)?;
17959            Ok(_response.s)
17960        }
17961        self.client.send_query_and_decode::<NodeSetAttrRequest, i32>(
17962            (flags, attributes),
17963            0x4186c0f40d938f46,
17964            fidl::encoding::DynamicFlags::empty(),
17965            _decode,
17966        )
17967    }
17968
17969    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
17970        (i32, OpenFlags),
17971        fidl::encoding::DefaultFuchsiaResourceDialect,
17972    >;
17973    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
17974        fn _decode(
17975            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17976        ) -> Result<(i32, OpenFlags), fidl::Error> {
17977            let _response = fidl::client::decode_transaction_body::<
17978                NodeDeprecatedGetFlagsResponse,
17979                fidl::encoding::DefaultFuchsiaResourceDialect,
17980                0x5b88fffb8eda3aa1,
17981            >(_buf?)?;
17982            Ok((_response.s, _response.flags))
17983        }
17984        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
17985            (),
17986            0x5b88fffb8eda3aa1,
17987            fidl::encoding::DynamicFlags::empty(),
17988            _decode,
17989        )
17990    }
17991
17992    type DeprecatedSetFlagsResponseFut =
17993        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
17994    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
17995        fn _decode(
17996            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17997        ) -> Result<i32, fidl::Error> {
17998            let _response = fidl::client::decode_transaction_body::<
17999                NodeDeprecatedSetFlagsResponse,
18000                fidl::encoding::DefaultFuchsiaResourceDialect,
18001                0x5295b76c71fde733,
18002            >(_buf?)?;
18003            Ok(_response.s)
18004        }
18005        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
18006            (flags,),
18007            0x5295b76c71fde733,
18008            fidl::encoding::DynamicFlags::empty(),
18009            _decode,
18010        )
18011    }
18012
18013    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
18014        NodeGetFlagsResult,
18015        fidl::encoding::DefaultFuchsiaResourceDialect,
18016    >;
18017    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
18018        fn _decode(
18019            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18020        ) -> Result<NodeGetFlagsResult, fidl::Error> {
18021            let _response = fidl::client::decode_transaction_body::<
18022                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
18023                fidl::encoding::DefaultFuchsiaResourceDialect,
18024                0x176eb318f64ec23,
18025            >(_buf?)?
18026            .into_result::<SymlinkMarker>("get_flags")?;
18027            Ok(_response.map(|x| x.flags))
18028        }
18029        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
18030            (),
18031            0x176eb318f64ec23,
18032            fidl::encoding::DynamicFlags::FLEXIBLE,
18033            _decode,
18034        )
18035    }
18036
18037    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
18038        NodeSetFlagsResult,
18039        fidl::encoding::DefaultFuchsiaResourceDialect,
18040    >;
18041    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
18042        fn _decode(
18043            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18044        ) -> Result<NodeSetFlagsResult, fidl::Error> {
18045            let _response = fidl::client::decode_transaction_body::<
18046                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
18047                fidl::encoding::DefaultFuchsiaResourceDialect,
18048                0x55a8028685791ea8,
18049            >(_buf?)?
18050            .into_result::<SymlinkMarker>("set_flags")?;
18051            Ok(_response.map(|x| x))
18052        }
18053        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
18054            (flags,),
18055            0x55a8028685791ea8,
18056            fidl::encoding::DynamicFlags::FLEXIBLE,
18057            _decode,
18058        )
18059    }
18060
18061    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
18062        (i32, Option<Box<FilesystemInfo>>),
18063        fidl::encoding::DefaultFuchsiaResourceDialect,
18064    >;
18065    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
18066        fn _decode(
18067            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18068        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
18069            let _response = fidl::client::decode_transaction_body::<
18070                NodeQueryFilesystemResponse,
18071                fidl::encoding::DefaultFuchsiaResourceDialect,
18072                0x6f344a1c6b0a0610,
18073            >(_buf?)?;
18074            Ok((_response.s, _response.info))
18075        }
18076        self.client.send_query_and_decode::<
18077            fidl::encoding::EmptyPayload,
18078            (i32, Option<Box<FilesystemInfo>>),
18079        >(
18080            (),
18081            0x6f344a1c6b0a0610,
18082            fidl::encoding::DynamicFlags::empty(),
18083            _decode,
18084        )
18085    }
18086
18087    type GetConnectionInfoResponseFut = fidl::client::QueryResponseFut<
18088        ConnectionInfo,
18089        fidl::encoding::DefaultFuchsiaResourceDialect,
18090    >;
18091    fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut {
18092        fn _decode(
18093            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18094        ) -> Result<ConnectionInfo, fidl::Error> {
18095            let _response = fidl::client::decode_transaction_body::<
18096                ConnectionInfo,
18097                fidl::encoding::DefaultFuchsiaResourceDialect,
18098                0x584c377c7c0a6d0b,
18099            >(_buf?)?;
18100            Ok(_response)
18101        }
18102        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ConnectionInfo>(
18103            (),
18104            0x584c377c7c0a6d0b,
18105            fidl::encoding::DynamicFlags::empty(),
18106            _decode,
18107        )
18108    }
18109
18110    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
18111        NodeGetAttributesResult,
18112        fidl::encoding::DefaultFuchsiaResourceDialect,
18113    >;
18114    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
18115        fn _decode(
18116            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18117        ) -> Result<NodeGetAttributesResult, fidl::Error> {
18118            let _response = fidl::client::decode_transaction_body::<
18119                fidl::encoding::ResultType<NodeAttributes2, i32>,
18120                fidl::encoding::DefaultFuchsiaResourceDialect,
18121                0x3d4396a638ea053b,
18122            >(_buf?)?;
18123            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
18124        }
18125        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
18126            (query,),
18127            0x3d4396a638ea053b,
18128            fidl::encoding::DynamicFlags::empty(),
18129            _decode,
18130        )
18131    }
18132
18133    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
18134        NodeUpdateAttributesResult,
18135        fidl::encoding::DefaultFuchsiaResourceDialect,
18136    >;
18137    fn r#update_attributes(
18138        &self,
18139        mut payload: &MutableNodeAttributes,
18140    ) -> Self::UpdateAttributesResponseFut {
18141        fn _decode(
18142            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18143        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
18144            let _response = fidl::client::decode_transaction_body::<
18145                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18146                fidl::encoding::DefaultFuchsiaResourceDialect,
18147                0x3308c1da5a89bf08,
18148            >(_buf?)?;
18149            Ok(_response.map(|x| x))
18150        }
18151        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
18152            payload,
18153            0x3308c1da5a89bf08,
18154            fidl::encoding::DynamicFlags::empty(),
18155            _decode,
18156        )
18157    }
18158
18159    type SyncResponseFut = fidl::client::QueryResponseFut<
18160        NodeSyncResult,
18161        fidl::encoding::DefaultFuchsiaResourceDialect,
18162    >;
18163    fn r#sync(&self) -> Self::SyncResponseFut {
18164        fn _decode(
18165            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18166        ) -> Result<NodeSyncResult, fidl::Error> {
18167            let _response = fidl::client::decode_transaction_body::<
18168                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18169                fidl::encoding::DefaultFuchsiaResourceDialect,
18170                0x2c5c27ca0ab5dc49,
18171            >(_buf?)?;
18172            Ok(_response.map(|x| x))
18173        }
18174        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
18175            (),
18176            0x2c5c27ca0ab5dc49,
18177            fidl::encoding::DynamicFlags::empty(),
18178            _decode,
18179        )
18180    }
18181
18182    fn r#list_extended_attributes(
18183        &self,
18184        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
18185    ) -> Result<(), fidl::Error> {
18186        self.client.send::<NodeListExtendedAttributesRequest>(
18187            (iterator,),
18188            0x4b61033de007fcd0,
18189            fidl::encoding::DynamicFlags::empty(),
18190        )
18191    }
18192
18193    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
18194        NodeGetExtendedAttributeResult,
18195        fidl::encoding::DefaultFuchsiaResourceDialect,
18196    >;
18197    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
18198        fn _decode(
18199            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18200        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
18201            let _response = fidl::client::decode_transaction_body::<
18202                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
18203                fidl::encoding::DefaultFuchsiaResourceDialect,
18204                0x45ffa3ccfdeb76db,
18205            >(_buf?)?;
18206            Ok(_response.map(|x| x))
18207        }
18208        self.client.send_query_and_decode::<
18209            NodeGetExtendedAttributeRequest,
18210            NodeGetExtendedAttributeResult,
18211        >(
18212            (name,),
18213            0x45ffa3ccfdeb76db,
18214            fidl::encoding::DynamicFlags::empty(),
18215            _decode,
18216        )
18217    }
18218
18219    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
18220        NodeSetExtendedAttributeResult,
18221        fidl::encoding::DefaultFuchsiaResourceDialect,
18222    >;
18223    fn r#set_extended_attribute(
18224        &self,
18225        mut name: &[u8],
18226        mut value: ExtendedAttributeValue,
18227        mut mode: SetExtendedAttributeMode,
18228    ) -> Self::SetExtendedAttributeResponseFut {
18229        fn _decode(
18230            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18231        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
18232            let _response = fidl::client::decode_transaction_body::<
18233                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18234                fidl::encoding::DefaultFuchsiaResourceDialect,
18235                0x4a951362f681f23c,
18236            >(_buf?)?;
18237            Ok(_response.map(|x| x))
18238        }
18239        self.client.send_query_and_decode::<
18240            NodeSetExtendedAttributeRequest,
18241            NodeSetExtendedAttributeResult,
18242        >(
18243            (name, &mut value, mode,),
18244            0x4a951362f681f23c,
18245            fidl::encoding::DynamicFlags::empty(),
18246            _decode,
18247        )
18248    }
18249
18250    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
18251        NodeRemoveExtendedAttributeResult,
18252        fidl::encoding::DefaultFuchsiaResourceDialect,
18253    >;
18254    fn r#remove_extended_attribute(
18255        &self,
18256        mut name: &[u8],
18257    ) -> Self::RemoveExtendedAttributeResponseFut {
18258        fn _decode(
18259            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18260        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
18261            let _response = fidl::client::decode_transaction_body::<
18262                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18263                fidl::encoding::DefaultFuchsiaResourceDialect,
18264                0x7a0b9f3a9bf9032d,
18265            >(_buf?)?;
18266            Ok(_response.map(|x| x))
18267        }
18268        self.client.send_query_and_decode::<
18269            NodeRemoveExtendedAttributeRequest,
18270            NodeRemoveExtendedAttributeResult,
18271        >(
18272            (name,),
18273            0x7a0b9f3a9bf9032d,
18274            fidl::encoding::DynamicFlags::empty(),
18275            _decode,
18276        )
18277    }
18278
18279    type DescribeResponseFut =
18280        fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
18281    fn r#describe(&self) -> Self::DescribeResponseFut {
18282        fn _decode(
18283            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18284        ) -> Result<SymlinkInfo, fidl::Error> {
18285            let _response = fidl::client::decode_transaction_body::<
18286                fidl::encoding::FlexibleType<SymlinkInfo>,
18287                fidl::encoding::DefaultFuchsiaResourceDialect,
18288                0x742c2ea5e89831f3,
18289            >(_buf?)?
18290            .into_result::<SymlinkMarker>("describe")?;
18291            Ok(_response)
18292        }
18293        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SymlinkInfo>(
18294            (),
18295            0x742c2ea5e89831f3,
18296            fidl::encoding::DynamicFlags::FLEXIBLE,
18297            _decode,
18298        )
18299    }
18300}
18301
18302pub struct SymlinkEventStream {
18303    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
18304}
18305
18306impl std::marker::Unpin for SymlinkEventStream {}
18307
18308impl futures::stream::FusedStream for SymlinkEventStream {
18309    fn is_terminated(&self) -> bool {
18310        self.event_receiver.is_terminated()
18311    }
18312}
18313
18314impl futures::Stream for SymlinkEventStream {
18315    type Item = Result<SymlinkEvent, fidl::Error>;
18316
18317    fn poll_next(
18318        mut self: std::pin::Pin<&mut Self>,
18319        cx: &mut std::task::Context<'_>,
18320    ) -> std::task::Poll<Option<Self::Item>> {
18321        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
18322            &mut self.event_receiver,
18323            cx
18324        )?) {
18325            Some(buf) => std::task::Poll::Ready(Some(SymlinkEvent::decode(buf))),
18326            None => std::task::Poll::Ready(None),
18327        }
18328    }
18329}
18330
18331#[derive(Debug)]
18332pub enum SymlinkEvent {
18333    OnOpen_ {
18334        s: i32,
18335        info: Option<Box<NodeInfoDeprecated>>,
18336    },
18337    OnRepresentation {
18338        payload: Representation,
18339    },
18340    #[non_exhaustive]
18341    _UnknownEvent {
18342        /// Ordinal of the event that was sent.
18343        ordinal: u64,
18344    },
18345}
18346
18347impl SymlinkEvent {
18348    #[allow(irrefutable_let_patterns)]
18349    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
18350        if let SymlinkEvent::OnOpen_ { s, info } = self {
18351            Some((s, info))
18352        } else {
18353            None
18354        }
18355    }
18356    #[allow(irrefutable_let_patterns)]
18357    pub fn into_on_representation(self) -> Option<Representation> {
18358        if let SymlinkEvent::OnRepresentation { payload } = self {
18359            Some((payload))
18360        } else {
18361            None
18362        }
18363    }
18364
18365    /// Decodes a message buffer as a [`SymlinkEvent`].
18366    fn decode(
18367        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
18368    ) -> Result<SymlinkEvent, fidl::Error> {
18369        let (bytes, _handles) = buf.split_mut();
18370        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
18371        debug_assert_eq!(tx_header.tx_id, 0);
18372        match tx_header.ordinal {
18373            0x7fc7bbb1dbfd1972 => {
18374                let mut out = fidl::new_empty!(
18375                    NodeOnOpenRequest,
18376                    fidl::encoding::DefaultFuchsiaResourceDialect
18377                );
18378                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
18379                Ok((SymlinkEvent::OnOpen_ { s: out.s, info: out.info }))
18380            }
18381            0x5cb40567d80a510c => {
18382                let mut out =
18383                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
18384                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
18385                Ok((SymlinkEvent::OnRepresentation { payload: out }))
18386            }
18387            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
18388                Ok(SymlinkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
18389            }
18390            _ => Err(fidl::Error::UnknownOrdinal {
18391                ordinal: tx_header.ordinal,
18392                protocol_name: <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
18393            }),
18394        }
18395    }
18396}
18397
18398/// A Stream of incoming requests for fuchsia.io/Symlink.
18399pub struct SymlinkRequestStream {
18400    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
18401    is_terminated: bool,
18402}
18403
18404impl std::marker::Unpin for SymlinkRequestStream {}
18405
18406impl futures::stream::FusedStream for SymlinkRequestStream {
18407    fn is_terminated(&self) -> bool {
18408        self.is_terminated
18409    }
18410}
18411
18412impl fidl::endpoints::RequestStream for SymlinkRequestStream {
18413    type Protocol = SymlinkMarker;
18414    type ControlHandle = SymlinkControlHandle;
18415
18416    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
18417        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
18418    }
18419
18420    fn control_handle(&self) -> Self::ControlHandle {
18421        SymlinkControlHandle { inner: self.inner.clone() }
18422    }
18423
18424    fn into_inner(
18425        self,
18426    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
18427    {
18428        (self.inner, self.is_terminated)
18429    }
18430
18431    fn from_inner(
18432        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
18433        is_terminated: bool,
18434    ) -> Self {
18435        Self { inner, is_terminated }
18436    }
18437}
18438
18439impl futures::Stream for SymlinkRequestStream {
18440    type Item = Result<SymlinkRequest, fidl::Error>;
18441
18442    fn poll_next(
18443        mut self: std::pin::Pin<&mut Self>,
18444        cx: &mut std::task::Context<'_>,
18445    ) -> std::task::Poll<Option<Self::Item>> {
18446        let this = &mut *self;
18447        if this.inner.check_shutdown(cx) {
18448            this.is_terminated = true;
18449            return std::task::Poll::Ready(None);
18450        }
18451        if this.is_terminated {
18452            panic!("polled SymlinkRequestStream after completion");
18453        }
18454        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
18455            |bytes, handles| {
18456                match this.inner.channel().read_etc(cx, bytes, handles) {
18457                    std::task::Poll::Ready(Ok(())) => {}
18458                    std::task::Poll::Pending => return std::task::Poll::Pending,
18459                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
18460                        this.is_terminated = true;
18461                        return std::task::Poll::Ready(None);
18462                    }
18463                    std::task::Poll::Ready(Err(e)) => {
18464                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
18465                            e.into(),
18466                        ))))
18467                    }
18468                }
18469
18470                // A message has been received from the channel
18471                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
18472
18473                std::task::Poll::Ready(Some(match header.ordinal {
18474                    0x54f3949246a03e74 => {
18475                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18476                        let mut req = fidl::new_empty!(
18477                            LinkableLinkIntoRequest,
18478                            fidl::encoding::DefaultFuchsiaResourceDialect
18479                        );
18480                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
18481                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18482                        Ok(SymlinkRequest::LinkInto {
18483                            dst_parent_token: req.dst_parent_token,
18484                            dst: req.dst,
18485
18486                            responder: SymlinkLinkIntoResponder {
18487                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18488                                tx_id: header.tx_id,
18489                            },
18490                        })
18491                    }
18492                    0x20d8a7aba2168a79 => {
18493                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18494                        let mut req = fidl::new_empty!(
18495                            fidl_fuchsia_unknown::CloneableCloneRequest,
18496                            fidl::encoding::DefaultFuchsiaResourceDialect
18497                        );
18498                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
18499                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18500                        Ok(SymlinkRequest::Clone { request: req.request, control_handle })
18501                    }
18502                    0x5ac5d459ad7f657e => {
18503                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18504                        let mut req = fidl::new_empty!(
18505                            fidl::encoding::EmptyPayload,
18506                            fidl::encoding::DefaultFuchsiaResourceDialect
18507                        );
18508                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18509                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18510                        Ok(SymlinkRequest::Close {
18511                            responder: SymlinkCloseResponder {
18512                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18513                                tx_id: header.tx_id,
18514                            },
18515                        })
18516                    }
18517                    0x2658edee9decfc06 => {
18518                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18519                        let mut req = fidl::new_empty!(
18520                            fidl::encoding::EmptyPayload,
18521                            fidl::encoding::DefaultFuchsiaResourceDialect
18522                        );
18523                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18524                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18525                        Ok(SymlinkRequest::Query {
18526                            responder: SymlinkQueryResponder {
18527                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18528                                tx_id: header.tx_id,
18529                            },
18530                        })
18531                    }
18532                    0x5a61678f293ce16f => {
18533                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18534                        let mut req = fidl::new_empty!(
18535                            NodeDeprecatedCloneRequest,
18536                            fidl::encoding::DefaultFuchsiaResourceDialect
18537                        );
18538                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
18539                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18540                        Ok(SymlinkRequest::DeprecatedClone {
18541                            flags: req.flags,
18542                            object: req.object,
18543
18544                            control_handle,
18545                        })
18546                    }
18547                    0x78985e216314dafd => {
18548                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18549                        let mut req = fidl::new_empty!(
18550                            fidl::encoding::EmptyPayload,
18551                            fidl::encoding::DefaultFuchsiaResourceDialect
18552                        );
18553                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18554                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18555                        Ok(SymlinkRequest::GetAttr {
18556                            responder: SymlinkGetAttrResponder {
18557                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18558                                tx_id: header.tx_id,
18559                            },
18560                        })
18561                    }
18562                    0x4186c0f40d938f46 => {
18563                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18564                        let mut req = fidl::new_empty!(
18565                            NodeSetAttrRequest,
18566                            fidl::encoding::DefaultFuchsiaResourceDialect
18567                        );
18568                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
18569                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18570                        Ok(SymlinkRequest::SetAttr {
18571                            flags: req.flags,
18572                            attributes: req.attributes,
18573
18574                            responder: SymlinkSetAttrResponder {
18575                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18576                                tx_id: header.tx_id,
18577                            },
18578                        })
18579                    }
18580                    0x5b88fffb8eda3aa1 => {
18581                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18582                        let mut req = fidl::new_empty!(
18583                            fidl::encoding::EmptyPayload,
18584                            fidl::encoding::DefaultFuchsiaResourceDialect
18585                        );
18586                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18587                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18588                        Ok(SymlinkRequest::DeprecatedGetFlags {
18589                            responder: SymlinkDeprecatedGetFlagsResponder {
18590                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18591                                tx_id: header.tx_id,
18592                            },
18593                        })
18594                    }
18595                    0x5295b76c71fde733 => {
18596                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18597                        let mut req = fidl::new_empty!(
18598                            NodeDeprecatedSetFlagsRequest,
18599                            fidl::encoding::DefaultFuchsiaResourceDialect
18600                        );
18601                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
18602                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18603                        Ok(SymlinkRequest::DeprecatedSetFlags {
18604                            flags: req.flags,
18605
18606                            responder: SymlinkDeprecatedSetFlagsResponder {
18607                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18608                                tx_id: header.tx_id,
18609                            },
18610                        })
18611                    }
18612                    0x176eb318f64ec23 => {
18613                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18614                        let mut req = fidl::new_empty!(
18615                            fidl::encoding::EmptyPayload,
18616                            fidl::encoding::DefaultFuchsiaResourceDialect
18617                        );
18618                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18619                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18620                        Ok(SymlinkRequest::GetFlags {
18621                            responder: SymlinkGetFlagsResponder {
18622                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18623                                tx_id: header.tx_id,
18624                            },
18625                        })
18626                    }
18627                    0x55a8028685791ea8 => {
18628                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18629                        let mut req = fidl::new_empty!(
18630                            NodeSetFlagsRequest,
18631                            fidl::encoding::DefaultFuchsiaResourceDialect
18632                        );
18633                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
18634                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18635                        Ok(SymlinkRequest::SetFlags {
18636                            flags: req.flags,
18637
18638                            responder: SymlinkSetFlagsResponder {
18639                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18640                                tx_id: header.tx_id,
18641                            },
18642                        })
18643                    }
18644                    0x6f344a1c6b0a0610 => {
18645                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18646                        let mut req = fidl::new_empty!(
18647                            fidl::encoding::EmptyPayload,
18648                            fidl::encoding::DefaultFuchsiaResourceDialect
18649                        );
18650                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18651                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18652                        Ok(SymlinkRequest::QueryFilesystem {
18653                            responder: SymlinkQueryFilesystemResponder {
18654                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18655                                tx_id: header.tx_id,
18656                            },
18657                        })
18658                    }
18659                    0x584c377c7c0a6d0b => {
18660                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18661                        let mut req = fidl::new_empty!(
18662                            fidl::encoding::EmptyPayload,
18663                            fidl::encoding::DefaultFuchsiaResourceDialect
18664                        );
18665                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18666                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18667                        Ok(SymlinkRequest::GetConnectionInfo {
18668                            responder: SymlinkGetConnectionInfoResponder {
18669                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18670                                tx_id: header.tx_id,
18671                            },
18672                        })
18673                    }
18674                    0x3d4396a638ea053b => {
18675                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18676                        let mut req = fidl::new_empty!(
18677                            NodeGetAttributesRequest,
18678                            fidl::encoding::DefaultFuchsiaResourceDialect
18679                        );
18680                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
18681                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18682                        Ok(SymlinkRequest::GetAttributes {
18683                            query: req.query,
18684
18685                            responder: SymlinkGetAttributesResponder {
18686                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18687                                tx_id: header.tx_id,
18688                            },
18689                        })
18690                    }
18691                    0x3308c1da5a89bf08 => {
18692                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18693                        let mut req = fidl::new_empty!(
18694                            MutableNodeAttributes,
18695                            fidl::encoding::DefaultFuchsiaResourceDialect
18696                        );
18697                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
18698                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18699                        Ok(SymlinkRequest::UpdateAttributes {
18700                            payload: req,
18701                            responder: SymlinkUpdateAttributesResponder {
18702                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18703                                tx_id: header.tx_id,
18704                            },
18705                        })
18706                    }
18707                    0x2c5c27ca0ab5dc49 => {
18708                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18709                        let mut req = fidl::new_empty!(
18710                            fidl::encoding::EmptyPayload,
18711                            fidl::encoding::DefaultFuchsiaResourceDialect
18712                        );
18713                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18714                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18715                        Ok(SymlinkRequest::Sync {
18716                            responder: SymlinkSyncResponder {
18717                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18718                                tx_id: header.tx_id,
18719                            },
18720                        })
18721                    }
18722                    0x4b61033de007fcd0 => {
18723                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18724                        let mut req = fidl::new_empty!(
18725                            NodeListExtendedAttributesRequest,
18726                            fidl::encoding::DefaultFuchsiaResourceDialect
18727                        );
18728                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
18729                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18730                        Ok(SymlinkRequest::ListExtendedAttributes {
18731                            iterator: req.iterator,
18732
18733                            control_handle,
18734                        })
18735                    }
18736                    0x45ffa3ccfdeb76db => {
18737                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18738                        let mut req = fidl::new_empty!(
18739                            NodeGetExtendedAttributeRequest,
18740                            fidl::encoding::DefaultFuchsiaResourceDialect
18741                        );
18742                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18743                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18744                        Ok(SymlinkRequest::GetExtendedAttribute {
18745                            name: req.name,
18746
18747                            responder: SymlinkGetExtendedAttributeResponder {
18748                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18749                                tx_id: header.tx_id,
18750                            },
18751                        })
18752                    }
18753                    0x4a951362f681f23c => {
18754                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18755                        let mut req = fidl::new_empty!(
18756                            NodeSetExtendedAttributeRequest,
18757                            fidl::encoding::DefaultFuchsiaResourceDialect
18758                        );
18759                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18760                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18761                        Ok(SymlinkRequest::SetExtendedAttribute {
18762                            name: req.name,
18763                            value: req.value,
18764                            mode: req.mode,
18765
18766                            responder: SymlinkSetExtendedAttributeResponder {
18767                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18768                                tx_id: header.tx_id,
18769                            },
18770                        })
18771                    }
18772                    0x7a0b9f3a9bf9032d => {
18773                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18774                        let mut req = fidl::new_empty!(
18775                            NodeRemoveExtendedAttributeRequest,
18776                            fidl::encoding::DefaultFuchsiaResourceDialect
18777                        );
18778                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18779                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18780                        Ok(SymlinkRequest::RemoveExtendedAttribute {
18781                            name: req.name,
18782
18783                            responder: SymlinkRemoveExtendedAttributeResponder {
18784                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18785                                tx_id: header.tx_id,
18786                            },
18787                        })
18788                    }
18789                    0x742c2ea5e89831f3 => {
18790                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18791                        let mut req = fidl::new_empty!(
18792                            fidl::encoding::EmptyPayload,
18793                            fidl::encoding::DefaultFuchsiaResourceDialect
18794                        );
18795                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18796                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18797                        Ok(SymlinkRequest::Describe {
18798                            responder: SymlinkDescribeResponder {
18799                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18800                                tx_id: header.tx_id,
18801                            },
18802                        })
18803                    }
18804                    _ if header.tx_id == 0
18805                        && header
18806                            .dynamic_flags()
18807                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
18808                    {
18809                        Ok(SymlinkRequest::_UnknownMethod {
18810                            ordinal: header.ordinal,
18811                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
18812                            method_type: fidl::MethodType::OneWay,
18813                        })
18814                    }
18815                    _ if header
18816                        .dynamic_flags()
18817                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
18818                    {
18819                        this.inner.send_framework_err(
18820                            fidl::encoding::FrameworkErr::UnknownMethod,
18821                            header.tx_id,
18822                            header.ordinal,
18823                            header.dynamic_flags(),
18824                            (bytes, handles),
18825                        )?;
18826                        Ok(SymlinkRequest::_UnknownMethod {
18827                            ordinal: header.ordinal,
18828                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
18829                            method_type: fidl::MethodType::TwoWay,
18830                        })
18831                    }
18832                    _ => Err(fidl::Error::UnknownOrdinal {
18833                        ordinal: header.ordinal,
18834                        protocol_name:
18835                            <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
18836                    }),
18837                }))
18838            },
18839        )
18840    }
18841}
18842
18843/// A ['Node'] which contains a symbolic link.
18844#[derive(Debug)]
18845pub enum SymlinkRequest {
18846    /// Creates a link to this this object with name `dst` in the directory represented by
18847    /// `dst_parent_token`.
18848    ///
18849    /// `dst` must be a resolved object name. Including "/" in the string will return
18850    /// `ZX_ERR_INVALID_ARGS`.
18851    ///
18852    /// This method requires the maximal set of rights supported by the filesystem for this object.
18853    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
18854    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
18855    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
18856    /// `ZX_ERR_ACCESS_DENIED`.
18857    ///
18858    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
18859    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
18860    ///
18861    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
18862    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
18863    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
18864    ///
18865    /// This method does not have the same atomicity properties has the `Directory::Link` method,
18866    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
18867    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
18868    LinkInto {
18869        dst_parent_token: fidl::Event,
18870        dst: String,
18871        responder: SymlinkLinkIntoResponder,
18872    },
18873    Clone {
18874        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
18875        control_handle: SymlinkControlHandle,
18876    },
18877    /// Terminates the connection.
18878    ///
18879    /// After calling `Close`, the client must not send any other requests.
18880    ///
18881    /// Servers, after sending the status response, should close the connection
18882    /// regardless of status and without sending an epitaph.
18883    ///
18884    /// Closing the client end of the channel should be semantically equivalent
18885    /// to calling `Close` without knowing when the close has completed or its
18886    /// status.
18887    Close {
18888        responder: SymlinkCloseResponder,
18889    },
18890    Query {
18891        responder: SymlinkQueryResponder,
18892    },
18893    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
18894    DeprecatedClone {
18895        flags: OpenFlags,
18896        object: fidl::endpoints::ServerEnd<NodeMarker>,
18897        control_handle: SymlinkControlHandle,
18898    },
18899    /// Acquires information about the node.
18900    ///
18901    /// This method does not require any rights.
18902    GetAttr {
18903        responder: SymlinkGetAttrResponder,
18904    },
18905    /// Updates information about the node.
18906    ///
18907    /// Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.
18908    ///
18909    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
18910    /// `ZX_ERR_BAD_HANDLE`.
18911    SetAttr {
18912        flags: NodeAttributeFlags,
18913        attributes: NodeAttributes,
18914        responder: SymlinkSetAttrResponder,
18915    },
18916    /// [DEPRECATED - Use new GetFlags method instead.]
18917    DeprecatedGetFlags {
18918        responder: SymlinkDeprecatedGetFlagsResponder,
18919    },
18920    /// [DEPRECATED - Use new SetFlags method instead.]
18921    DeprecatedSetFlags {
18922        flags: OpenFlags,
18923        responder: SymlinkDeprecatedSetFlagsResponder,
18924    },
18925    /// Queries the flags that apply to this node after it has been opened/created. This method does
18926    /// not require any rights.
18927    ///
18928    /// Note that the final set of flags that apply to the connection may differ from those
18929    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
18930    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
18931    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
18932    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
18933    GetFlags {
18934        responder: SymlinkGetFlagsResponder,
18935    },
18936    /// Sets the flags that apply to this node after it has been opened. This method does not
18937    /// require any rights.
18938    ///
18939    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
18940    /// clear append mode.
18941    ///
18942    /// Errors:
18943    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
18944    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
18945    SetFlags {
18946        flags: Flags,
18947        responder: SymlinkSetFlagsResponder,
18948    },
18949    /// Query the filesystem for filesystem-specific information.
18950    QueryFilesystem {
18951        responder: SymlinkQueryFilesystemResponder,
18952    },
18953    /// Acquires information about the connection.
18954    ///
18955    /// This method does not require any rights.
18956    GetConnectionInfo {
18957        responder: SymlinkGetConnectionInfoResponder,
18958    },
18959    /// Acquires information about the node.
18960    ///
18961    /// The attributes of a node should be stable, independent of the
18962    /// specific protocol used to access it.
18963    ///
18964    /// If a particular attribute is not applicable or not supported,
18965    /// filesystems should leave the corresponding field absent.
18966    ///
18967    /// + `query` a bit-mask specifying which attributes to fetch. The server
18968    ///   should not return more than necessary.
18969    /// - `attributes` the returned attributes.
18970    ///
18971    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18972    GetAttributes {
18973        query: NodeAttributesQuery,
18974        responder: SymlinkGetAttributesResponder,
18975    },
18976    /// Updates information about the node.
18977    ///
18978    /// + `attributes` the presence of a table field in `attributes` indicates
18979    /// the intent to update the corresponding attribute.
18980    ///
18981    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
18982    ///
18983    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
18984    UpdateAttributes {
18985        payload: MutableNodeAttributes,
18986        responder: SymlinkUpdateAttributesResponder,
18987    },
18988    /// Synchronizes updates to the node to the underlying media, if it exists.
18989    ///
18990    /// This method will return when the filesystem server has flushed the
18991    /// relevant updates to the underlying media, but does not guarantee the
18992    /// underlying media has persisted the information, nor that any information
18993    /// is committed to hardware. Clients may use `Sync` to ensure ordering
18994    /// between operations.
18995    ///
18996    /// This method does not require any rights.
18997    Sync {
18998        responder: SymlinkSyncResponder,
18999    },
19000    /// Creates an iterator over all the extended attribute names associated
19001    /// with this node. If an error occurs it is returned as an epitaph on the
19002    /// iterator request channel, and then the channel is closed.
19003    ///
19004    /// GetExtendedAttributes can be used with any of these names to retrieve
19005    /// the associated value.
19006    ///
19007    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
19008    ListExtendedAttributes {
19009        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
19010        control_handle: SymlinkControlHandle,
19011    },
19012    /// Get the value associated with the given attribute `name` for this node.
19013    ///
19014    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
19015    /// particular structure is imposed on them.
19016    ///
19017    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
19018    GetExtendedAttribute {
19019        name: Vec<u8>,
19020        responder: SymlinkGetExtendedAttributeResponder,
19021    },
19022    /// Set the value for the given attribute `name` to `value` for this node.
19023    ///
19024    /// The attribute name may exist, in which case the attribute is updated.
19025    /// If the attribute doesn't exist, it is created. The name should have no
19026    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
19027    ///
19028    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
19029    SetExtendedAttribute {
19030        name: Vec<u8>,
19031        value: ExtendedAttributeValue,
19032        mode: SetExtendedAttributeMode,
19033        responder: SymlinkSetExtendedAttributeResponder,
19034    },
19035    /// Remove the specified extended attribute.
19036    ///
19037    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
19038    ///
19039    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
19040    RemoveExtendedAttribute {
19041        name: Vec<u8>,
19042        responder: SymlinkRemoveExtendedAttributeResponder,
19043    },
19044    Describe {
19045        responder: SymlinkDescribeResponder,
19046    },
19047    /// An interaction was received which does not match any known method.
19048    #[non_exhaustive]
19049    _UnknownMethod {
19050        /// Ordinal of the method that was called.
19051        ordinal: u64,
19052        control_handle: SymlinkControlHandle,
19053        method_type: fidl::MethodType,
19054    },
19055}
19056
19057impl SymlinkRequest {
19058    #[allow(irrefutable_let_patterns)]
19059    pub fn into_link_into(self) -> Option<(fidl::Event, String, SymlinkLinkIntoResponder)> {
19060        if let SymlinkRequest::LinkInto { dst_parent_token, dst, responder } = self {
19061            Some((dst_parent_token, dst, responder))
19062        } else {
19063            None
19064        }
19065    }
19066
19067    #[allow(irrefutable_let_patterns)]
19068    pub fn into_clone(
19069        self,
19070    ) -> Option<(
19071        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
19072        SymlinkControlHandle,
19073    )> {
19074        if let SymlinkRequest::Clone { request, control_handle } = self {
19075            Some((request, control_handle))
19076        } else {
19077            None
19078        }
19079    }
19080
19081    #[allow(irrefutable_let_patterns)]
19082    pub fn into_close(self) -> Option<(SymlinkCloseResponder)> {
19083        if let SymlinkRequest::Close { responder } = self {
19084            Some((responder))
19085        } else {
19086            None
19087        }
19088    }
19089
19090    #[allow(irrefutable_let_patterns)]
19091    pub fn into_query(self) -> Option<(SymlinkQueryResponder)> {
19092        if let SymlinkRequest::Query { responder } = self {
19093            Some((responder))
19094        } else {
19095            None
19096        }
19097    }
19098
19099    #[allow(irrefutable_let_patterns)]
19100    pub fn into_deprecated_clone(
19101        self,
19102    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, SymlinkControlHandle)> {
19103        if let SymlinkRequest::DeprecatedClone { flags, object, control_handle } = self {
19104            Some((flags, object, control_handle))
19105        } else {
19106            None
19107        }
19108    }
19109
19110    #[allow(irrefutable_let_patterns)]
19111    pub fn into_get_attr(self) -> Option<(SymlinkGetAttrResponder)> {
19112        if let SymlinkRequest::GetAttr { responder } = self {
19113            Some((responder))
19114        } else {
19115            None
19116        }
19117    }
19118
19119    #[allow(irrefutable_let_patterns)]
19120    pub fn into_set_attr(
19121        self,
19122    ) -> Option<(NodeAttributeFlags, NodeAttributes, SymlinkSetAttrResponder)> {
19123        if let SymlinkRequest::SetAttr { flags, attributes, responder } = self {
19124            Some((flags, attributes, responder))
19125        } else {
19126            None
19127        }
19128    }
19129
19130    #[allow(irrefutable_let_patterns)]
19131    pub fn into_deprecated_get_flags(self) -> Option<(SymlinkDeprecatedGetFlagsResponder)> {
19132        if let SymlinkRequest::DeprecatedGetFlags { responder } = self {
19133            Some((responder))
19134        } else {
19135            None
19136        }
19137    }
19138
19139    #[allow(irrefutable_let_patterns)]
19140    pub fn into_deprecated_set_flags(
19141        self,
19142    ) -> Option<(OpenFlags, SymlinkDeprecatedSetFlagsResponder)> {
19143        if let SymlinkRequest::DeprecatedSetFlags { flags, responder } = self {
19144            Some((flags, responder))
19145        } else {
19146            None
19147        }
19148    }
19149
19150    #[allow(irrefutable_let_patterns)]
19151    pub fn into_get_flags(self) -> Option<(SymlinkGetFlagsResponder)> {
19152        if let SymlinkRequest::GetFlags { responder } = self {
19153            Some((responder))
19154        } else {
19155            None
19156        }
19157    }
19158
19159    #[allow(irrefutable_let_patterns)]
19160    pub fn into_set_flags(self) -> Option<(Flags, SymlinkSetFlagsResponder)> {
19161        if let SymlinkRequest::SetFlags { flags, responder } = self {
19162            Some((flags, responder))
19163        } else {
19164            None
19165        }
19166    }
19167
19168    #[allow(irrefutable_let_patterns)]
19169    pub fn into_query_filesystem(self) -> Option<(SymlinkQueryFilesystemResponder)> {
19170        if let SymlinkRequest::QueryFilesystem { responder } = self {
19171            Some((responder))
19172        } else {
19173            None
19174        }
19175    }
19176
19177    #[allow(irrefutable_let_patterns)]
19178    pub fn into_get_connection_info(self) -> Option<(SymlinkGetConnectionInfoResponder)> {
19179        if let SymlinkRequest::GetConnectionInfo { responder } = self {
19180            Some((responder))
19181        } else {
19182            None
19183        }
19184    }
19185
19186    #[allow(irrefutable_let_patterns)]
19187    pub fn into_get_attributes(
19188        self,
19189    ) -> Option<(NodeAttributesQuery, SymlinkGetAttributesResponder)> {
19190        if let SymlinkRequest::GetAttributes { query, responder } = self {
19191            Some((query, responder))
19192        } else {
19193            None
19194        }
19195    }
19196
19197    #[allow(irrefutable_let_patterns)]
19198    pub fn into_update_attributes(
19199        self,
19200    ) -> Option<(MutableNodeAttributes, SymlinkUpdateAttributesResponder)> {
19201        if let SymlinkRequest::UpdateAttributes { payload, responder } = self {
19202            Some((payload, responder))
19203        } else {
19204            None
19205        }
19206    }
19207
19208    #[allow(irrefutable_let_patterns)]
19209    pub fn into_sync(self) -> Option<(SymlinkSyncResponder)> {
19210        if let SymlinkRequest::Sync { responder } = self {
19211            Some((responder))
19212        } else {
19213            None
19214        }
19215    }
19216
19217    #[allow(irrefutable_let_patterns)]
19218    pub fn into_list_extended_attributes(
19219        self,
19220    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, SymlinkControlHandle)>
19221    {
19222        if let SymlinkRequest::ListExtendedAttributes { iterator, control_handle } = self {
19223            Some((iterator, control_handle))
19224        } else {
19225            None
19226        }
19227    }
19228
19229    #[allow(irrefutable_let_patterns)]
19230    pub fn into_get_extended_attribute(
19231        self,
19232    ) -> Option<(Vec<u8>, SymlinkGetExtendedAttributeResponder)> {
19233        if let SymlinkRequest::GetExtendedAttribute { name, responder } = self {
19234            Some((name, responder))
19235        } else {
19236            None
19237        }
19238    }
19239
19240    #[allow(irrefutable_let_patterns)]
19241    pub fn into_set_extended_attribute(
19242        self,
19243    ) -> Option<(
19244        Vec<u8>,
19245        ExtendedAttributeValue,
19246        SetExtendedAttributeMode,
19247        SymlinkSetExtendedAttributeResponder,
19248    )> {
19249        if let SymlinkRequest::SetExtendedAttribute { name, value, mode, responder } = self {
19250            Some((name, value, mode, responder))
19251        } else {
19252            None
19253        }
19254    }
19255
19256    #[allow(irrefutable_let_patterns)]
19257    pub fn into_remove_extended_attribute(
19258        self,
19259    ) -> Option<(Vec<u8>, SymlinkRemoveExtendedAttributeResponder)> {
19260        if let SymlinkRequest::RemoveExtendedAttribute { name, responder } = self {
19261            Some((name, responder))
19262        } else {
19263            None
19264        }
19265    }
19266
19267    #[allow(irrefutable_let_patterns)]
19268    pub fn into_describe(self) -> Option<(SymlinkDescribeResponder)> {
19269        if let SymlinkRequest::Describe { responder } = self {
19270            Some((responder))
19271        } else {
19272            None
19273        }
19274    }
19275
19276    /// Name of the method defined in FIDL
19277    pub fn method_name(&self) -> &'static str {
19278        match *self {
19279            SymlinkRequest::LinkInto { .. } => "link_into",
19280            SymlinkRequest::Clone { .. } => "clone",
19281            SymlinkRequest::Close { .. } => "close",
19282            SymlinkRequest::Query { .. } => "query",
19283            SymlinkRequest::DeprecatedClone { .. } => "deprecated_clone",
19284            SymlinkRequest::GetAttr { .. } => "get_attr",
19285            SymlinkRequest::SetAttr { .. } => "set_attr",
19286            SymlinkRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
19287            SymlinkRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
19288            SymlinkRequest::GetFlags { .. } => "get_flags",
19289            SymlinkRequest::SetFlags { .. } => "set_flags",
19290            SymlinkRequest::QueryFilesystem { .. } => "query_filesystem",
19291            SymlinkRequest::GetConnectionInfo { .. } => "get_connection_info",
19292            SymlinkRequest::GetAttributes { .. } => "get_attributes",
19293            SymlinkRequest::UpdateAttributes { .. } => "update_attributes",
19294            SymlinkRequest::Sync { .. } => "sync",
19295            SymlinkRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
19296            SymlinkRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
19297            SymlinkRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
19298            SymlinkRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
19299            SymlinkRequest::Describe { .. } => "describe",
19300            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
19301                "unknown one-way method"
19302            }
19303            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
19304                "unknown two-way method"
19305            }
19306        }
19307    }
19308}
19309
19310#[derive(Debug, Clone)]
19311pub struct SymlinkControlHandle {
19312    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
19313}
19314
19315impl fidl::endpoints::ControlHandle for SymlinkControlHandle {
19316    fn shutdown(&self) {
19317        self.inner.shutdown()
19318    }
19319    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
19320        self.inner.shutdown_with_epitaph(status)
19321    }
19322
19323    fn is_closed(&self) -> bool {
19324        self.inner.channel().is_closed()
19325    }
19326    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
19327        self.inner.channel().on_closed()
19328    }
19329
19330    #[cfg(target_os = "fuchsia")]
19331    fn signal_peer(
19332        &self,
19333        clear_mask: zx::Signals,
19334        set_mask: zx::Signals,
19335    ) -> Result<(), zx_status::Status> {
19336        use fidl::Peered;
19337        self.inner.channel().signal_peer(clear_mask, set_mask)
19338    }
19339}
19340
19341impl SymlinkControlHandle {
19342    pub fn send_on_open_(
19343        &self,
19344        mut s: i32,
19345        mut info: Option<NodeInfoDeprecated>,
19346    ) -> Result<(), fidl::Error> {
19347        self.inner.send::<NodeOnOpenRequest>(
19348            (s, info.as_mut()),
19349            0,
19350            0x7fc7bbb1dbfd1972,
19351            fidl::encoding::DynamicFlags::empty(),
19352        )
19353    }
19354
19355    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
19356        self.inner.send::<Representation>(
19357            &mut payload,
19358            0,
19359            0x5cb40567d80a510c,
19360            fidl::encoding::DynamicFlags::empty(),
19361        )
19362    }
19363}
19364
19365#[must_use = "FIDL methods require a response to be sent"]
19366#[derive(Debug)]
19367pub struct SymlinkLinkIntoResponder {
19368    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19369    tx_id: u32,
19370}
19371
19372/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19373/// if the responder is dropped without sending a response, so that the client
19374/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19375impl std::ops::Drop for SymlinkLinkIntoResponder {
19376    fn drop(&mut self) {
19377        self.control_handle.shutdown();
19378        // Safety: drops once, never accessed again
19379        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19380    }
19381}
19382
19383impl fidl::endpoints::Responder for SymlinkLinkIntoResponder {
19384    type ControlHandle = SymlinkControlHandle;
19385
19386    fn control_handle(&self) -> &SymlinkControlHandle {
19387        &self.control_handle
19388    }
19389
19390    fn drop_without_shutdown(mut self) {
19391        // Safety: drops once, never accessed again due to mem::forget
19392        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19393        // Prevent Drop from running (which would shut down the channel)
19394        std::mem::forget(self);
19395    }
19396}
19397
19398impl SymlinkLinkIntoResponder {
19399    /// Sends a response to the FIDL transaction.
19400    ///
19401    /// Sets the channel to shutdown if an error occurs.
19402    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19403        let _result = self.send_raw(result);
19404        if _result.is_err() {
19405            self.control_handle.shutdown();
19406        }
19407        self.drop_without_shutdown();
19408        _result
19409    }
19410
19411    /// Similar to "send" but does not shutdown the channel if an error occurs.
19412    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19413        let _result = self.send_raw(result);
19414        self.drop_without_shutdown();
19415        _result
19416    }
19417
19418    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19419        self.control_handle
19420            .inner
19421            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19422                result,
19423                self.tx_id,
19424                0x54f3949246a03e74,
19425                fidl::encoding::DynamicFlags::empty(),
19426            )
19427    }
19428}
19429
19430#[must_use = "FIDL methods require a response to be sent"]
19431#[derive(Debug)]
19432pub struct SymlinkCloseResponder {
19433    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19434    tx_id: u32,
19435}
19436
19437/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19438/// if the responder is dropped without sending a response, so that the client
19439/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19440impl std::ops::Drop for SymlinkCloseResponder {
19441    fn drop(&mut self) {
19442        self.control_handle.shutdown();
19443        // Safety: drops once, never accessed again
19444        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19445    }
19446}
19447
19448impl fidl::endpoints::Responder for SymlinkCloseResponder {
19449    type ControlHandle = SymlinkControlHandle;
19450
19451    fn control_handle(&self) -> &SymlinkControlHandle {
19452        &self.control_handle
19453    }
19454
19455    fn drop_without_shutdown(mut self) {
19456        // Safety: drops once, never accessed again due to mem::forget
19457        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19458        // Prevent Drop from running (which would shut down the channel)
19459        std::mem::forget(self);
19460    }
19461}
19462
19463impl SymlinkCloseResponder {
19464    /// Sends a response to the FIDL transaction.
19465    ///
19466    /// Sets the channel to shutdown if an error occurs.
19467    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19468        let _result = self.send_raw(result);
19469        if _result.is_err() {
19470            self.control_handle.shutdown();
19471        }
19472        self.drop_without_shutdown();
19473        _result
19474    }
19475
19476    /// Similar to "send" but does not shutdown the channel if an error occurs.
19477    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19478        let _result = self.send_raw(result);
19479        self.drop_without_shutdown();
19480        _result
19481    }
19482
19483    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19484        self.control_handle
19485            .inner
19486            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19487                result,
19488                self.tx_id,
19489                0x5ac5d459ad7f657e,
19490                fidl::encoding::DynamicFlags::empty(),
19491            )
19492    }
19493}
19494
19495#[must_use = "FIDL methods require a response to be sent"]
19496#[derive(Debug)]
19497pub struct SymlinkQueryResponder {
19498    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19499    tx_id: u32,
19500}
19501
19502/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19503/// if the responder is dropped without sending a response, so that the client
19504/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19505impl std::ops::Drop for SymlinkQueryResponder {
19506    fn drop(&mut self) {
19507        self.control_handle.shutdown();
19508        // Safety: drops once, never accessed again
19509        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19510    }
19511}
19512
19513impl fidl::endpoints::Responder for SymlinkQueryResponder {
19514    type ControlHandle = SymlinkControlHandle;
19515
19516    fn control_handle(&self) -> &SymlinkControlHandle {
19517        &self.control_handle
19518    }
19519
19520    fn drop_without_shutdown(mut self) {
19521        // Safety: drops once, never accessed again due to mem::forget
19522        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19523        // Prevent Drop from running (which would shut down the channel)
19524        std::mem::forget(self);
19525    }
19526}
19527
19528impl SymlinkQueryResponder {
19529    /// Sends a response to the FIDL transaction.
19530    ///
19531    /// Sets the channel to shutdown if an error occurs.
19532    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
19533        let _result = self.send_raw(protocol);
19534        if _result.is_err() {
19535            self.control_handle.shutdown();
19536        }
19537        self.drop_without_shutdown();
19538        _result
19539    }
19540
19541    /// Similar to "send" but does not shutdown the channel if an error occurs.
19542    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
19543        let _result = self.send_raw(protocol);
19544        self.drop_without_shutdown();
19545        _result
19546    }
19547
19548    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
19549        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
19550            (protocol,),
19551            self.tx_id,
19552            0x2658edee9decfc06,
19553            fidl::encoding::DynamicFlags::empty(),
19554        )
19555    }
19556}
19557
19558#[must_use = "FIDL methods require a response to be sent"]
19559#[derive(Debug)]
19560pub struct SymlinkGetAttrResponder {
19561    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19562    tx_id: u32,
19563}
19564
19565/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19566/// if the responder is dropped without sending a response, so that the client
19567/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19568impl std::ops::Drop for SymlinkGetAttrResponder {
19569    fn drop(&mut self) {
19570        self.control_handle.shutdown();
19571        // Safety: drops once, never accessed again
19572        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19573    }
19574}
19575
19576impl fidl::endpoints::Responder for SymlinkGetAttrResponder {
19577    type ControlHandle = SymlinkControlHandle;
19578
19579    fn control_handle(&self) -> &SymlinkControlHandle {
19580        &self.control_handle
19581    }
19582
19583    fn drop_without_shutdown(mut self) {
19584        // Safety: drops once, never accessed again due to mem::forget
19585        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19586        // Prevent Drop from running (which would shut down the channel)
19587        std::mem::forget(self);
19588    }
19589}
19590
19591impl SymlinkGetAttrResponder {
19592    /// Sends a response to the FIDL transaction.
19593    ///
19594    /// Sets the channel to shutdown if an error occurs.
19595    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
19596        let _result = self.send_raw(s, attributes);
19597        if _result.is_err() {
19598            self.control_handle.shutdown();
19599        }
19600        self.drop_without_shutdown();
19601        _result
19602    }
19603
19604    /// Similar to "send" but does not shutdown the channel if an error occurs.
19605    pub fn send_no_shutdown_on_err(
19606        self,
19607        mut s: i32,
19608        mut attributes: &NodeAttributes,
19609    ) -> Result<(), fidl::Error> {
19610        let _result = self.send_raw(s, attributes);
19611        self.drop_without_shutdown();
19612        _result
19613    }
19614
19615    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
19616        self.control_handle.inner.send::<NodeGetAttrResponse>(
19617            (s, attributes),
19618            self.tx_id,
19619            0x78985e216314dafd,
19620            fidl::encoding::DynamicFlags::empty(),
19621        )
19622    }
19623}
19624
19625#[must_use = "FIDL methods require a response to be sent"]
19626#[derive(Debug)]
19627pub struct SymlinkSetAttrResponder {
19628    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19629    tx_id: u32,
19630}
19631
19632/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19633/// if the responder is dropped without sending a response, so that the client
19634/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19635impl std::ops::Drop for SymlinkSetAttrResponder {
19636    fn drop(&mut self) {
19637        self.control_handle.shutdown();
19638        // Safety: drops once, never accessed again
19639        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19640    }
19641}
19642
19643impl fidl::endpoints::Responder for SymlinkSetAttrResponder {
19644    type ControlHandle = SymlinkControlHandle;
19645
19646    fn control_handle(&self) -> &SymlinkControlHandle {
19647        &self.control_handle
19648    }
19649
19650    fn drop_without_shutdown(mut self) {
19651        // Safety: drops once, never accessed again due to mem::forget
19652        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19653        // Prevent Drop from running (which would shut down the channel)
19654        std::mem::forget(self);
19655    }
19656}
19657
19658impl SymlinkSetAttrResponder {
19659    /// Sends a response to the FIDL transaction.
19660    ///
19661    /// Sets the channel to shutdown if an error occurs.
19662    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
19663        let _result = self.send_raw(s);
19664        if _result.is_err() {
19665            self.control_handle.shutdown();
19666        }
19667        self.drop_without_shutdown();
19668        _result
19669    }
19670
19671    /// Similar to "send" but does not shutdown the channel if an error occurs.
19672    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
19673        let _result = self.send_raw(s);
19674        self.drop_without_shutdown();
19675        _result
19676    }
19677
19678    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
19679        self.control_handle.inner.send::<NodeSetAttrResponse>(
19680            (s,),
19681            self.tx_id,
19682            0x4186c0f40d938f46,
19683            fidl::encoding::DynamicFlags::empty(),
19684        )
19685    }
19686}
19687
19688#[must_use = "FIDL methods require a response to be sent"]
19689#[derive(Debug)]
19690pub struct SymlinkDeprecatedGetFlagsResponder {
19691    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19692    tx_id: u32,
19693}
19694
19695/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19696/// if the responder is dropped without sending a response, so that the client
19697/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19698impl std::ops::Drop for SymlinkDeprecatedGetFlagsResponder {
19699    fn drop(&mut self) {
19700        self.control_handle.shutdown();
19701        // Safety: drops once, never accessed again
19702        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19703    }
19704}
19705
19706impl fidl::endpoints::Responder for SymlinkDeprecatedGetFlagsResponder {
19707    type ControlHandle = SymlinkControlHandle;
19708
19709    fn control_handle(&self) -> &SymlinkControlHandle {
19710        &self.control_handle
19711    }
19712
19713    fn drop_without_shutdown(mut self) {
19714        // Safety: drops once, never accessed again due to mem::forget
19715        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19716        // Prevent Drop from running (which would shut down the channel)
19717        std::mem::forget(self);
19718    }
19719}
19720
19721impl SymlinkDeprecatedGetFlagsResponder {
19722    /// Sends a response to the FIDL transaction.
19723    ///
19724    /// Sets the channel to shutdown if an error occurs.
19725    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
19726        let _result = self.send_raw(s, flags);
19727        if _result.is_err() {
19728            self.control_handle.shutdown();
19729        }
19730        self.drop_without_shutdown();
19731        _result
19732    }
19733
19734    /// Similar to "send" but does not shutdown the channel if an error occurs.
19735    pub fn send_no_shutdown_on_err(
19736        self,
19737        mut s: i32,
19738        mut flags: OpenFlags,
19739    ) -> Result<(), fidl::Error> {
19740        let _result = self.send_raw(s, flags);
19741        self.drop_without_shutdown();
19742        _result
19743    }
19744
19745    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
19746        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
19747            (s, flags),
19748            self.tx_id,
19749            0x5b88fffb8eda3aa1,
19750            fidl::encoding::DynamicFlags::empty(),
19751        )
19752    }
19753}
19754
19755#[must_use = "FIDL methods require a response to be sent"]
19756#[derive(Debug)]
19757pub struct SymlinkDeprecatedSetFlagsResponder {
19758    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19759    tx_id: u32,
19760}
19761
19762/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19763/// if the responder is dropped without sending a response, so that the client
19764/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19765impl std::ops::Drop for SymlinkDeprecatedSetFlagsResponder {
19766    fn drop(&mut self) {
19767        self.control_handle.shutdown();
19768        // Safety: drops once, never accessed again
19769        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19770    }
19771}
19772
19773impl fidl::endpoints::Responder for SymlinkDeprecatedSetFlagsResponder {
19774    type ControlHandle = SymlinkControlHandle;
19775
19776    fn control_handle(&self) -> &SymlinkControlHandle {
19777        &self.control_handle
19778    }
19779
19780    fn drop_without_shutdown(mut self) {
19781        // Safety: drops once, never accessed again due to mem::forget
19782        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19783        // Prevent Drop from running (which would shut down the channel)
19784        std::mem::forget(self);
19785    }
19786}
19787
19788impl SymlinkDeprecatedSetFlagsResponder {
19789    /// Sends a response to the FIDL transaction.
19790    ///
19791    /// Sets the channel to shutdown if an error occurs.
19792    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
19793        let _result = self.send_raw(s);
19794        if _result.is_err() {
19795            self.control_handle.shutdown();
19796        }
19797        self.drop_without_shutdown();
19798        _result
19799    }
19800
19801    /// Similar to "send" but does not shutdown the channel if an error occurs.
19802    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
19803        let _result = self.send_raw(s);
19804        self.drop_without_shutdown();
19805        _result
19806    }
19807
19808    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
19809        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
19810            (s,),
19811            self.tx_id,
19812            0x5295b76c71fde733,
19813            fidl::encoding::DynamicFlags::empty(),
19814        )
19815    }
19816}
19817
19818#[must_use = "FIDL methods require a response to be sent"]
19819#[derive(Debug)]
19820pub struct SymlinkGetFlagsResponder {
19821    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19822    tx_id: u32,
19823}
19824
19825/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19826/// if the responder is dropped without sending a response, so that the client
19827/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19828impl std::ops::Drop for SymlinkGetFlagsResponder {
19829    fn drop(&mut self) {
19830        self.control_handle.shutdown();
19831        // Safety: drops once, never accessed again
19832        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19833    }
19834}
19835
19836impl fidl::endpoints::Responder for SymlinkGetFlagsResponder {
19837    type ControlHandle = SymlinkControlHandle;
19838
19839    fn control_handle(&self) -> &SymlinkControlHandle {
19840        &self.control_handle
19841    }
19842
19843    fn drop_without_shutdown(mut self) {
19844        // Safety: drops once, never accessed again due to mem::forget
19845        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19846        // Prevent Drop from running (which would shut down the channel)
19847        std::mem::forget(self);
19848    }
19849}
19850
19851impl SymlinkGetFlagsResponder {
19852    /// Sends a response to the FIDL transaction.
19853    ///
19854    /// Sets the channel to shutdown if an error occurs.
19855    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
19856        let _result = self.send_raw(result);
19857        if _result.is_err() {
19858            self.control_handle.shutdown();
19859        }
19860        self.drop_without_shutdown();
19861        _result
19862    }
19863
19864    /// Similar to "send" but does not shutdown the channel if an error occurs.
19865    pub fn send_no_shutdown_on_err(
19866        self,
19867        mut result: Result<Flags, i32>,
19868    ) -> Result<(), fidl::Error> {
19869        let _result = self.send_raw(result);
19870        self.drop_without_shutdown();
19871        _result
19872    }
19873
19874    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
19875        self.control_handle
19876            .inner
19877            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
19878                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
19879                self.tx_id,
19880                0x176eb318f64ec23,
19881                fidl::encoding::DynamicFlags::FLEXIBLE,
19882            )
19883    }
19884}
19885
19886#[must_use = "FIDL methods require a response to be sent"]
19887#[derive(Debug)]
19888pub struct SymlinkSetFlagsResponder {
19889    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19890    tx_id: u32,
19891}
19892
19893/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19894/// if the responder is dropped without sending a response, so that the client
19895/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19896impl std::ops::Drop for SymlinkSetFlagsResponder {
19897    fn drop(&mut self) {
19898        self.control_handle.shutdown();
19899        // Safety: drops once, never accessed again
19900        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19901    }
19902}
19903
19904impl fidl::endpoints::Responder for SymlinkSetFlagsResponder {
19905    type ControlHandle = SymlinkControlHandle;
19906
19907    fn control_handle(&self) -> &SymlinkControlHandle {
19908        &self.control_handle
19909    }
19910
19911    fn drop_without_shutdown(mut self) {
19912        // Safety: drops once, never accessed again due to mem::forget
19913        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19914        // Prevent Drop from running (which would shut down the channel)
19915        std::mem::forget(self);
19916    }
19917}
19918
19919impl SymlinkSetFlagsResponder {
19920    /// Sends a response to the FIDL transaction.
19921    ///
19922    /// Sets the channel to shutdown if an error occurs.
19923    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19924        let _result = self.send_raw(result);
19925        if _result.is_err() {
19926            self.control_handle.shutdown();
19927        }
19928        self.drop_without_shutdown();
19929        _result
19930    }
19931
19932    /// Similar to "send" but does not shutdown the channel if an error occurs.
19933    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19934        let _result = self.send_raw(result);
19935        self.drop_without_shutdown();
19936        _result
19937    }
19938
19939    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19940        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
19941            fidl::encoding::EmptyStruct,
19942            i32,
19943        >>(
19944            fidl::encoding::FlexibleResult::new(result),
19945            self.tx_id,
19946            0x55a8028685791ea8,
19947            fidl::encoding::DynamicFlags::FLEXIBLE,
19948        )
19949    }
19950}
19951
19952#[must_use = "FIDL methods require a response to be sent"]
19953#[derive(Debug)]
19954pub struct SymlinkQueryFilesystemResponder {
19955    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19956    tx_id: u32,
19957}
19958
19959/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19960/// if the responder is dropped without sending a response, so that the client
19961/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19962impl std::ops::Drop for SymlinkQueryFilesystemResponder {
19963    fn drop(&mut self) {
19964        self.control_handle.shutdown();
19965        // Safety: drops once, never accessed again
19966        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19967    }
19968}
19969
19970impl fidl::endpoints::Responder for SymlinkQueryFilesystemResponder {
19971    type ControlHandle = SymlinkControlHandle;
19972
19973    fn control_handle(&self) -> &SymlinkControlHandle {
19974        &self.control_handle
19975    }
19976
19977    fn drop_without_shutdown(mut self) {
19978        // Safety: drops once, never accessed again due to mem::forget
19979        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19980        // Prevent Drop from running (which would shut down the channel)
19981        std::mem::forget(self);
19982    }
19983}
19984
19985impl SymlinkQueryFilesystemResponder {
19986    /// Sends a response to the FIDL transaction.
19987    ///
19988    /// Sets the channel to shutdown if an error occurs.
19989    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
19990        let _result = self.send_raw(s, info);
19991        if _result.is_err() {
19992            self.control_handle.shutdown();
19993        }
19994        self.drop_without_shutdown();
19995        _result
19996    }
19997
19998    /// Similar to "send" but does not shutdown the channel if an error occurs.
19999    pub fn send_no_shutdown_on_err(
20000        self,
20001        mut s: i32,
20002        mut info: Option<&FilesystemInfo>,
20003    ) -> Result<(), fidl::Error> {
20004        let _result = self.send_raw(s, info);
20005        self.drop_without_shutdown();
20006        _result
20007    }
20008
20009    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
20010        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
20011            (s, info),
20012            self.tx_id,
20013            0x6f344a1c6b0a0610,
20014            fidl::encoding::DynamicFlags::empty(),
20015        )
20016    }
20017}
20018
20019#[must_use = "FIDL methods require a response to be sent"]
20020#[derive(Debug)]
20021pub struct SymlinkGetConnectionInfoResponder {
20022    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20023    tx_id: u32,
20024}
20025
20026/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20027/// if the responder is dropped without sending a response, so that the client
20028/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20029impl std::ops::Drop for SymlinkGetConnectionInfoResponder {
20030    fn drop(&mut self) {
20031        self.control_handle.shutdown();
20032        // Safety: drops once, never accessed again
20033        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20034    }
20035}
20036
20037impl fidl::endpoints::Responder for SymlinkGetConnectionInfoResponder {
20038    type ControlHandle = SymlinkControlHandle;
20039
20040    fn control_handle(&self) -> &SymlinkControlHandle {
20041        &self.control_handle
20042    }
20043
20044    fn drop_without_shutdown(mut self) {
20045        // Safety: drops once, never accessed again due to mem::forget
20046        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20047        // Prevent Drop from running (which would shut down the channel)
20048        std::mem::forget(self);
20049    }
20050}
20051
20052impl SymlinkGetConnectionInfoResponder {
20053    /// Sends a response to the FIDL transaction.
20054    ///
20055    /// Sets the channel to shutdown if an error occurs.
20056    pub fn send(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
20057        let _result = self.send_raw(payload);
20058        if _result.is_err() {
20059            self.control_handle.shutdown();
20060        }
20061        self.drop_without_shutdown();
20062        _result
20063    }
20064
20065    /// Similar to "send" but does not shutdown the channel if an error occurs.
20066    pub fn send_no_shutdown_on_err(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
20067        let _result = self.send_raw(payload);
20068        self.drop_without_shutdown();
20069        _result
20070    }
20071
20072    fn send_raw(&self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
20073        self.control_handle.inner.send::<ConnectionInfo>(
20074            &mut payload,
20075            self.tx_id,
20076            0x584c377c7c0a6d0b,
20077            fidl::encoding::DynamicFlags::empty(),
20078        )
20079    }
20080}
20081
20082#[must_use = "FIDL methods require a response to be sent"]
20083#[derive(Debug)]
20084pub struct SymlinkGetAttributesResponder {
20085    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20086    tx_id: u32,
20087}
20088
20089/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20090/// if the responder is dropped without sending a response, so that the client
20091/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20092impl std::ops::Drop for SymlinkGetAttributesResponder {
20093    fn drop(&mut self) {
20094        self.control_handle.shutdown();
20095        // Safety: drops once, never accessed again
20096        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20097    }
20098}
20099
20100impl fidl::endpoints::Responder for SymlinkGetAttributesResponder {
20101    type ControlHandle = SymlinkControlHandle;
20102
20103    fn control_handle(&self) -> &SymlinkControlHandle {
20104        &self.control_handle
20105    }
20106
20107    fn drop_without_shutdown(mut self) {
20108        // Safety: drops once, never accessed again due to mem::forget
20109        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20110        // Prevent Drop from running (which would shut down the channel)
20111        std::mem::forget(self);
20112    }
20113}
20114
20115impl SymlinkGetAttributesResponder {
20116    /// Sends a response to the FIDL transaction.
20117    ///
20118    /// Sets the channel to shutdown if an error occurs.
20119    pub fn send(
20120        self,
20121        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
20122    ) -> Result<(), fidl::Error> {
20123        let _result = self.send_raw(result);
20124        if _result.is_err() {
20125            self.control_handle.shutdown();
20126        }
20127        self.drop_without_shutdown();
20128        _result
20129    }
20130
20131    /// Similar to "send" but does not shutdown the channel if an error occurs.
20132    pub fn send_no_shutdown_on_err(
20133        self,
20134        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
20135    ) -> Result<(), fidl::Error> {
20136        let _result = self.send_raw(result);
20137        self.drop_without_shutdown();
20138        _result
20139    }
20140
20141    fn send_raw(
20142        &self,
20143        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
20144    ) -> Result<(), fidl::Error> {
20145        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
20146            result,
20147            self.tx_id,
20148            0x3d4396a638ea053b,
20149            fidl::encoding::DynamicFlags::empty(),
20150        )
20151    }
20152}
20153
20154#[must_use = "FIDL methods require a response to be sent"]
20155#[derive(Debug)]
20156pub struct SymlinkUpdateAttributesResponder {
20157    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20158    tx_id: u32,
20159}
20160
20161/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20162/// if the responder is dropped without sending a response, so that the client
20163/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20164impl std::ops::Drop for SymlinkUpdateAttributesResponder {
20165    fn drop(&mut self) {
20166        self.control_handle.shutdown();
20167        // Safety: drops once, never accessed again
20168        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20169    }
20170}
20171
20172impl fidl::endpoints::Responder for SymlinkUpdateAttributesResponder {
20173    type ControlHandle = SymlinkControlHandle;
20174
20175    fn control_handle(&self) -> &SymlinkControlHandle {
20176        &self.control_handle
20177    }
20178
20179    fn drop_without_shutdown(mut self) {
20180        // Safety: drops once, never accessed again due to mem::forget
20181        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20182        // Prevent Drop from running (which would shut down the channel)
20183        std::mem::forget(self);
20184    }
20185}
20186
20187impl SymlinkUpdateAttributesResponder {
20188    /// Sends a response to the FIDL transaction.
20189    ///
20190    /// Sets the channel to shutdown if an error occurs.
20191    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20192        let _result = self.send_raw(result);
20193        if _result.is_err() {
20194            self.control_handle.shutdown();
20195        }
20196        self.drop_without_shutdown();
20197        _result
20198    }
20199
20200    /// Similar to "send" but does not shutdown the channel if an error occurs.
20201    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20202        let _result = self.send_raw(result);
20203        self.drop_without_shutdown();
20204        _result
20205    }
20206
20207    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20208        self.control_handle
20209            .inner
20210            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20211                result,
20212                self.tx_id,
20213                0x3308c1da5a89bf08,
20214                fidl::encoding::DynamicFlags::empty(),
20215            )
20216    }
20217}
20218
20219#[must_use = "FIDL methods require a response to be sent"]
20220#[derive(Debug)]
20221pub struct SymlinkSyncResponder {
20222    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20223    tx_id: u32,
20224}
20225
20226/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20227/// if the responder is dropped without sending a response, so that the client
20228/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20229impl std::ops::Drop for SymlinkSyncResponder {
20230    fn drop(&mut self) {
20231        self.control_handle.shutdown();
20232        // Safety: drops once, never accessed again
20233        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20234    }
20235}
20236
20237impl fidl::endpoints::Responder for SymlinkSyncResponder {
20238    type ControlHandle = SymlinkControlHandle;
20239
20240    fn control_handle(&self) -> &SymlinkControlHandle {
20241        &self.control_handle
20242    }
20243
20244    fn drop_without_shutdown(mut self) {
20245        // Safety: drops once, never accessed again due to mem::forget
20246        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20247        // Prevent Drop from running (which would shut down the channel)
20248        std::mem::forget(self);
20249    }
20250}
20251
20252impl SymlinkSyncResponder {
20253    /// Sends a response to the FIDL transaction.
20254    ///
20255    /// Sets the channel to shutdown if an error occurs.
20256    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20257        let _result = self.send_raw(result);
20258        if _result.is_err() {
20259            self.control_handle.shutdown();
20260        }
20261        self.drop_without_shutdown();
20262        _result
20263    }
20264
20265    /// Similar to "send" but does not shutdown the channel if an error occurs.
20266    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20267        let _result = self.send_raw(result);
20268        self.drop_without_shutdown();
20269        _result
20270    }
20271
20272    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20273        self.control_handle
20274            .inner
20275            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20276                result,
20277                self.tx_id,
20278                0x2c5c27ca0ab5dc49,
20279                fidl::encoding::DynamicFlags::empty(),
20280            )
20281    }
20282}
20283
20284#[must_use = "FIDL methods require a response to be sent"]
20285#[derive(Debug)]
20286pub struct SymlinkGetExtendedAttributeResponder {
20287    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20288    tx_id: u32,
20289}
20290
20291/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20292/// if the responder is dropped without sending a response, so that the client
20293/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20294impl std::ops::Drop for SymlinkGetExtendedAttributeResponder {
20295    fn drop(&mut self) {
20296        self.control_handle.shutdown();
20297        // Safety: drops once, never accessed again
20298        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20299    }
20300}
20301
20302impl fidl::endpoints::Responder for SymlinkGetExtendedAttributeResponder {
20303    type ControlHandle = SymlinkControlHandle;
20304
20305    fn control_handle(&self) -> &SymlinkControlHandle {
20306        &self.control_handle
20307    }
20308
20309    fn drop_without_shutdown(mut self) {
20310        // Safety: drops once, never accessed again due to mem::forget
20311        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20312        // Prevent Drop from running (which would shut down the channel)
20313        std::mem::forget(self);
20314    }
20315}
20316
20317impl SymlinkGetExtendedAttributeResponder {
20318    /// Sends a response to the FIDL transaction.
20319    ///
20320    /// Sets the channel to shutdown if an error occurs.
20321    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
20322        let _result = self.send_raw(result);
20323        if _result.is_err() {
20324            self.control_handle.shutdown();
20325        }
20326        self.drop_without_shutdown();
20327        _result
20328    }
20329
20330    /// Similar to "send" but does not shutdown the channel if an error occurs.
20331    pub fn send_no_shutdown_on_err(
20332        self,
20333        mut result: Result<ExtendedAttributeValue, i32>,
20334    ) -> Result<(), fidl::Error> {
20335        let _result = self.send_raw(result);
20336        self.drop_without_shutdown();
20337        _result
20338    }
20339
20340    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
20341        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
20342            result.as_mut().map_err(|e| *e),
20343            self.tx_id,
20344            0x45ffa3ccfdeb76db,
20345            fidl::encoding::DynamicFlags::empty(),
20346        )
20347    }
20348}
20349
20350#[must_use = "FIDL methods require a response to be sent"]
20351#[derive(Debug)]
20352pub struct SymlinkSetExtendedAttributeResponder {
20353    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20354    tx_id: u32,
20355}
20356
20357/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20358/// if the responder is dropped without sending a response, so that the client
20359/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20360impl std::ops::Drop for SymlinkSetExtendedAttributeResponder {
20361    fn drop(&mut self) {
20362        self.control_handle.shutdown();
20363        // Safety: drops once, never accessed again
20364        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20365    }
20366}
20367
20368impl fidl::endpoints::Responder for SymlinkSetExtendedAttributeResponder {
20369    type ControlHandle = SymlinkControlHandle;
20370
20371    fn control_handle(&self) -> &SymlinkControlHandle {
20372        &self.control_handle
20373    }
20374
20375    fn drop_without_shutdown(mut self) {
20376        // Safety: drops once, never accessed again due to mem::forget
20377        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20378        // Prevent Drop from running (which would shut down the channel)
20379        std::mem::forget(self);
20380    }
20381}
20382
20383impl SymlinkSetExtendedAttributeResponder {
20384    /// Sends a response to the FIDL transaction.
20385    ///
20386    /// Sets the channel to shutdown if an error occurs.
20387    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20388        let _result = self.send_raw(result);
20389        if _result.is_err() {
20390            self.control_handle.shutdown();
20391        }
20392        self.drop_without_shutdown();
20393        _result
20394    }
20395
20396    /// Similar to "send" but does not shutdown the channel if an error occurs.
20397    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20398        let _result = self.send_raw(result);
20399        self.drop_without_shutdown();
20400        _result
20401    }
20402
20403    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20404        self.control_handle
20405            .inner
20406            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20407                result,
20408                self.tx_id,
20409                0x4a951362f681f23c,
20410                fidl::encoding::DynamicFlags::empty(),
20411            )
20412    }
20413}
20414
20415#[must_use = "FIDL methods require a response to be sent"]
20416#[derive(Debug)]
20417pub struct SymlinkRemoveExtendedAttributeResponder {
20418    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20419    tx_id: u32,
20420}
20421
20422/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20423/// if the responder is dropped without sending a response, so that the client
20424/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20425impl std::ops::Drop for SymlinkRemoveExtendedAttributeResponder {
20426    fn drop(&mut self) {
20427        self.control_handle.shutdown();
20428        // Safety: drops once, never accessed again
20429        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20430    }
20431}
20432
20433impl fidl::endpoints::Responder for SymlinkRemoveExtendedAttributeResponder {
20434    type ControlHandle = SymlinkControlHandle;
20435
20436    fn control_handle(&self) -> &SymlinkControlHandle {
20437        &self.control_handle
20438    }
20439
20440    fn drop_without_shutdown(mut self) {
20441        // Safety: drops once, never accessed again due to mem::forget
20442        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20443        // Prevent Drop from running (which would shut down the channel)
20444        std::mem::forget(self);
20445    }
20446}
20447
20448impl SymlinkRemoveExtendedAttributeResponder {
20449    /// Sends a response to the FIDL transaction.
20450    ///
20451    /// Sets the channel to shutdown if an error occurs.
20452    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20453        let _result = self.send_raw(result);
20454        if _result.is_err() {
20455            self.control_handle.shutdown();
20456        }
20457        self.drop_without_shutdown();
20458        _result
20459    }
20460
20461    /// Similar to "send" but does not shutdown the channel if an error occurs.
20462    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20463        let _result = self.send_raw(result);
20464        self.drop_without_shutdown();
20465        _result
20466    }
20467
20468    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20469        self.control_handle
20470            .inner
20471            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20472                result,
20473                self.tx_id,
20474                0x7a0b9f3a9bf9032d,
20475                fidl::encoding::DynamicFlags::empty(),
20476            )
20477    }
20478}
20479
20480#[must_use = "FIDL methods require a response to be sent"]
20481#[derive(Debug)]
20482pub struct SymlinkDescribeResponder {
20483    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20484    tx_id: u32,
20485}
20486
20487/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20488/// if the responder is dropped without sending a response, so that the client
20489/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20490impl std::ops::Drop for SymlinkDescribeResponder {
20491    fn drop(&mut self) {
20492        self.control_handle.shutdown();
20493        // Safety: drops once, never accessed again
20494        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20495    }
20496}
20497
20498impl fidl::endpoints::Responder for SymlinkDescribeResponder {
20499    type ControlHandle = SymlinkControlHandle;
20500
20501    fn control_handle(&self) -> &SymlinkControlHandle {
20502        &self.control_handle
20503    }
20504
20505    fn drop_without_shutdown(mut self) {
20506        // Safety: drops once, never accessed again due to mem::forget
20507        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20508        // Prevent Drop from running (which would shut down the channel)
20509        std::mem::forget(self);
20510    }
20511}
20512
20513impl SymlinkDescribeResponder {
20514    /// Sends a response to the FIDL transaction.
20515    ///
20516    /// Sets the channel to shutdown if an error occurs.
20517    pub fn send(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
20518        let _result = self.send_raw(payload);
20519        if _result.is_err() {
20520            self.control_handle.shutdown();
20521        }
20522        self.drop_without_shutdown();
20523        _result
20524    }
20525
20526    /// Similar to "send" but does not shutdown the channel if an error occurs.
20527    pub fn send_no_shutdown_on_err(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
20528        let _result = self.send_raw(payload);
20529        self.drop_without_shutdown();
20530        _result
20531    }
20532
20533    fn send_raw(&self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
20534        self.control_handle.inner.send::<fidl::encoding::FlexibleType<SymlinkInfo>>(
20535            fidl::encoding::Flexible::new(payload),
20536            self.tx_id,
20537            0x742c2ea5e89831f3,
20538            fidl::encoding::DynamicFlags::FLEXIBLE,
20539        )
20540    }
20541}
20542
20543#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
20544pub struct WritableMarker;
20545
20546impl fidl::endpoints::ProtocolMarker for WritableMarker {
20547    type Proxy = WritableProxy;
20548    type RequestStream = WritableRequestStream;
20549    #[cfg(target_os = "fuchsia")]
20550    type SynchronousProxy = WritableSynchronousProxy;
20551
20552    const DEBUG_NAME: &'static str = "(anonymous) Writable";
20553}
20554pub type WritableWriteResult = Result<u64, i32>;
20555
20556pub trait WritableProxyInterface: Send + Sync {
20557    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
20558        + Send;
20559    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
20560}
20561#[derive(Debug)]
20562#[cfg(target_os = "fuchsia")]
20563pub struct WritableSynchronousProxy {
20564    client: fidl::client::sync::Client,
20565}
20566
20567#[cfg(target_os = "fuchsia")]
20568impl fidl::endpoints::SynchronousProxy for WritableSynchronousProxy {
20569    type Proxy = WritableProxy;
20570    type Protocol = WritableMarker;
20571
20572    fn from_channel(inner: fidl::Channel) -> Self {
20573        Self::new(inner)
20574    }
20575
20576    fn into_channel(self) -> fidl::Channel {
20577        self.client.into_channel()
20578    }
20579
20580    fn as_channel(&self) -> &fidl::Channel {
20581        self.client.as_channel()
20582    }
20583}
20584
20585#[cfg(target_os = "fuchsia")]
20586impl WritableSynchronousProxy {
20587    pub fn new(channel: fidl::Channel) -> Self {
20588        let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
20589        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
20590    }
20591
20592    pub fn into_channel(self) -> fidl::Channel {
20593        self.client.into_channel()
20594    }
20595
20596    /// Waits until an event arrives and returns it. It is safe for other
20597    /// threads to make concurrent requests while waiting for an event.
20598    pub fn wait_for_event(
20599        &self,
20600        deadline: zx::MonotonicInstant,
20601    ) -> Result<WritableEvent, fidl::Error> {
20602        WritableEvent::decode(self.client.wait_for_event(deadline)?)
20603    }
20604
20605    /// Writes data at the seek offset.
20606    /// The seek offset is moved forward by the number of bytes written.
20607    /// If the file is in append mode, the seek offset is first set to the end
20608    /// of the file, followed by the write, in one atomic step.
20609    ///
20610    /// The file size may grow if the seek offset plus `data.length` is beyond
20611    /// the current end of file.
20612    ///
20613    /// + request `data` the byte buffer to write to the file.
20614    /// - response `actual_count` the number of bytes written.
20615    ///
20616    /// ## Invariants
20617    ///
20618    /// * The returned `actual_count` will never be greater than `data.length`.
20619    /// * If the server is unable to write all the data due to e.g. not enough
20620    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20621    ///   could be written, an error is returned.
20622    /// * If `data.length` is zero, the server should perform all the checks
20623    ///   ensuring write access without mutating the file and return a
20624    ///   successful write of zero bytes.  The seek offset is still updated if
20625    ///   in append mode.
20626    ///
20627    /// This method requires the [`Rights.WRITE_BYTES`] right.
20628    pub fn r#write(
20629        &self,
20630        mut data: &[u8],
20631        ___deadline: zx::MonotonicInstant,
20632    ) -> Result<WritableWriteResult, fidl::Error> {
20633        let _response = self.client.send_query::<
20634            WritableWriteRequest,
20635            fidl::encoding::ResultType<WritableWriteResponse, i32>,
20636        >(
20637            (data,),
20638            0x6a31437832469f82,
20639            fidl::encoding::DynamicFlags::empty(),
20640            ___deadline,
20641        )?;
20642        Ok(_response.map(|x| x.actual_count))
20643    }
20644}
20645
20646#[cfg(target_os = "fuchsia")]
20647impl From<WritableSynchronousProxy> for zx::Handle {
20648    fn from(value: WritableSynchronousProxy) -> Self {
20649        value.into_channel().into()
20650    }
20651}
20652
20653#[cfg(target_os = "fuchsia")]
20654impl From<fidl::Channel> for WritableSynchronousProxy {
20655    fn from(value: fidl::Channel) -> Self {
20656        Self::new(value)
20657    }
20658}
20659
20660#[derive(Debug, Clone)]
20661pub struct WritableProxy {
20662    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
20663}
20664
20665impl fidl::endpoints::Proxy for WritableProxy {
20666    type Protocol = WritableMarker;
20667
20668    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
20669        Self::new(inner)
20670    }
20671
20672    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
20673        self.client.into_channel().map_err(|client| Self { client })
20674    }
20675
20676    fn as_channel(&self) -> &::fidl::AsyncChannel {
20677        self.client.as_channel()
20678    }
20679}
20680
20681impl WritableProxy {
20682    /// Create a new Proxy for fuchsia.io/Writable.
20683    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
20684        let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
20685        Self { client: fidl::client::Client::new(channel, protocol_name) }
20686    }
20687
20688    /// Get a Stream of events from the remote end of the protocol.
20689    ///
20690    /// # Panics
20691    ///
20692    /// Panics if the event stream was already taken.
20693    pub fn take_event_stream(&self) -> WritableEventStream {
20694        WritableEventStream { event_receiver: self.client.take_event_receiver() }
20695    }
20696
20697    /// Writes data at the seek offset.
20698    /// The seek offset is moved forward by the number of bytes written.
20699    /// If the file is in append mode, the seek offset is first set to the end
20700    /// of the file, followed by the write, in one atomic step.
20701    ///
20702    /// The file size may grow if the seek offset plus `data.length` is beyond
20703    /// the current end of file.
20704    ///
20705    /// + request `data` the byte buffer to write to the file.
20706    /// - response `actual_count` the number of bytes written.
20707    ///
20708    /// ## Invariants
20709    ///
20710    /// * The returned `actual_count` will never be greater than `data.length`.
20711    /// * If the server is unable to write all the data due to e.g. not enough
20712    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20713    ///   could be written, an error is returned.
20714    /// * If `data.length` is zero, the server should perform all the checks
20715    ///   ensuring write access without mutating the file and return a
20716    ///   successful write of zero bytes.  The seek offset is still updated if
20717    ///   in append mode.
20718    ///
20719    /// This method requires the [`Rights.WRITE_BYTES`] right.
20720    pub fn r#write(
20721        &self,
20722        mut data: &[u8],
20723    ) -> fidl::client::QueryResponseFut<
20724        WritableWriteResult,
20725        fidl::encoding::DefaultFuchsiaResourceDialect,
20726    > {
20727        WritableProxyInterface::r#write(self, data)
20728    }
20729}
20730
20731impl WritableProxyInterface for WritableProxy {
20732    type WriteResponseFut = fidl::client::QueryResponseFut<
20733        WritableWriteResult,
20734        fidl::encoding::DefaultFuchsiaResourceDialect,
20735    >;
20736    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
20737        fn _decode(
20738            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
20739        ) -> Result<WritableWriteResult, fidl::Error> {
20740            let _response = fidl::client::decode_transaction_body::<
20741                fidl::encoding::ResultType<WritableWriteResponse, i32>,
20742                fidl::encoding::DefaultFuchsiaResourceDialect,
20743                0x6a31437832469f82,
20744            >(_buf?)?;
20745            Ok(_response.map(|x| x.actual_count))
20746        }
20747        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
20748            (data,),
20749            0x6a31437832469f82,
20750            fidl::encoding::DynamicFlags::empty(),
20751            _decode,
20752        )
20753    }
20754}
20755
20756pub struct WritableEventStream {
20757    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
20758}
20759
20760impl std::marker::Unpin for WritableEventStream {}
20761
20762impl futures::stream::FusedStream for WritableEventStream {
20763    fn is_terminated(&self) -> bool {
20764        self.event_receiver.is_terminated()
20765    }
20766}
20767
20768impl futures::Stream for WritableEventStream {
20769    type Item = Result<WritableEvent, fidl::Error>;
20770
20771    fn poll_next(
20772        mut self: std::pin::Pin<&mut Self>,
20773        cx: &mut std::task::Context<'_>,
20774    ) -> std::task::Poll<Option<Self::Item>> {
20775        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
20776            &mut self.event_receiver,
20777            cx
20778        )?) {
20779            Some(buf) => std::task::Poll::Ready(Some(WritableEvent::decode(buf))),
20780            None => std::task::Poll::Ready(None),
20781        }
20782    }
20783}
20784
20785#[derive(Debug)]
20786pub enum WritableEvent {}
20787
20788impl WritableEvent {
20789    /// Decodes a message buffer as a [`WritableEvent`].
20790    fn decode(
20791        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
20792    ) -> Result<WritableEvent, fidl::Error> {
20793        let (bytes, _handles) = buf.split_mut();
20794        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
20795        debug_assert_eq!(tx_header.tx_id, 0);
20796        match tx_header.ordinal {
20797            _ => Err(fidl::Error::UnknownOrdinal {
20798                ordinal: tx_header.ordinal,
20799                protocol_name: <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
20800            }),
20801        }
20802    }
20803}
20804
20805/// A Stream of incoming requests for fuchsia.io/Writable.
20806pub struct WritableRequestStream {
20807    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20808    is_terminated: bool,
20809}
20810
20811impl std::marker::Unpin for WritableRequestStream {}
20812
20813impl futures::stream::FusedStream for WritableRequestStream {
20814    fn is_terminated(&self) -> bool {
20815        self.is_terminated
20816    }
20817}
20818
20819impl fidl::endpoints::RequestStream for WritableRequestStream {
20820    type Protocol = WritableMarker;
20821    type ControlHandle = WritableControlHandle;
20822
20823    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
20824        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
20825    }
20826
20827    fn control_handle(&self) -> Self::ControlHandle {
20828        WritableControlHandle { inner: self.inner.clone() }
20829    }
20830
20831    fn into_inner(
20832        self,
20833    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
20834    {
20835        (self.inner, self.is_terminated)
20836    }
20837
20838    fn from_inner(
20839        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20840        is_terminated: bool,
20841    ) -> Self {
20842        Self { inner, is_terminated }
20843    }
20844}
20845
20846impl futures::Stream for WritableRequestStream {
20847    type Item = Result<WritableRequest, fidl::Error>;
20848
20849    fn poll_next(
20850        mut self: std::pin::Pin<&mut Self>,
20851        cx: &mut std::task::Context<'_>,
20852    ) -> std::task::Poll<Option<Self::Item>> {
20853        let this = &mut *self;
20854        if this.inner.check_shutdown(cx) {
20855            this.is_terminated = true;
20856            return std::task::Poll::Ready(None);
20857        }
20858        if this.is_terminated {
20859            panic!("polled WritableRequestStream after completion");
20860        }
20861        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
20862            |bytes, handles| {
20863                match this.inner.channel().read_etc(cx, bytes, handles) {
20864                    std::task::Poll::Ready(Ok(())) => {}
20865                    std::task::Poll::Pending => return std::task::Poll::Pending,
20866                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
20867                        this.is_terminated = true;
20868                        return std::task::Poll::Ready(None);
20869                    }
20870                    std::task::Poll::Ready(Err(e)) => {
20871                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
20872                            e.into(),
20873                        ))))
20874                    }
20875                }
20876
20877                // A message has been received from the channel
20878                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
20879
20880                std::task::Poll::Ready(Some(match header.ordinal {
20881                    0x6a31437832469f82 => {
20882                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
20883                        let mut req = fidl::new_empty!(
20884                            WritableWriteRequest,
20885                            fidl::encoding::DefaultFuchsiaResourceDialect
20886                        );
20887                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
20888                        let control_handle = WritableControlHandle { inner: this.inner.clone() };
20889                        Ok(WritableRequest::Write {
20890                            data: req.data,
20891
20892                            responder: WritableWriteResponder {
20893                                control_handle: std::mem::ManuallyDrop::new(control_handle),
20894                                tx_id: header.tx_id,
20895                            },
20896                        })
20897                    }
20898                    _ => Err(fidl::Error::UnknownOrdinal {
20899                        ordinal: header.ordinal,
20900                        protocol_name:
20901                            <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
20902                    }),
20903                }))
20904            },
20905        )
20906    }
20907}
20908
20909#[derive(Debug)]
20910pub enum WritableRequest {
20911    /// Writes data at the seek offset.
20912    /// The seek offset is moved forward by the number of bytes written.
20913    /// If the file is in append mode, the seek offset is first set to the end
20914    /// of the file, followed by the write, in one atomic step.
20915    ///
20916    /// The file size may grow if the seek offset plus `data.length` is beyond
20917    /// the current end of file.
20918    ///
20919    /// + request `data` the byte buffer to write to the file.
20920    /// - response `actual_count` the number of bytes written.
20921    ///
20922    /// ## Invariants
20923    ///
20924    /// * The returned `actual_count` will never be greater than `data.length`.
20925    /// * If the server is unable to write all the data due to e.g. not enough
20926    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20927    ///   could be written, an error is returned.
20928    /// * If `data.length` is zero, the server should perform all the checks
20929    ///   ensuring write access without mutating the file and return a
20930    ///   successful write of zero bytes.  The seek offset is still updated if
20931    ///   in append mode.
20932    ///
20933    /// This method requires the [`Rights.WRITE_BYTES`] right.
20934    Write { data: Vec<u8>, responder: WritableWriteResponder },
20935}
20936
20937impl WritableRequest {
20938    #[allow(irrefutable_let_patterns)]
20939    pub fn into_write(self) -> Option<(Vec<u8>, WritableWriteResponder)> {
20940        if let WritableRequest::Write { data, responder } = self {
20941            Some((data, responder))
20942        } else {
20943            None
20944        }
20945    }
20946
20947    /// Name of the method defined in FIDL
20948    pub fn method_name(&self) -> &'static str {
20949        match *self {
20950            WritableRequest::Write { .. } => "write",
20951        }
20952    }
20953}
20954
20955#[derive(Debug, Clone)]
20956pub struct WritableControlHandle {
20957    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20958}
20959
20960impl fidl::endpoints::ControlHandle for WritableControlHandle {
20961    fn shutdown(&self) {
20962        self.inner.shutdown()
20963    }
20964    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
20965        self.inner.shutdown_with_epitaph(status)
20966    }
20967
20968    fn is_closed(&self) -> bool {
20969        self.inner.channel().is_closed()
20970    }
20971    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
20972        self.inner.channel().on_closed()
20973    }
20974
20975    #[cfg(target_os = "fuchsia")]
20976    fn signal_peer(
20977        &self,
20978        clear_mask: zx::Signals,
20979        set_mask: zx::Signals,
20980    ) -> Result<(), zx_status::Status> {
20981        use fidl::Peered;
20982        self.inner.channel().signal_peer(clear_mask, set_mask)
20983    }
20984}
20985
20986impl WritableControlHandle {}
20987
20988#[must_use = "FIDL methods require a response to be sent"]
20989#[derive(Debug)]
20990pub struct WritableWriteResponder {
20991    control_handle: std::mem::ManuallyDrop<WritableControlHandle>,
20992    tx_id: u32,
20993}
20994
20995/// Set the the channel to be shutdown (see [`WritableControlHandle::shutdown`])
20996/// if the responder is dropped without sending a response, so that the client
20997/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20998impl std::ops::Drop for WritableWriteResponder {
20999    fn drop(&mut self) {
21000        self.control_handle.shutdown();
21001        // Safety: drops once, never accessed again
21002        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
21003    }
21004}
21005
21006impl fidl::endpoints::Responder for WritableWriteResponder {
21007    type ControlHandle = WritableControlHandle;
21008
21009    fn control_handle(&self) -> &WritableControlHandle {
21010        &self.control_handle
21011    }
21012
21013    fn drop_without_shutdown(mut self) {
21014        // Safety: drops once, never accessed again due to mem::forget
21015        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
21016        // Prevent Drop from running (which would shut down the channel)
21017        std::mem::forget(self);
21018    }
21019}
21020
21021impl WritableWriteResponder {
21022    /// Sends a response to the FIDL transaction.
21023    ///
21024    /// Sets the channel to shutdown if an error occurs.
21025    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
21026        let _result = self.send_raw(result);
21027        if _result.is_err() {
21028            self.control_handle.shutdown();
21029        }
21030        self.drop_without_shutdown();
21031        _result
21032    }
21033
21034    /// Similar to "send" but does not shutdown the channel if an error occurs.
21035    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
21036        let _result = self.send_raw(result);
21037        self.drop_without_shutdown();
21038        _result
21039    }
21040
21041    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
21042        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
21043            result.map(|actual_count| (actual_count,)),
21044            self.tx_id,
21045            0x6a31437832469f82,
21046            fidl::encoding::DynamicFlags::empty(),
21047        )
21048    }
21049}
21050
21051mod internal {
21052    use super::*;
21053
21054    impl fidl::encoding::ResourceTypeMarker for DirectoryCreateSymlinkRequest {
21055        type Borrowed<'a> = &'a mut Self;
21056        fn take_or_borrow<'a>(
21057            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21058        ) -> Self::Borrowed<'a> {
21059            value
21060        }
21061    }
21062
21063    unsafe impl fidl::encoding::TypeMarker for DirectoryCreateSymlinkRequest {
21064        type Owned = Self;
21065
21066        #[inline(always)]
21067        fn inline_align(_context: fidl::encoding::Context) -> usize {
21068            8
21069        }
21070
21071        #[inline(always)]
21072        fn inline_size(_context: fidl::encoding::Context) -> usize {
21073            40
21074        }
21075    }
21076
21077    unsafe impl
21078        fidl::encoding::Encode<
21079            DirectoryCreateSymlinkRequest,
21080            fidl::encoding::DefaultFuchsiaResourceDialect,
21081        > for &mut DirectoryCreateSymlinkRequest
21082    {
21083        #[inline]
21084        unsafe fn encode(
21085            self,
21086            encoder: &mut fidl::encoding::Encoder<
21087                '_,
21088                fidl::encoding::DefaultFuchsiaResourceDialect,
21089            >,
21090            offset: usize,
21091            _depth: fidl::encoding::Depth,
21092        ) -> fidl::Result<()> {
21093            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
21094            // Delegate to tuple encoding.
21095            fidl::encoding::Encode::<
21096                DirectoryCreateSymlinkRequest,
21097                fidl::encoding::DefaultFuchsiaResourceDialect,
21098            >::encode(
21099                (
21100                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21101                        &self.name,
21102                    ),
21103                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
21104                        &self.target,
21105                    ),
21106                    <fidl::encoding::Optional<
21107                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21108                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21109                        &mut self.connection
21110                    ),
21111                ),
21112                encoder,
21113                offset,
21114                _depth,
21115            )
21116        }
21117    }
21118    unsafe impl<
21119            T0: fidl::encoding::Encode<
21120                fidl::encoding::BoundedString<255>,
21121                fidl::encoding::DefaultFuchsiaResourceDialect,
21122            >,
21123            T1: fidl::encoding::Encode<
21124                fidl::encoding::Vector<u8, 4095>,
21125                fidl::encoding::DefaultFuchsiaResourceDialect,
21126            >,
21127            T2: fidl::encoding::Encode<
21128                fidl::encoding::Optional<
21129                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21130                >,
21131                fidl::encoding::DefaultFuchsiaResourceDialect,
21132            >,
21133        >
21134        fidl::encoding::Encode<
21135            DirectoryCreateSymlinkRequest,
21136            fidl::encoding::DefaultFuchsiaResourceDialect,
21137        > for (T0, T1, T2)
21138    {
21139        #[inline]
21140        unsafe fn encode(
21141            self,
21142            encoder: &mut fidl::encoding::Encoder<
21143                '_,
21144                fidl::encoding::DefaultFuchsiaResourceDialect,
21145            >,
21146            offset: usize,
21147            depth: fidl::encoding::Depth,
21148        ) -> fidl::Result<()> {
21149            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
21150            // Zero out padding regions. There's no need to apply masks
21151            // because the unmasked parts will be overwritten by fields.
21152            unsafe {
21153                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
21154                (ptr as *mut u64).write_unaligned(0);
21155            }
21156            // Write the fields.
21157            self.0.encode(encoder, offset + 0, depth)?;
21158            self.1.encode(encoder, offset + 16, depth)?;
21159            self.2.encode(encoder, offset + 32, depth)?;
21160            Ok(())
21161        }
21162    }
21163
21164    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21165        for DirectoryCreateSymlinkRequest
21166    {
21167        #[inline(always)]
21168        fn new_empty() -> Self {
21169            Self {
21170                name: fidl::new_empty!(
21171                    fidl::encoding::BoundedString<255>,
21172                    fidl::encoding::DefaultFuchsiaResourceDialect
21173                ),
21174                target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect),
21175                connection: fidl::new_empty!(
21176                    fidl::encoding::Optional<
21177                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21178                    >,
21179                    fidl::encoding::DefaultFuchsiaResourceDialect
21180                ),
21181            }
21182        }
21183
21184        #[inline]
21185        unsafe fn decode(
21186            &mut self,
21187            decoder: &mut fidl::encoding::Decoder<
21188                '_,
21189                fidl::encoding::DefaultFuchsiaResourceDialect,
21190            >,
21191            offset: usize,
21192            _depth: fidl::encoding::Depth,
21193        ) -> fidl::Result<()> {
21194            decoder.debug_check_bounds::<Self>(offset);
21195            // Verify that padding bytes are zero.
21196            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
21197            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21198            let mask = 0xffffffff00000000u64;
21199            let maskedval = padval & mask;
21200            if maskedval != 0 {
21201                return Err(fidl::Error::NonZeroPadding {
21202                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
21203                });
21204            }
21205            fidl::decode!(
21206                fidl::encoding::BoundedString<255>,
21207                fidl::encoding::DefaultFuchsiaResourceDialect,
21208                &mut self.name,
21209                decoder,
21210                offset + 0,
21211                _depth
21212            )?;
21213            fidl::decode!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.target, decoder, offset + 16, _depth)?;
21214            fidl::decode!(
21215                fidl::encoding::Optional<
21216                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21217                >,
21218                fidl::encoding::DefaultFuchsiaResourceDialect,
21219                &mut self.connection,
21220                decoder,
21221                offset + 32,
21222                _depth
21223            )?;
21224            Ok(())
21225        }
21226    }
21227
21228    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedOpenRequest {
21229        type Borrowed<'a> = &'a mut Self;
21230        fn take_or_borrow<'a>(
21231            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21232        ) -> Self::Borrowed<'a> {
21233            value
21234        }
21235    }
21236
21237    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedOpenRequest {
21238        type Owned = Self;
21239
21240        #[inline(always)]
21241        fn inline_align(_context: fidl::encoding::Context) -> usize {
21242            8
21243        }
21244
21245        #[inline(always)]
21246        fn inline_size(_context: fidl::encoding::Context) -> usize {
21247            32
21248        }
21249    }
21250
21251    unsafe impl
21252        fidl::encoding::Encode<
21253            DirectoryDeprecatedOpenRequest,
21254            fidl::encoding::DefaultFuchsiaResourceDialect,
21255        > for &mut DirectoryDeprecatedOpenRequest
21256    {
21257        #[inline]
21258        unsafe fn encode(
21259            self,
21260            encoder: &mut fidl::encoding::Encoder<
21261                '_,
21262                fidl::encoding::DefaultFuchsiaResourceDialect,
21263            >,
21264            offset: usize,
21265            _depth: fidl::encoding::Depth,
21266        ) -> fidl::Result<()> {
21267            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
21268            // Delegate to tuple encoding.
21269            fidl::encoding::Encode::<DirectoryDeprecatedOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21270                (
21271                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
21272                    <ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
21273                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
21274                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
21275                ),
21276                encoder, offset, _depth
21277            )
21278        }
21279    }
21280    unsafe impl<
21281            T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
21282            T1: fidl::encoding::Encode<ModeType, fidl::encoding::DefaultFuchsiaResourceDialect>,
21283            T2: fidl::encoding::Encode<
21284                fidl::encoding::BoundedString<4095>,
21285                fidl::encoding::DefaultFuchsiaResourceDialect,
21286            >,
21287            T3: fidl::encoding::Encode<
21288                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
21289                fidl::encoding::DefaultFuchsiaResourceDialect,
21290            >,
21291        >
21292        fidl::encoding::Encode<
21293            DirectoryDeprecatedOpenRequest,
21294            fidl::encoding::DefaultFuchsiaResourceDialect,
21295        > for (T0, T1, T2, T3)
21296    {
21297        #[inline]
21298        unsafe fn encode(
21299            self,
21300            encoder: &mut fidl::encoding::Encoder<
21301                '_,
21302                fidl::encoding::DefaultFuchsiaResourceDialect,
21303            >,
21304            offset: usize,
21305            depth: fidl::encoding::Depth,
21306        ) -> fidl::Result<()> {
21307            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
21308            // Zero out padding regions. There's no need to apply masks
21309            // because the unmasked parts will be overwritten by fields.
21310            unsafe {
21311                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
21312                (ptr as *mut u64).write_unaligned(0);
21313            }
21314            // Write the fields.
21315            self.0.encode(encoder, offset + 0, depth)?;
21316            self.1.encode(encoder, offset + 4, depth)?;
21317            self.2.encode(encoder, offset + 8, depth)?;
21318            self.3.encode(encoder, offset + 24, depth)?;
21319            Ok(())
21320        }
21321    }
21322
21323    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21324        for DirectoryDeprecatedOpenRequest
21325    {
21326        #[inline(always)]
21327        fn new_empty() -> Self {
21328            Self {
21329                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
21330                mode: fidl::new_empty!(ModeType, fidl::encoding::DefaultFuchsiaResourceDialect),
21331                path: fidl::new_empty!(
21332                    fidl::encoding::BoundedString<4095>,
21333                    fidl::encoding::DefaultFuchsiaResourceDialect
21334                ),
21335                object: fidl::new_empty!(
21336                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
21337                    fidl::encoding::DefaultFuchsiaResourceDialect
21338                ),
21339            }
21340        }
21341
21342        #[inline]
21343        unsafe fn decode(
21344            &mut self,
21345            decoder: &mut fidl::encoding::Decoder<
21346                '_,
21347                fidl::encoding::DefaultFuchsiaResourceDialect,
21348            >,
21349            offset: usize,
21350            _depth: fidl::encoding::Depth,
21351        ) -> fidl::Result<()> {
21352            decoder.debug_check_bounds::<Self>(offset);
21353            // Verify that padding bytes are zero.
21354            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
21355            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21356            let mask = 0xffffffff00000000u64;
21357            let maskedval = padval & mask;
21358            if maskedval != 0 {
21359                return Err(fidl::Error::NonZeroPadding {
21360                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
21361                });
21362            }
21363            fidl::decode!(
21364                OpenFlags,
21365                fidl::encoding::DefaultFuchsiaResourceDialect,
21366                &mut self.flags,
21367                decoder,
21368                offset + 0,
21369                _depth
21370            )?;
21371            fidl::decode!(
21372                ModeType,
21373                fidl::encoding::DefaultFuchsiaResourceDialect,
21374                &mut self.mode,
21375                decoder,
21376                offset + 4,
21377                _depth
21378            )?;
21379            fidl::decode!(
21380                fidl::encoding::BoundedString<4095>,
21381                fidl::encoding::DefaultFuchsiaResourceDialect,
21382                &mut self.path,
21383                decoder,
21384                offset + 8,
21385                _depth
21386            )?;
21387            fidl::decode!(
21388                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
21389                fidl::encoding::DefaultFuchsiaResourceDialect,
21390                &mut self.object,
21391                decoder,
21392                offset + 24,
21393                _depth
21394            )?;
21395            Ok(())
21396        }
21397    }
21398
21399    impl fidl::encoding::ResourceTypeMarker for DirectoryGetTokenResponse {
21400        type Borrowed<'a> = &'a mut Self;
21401        fn take_or_borrow<'a>(
21402            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21403        ) -> Self::Borrowed<'a> {
21404            value
21405        }
21406    }
21407
21408    unsafe impl fidl::encoding::TypeMarker for DirectoryGetTokenResponse {
21409        type Owned = Self;
21410
21411        #[inline(always)]
21412        fn inline_align(_context: fidl::encoding::Context) -> usize {
21413            4
21414        }
21415
21416        #[inline(always)]
21417        fn inline_size(_context: fidl::encoding::Context) -> usize {
21418            8
21419        }
21420    }
21421
21422    unsafe impl
21423        fidl::encoding::Encode<
21424            DirectoryGetTokenResponse,
21425            fidl::encoding::DefaultFuchsiaResourceDialect,
21426        > for &mut DirectoryGetTokenResponse
21427    {
21428        #[inline]
21429        unsafe fn encode(
21430            self,
21431            encoder: &mut fidl::encoding::Encoder<
21432                '_,
21433                fidl::encoding::DefaultFuchsiaResourceDialect,
21434            >,
21435            offset: usize,
21436            _depth: fidl::encoding::Depth,
21437        ) -> fidl::Result<()> {
21438            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
21439            // Delegate to tuple encoding.
21440            fidl::encoding::Encode::<
21441                DirectoryGetTokenResponse,
21442                fidl::encoding::DefaultFuchsiaResourceDialect,
21443            >::encode(
21444                (
21445                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
21446                    <fidl::encoding::Optional<
21447                        fidl::encoding::HandleType<
21448                            fidl::Handle,
21449                            { fidl::ObjectType::NONE.into_raw() },
21450                            2147483648,
21451                        >,
21452                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21453                        &mut self.token
21454                    ),
21455                ),
21456                encoder,
21457                offset,
21458                _depth,
21459            )
21460        }
21461    }
21462    unsafe impl<
21463            T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
21464            T1: fidl::encoding::Encode<
21465                fidl::encoding::Optional<
21466                    fidl::encoding::HandleType<
21467                        fidl::Handle,
21468                        { fidl::ObjectType::NONE.into_raw() },
21469                        2147483648,
21470                    >,
21471                >,
21472                fidl::encoding::DefaultFuchsiaResourceDialect,
21473            >,
21474        >
21475        fidl::encoding::Encode<
21476            DirectoryGetTokenResponse,
21477            fidl::encoding::DefaultFuchsiaResourceDialect,
21478        > for (T0, T1)
21479    {
21480        #[inline]
21481        unsafe fn encode(
21482            self,
21483            encoder: &mut fidl::encoding::Encoder<
21484                '_,
21485                fidl::encoding::DefaultFuchsiaResourceDialect,
21486            >,
21487            offset: usize,
21488            depth: fidl::encoding::Depth,
21489        ) -> fidl::Result<()> {
21490            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
21491            // Zero out padding regions. There's no need to apply masks
21492            // because the unmasked parts will be overwritten by fields.
21493            // Write the fields.
21494            self.0.encode(encoder, offset + 0, depth)?;
21495            self.1.encode(encoder, offset + 4, depth)?;
21496            Ok(())
21497        }
21498    }
21499
21500    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21501        for DirectoryGetTokenResponse
21502    {
21503        #[inline(always)]
21504        fn new_empty() -> Self {
21505            Self {
21506                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
21507                token: fidl::new_empty!(
21508                    fidl::encoding::Optional<
21509                        fidl::encoding::HandleType<
21510                            fidl::Handle,
21511                            { fidl::ObjectType::NONE.into_raw() },
21512                            2147483648,
21513                        >,
21514                    >,
21515                    fidl::encoding::DefaultFuchsiaResourceDialect
21516                ),
21517            }
21518        }
21519
21520        #[inline]
21521        unsafe fn decode(
21522            &mut self,
21523            decoder: &mut fidl::encoding::Decoder<
21524                '_,
21525                fidl::encoding::DefaultFuchsiaResourceDialect,
21526            >,
21527            offset: usize,
21528            _depth: fidl::encoding::Depth,
21529        ) -> fidl::Result<()> {
21530            decoder.debug_check_bounds::<Self>(offset);
21531            // Verify that padding bytes are zero.
21532            fidl::decode!(
21533                i32,
21534                fidl::encoding::DefaultFuchsiaResourceDialect,
21535                &mut self.s,
21536                decoder,
21537                offset + 0,
21538                _depth
21539            )?;
21540            fidl::decode!(
21541                fidl::encoding::Optional<
21542                    fidl::encoding::HandleType<
21543                        fidl::Handle,
21544                        { fidl::ObjectType::NONE.into_raw() },
21545                        2147483648,
21546                    >,
21547                >,
21548                fidl::encoding::DefaultFuchsiaResourceDialect,
21549                &mut self.token,
21550                decoder,
21551                offset + 4,
21552                _depth
21553            )?;
21554            Ok(())
21555        }
21556    }
21557
21558    impl fidl::encoding::ResourceTypeMarker for DirectoryLinkRequest {
21559        type Borrowed<'a> = &'a mut Self;
21560        fn take_or_borrow<'a>(
21561            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21562        ) -> Self::Borrowed<'a> {
21563            value
21564        }
21565    }
21566
21567    unsafe impl fidl::encoding::TypeMarker for DirectoryLinkRequest {
21568        type Owned = Self;
21569
21570        #[inline(always)]
21571        fn inline_align(_context: fidl::encoding::Context) -> usize {
21572            8
21573        }
21574
21575        #[inline(always)]
21576        fn inline_size(_context: fidl::encoding::Context) -> usize {
21577            40
21578        }
21579    }
21580
21581    unsafe impl
21582        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21583        for &mut DirectoryLinkRequest
21584    {
21585        #[inline]
21586        unsafe fn encode(
21587            self,
21588            encoder: &mut fidl::encoding::Encoder<
21589                '_,
21590                fidl::encoding::DefaultFuchsiaResourceDialect,
21591            >,
21592            offset: usize,
21593            _depth: fidl::encoding::Depth,
21594        ) -> fidl::Result<()> {
21595            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
21596            // Delegate to tuple encoding.
21597            fidl::encoding::Encode::<
21598                DirectoryLinkRequest,
21599                fidl::encoding::DefaultFuchsiaResourceDialect,
21600            >::encode(
21601                (
21602                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21603                        &self.src,
21604                    ),
21605                    <fidl::encoding::HandleType<
21606                        fidl::Handle,
21607                        { fidl::ObjectType::NONE.into_raw() },
21608                        2147483648,
21609                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21610                        &mut self.dst_parent_token,
21611                    ),
21612                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21613                        &self.dst,
21614                    ),
21615                ),
21616                encoder,
21617                offset,
21618                _depth,
21619            )
21620        }
21621    }
21622    unsafe impl<
21623            T0: fidl::encoding::Encode<
21624                fidl::encoding::BoundedString<255>,
21625                fidl::encoding::DefaultFuchsiaResourceDialect,
21626            >,
21627            T1: fidl::encoding::Encode<
21628                fidl::encoding::HandleType<
21629                    fidl::Handle,
21630                    { fidl::ObjectType::NONE.into_raw() },
21631                    2147483648,
21632                >,
21633                fidl::encoding::DefaultFuchsiaResourceDialect,
21634            >,
21635            T2: fidl::encoding::Encode<
21636                fidl::encoding::BoundedString<255>,
21637                fidl::encoding::DefaultFuchsiaResourceDialect,
21638            >,
21639        >
21640        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21641        for (T0, T1, T2)
21642    {
21643        #[inline]
21644        unsafe fn encode(
21645            self,
21646            encoder: &mut fidl::encoding::Encoder<
21647                '_,
21648                fidl::encoding::DefaultFuchsiaResourceDialect,
21649            >,
21650            offset: usize,
21651            depth: fidl::encoding::Depth,
21652        ) -> fidl::Result<()> {
21653            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
21654            // Zero out padding regions. There's no need to apply masks
21655            // because the unmasked parts will be overwritten by fields.
21656            unsafe {
21657                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21658                (ptr as *mut u64).write_unaligned(0);
21659            }
21660            // Write the fields.
21661            self.0.encode(encoder, offset + 0, depth)?;
21662            self.1.encode(encoder, offset + 16, depth)?;
21663            self.2.encode(encoder, offset + 24, depth)?;
21664            Ok(())
21665        }
21666    }
21667
21668    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21669        for DirectoryLinkRequest
21670    {
21671        #[inline(always)]
21672        fn new_empty() -> Self {
21673            Self {
21674                src: fidl::new_empty!(
21675                    fidl::encoding::BoundedString<255>,
21676                    fidl::encoding::DefaultFuchsiaResourceDialect
21677                ),
21678                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21679                dst: fidl::new_empty!(
21680                    fidl::encoding::BoundedString<255>,
21681                    fidl::encoding::DefaultFuchsiaResourceDialect
21682                ),
21683            }
21684        }
21685
21686        #[inline]
21687        unsafe fn decode(
21688            &mut self,
21689            decoder: &mut fidl::encoding::Decoder<
21690                '_,
21691                fidl::encoding::DefaultFuchsiaResourceDialect,
21692            >,
21693            offset: usize,
21694            _depth: fidl::encoding::Depth,
21695        ) -> fidl::Result<()> {
21696            decoder.debug_check_bounds::<Self>(offset);
21697            // Verify that padding bytes are zero.
21698            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21699            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21700            let mask = 0xffffffff00000000u64;
21701            let maskedval = padval & mask;
21702            if maskedval != 0 {
21703                return Err(fidl::Error::NonZeroPadding {
21704                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21705                });
21706            }
21707            fidl::decode!(
21708                fidl::encoding::BoundedString<255>,
21709                fidl::encoding::DefaultFuchsiaResourceDialect,
21710                &mut self.src,
21711                decoder,
21712                offset + 0,
21713                _depth
21714            )?;
21715            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)?;
21716            fidl::decode!(
21717                fidl::encoding::BoundedString<255>,
21718                fidl::encoding::DefaultFuchsiaResourceDialect,
21719                &mut self.dst,
21720                decoder,
21721                offset + 24,
21722                _depth
21723            )?;
21724            Ok(())
21725        }
21726    }
21727
21728    impl fidl::encoding::ResourceTypeMarker for DirectoryOpenRequest {
21729        type Borrowed<'a> = &'a mut Self;
21730        fn take_or_borrow<'a>(
21731            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21732        ) -> Self::Borrowed<'a> {
21733            value
21734        }
21735    }
21736
21737    unsafe impl fidl::encoding::TypeMarker for DirectoryOpenRequest {
21738        type Owned = Self;
21739
21740        #[inline(always)]
21741        fn inline_align(_context: fidl::encoding::Context) -> usize {
21742            8
21743        }
21744
21745        #[inline(always)]
21746        fn inline_size(_context: fidl::encoding::Context) -> usize {
21747            48
21748        }
21749    }
21750
21751    unsafe impl
21752        fidl::encoding::Encode<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21753        for &mut DirectoryOpenRequest
21754    {
21755        #[inline]
21756        unsafe fn encode(
21757            self,
21758            encoder: &mut fidl::encoding::Encoder<
21759                '_,
21760                fidl::encoding::DefaultFuchsiaResourceDialect,
21761            >,
21762            offset: usize,
21763            _depth: fidl::encoding::Depth,
21764        ) -> fidl::Result<()> {
21765            encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
21766            // Delegate to tuple encoding.
21767            fidl::encoding::Encode::<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21768                (
21769                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
21770                    <Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
21771                    <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
21772                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
21773                ),
21774                encoder, offset, _depth
21775            )
21776        }
21777    }
21778    unsafe impl<
21779            T0: fidl::encoding::Encode<
21780                fidl::encoding::BoundedString<4095>,
21781                fidl::encoding::DefaultFuchsiaResourceDialect,
21782            >,
21783            T1: fidl::encoding::Encode<Flags, fidl::encoding::DefaultFuchsiaResourceDialect>,
21784            T2: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
21785            T3: fidl::encoding::Encode<
21786                fidl::encoding::HandleType<
21787                    fidl::Channel,
21788                    { fidl::ObjectType::CHANNEL.into_raw() },
21789                    2147483648,
21790                >,
21791                fidl::encoding::DefaultFuchsiaResourceDialect,
21792            >,
21793        >
21794        fidl::encoding::Encode<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21795        for (T0, T1, T2, T3)
21796    {
21797        #[inline]
21798        unsafe fn encode(
21799            self,
21800            encoder: &mut fidl::encoding::Encoder<
21801                '_,
21802                fidl::encoding::DefaultFuchsiaResourceDialect,
21803            >,
21804            offset: usize,
21805            depth: fidl::encoding::Depth,
21806        ) -> fidl::Result<()> {
21807            encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
21808            // Zero out padding regions. There's no need to apply masks
21809            // because the unmasked parts will be overwritten by fields.
21810            unsafe {
21811                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
21812                (ptr as *mut u64).write_unaligned(0);
21813            }
21814            // Write the fields.
21815            self.0.encode(encoder, offset + 0, depth)?;
21816            self.1.encode(encoder, offset + 16, depth)?;
21817            self.2.encode(encoder, offset + 24, depth)?;
21818            self.3.encode(encoder, offset + 40, depth)?;
21819            Ok(())
21820        }
21821    }
21822
21823    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21824        for DirectoryOpenRequest
21825    {
21826        #[inline(always)]
21827        fn new_empty() -> Self {
21828            Self {
21829                path: fidl::new_empty!(
21830                    fidl::encoding::BoundedString<4095>,
21831                    fidl::encoding::DefaultFuchsiaResourceDialect
21832                ),
21833                flags: fidl::new_empty!(Flags, fidl::encoding::DefaultFuchsiaResourceDialect),
21834                options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
21835                object: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21836            }
21837        }
21838
21839        #[inline]
21840        unsafe fn decode(
21841            &mut self,
21842            decoder: &mut fidl::encoding::Decoder<
21843                '_,
21844                fidl::encoding::DefaultFuchsiaResourceDialect,
21845            >,
21846            offset: usize,
21847            _depth: fidl::encoding::Depth,
21848        ) -> fidl::Result<()> {
21849            decoder.debug_check_bounds::<Self>(offset);
21850            // Verify that padding bytes are zero.
21851            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
21852            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21853            let mask = 0xffffffff00000000u64;
21854            let maskedval = padval & mask;
21855            if maskedval != 0 {
21856                return Err(fidl::Error::NonZeroPadding {
21857                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
21858                });
21859            }
21860            fidl::decode!(
21861                fidl::encoding::BoundedString<4095>,
21862                fidl::encoding::DefaultFuchsiaResourceDialect,
21863                &mut self.path,
21864                decoder,
21865                offset + 0,
21866                _depth
21867            )?;
21868            fidl::decode!(
21869                Flags,
21870                fidl::encoding::DefaultFuchsiaResourceDialect,
21871                &mut self.flags,
21872                decoder,
21873                offset + 16,
21874                _depth
21875            )?;
21876            fidl::decode!(
21877                Options,
21878                fidl::encoding::DefaultFuchsiaResourceDialect,
21879                &mut self.options,
21880                decoder,
21881                offset + 24,
21882                _depth
21883            )?;
21884            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.object, decoder, offset + 40, _depth)?;
21885            Ok(())
21886        }
21887    }
21888
21889    impl fidl::encoding::ResourceTypeMarker for DirectoryRenameRequest {
21890        type Borrowed<'a> = &'a mut Self;
21891        fn take_or_borrow<'a>(
21892            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21893        ) -> Self::Borrowed<'a> {
21894            value
21895        }
21896    }
21897
21898    unsafe impl fidl::encoding::TypeMarker for DirectoryRenameRequest {
21899        type Owned = Self;
21900
21901        #[inline(always)]
21902        fn inline_align(_context: fidl::encoding::Context) -> usize {
21903            8
21904        }
21905
21906        #[inline(always)]
21907        fn inline_size(_context: fidl::encoding::Context) -> usize {
21908            40
21909        }
21910    }
21911
21912    unsafe impl
21913        fidl::encoding::Encode<
21914            DirectoryRenameRequest,
21915            fidl::encoding::DefaultFuchsiaResourceDialect,
21916        > for &mut DirectoryRenameRequest
21917    {
21918        #[inline]
21919        unsafe fn encode(
21920            self,
21921            encoder: &mut fidl::encoding::Encoder<
21922                '_,
21923                fidl::encoding::DefaultFuchsiaResourceDialect,
21924            >,
21925            offset: usize,
21926            _depth: fidl::encoding::Depth,
21927        ) -> fidl::Result<()> {
21928            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
21929            // Delegate to tuple encoding.
21930            fidl::encoding::Encode::<
21931                DirectoryRenameRequest,
21932                fidl::encoding::DefaultFuchsiaResourceDialect,
21933            >::encode(
21934                (
21935                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21936                        &self.src,
21937                    ),
21938                    <fidl::encoding::HandleType<
21939                        fidl::Event,
21940                        { fidl::ObjectType::EVENT.into_raw() },
21941                        2147483648,
21942                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21943                        &mut self.dst_parent_token,
21944                    ),
21945                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21946                        &self.dst,
21947                    ),
21948                ),
21949                encoder,
21950                offset,
21951                _depth,
21952            )
21953        }
21954    }
21955    unsafe impl<
21956            T0: fidl::encoding::Encode<
21957                fidl::encoding::BoundedString<255>,
21958                fidl::encoding::DefaultFuchsiaResourceDialect,
21959            >,
21960            T1: fidl::encoding::Encode<
21961                fidl::encoding::HandleType<
21962                    fidl::Event,
21963                    { fidl::ObjectType::EVENT.into_raw() },
21964                    2147483648,
21965                >,
21966                fidl::encoding::DefaultFuchsiaResourceDialect,
21967            >,
21968            T2: fidl::encoding::Encode<
21969                fidl::encoding::BoundedString<255>,
21970                fidl::encoding::DefaultFuchsiaResourceDialect,
21971            >,
21972        >
21973        fidl::encoding::Encode<
21974            DirectoryRenameRequest,
21975            fidl::encoding::DefaultFuchsiaResourceDialect,
21976        > for (T0, T1, T2)
21977    {
21978        #[inline]
21979        unsafe fn encode(
21980            self,
21981            encoder: &mut fidl::encoding::Encoder<
21982                '_,
21983                fidl::encoding::DefaultFuchsiaResourceDialect,
21984            >,
21985            offset: usize,
21986            depth: fidl::encoding::Depth,
21987        ) -> fidl::Result<()> {
21988            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
21989            // Zero out padding regions. There's no need to apply masks
21990            // because the unmasked parts will be overwritten by fields.
21991            unsafe {
21992                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21993                (ptr as *mut u64).write_unaligned(0);
21994            }
21995            // Write the fields.
21996            self.0.encode(encoder, offset + 0, depth)?;
21997            self.1.encode(encoder, offset + 16, depth)?;
21998            self.2.encode(encoder, offset + 24, depth)?;
21999            Ok(())
22000        }
22001    }
22002
22003    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22004        for DirectoryRenameRequest
22005    {
22006        #[inline(always)]
22007        fn new_empty() -> Self {
22008            Self {
22009                src: fidl::new_empty!(
22010                    fidl::encoding::BoundedString<255>,
22011                    fidl::encoding::DefaultFuchsiaResourceDialect
22012                ),
22013                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22014                dst: fidl::new_empty!(
22015                    fidl::encoding::BoundedString<255>,
22016                    fidl::encoding::DefaultFuchsiaResourceDialect
22017                ),
22018            }
22019        }
22020
22021        #[inline]
22022        unsafe fn decode(
22023            &mut self,
22024            decoder: &mut fidl::encoding::Decoder<
22025                '_,
22026                fidl::encoding::DefaultFuchsiaResourceDialect,
22027            >,
22028            offset: usize,
22029            _depth: fidl::encoding::Depth,
22030        ) -> fidl::Result<()> {
22031            decoder.debug_check_bounds::<Self>(offset);
22032            // Verify that padding bytes are zero.
22033            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
22034            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22035            let mask = 0xffffffff00000000u64;
22036            let maskedval = padval & mask;
22037            if maskedval != 0 {
22038                return Err(fidl::Error::NonZeroPadding {
22039                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
22040                });
22041            }
22042            fidl::decode!(
22043                fidl::encoding::BoundedString<255>,
22044                fidl::encoding::DefaultFuchsiaResourceDialect,
22045                &mut self.src,
22046                decoder,
22047                offset + 0,
22048                _depth
22049            )?;
22050            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)?;
22051            fidl::decode!(
22052                fidl::encoding::BoundedString<255>,
22053                fidl::encoding::DefaultFuchsiaResourceDialect,
22054                &mut self.dst,
22055                decoder,
22056                offset + 24,
22057                _depth
22058            )?;
22059            Ok(())
22060        }
22061    }
22062
22063    impl fidl::encoding::ResourceTypeMarker for DirectoryWatchRequest {
22064        type Borrowed<'a> = &'a mut Self;
22065        fn take_or_borrow<'a>(
22066            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22067        ) -> Self::Borrowed<'a> {
22068            value
22069        }
22070    }
22071
22072    unsafe impl fidl::encoding::TypeMarker for DirectoryWatchRequest {
22073        type Owned = Self;
22074
22075        #[inline(always)]
22076        fn inline_align(_context: fidl::encoding::Context) -> usize {
22077            4
22078        }
22079
22080        #[inline(always)]
22081        fn inline_size(_context: fidl::encoding::Context) -> usize {
22082            12
22083        }
22084    }
22085
22086    unsafe impl
22087        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22088        for &mut DirectoryWatchRequest
22089    {
22090        #[inline]
22091        unsafe fn encode(
22092            self,
22093            encoder: &mut fidl::encoding::Encoder<
22094                '_,
22095                fidl::encoding::DefaultFuchsiaResourceDialect,
22096            >,
22097            offset: usize,
22098            _depth: fidl::encoding::Depth,
22099        ) -> fidl::Result<()> {
22100            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
22101            // Delegate to tuple encoding.
22102            fidl::encoding::Encode::<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22103                (
22104                    <WatchMask as fidl::encoding::ValueTypeMarker>::borrow(&self.mask),
22105                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
22106                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
22107                ),
22108                encoder, offset, _depth
22109            )
22110        }
22111    }
22112    unsafe impl<
22113            T0: fidl::encoding::Encode<WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect>,
22114            T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
22115            T2: fidl::encoding::Encode<
22116                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
22117                fidl::encoding::DefaultFuchsiaResourceDialect,
22118            >,
22119        >
22120        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22121        for (T0, T1, T2)
22122    {
22123        #[inline]
22124        unsafe fn encode(
22125            self,
22126            encoder: &mut fidl::encoding::Encoder<
22127                '_,
22128                fidl::encoding::DefaultFuchsiaResourceDialect,
22129            >,
22130            offset: usize,
22131            depth: fidl::encoding::Depth,
22132        ) -> fidl::Result<()> {
22133            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
22134            // Zero out padding regions. There's no need to apply masks
22135            // because the unmasked parts will be overwritten by fields.
22136            // Write the fields.
22137            self.0.encode(encoder, offset + 0, depth)?;
22138            self.1.encode(encoder, offset + 4, depth)?;
22139            self.2.encode(encoder, offset + 8, depth)?;
22140            Ok(())
22141        }
22142    }
22143
22144    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22145        for DirectoryWatchRequest
22146    {
22147        #[inline(always)]
22148        fn new_empty() -> Self {
22149            Self {
22150                mask: fidl::new_empty!(WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect),
22151                options: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
22152                watcher: fidl::new_empty!(
22153                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
22154                    fidl::encoding::DefaultFuchsiaResourceDialect
22155                ),
22156            }
22157        }
22158
22159        #[inline]
22160        unsafe fn decode(
22161            &mut self,
22162            decoder: &mut fidl::encoding::Decoder<
22163                '_,
22164                fidl::encoding::DefaultFuchsiaResourceDialect,
22165            >,
22166            offset: usize,
22167            _depth: fidl::encoding::Depth,
22168        ) -> fidl::Result<()> {
22169            decoder.debug_check_bounds::<Self>(offset);
22170            // Verify that padding bytes are zero.
22171            fidl::decode!(
22172                WatchMask,
22173                fidl::encoding::DefaultFuchsiaResourceDialect,
22174                &mut self.mask,
22175                decoder,
22176                offset + 0,
22177                _depth
22178            )?;
22179            fidl::decode!(
22180                u32,
22181                fidl::encoding::DefaultFuchsiaResourceDialect,
22182                &mut self.options,
22183                decoder,
22184                offset + 4,
22185                _depth
22186            )?;
22187            fidl::decode!(
22188                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
22189                fidl::encoding::DefaultFuchsiaResourceDialect,
22190                &mut self.watcher,
22191                decoder,
22192                offset + 8,
22193                _depth
22194            )?;
22195            Ok(())
22196        }
22197    }
22198
22199    impl fidl::encoding::ResourceTypeMarker for FileAllocateRequest {
22200        type Borrowed<'a> = &'a mut Self;
22201        fn take_or_borrow<'a>(
22202            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22203        ) -> Self::Borrowed<'a> {
22204            value
22205        }
22206    }
22207
22208    unsafe impl fidl::encoding::TypeMarker for FileAllocateRequest {
22209        type Owned = Self;
22210
22211        #[inline(always)]
22212        fn inline_align(_context: fidl::encoding::Context) -> usize {
22213            8
22214        }
22215
22216        #[inline(always)]
22217        fn inline_size(_context: fidl::encoding::Context) -> usize {
22218            24
22219        }
22220    }
22221
22222    unsafe impl
22223        fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22224        for &mut FileAllocateRequest
22225    {
22226        #[inline]
22227        unsafe fn encode(
22228            self,
22229            encoder: &mut fidl::encoding::Encoder<
22230                '_,
22231                fidl::encoding::DefaultFuchsiaResourceDialect,
22232            >,
22233            offset: usize,
22234            _depth: fidl::encoding::Depth,
22235        ) -> fidl::Result<()> {
22236            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
22237            // Delegate to tuple encoding.
22238            fidl::encoding::Encode::<
22239                FileAllocateRequest,
22240                fidl::encoding::DefaultFuchsiaResourceDialect,
22241            >::encode(
22242                (
22243                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
22244                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
22245                    <AllocateMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
22246                ),
22247                encoder,
22248                offset,
22249                _depth,
22250            )
22251        }
22252    }
22253    unsafe impl<
22254            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
22255            T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
22256            T2: fidl::encoding::Encode<AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect>,
22257        >
22258        fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22259        for (T0, T1, T2)
22260    {
22261        #[inline]
22262        unsafe fn encode(
22263            self,
22264            encoder: &mut fidl::encoding::Encoder<
22265                '_,
22266                fidl::encoding::DefaultFuchsiaResourceDialect,
22267            >,
22268            offset: usize,
22269            depth: fidl::encoding::Depth,
22270        ) -> fidl::Result<()> {
22271            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
22272            // Zero out padding regions. There's no need to apply masks
22273            // because the unmasked parts will be overwritten by fields.
22274            unsafe {
22275                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
22276                (ptr as *mut u64).write_unaligned(0);
22277            }
22278            // Write the fields.
22279            self.0.encode(encoder, offset + 0, depth)?;
22280            self.1.encode(encoder, offset + 8, depth)?;
22281            self.2.encode(encoder, offset + 16, depth)?;
22282            Ok(())
22283        }
22284    }
22285
22286    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22287        for FileAllocateRequest
22288    {
22289        #[inline(always)]
22290        fn new_empty() -> Self {
22291            Self {
22292                offset: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
22293                length: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
22294                mode: fidl::new_empty!(AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect),
22295            }
22296        }
22297
22298        #[inline]
22299        unsafe fn decode(
22300            &mut self,
22301            decoder: &mut fidl::encoding::Decoder<
22302                '_,
22303                fidl::encoding::DefaultFuchsiaResourceDialect,
22304            >,
22305            offset: usize,
22306            _depth: fidl::encoding::Depth,
22307        ) -> fidl::Result<()> {
22308            decoder.debug_check_bounds::<Self>(offset);
22309            // Verify that padding bytes are zero.
22310            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
22311            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22312            let mask = 0xffffffff00000000u64;
22313            let maskedval = padval & mask;
22314            if maskedval != 0 {
22315                return Err(fidl::Error::NonZeroPadding {
22316                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
22317                });
22318            }
22319            fidl::decode!(
22320                u64,
22321                fidl::encoding::DefaultFuchsiaResourceDialect,
22322                &mut self.offset,
22323                decoder,
22324                offset + 0,
22325                _depth
22326            )?;
22327            fidl::decode!(
22328                u64,
22329                fidl::encoding::DefaultFuchsiaResourceDialect,
22330                &mut self.length,
22331                decoder,
22332                offset + 8,
22333                _depth
22334            )?;
22335            fidl::decode!(
22336                AllocateMode,
22337                fidl::encoding::DefaultFuchsiaResourceDialect,
22338                &mut self.mode,
22339                decoder,
22340                offset + 16,
22341                _depth
22342            )?;
22343            Ok(())
22344        }
22345    }
22346
22347    impl fidl::encoding::ResourceTypeMarker for FileEnableVerityRequest {
22348        type Borrowed<'a> = &'a mut Self;
22349        fn take_or_borrow<'a>(
22350            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22351        ) -> Self::Borrowed<'a> {
22352            value
22353        }
22354    }
22355
22356    unsafe impl fidl::encoding::TypeMarker for FileEnableVerityRequest {
22357        type Owned = Self;
22358
22359        #[inline(always)]
22360        fn inline_align(_context: fidl::encoding::Context) -> usize {
22361            8
22362        }
22363
22364        #[inline(always)]
22365        fn inline_size(_context: fidl::encoding::Context) -> usize {
22366            16
22367        }
22368    }
22369
22370    unsafe impl
22371        fidl::encoding::Encode<
22372            FileEnableVerityRequest,
22373            fidl::encoding::DefaultFuchsiaResourceDialect,
22374        > for &mut FileEnableVerityRequest
22375    {
22376        #[inline]
22377        unsafe fn encode(
22378            self,
22379            encoder: &mut fidl::encoding::Encoder<
22380                '_,
22381                fidl::encoding::DefaultFuchsiaResourceDialect,
22382            >,
22383            offset: usize,
22384            _depth: fidl::encoding::Depth,
22385        ) -> fidl::Result<()> {
22386            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
22387            // Delegate to tuple encoding.
22388            fidl::encoding::Encode::<
22389                FileEnableVerityRequest,
22390                fidl::encoding::DefaultFuchsiaResourceDialect,
22391            >::encode(
22392                (<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
22393                encoder,
22394                offset,
22395                _depth,
22396            )
22397        }
22398    }
22399    unsafe impl<
22400            T0: fidl::encoding::Encode<
22401                VerificationOptions,
22402                fidl::encoding::DefaultFuchsiaResourceDialect,
22403            >,
22404        >
22405        fidl::encoding::Encode<
22406            FileEnableVerityRequest,
22407            fidl::encoding::DefaultFuchsiaResourceDialect,
22408        > for (T0,)
22409    {
22410        #[inline]
22411        unsafe fn encode(
22412            self,
22413            encoder: &mut fidl::encoding::Encoder<
22414                '_,
22415                fidl::encoding::DefaultFuchsiaResourceDialect,
22416            >,
22417            offset: usize,
22418            depth: fidl::encoding::Depth,
22419        ) -> fidl::Result<()> {
22420            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
22421            // Zero out padding regions. There's no need to apply masks
22422            // because the unmasked parts will be overwritten by fields.
22423            // Write the fields.
22424            self.0.encode(encoder, offset + 0, depth)?;
22425            Ok(())
22426        }
22427    }
22428
22429    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22430        for FileEnableVerityRequest
22431    {
22432        #[inline(always)]
22433        fn new_empty() -> Self {
22434            Self {
22435                options: fidl::new_empty!(
22436                    VerificationOptions,
22437                    fidl::encoding::DefaultFuchsiaResourceDialect
22438                ),
22439            }
22440        }
22441
22442        #[inline]
22443        unsafe fn decode(
22444            &mut self,
22445            decoder: &mut fidl::encoding::Decoder<
22446                '_,
22447                fidl::encoding::DefaultFuchsiaResourceDialect,
22448            >,
22449            offset: usize,
22450            _depth: fidl::encoding::Depth,
22451        ) -> fidl::Result<()> {
22452            decoder.debug_check_bounds::<Self>(offset);
22453            // Verify that padding bytes are zero.
22454            fidl::decode!(
22455                VerificationOptions,
22456                fidl::encoding::DefaultFuchsiaResourceDialect,
22457                &mut self.options,
22458                decoder,
22459                offset + 0,
22460                _depth
22461            )?;
22462            Ok(())
22463        }
22464    }
22465
22466    impl fidl::encoding::ResourceTypeMarker for FileObject {
22467        type Borrowed<'a> = &'a mut Self;
22468        fn take_or_borrow<'a>(
22469            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22470        ) -> Self::Borrowed<'a> {
22471            value
22472        }
22473    }
22474
22475    unsafe impl fidl::encoding::TypeMarker for FileObject {
22476        type Owned = Self;
22477
22478        #[inline(always)]
22479        fn inline_align(_context: fidl::encoding::Context) -> usize {
22480            4
22481        }
22482
22483        #[inline(always)]
22484        fn inline_size(_context: fidl::encoding::Context) -> usize {
22485            8
22486        }
22487    }
22488
22489    unsafe impl fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
22490        for &mut FileObject
22491    {
22492        #[inline]
22493        unsafe fn encode(
22494            self,
22495            encoder: &mut fidl::encoding::Encoder<
22496                '_,
22497                fidl::encoding::DefaultFuchsiaResourceDialect,
22498            >,
22499            offset: usize,
22500            _depth: fidl::encoding::Depth,
22501        ) -> fidl::Result<()> {
22502            encoder.debug_check_bounds::<FileObject>(offset);
22503            // Delegate to tuple encoding.
22504            fidl::encoding::Encode::<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22505                (
22506                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.event),
22507                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stream),
22508                ),
22509                encoder, offset, _depth
22510            )
22511        }
22512    }
22513    unsafe impl<
22514            T0: fidl::encoding::Encode<
22515                fidl::encoding::Optional<
22516                    fidl::encoding::HandleType<
22517                        fidl::Event,
22518                        { fidl::ObjectType::EVENT.into_raw() },
22519                        2147483648,
22520                    >,
22521                >,
22522                fidl::encoding::DefaultFuchsiaResourceDialect,
22523            >,
22524            T1: fidl::encoding::Encode<
22525                fidl::encoding::Optional<
22526                    fidl::encoding::HandleType<
22527                        fidl::Stream,
22528                        { fidl::ObjectType::STREAM.into_raw() },
22529                        2147483648,
22530                    >,
22531                >,
22532                fidl::encoding::DefaultFuchsiaResourceDialect,
22533            >,
22534        > fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
22535        for (T0, T1)
22536    {
22537        #[inline]
22538        unsafe fn encode(
22539            self,
22540            encoder: &mut fidl::encoding::Encoder<
22541                '_,
22542                fidl::encoding::DefaultFuchsiaResourceDialect,
22543            >,
22544            offset: usize,
22545            depth: fidl::encoding::Depth,
22546        ) -> fidl::Result<()> {
22547            encoder.debug_check_bounds::<FileObject>(offset);
22548            // Zero out padding regions. There's no need to apply masks
22549            // because the unmasked parts will be overwritten by fields.
22550            // Write the fields.
22551            self.0.encode(encoder, offset + 0, depth)?;
22552            self.1.encode(encoder, offset + 4, depth)?;
22553            Ok(())
22554        }
22555    }
22556
22557    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileObject {
22558        #[inline(always)]
22559        fn new_empty() -> Self {
22560            Self {
22561                event: fidl::new_empty!(
22562                    fidl::encoding::Optional<
22563                        fidl::encoding::HandleType<
22564                            fidl::Event,
22565                            { fidl::ObjectType::EVENT.into_raw() },
22566                            2147483648,
22567                        >,
22568                    >,
22569                    fidl::encoding::DefaultFuchsiaResourceDialect
22570                ),
22571                stream: fidl::new_empty!(
22572                    fidl::encoding::Optional<
22573                        fidl::encoding::HandleType<
22574                            fidl::Stream,
22575                            { fidl::ObjectType::STREAM.into_raw() },
22576                            2147483648,
22577                        >,
22578                    >,
22579                    fidl::encoding::DefaultFuchsiaResourceDialect
22580                ),
22581            }
22582        }
22583
22584        #[inline]
22585        unsafe fn decode(
22586            &mut self,
22587            decoder: &mut fidl::encoding::Decoder<
22588                '_,
22589                fidl::encoding::DefaultFuchsiaResourceDialect,
22590            >,
22591            offset: usize,
22592            _depth: fidl::encoding::Depth,
22593        ) -> fidl::Result<()> {
22594            decoder.debug_check_bounds::<Self>(offset);
22595            // Verify that padding bytes are zero.
22596            fidl::decode!(
22597                fidl::encoding::Optional<
22598                    fidl::encoding::HandleType<
22599                        fidl::Event,
22600                        { fidl::ObjectType::EVENT.into_raw() },
22601                        2147483648,
22602                    >,
22603                >,
22604                fidl::encoding::DefaultFuchsiaResourceDialect,
22605                &mut self.event,
22606                decoder,
22607                offset + 0,
22608                _depth
22609            )?;
22610            fidl::decode!(
22611                fidl::encoding::Optional<
22612                    fidl::encoding::HandleType<
22613                        fidl::Stream,
22614                        { fidl::ObjectType::STREAM.into_raw() },
22615                        2147483648,
22616                    >,
22617                >,
22618                fidl::encoding::DefaultFuchsiaResourceDialect,
22619                &mut self.stream,
22620                decoder,
22621                offset + 4,
22622                _depth
22623            )?;
22624            Ok(())
22625        }
22626    }
22627
22628    impl fidl::encoding::ResourceTypeMarker for FileGetBackingMemoryResponse {
22629        type Borrowed<'a> = &'a mut Self;
22630        fn take_or_borrow<'a>(
22631            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22632        ) -> Self::Borrowed<'a> {
22633            value
22634        }
22635    }
22636
22637    unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryResponse {
22638        type Owned = Self;
22639
22640        #[inline(always)]
22641        fn inline_align(_context: fidl::encoding::Context) -> usize {
22642            4
22643        }
22644
22645        #[inline(always)]
22646        fn inline_size(_context: fidl::encoding::Context) -> usize {
22647            4
22648        }
22649    }
22650
22651    unsafe impl
22652        fidl::encoding::Encode<
22653            FileGetBackingMemoryResponse,
22654            fidl::encoding::DefaultFuchsiaResourceDialect,
22655        > for &mut FileGetBackingMemoryResponse
22656    {
22657        #[inline]
22658        unsafe fn encode(
22659            self,
22660            encoder: &mut fidl::encoding::Encoder<
22661                '_,
22662                fidl::encoding::DefaultFuchsiaResourceDialect,
22663            >,
22664            offset: usize,
22665            _depth: fidl::encoding::Depth,
22666        ) -> fidl::Result<()> {
22667            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
22668            // Delegate to tuple encoding.
22669            fidl::encoding::Encode::<
22670                FileGetBackingMemoryResponse,
22671                fidl::encoding::DefaultFuchsiaResourceDialect,
22672            >::encode(
22673                (<fidl::encoding::HandleType<
22674                    fidl::Vmo,
22675                    { fidl::ObjectType::VMO.into_raw() },
22676                    2147483648,
22677                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22678                    &mut self.vmo
22679                ),),
22680                encoder,
22681                offset,
22682                _depth,
22683            )
22684        }
22685    }
22686    unsafe impl<
22687            T0: fidl::encoding::Encode<
22688                fidl::encoding::HandleType<
22689                    fidl::Vmo,
22690                    { fidl::ObjectType::VMO.into_raw() },
22691                    2147483648,
22692                >,
22693                fidl::encoding::DefaultFuchsiaResourceDialect,
22694            >,
22695        >
22696        fidl::encoding::Encode<
22697            FileGetBackingMemoryResponse,
22698            fidl::encoding::DefaultFuchsiaResourceDialect,
22699        > for (T0,)
22700    {
22701        #[inline]
22702        unsafe fn encode(
22703            self,
22704            encoder: &mut fidl::encoding::Encoder<
22705                '_,
22706                fidl::encoding::DefaultFuchsiaResourceDialect,
22707            >,
22708            offset: usize,
22709            depth: fidl::encoding::Depth,
22710        ) -> fidl::Result<()> {
22711            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
22712            // Zero out padding regions. There's no need to apply masks
22713            // because the unmasked parts will be overwritten by fields.
22714            // Write the fields.
22715            self.0.encode(encoder, offset + 0, depth)?;
22716            Ok(())
22717        }
22718    }
22719
22720    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22721        for FileGetBackingMemoryResponse
22722    {
22723        #[inline(always)]
22724        fn new_empty() -> Self {
22725            Self {
22726                vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22727            }
22728        }
22729
22730        #[inline]
22731        unsafe fn decode(
22732            &mut self,
22733            decoder: &mut fidl::encoding::Decoder<
22734                '_,
22735                fidl::encoding::DefaultFuchsiaResourceDialect,
22736            >,
22737            offset: usize,
22738            _depth: fidl::encoding::Depth,
22739        ) -> fidl::Result<()> {
22740            decoder.debug_check_bounds::<Self>(offset);
22741            // Verify that padding bytes are zero.
22742            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
22743            Ok(())
22744        }
22745    }
22746
22747    impl fidl::encoding::ResourceTypeMarker for LinkableLinkIntoRequest {
22748        type Borrowed<'a> = &'a mut Self;
22749        fn take_or_borrow<'a>(
22750            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22751        ) -> Self::Borrowed<'a> {
22752            value
22753        }
22754    }
22755
22756    unsafe impl fidl::encoding::TypeMarker for LinkableLinkIntoRequest {
22757        type Owned = Self;
22758
22759        #[inline(always)]
22760        fn inline_align(_context: fidl::encoding::Context) -> usize {
22761            8
22762        }
22763
22764        #[inline(always)]
22765        fn inline_size(_context: fidl::encoding::Context) -> usize {
22766            24
22767        }
22768    }
22769
22770    unsafe impl
22771        fidl::encoding::Encode<
22772            LinkableLinkIntoRequest,
22773            fidl::encoding::DefaultFuchsiaResourceDialect,
22774        > for &mut LinkableLinkIntoRequest
22775    {
22776        #[inline]
22777        unsafe fn encode(
22778            self,
22779            encoder: &mut fidl::encoding::Encoder<
22780                '_,
22781                fidl::encoding::DefaultFuchsiaResourceDialect,
22782            >,
22783            offset: usize,
22784            _depth: fidl::encoding::Depth,
22785        ) -> fidl::Result<()> {
22786            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
22787            // Delegate to tuple encoding.
22788            fidl::encoding::Encode::<
22789                LinkableLinkIntoRequest,
22790                fidl::encoding::DefaultFuchsiaResourceDialect,
22791            >::encode(
22792                (
22793                    <fidl::encoding::HandleType<
22794                        fidl::Event,
22795                        { fidl::ObjectType::EVENT.into_raw() },
22796                        2147483648,
22797                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22798                        &mut self.dst_parent_token,
22799                    ),
22800                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
22801                        &self.dst,
22802                    ),
22803                ),
22804                encoder,
22805                offset,
22806                _depth,
22807            )
22808        }
22809    }
22810    unsafe impl<
22811            T0: fidl::encoding::Encode<
22812                fidl::encoding::HandleType<
22813                    fidl::Event,
22814                    { fidl::ObjectType::EVENT.into_raw() },
22815                    2147483648,
22816                >,
22817                fidl::encoding::DefaultFuchsiaResourceDialect,
22818            >,
22819            T1: fidl::encoding::Encode<
22820                fidl::encoding::BoundedString<255>,
22821                fidl::encoding::DefaultFuchsiaResourceDialect,
22822            >,
22823        >
22824        fidl::encoding::Encode<
22825            LinkableLinkIntoRequest,
22826            fidl::encoding::DefaultFuchsiaResourceDialect,
22827        > for (T0, T1)
22828    {
22829        #[inline]
22830        unsafe fn encode(
22831            self,
22832            encoder: &mut fidl::encoding::Encoder<
22833                '_,
22834                fidl::encoding::DefaultFuchsiaResourceDialect,
22835            >,
22836            offset: usize,
22837            depth: fidl::encoding::Depth,
22838        ) -> fidl::Result<()> {
22839            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
22840            // Zero out padding regions. There's no need to apply masks
22841            // because the unmasked parts will be overwritten by fields.
22842            unsafe {
22843                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
22844                (ptr as *mut u64).write_unaligned(0);
22845            }
22846            // Write the fields.
22847            self.0.encode(encoder, offset + 0, depth)?;
22848            self.1.encode(encoder, offset + 8, depth)?;
22849            Ok(())
22850        }
22851    }
22852
22853    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22854        for LinkableLinkIntoRequest
22855    {
22856        #[inline(always)]
22857        fn new_empty() -> Self {
22858            Self {
22859                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22860                dst: fidl::new_empty!(
22861                    fidl::encoding::BoundedString<255>,
22862                    fidl::encoding::DefaultFuchsiaResourceDialect
22863                ),
22864            }
22865        }
22866
22867        #[inline]
22868        unsafe fn decode(
22869            &mut self,
22870            decoder: &mut fidl::encoding::Decoder<
22871                '_,
22872                fidl::encoding::DefaultFuchsiaResourceDialect,
22873            >,
22874            offset: usize,
22875            _depth: fidl::encoding::Depth,
22876        ) -> fidl::Result<()> {
22877            decoder.debug_check_bounds::<Self>(offset);
22878            // Verify that padding bytes are zero.
22879            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
22880            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22881            let mask = 0xffffffff00000000u64;
22882            let maskedval = padval & mask;
22883            if maskedval != 0 {
22884                return Err(fidl::Error::NonZeroPadding {
22885                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
22886                });
22887            }
22888            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)?;
22889            fidl::decode!(
22890                fidl::encoding::BoundedString<255>,
22891                fidl::encoding::DefaultFuchsiaResourceDialect,
22892                &mut self.dst,
22893                decoder,
22894                offset + 8,
22895                _depth
22896            )?;
22897            Ok(())
22898        }
22899    }
22900
22901    impl fidl::encoding::ResourceTypeMarker for NodeDeprecatedCloneRequest {
22902        type Borrowed<'a> = &'a mut Self;
22903        fn take_or_borrow<'a>(
22904            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22905        ) -> Self::Borrowed<'a> {
22906            value
22907        }
22908    }
22909
22910    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedCloneRequest {
22911        type Owned = Self;
22912
22913        #[inline(always)]
22914        fn inline_align(_context: fidl::encoding::Context) -> usize {
22915            4
22916        }
22917
22918        #[inline(always)]
22919        fn inline_size(_context: fidl::encoding::Context) -> usize {
22920            8
22921        }
22922    }
22923
22924    unsafe impl
22925        fidl::encoding::Encode<
22926            NodeDeprecatedCloneRequest,
22927            fidl::encoding::DefaultFuchsiaResourceDialect,
22928        > for &mut NodeDeprecatedCloneRequest
22929    {
22930        #[inline]
22931        unsafe fn encode(
22932            self,
22933            encoder: &mut fidl::encoding::Encoder<
22934                '_,
22935                fidl::encoding::DefaultFuchsiaResourceDialect,
22936            >,
22937            offset: usize,
22938            _depth: fidl::encoding::Depth,
22939        ) -> fidl::Result<()> {
22940            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
22941            // Delegate to tuple encoding.
22942            fidl::encoding::Encode::<NodeDeprecatedCloneRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22943                (
22944                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
22945                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
22946                ),
22947                encoder, offset, _depth
22948            )
22949        }
22950    }
22951    unsafe impl<
22952            T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
22953            T1: fidl::encoding::Encode<
22954                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22955                fidl::encoding::DefaultFuchsiaResourceDialect,
22956            >,
22957        >
22958        fidl::encoding::Encode<
22959            NodeDeprecatedCloneRequest,
22960            fidl::encoding::DefaultFuchsiaResourceDialect,
22961        > for (T0, T1)
22962    {
22963        #[inline]
22964        unsafe fn encode(
22965            self,
22966            encoder: &mut fidl::encoding::Encoder<
22967                '_,
22968                fidl::encoding::DefaultFuchsiaResourceDialect,
22969            >,
22970            offset: usize,
22971            depth: fidl::encoding::Depth,
22972        ) -> fidl::Result<()> {
22973            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
22974            // Zero out padding regions. There's no need to apply masks
22975            // because the unmasked parts will be overwritten by fields.
22976            // Write the fields.
22977            self.0.encode(encoder, offset + 0, depth)?;
22978            self.1.encode(encoder, offset + 4, depth)?;
22979            Ok(())
22980        }
22981    }
22982
22983    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22984        for NodeDeprecatedCloneRequest
22985    {
22986        #[inline(always)]
22987        fn new_empty() -> Self {
22988            Self {
22989                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
22990                object: fidl::new_empty!(
22991                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22992                    fidl::encoding::DefaultFuchsiaResourceDialect
22993                ),
22994            }
22995        }
22996
22997        #[inline]
22998        unsafe fn decode(
22999            &mut self,
23000            decoder: &mut fidl::encoding::Decoder<
23001                '_,
23002                fidl::encoding::DefaultFuchsiaResourceDialect,
23003            >,
23004            offset: usize,
23005            _depth: fidl::encoding::Depth,
23006        ) -> fidl::Result<()> {
23007            decoder.debug_check_bounds::<Self>(offset);
23008            // Verify that padding bytes are zero.
23009            fidl::decode!(
23010                OpenFlags,
23011                fidl::encoding::DefaultFuchsiaResourceDialect,
23012                &mut self.flags,
23013                decoder,
23014                offset + 0,
23015                _depth
23016            )?;
23017            fidl::decode!(
23018                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
23019                fidl::encoding::DefaultFuchsiaResourceDialect,
23020                &mut self.object,
23021                decoder,
23022                offset + 4,
23023                _depth
23024            )?;
23025            Ok(())
23026        }
23027    }
23028
23029    impl fidl::encoding::ResourceTypeMarker for NodeListExtendedAttributesRequest {
23030        type Borrowed<'a> = &'a mut Self;
23031        fn take_or_borrow<'a>(
23032            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23033        ) -> Self::Borrowed<'a> {
23034            value
23035        }
23036    }
23037
23038    unsafe impl fidl::encoding::TypeMarker for NodeListExtendedAttributesRequest {
23039        type Owned = Self;
23040
23041        #[inline(always)]
23042        fn inline_align(_context: fidl::encoding::Context) -> usize {
23043            4
23044        }
23045
23046        #[inline(always)]
23047        fn inline_size(_context: fidl::encoding::Context) -> usize {
23048            4
23049        }
23050    }
23051
23052    unsafe impl
23053        fidl::encoding::Encode<
23054            NodeListExtendedAttributesRequest,
23055            fidl::encoding::DefaultFuchsiaResourceDialect,
23056        > for &mut NodeListExtendedAttributesRequest
23057    {
23058        #[inline]
23059        unsafe fn encode(
23060            self,
23061            encoder: &mut fidl::encoding::Encoder<
23062                '_,
23063                fidl::encoding::DefaultFuchsiaResourceDialect,
23064            >,
23065            offset: usize,
23066            _depth: fidl::encoding::Depth,
23067        ) -> fidl::Result<()> {
23068            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
23069            // Delegate to tuple encoding.
23070            fidl::encoding::Encode::<
23071                NodeListExtendedAttributesRequest,
23072                fidl::encoding::DefaultFuchsiaResourceDialect,
23073            >::encode(
23074                (<fidl::encoding::Endpoint<
23075                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
23076                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
23077                    &mut self.iterator
23078                ),),
23079                encoder,
23080                offset,
23081                _depth,
23082            )
23083        }
23084    }
23085    unsafe impl<
23086            T0: fidl::encoding::Encode<
23087                fidl::encoding::Endpoint<
23088                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
23089                >,
23090                fidl::encoding::DefaultFuchsiaResourceDialect,
23091            >,
23092        >
23093        fidl::encoding::Encode<
23094            NodeListExtendedAttributesRequest,
23095            fidl::encoding::DefaultFuchsiaResourceDialect,
23096        > for (T0,)
23097    {
23098        #[inline]
23099        unsafe fn encode(
23100            self,
23101            encoder: &mut fidl::encoding::Encoder<
23102                '_,
23103                fidl::encoding::DefaultFuchsiaResourceDialect,
23104            >,
23105            offset: usize,
23106            depth: fidl::encoding::Depth,
23107        ) -> fidl::Result<()> {
23108            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
23109            // Zero out padding regions. There's no need to apply masks
23110            // because the unmasked parts will be overwritten by fields.
23111            // Write the fields.
23112            self.0.encode(encoder, offset + 0, depth)?;
23113            Ok(())
23114        }
23115    }
23116
23117    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23118        for NodeListExtendedAttributesRequest
23119    {
23120        #[inline(always)]
23121        fn new_empty() -> Self {
23122            Self {
23123                iterator: fidl::new_empty!(
23124                    fidl::encoding::Endpoint<
23125                        fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
23126                    >,
23127                    fidl::encoding::DefaultFuchsiaResourceDialect
23128                ),
23129            }
23130        }
23131
23132        #[inline]
23133        unsafe fn decode(
23134            &mut self,
23135            decoder: &mut fidl::encoding::Decoder<
23136                '_,
23137                fidl::encoding::DefaultFuchsiaResourceDialect,
23138            >,
23139            offset: usize,
23140            _depth: fidl::encoding::Depth,
23141        ) -> fidl::Result<()> {
23142            decoder.debug_check_bounds::<Self>(offset);
23143            // Verify that padding bytes are zero.
23144            fidl::decode!(
23145                fidl::encoding::Endpoint<
23146                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
23147                >,
23148                fidl::encoding::DefaultFuchsiaResourceDialect,
23149                &mut self.iterator,
23150                decoder,
23151                offset + 0,
23152                _depth
23153            )?;
23154            Ok(())
23155        }
23156    }
23157
23158    impl fidl::encoding::ResourceTypeMarker for NodeOnOpenRequest {
23159        type Borrowed<'a> = &'a mut Self;
23160        fn take_or_borrow<'a>(
23161            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23162        ) -> Self::Borrowed<'a> {
23163            value
23164        }
23165    }
23166
23167    unsafe impl fidl::encoding::TypeMarker for NodeOnOpenRequest {
23168        type Owned = Self;
23169
23170        #[inline(always)]
23171        fn inline_align(_context: fidl::encoding::Context) -> usize {
23172            8
23173        }
23174
23175        #[inline(always)]
23176        fn inline_size(_context: fidl::encoding::Context) -> usize {
23177            24
23178        }
23179    }
23180
23181    unsafe impl
23182        fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
23183        for &mut NodeOnOpenRequest
23184    {
23185        #[inline]
23186        unsafe fn encode(
23187            self,
23188            encoder: &mut fidl::encoding::Encoder<
23189                '_,
23190                fidl::encoding::DefaultFuchsiaResourceDialect,
23191            >,
23192            offset: usize,
23193            _depth: fidl::encoding::Depth,
23194        ) -> fidl::Result<()> {
23195            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
23196            // Delegate to tuple encoding.
23197            fidl::encoding::Encode::<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
23198                (
23199                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
23200                    <fidl::encoding::OptionalUnion<NodeInfoDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
23201                ),
23202                encoder, offset, _depth
23203            )
23204        }
23205    }
23206    unsafe impl<
23207            T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
23208            T1: fidl::encoding::Encode<
23209                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
23210                fidl::encoding::DefaultFuchsiaResourceDialect,
23211            >,
23212        >
23213        fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
23214        for (T0, T1)
23215    {
23216        #[inline]
23217        unsafe fn encode(
23218            self,
23219            encoder: &mut fidl::encoding::Encoder<
23220                '_,
23221                fidl::encoding::DefaultFuchsiaResourceDialect,
23222            >,
23223            offset: usize,
23224            depth: fidl::encoding::Depth,
23225        ) -> fidl::Result<()> {
23226            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
23227            // Zero out padding regions. There's no need to apply masks
23228            // because the unmasked parts will be overwritten by fields.
23229            unsafe {
23230                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
23231                (ptr as *mut u64).write_unaligned(0);
23232            }
23233            // Write the fields.
23234            self.0.encode(encoder, offset + 0, depth)?;
23235            self.1.encode(encoder, offset + 8, depth)?;
23236            Ok(())
23237        }
23238    }
23239
23240    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23241        for NodeOnOpenRequest
23242    {
23243        #[inline(always)]
23244        fn new_empty() -> Self {
23245            Self {
23246                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
23247                info: fidl::new_empty!(
23248                    fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
23249                    fidl::encoding::DefaultFuchsiaResourceDialect
23250                ),
23251            }
23252        }
23253
23254        #[inline]
23255        unsafe fn decode(
23256            &mut self,
23257            decoder: &mut fidl::encoding::Decoder<
23258                '_,
23259                fidl::encoding::DefaultFuchsiaResourceDialect,
23260            >,
23261            offset: usize,
23262            _depth: fidl::encoding::Depth,
23263        ) -> fidl::Result<()> {
23264            decoder.debug_check_bounds::<Self>(offset);
23265            // Verify that padding bytes are zero.
23266            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
23267            let padval = unsafe { (ptr as *const u64).read_unaligned() };
23268            let mask = 0xffffffff00000000u64;
23269            let maskedval = padval & mask;
23270            if maskedval != 0 {
23271                return Err(fidl::Error::NonZeroPadding {
23272                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
23273                });
23274            }
23275            fidl::decode!(
23276                i32,
23277                fidl::encoding::DefaultFuchsiaResourceDialect,
23278                &mut self.s,
23279                decoder,
23280                offset + 0,
23281                _depth
23282            )?;
23283            fidl::decode!(
23284                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
23285                fidl::encoding::DefaultFuchsiaResourceDialect,
23286                &mut self.info,
23287                decoder,
23288                offset + 8,
23289                _depth
23290            )?;
23291            Ok(())
23292        }
23293    }
23294
23295    impl fidl::encoding::ResourceTypeMarker for NodeSetExtendedAttributeRequest {
23296        type Borrowed<'a> = &'a mut Self;
23297        fn take_or_borrow<'a>(
23298            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23299        ) -> Self::Borrowed<'a> {
23300            value
23301        }
23302    }
23303
23304    unsafe impl fidl::encoding::TypeMarker for NodeSetExtendedAttributeRequest {
23305        type Owned = Self;
23306
23307        #[inline(always)]
23308        fn inline_align(_context: fidl::encoding::Context) -> usize {
23309            8
23310        }
23311
23312        #[inline(always)]
23313        fn inline_size(_context: fidl::encoding::Context) -> usize {
23314            40
23315        }
23316    }
23317
23318    unsafe impl
23319        fidl::encoding::Encode<
23320            NodeSetExtendedAttributeRequest,
23321            fidl::encoding::DefaultFuchsiaResourceDialect,
23322        > for &mut NodeSetExtendedAttributeRequest
23323    {
23324        #[inline]
23325        unsafe fn encode(
23326            self,
23327            encoder: &mut fidl::encoding::Encoder<
23328                '_,
23329                fidl::encoding::DefaultFuchsiaResourceDialect,
23330            >,
23331            offset: usize,
23332            _depth: fidl::encoding::Depth,
23333        ) -> fidl::Result<()> {
23334            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
23335            // Delegate to tuple encoding.
23336            fidl::encoding::Encode::<
23337                NodeSetExtendedAttributeRequest,
23338                fidl::encoding::DefaultFuchsiaResourceDialect,
23339            >::encode(
23340                (
23341                    <fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
23342                        &self.name,
23343                    ),
23344                    <ExtendedAttributeValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
23345                        &mut self.value,
23346                    ),
23347                    <SetExtendedAttributeMode as fidl::encoding::ValueTypeMarker>::borrow(
23348                        &self.mode,
23349                    ),
23350                ),
23351                encoder,
23352                offset,
23353                _depth,
23354            )
23355        }
23356    }
23357    unsafe impl<
23358            T0: fidl::encoding::Encode<
23359                fidl::encoding::Vector<u8, 255>,
23360                fidl::encoding::DefaultFuchsiaResourceDialect,
23361            >,
23362            T1: fidl::encoding::Encode<
23363                ExtendedAttributeValue,
23364                fidl::encoding::DefaultFuchsiaResourceDialect,
23365            >,
23366            T2: fidl::encoding::Encode<
23367                SetExtendedAttributeMode,
23368                fidl::encoding::DefaultFuchsiaResourceDialect,
23369            >,
23370        >
23371        fidl::encoding::Encode<
23372            NodeSetExtendedAttributeRequest,
23373            fidl::encoding::DefaultFuchsiaResourceDialect,
23374        > for (T0, T1, T2)
23375    {
23376        #[inline]
23377        unsafe fn encode(
23378            self,
23379            encoder: &mut fidl::encoding::Encoder<
23380                '_,
23381                fidl::encoding::DefaultFuchsiaResourceDialect,
23382            >,
23383            offset: usize,
23384            depth: fidl::encoding::Depth,
23385        ) -> fidl::Result<()> {
23386            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
23387            // Zero out padding regions. There's no need to apply masks
23388            // because the unmasked parts will be overwritten by fields.
23389            unsafe {
23390                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
23391                (ptr as *mut u64).write_unaligned(0);
23392            }
23393            // Write the fields.
23394            self.0.encode(encoder, offset + 0, depth)?;
23395            self.1.encode(encoder, offset + 16, depth)?;
23396            self.2.encode(encoder, offset + 32, depth)?;
23397            Ok(())
23398        }
23399    }
23400
23401    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23402        for NodeSetExtendedAttributeRequest
23403    {
23404        #[inline(always)]
23405        fn new_empty() -> Self {
23406            Self {
23407                name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect),
23408                value: fidl::new_empty!(
23409                    ExtendedAttributeValue,
23410                    fidl::encoding::DefaultFuchsiaResourceDialect
23411                ),
23412                mode: fidl::new_empty!(
23413                    SetExtendedAttributeMode,
23414                    fidl::encoding::DefaultFuchsiaResourceDialect
23415                ),
23416            }
23417        }
23418
23419        #[inline]
23420        unsafe fn decode(
23421            &mut self,
23422            decoder: &mut fidl::encoding::Decoder<
23423                '_,
23424                fidl::encoding::DefaultFuchsiaResourceDialect,
23425            >,
23426            offset: usize,
23427            _depth: fidl::encoding::Depth,
23428        ) -> fidl::Result<()> {
23429            decoder.debug_check_bounds::<Self>(offset);
23430            // Verify that padding bytes are zero.
23431            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
23432            let padval = unsafe { (ptr as *const u64).read_unaligned() };
23433            let mask = 0xffffffff00000000u64;
23434            let maskedval = padval & mask;
23435            if maskedval != 0 {
23436                return Err(fidl::Error::NonZeroPadding {
23437                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
23438                });
23439            }
23440            fidl::decode!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.name, decoder, offset + 0, _depth)?;
23441            fidl::decode!(
23442                ExtendedAttributeValue,
23443                fidl::encoding::DefaultFuchsiaResourceDialect,
23444                &mut self.value,
23445                decoder,
23446                offset + 16,
23447                _depth
23448            )?;
23449            fidl::decode!(
23450                SetExtendedAttributeMode,
23451                fidl::encoding::DefaultFuchsiaResourceDialect,
23452                &mut self.mode,
23453                decoder,
23454                offset + 32,
23455                _depth
23456            )?;
23457            Ok(())
23458        }
23459    }
23460
23461    impl ConnectionInfo {
23462        #[inline(always)]
23463        fn max_ordinal_present(&self) -> u64 {
23464            if let Some(_) = self.rights {
23465                return 1;
23466            }
23467            0
23468        }
23469    }
23470
23471    impl fidl::encoding::ResourceTypeMarker for ConnectionInfo {
23472        type Borrowed<'a> = &'a mut Self;
23473        fn take_or_borrow<'a>(
23474            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23475        ) -> Self::Borrowed<'a> {
23476            value
23477        }
23478    }
23479
23480    unsafe impl fidl::encoding::TypeMarker for ConnectionInfo {
23481        type Owned = Self;
23482
23483        #[inline(always)]
23484        fn inline_align(_context: fidl::encoding::Context) -> usize {
23485            8
23486        }
23487
23488        #[inline(always)]
23489        fn inline_size(_context: fidl::encoding::Context) -> usize {
23490            16
23491        }
23492    }
23493
23494    unsafe impl
23495        fidl::encoding::Encode<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
23496        for &mut ConnectionInfo
23497    {
23498        unsafe fn encode(
23499            self,
23500            encoder: &mut fidl::encoding::Encoder<
23501                '_,
23502                fidl::encoding::DefaultFuchsiaResourceDialect,
23503            >,
23504            offset: usize,
23505            mut depth: fidl::encoding::Depth,
23506        ) -> fidl::Result<()> {
23507            encoder.debug_check_bounds::<ConnectionInfo>(offset);
23508            // Vector header
23509            let max_ordinal: u64 = self.max_ordinal_present();
23510            encoder.write_num(max_ordinal, offset);
23511            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23512            // Calling encoder.out_of_line_offset(0) is not allowed.
23513            if max_ordinal == 0 {
23514                return Ok(());
23515            }
23516            depth.increment()?;
23517            let envelope_size = 8;
23518            let bytes_len = max_ordinal as usize * envelope_size;
23519            #[allow(unused_variables)]
23520            let offset = encoder.out_of_line_offset(bytes_len);
23521            let mut _prev_end_offset: usize = 0;
23522            if 1 > max_ordinal {
23523                return Ok(());
23524            }
23525
23526            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23527            // are envelope_size bytes.
23528            let cur_offset: usize = (1 - 1) * envelope_size;
23529
23530            // Zero reserved fields.
23531            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23532
23533            // Safety:
23534            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23535            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23536            //   envelope_size bytes, there is always sufficient room.
23537            fidl::encoding::encode_in_envelope_optional::<
23538                Operations,
23539                fidl::encoding::DefaultFuchsiaResourceDialect,
23540            >(
23541                self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
23542                encoder,
23543                offset + cur_offset,
23544                depth,
23545            )?;
23546
23547            _prev_end_offset = cur_offset + envelope_size;
23548
23549            Ok(())
23550        }
23551    }
23552
23553    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23554        for ConnectionInfo
23555    {
23556        #[inline(always)]
23557        fn new_empty() -> Self {
23558            Self::default()
23559        }
23560
23561        unsafe fn decode(
23562            &mut self,
23563            decoder: &mut fidl::encoding::Decoder<
23564                '_,
23565                fidl::encoding::DefaultFuchsiaResourceDialect,
23566            >,
23567            offset: usize,
23568            mut depth: fidl::encoding::Depth,
23569        ) -> fidl::Result<()> {
23570            decoder.debug_check_bounds::<Self>(offset);
23571            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23572                None => return Err(fidl::Error::NotNullable),
23573                Some(len) => len,
23574            };
23575            // Calling decoder.out_of_line_offset(0) is not allowed.
23576            if len == 0 {
23577                return Ok(());
23578            };
23579            depth.increment()?;
23580            let envelope_size = 8;
23581            let bytes_len = len * envelope_size;
23582            let offset = decoder.out_of_line_offset(bytes_len)?;
23583            // Decode the envelope for each type.
23584            let mut _next_ordinal_to_read = 0;
23585            let mut next_offset = offset;
23586            let end_offset = offset + bytes_len;
23587            _next_ordinal_to_read += 1;
23588            if next_offset >= end_offset {
23589                return Ok(());
23590            }
23591
23592            // Decode unknown envelopes for gaps in ordinals.
23593            while _next_ordinal_to_read < 1 {
23594                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23595                _next_ordinal_to_read += 1;
23596                next_offset += envelope_size;
23597            }
23598
23599            let next_out_of_line = decoder.next_out_of_line();
23600            let handles_before = decoder.remaining_handles();
23601            if let Some((inlined, num_bytes, num_handles)) =
23602                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23603            {
23604                let member_inline_size =
23605                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23606                if inlined != (member_inline_size <= 4) {
23607                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23608                }
23609                let inner_offset;
23610                let mut inner_depth = depth.clone();
23611                if inlined {
23612                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23613                    inner_offset = next_offset;
23614                } else {
23615                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23616                    inner_depth.increment()?;
23617                }
23618                let val_ref = self.rights.get_or_insert_with(|| {
23619                    fidl::new_empty!(Operations, fidl::encoding::DefaultFuchsiaResourceDialect)
23620                });
23621                fidl::decode!(
23622                    Operations,
23623                    fidl::encoding::DefaultFuchsiaResourceDialect,
23624                    val_ref,
23625                    decoder,
23626                    inner_offset,
23627                    inner_depth
23628                )?;
23629                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23630                {
23631                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23632                }
23633                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23634                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23635                }
23636            }
23637
23638            next_offset += envelope_size;
23639
23640            // Decode the remaining unknown envelopes.
23641            while next_offset < end_offset {
23642                _next_ordinal_to_read += 1;
23643                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23644                next_offset += envelope_size;
23645            }
23646
23647            Ok(())
23648        }
23649    }
23650
23651    impl FileInfo {
23652        #[inline(always)]
23653        fn max_ordinal_present(&self) -> u64 {
23654            if let Some(_) = self.attributes {
23655                return 4;
23656            }
23657            if let Some(_) = self.stream {
23658                return 3;
23659            }
23660            if let Some(_) = self.observer {
23661                return 2;
23662            }
23663            if let Some(_) = self.is_append {
23664                return 1;
23665            }
23666            0
23667        }
23668    }
23669
23670    impl fidl::encoding::ResourceTypeMarker for FileInfo {
23671        type Borrowed<'a> = &'a mut Self;
23672        fn take_or_borrow<'a>(
23673            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23674        ) -> Self::Borrowed<'a> {
23675            value
23676        }
23677    }
23678
23679    unsafe impl fidl::encoding::TypeMarker for FileInfo {
23680        type Owned = Self;
23681
23682        #[inline(always)]
23683        fn inline_align(_context: fidl::encoding::Context) -> usize {
23684            8
23685        }
23686
23687        #[inline(always)]
23688        fn inline_size(_context: fidl::encoding::Context) -> usize {
23689            16
23690        }
23691    }
23692
23693    unsafe impl fidl::encoding::Encode<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
23694        for &mut FileInfo
23695    {
23696        unsafe fn encode(
23697            self,
23698            encoder: &mut fidl::encoding::Encoder<
23699                '_,
23700                fidl::encoding::DefaultFuchsiaResourceDialect,
23701            >,
23702            offset: usize,
23703            mut depth: fidl::encoding::Depth,
23704        ) -> fidl::Result<()> {
23705            encoder.debug_check_bounds::<FileInfo>(offset);
23706            // Vector header
23707            let max_ordinal: u64 = self.max_ordinal_present();
23708            encoder.write_num(max_ordinal, offset);
23709            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23710            // Calling encoder.out_of_line_offset(0) is not allowed.
23711            if max_ordinal == 0 {
23712                return Ok(());
23713            }
23714            depth.increment()?;
23715            let envelope_size = 8;
23716            let bytes_len = max_ordinal as usize * envelope_size;
23717            #[allow(unused_variables)]
23718            let offset = encoder.out_of_line_offset(bytes_len);
23719            let mut _prev_end_offset: usize = 0;
23720            if 1 > max_ordinal {
23721                return Ok(());
23722            }
23723
23724            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23725            // are envelope_size bytes.
23726            let cur_offset: usize = (1 - 1) * envelope_size;
23727
23728            // Zero reserved fields.
23729            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23730
23731            // Safety:
23732            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23733            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23734            //   envelope_size bytes, there is always sufficient room.
23735            fidl::encoding::encode_in_envelope_optional::<
23736                bool,
23737                fidl::encoding::DefaultFuchsiaResourceDialect,
23738            >(
23739                self.is_append.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
23740                encoder,
23741                offset + cur_offset,
23742                depth,
23743            )?;
23744
23745            _prev_end_offset = cur_offset + envelope_size;
23746            if 2 > max_ordinal {
23747                return Ok(());
23748            }
23749
23750            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23751            // are envelope_size bytes.
23752            let cur_offset: usize = (2 - 1) * envelope_size;
23753
23754            // Zero reserved fields.
23755            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23756
23757            // Safety:
23758            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23759            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23760            //   envelope_size bytes, there is always sufficient room.
23761            fidl::encoding::encode_in_envelope_optional::<
23762                fidl::encoding::HandleType<
23763                    fidl::Event,
23764                    { fidl::ObjectType::EVENT.into_raw() },
23765                    2147483648,
23766                >,
23767                fidl::encoding::DefaultFuchsiaResourceDialect,
23768            >(
23769                self.observer.as_mut().map(
23770                    <fidl::encoding::HandleType<
23771                        fidl::Event,
23772                        { fidl::ObjectType::EVENT.into_raw() },
23773                        2147483648,
23774                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
23775                ),
23776                encoder,
23777                offset + cur_offset,
23778                depth,
23779            )?;
23780
23781            _prev_end_offset = cur_offset + envelope_size;
23782            if 3 > max_ordinal {
23783                return Ok(());
23784            }
23785
23786            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23787            // are envelope_size bytes.
23788            let cur_offset: usize = (3 - 1) * envelope_size;
23789
23790            // Zero reserved fields.
23791            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23792
23793            // Safety:
23794            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23795            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23796            //   envelope_size bytes, there is always sufficient room.
23797            fidl::encoding::encode_in_envelope_optional::<
23798                fidl::encoding::HandleType<
23799                    fidl::Stream,
23800                    { fidl::ObjectType::STREAM.into_raw() },
23801                    2147483648,
23802                >,
23803                fidl::encoding::DefaultFuchsiaResourceDialect,
23804            >(
23805                self.stream.as_mut().map(
23806                    <fidl::encoding::HandleType<
23807                        fidl::Stream,
23808                        { fidl::ObjectType::STREAM.into_raw() },
23809                        2147483648,
23810                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
23811                ),
23812                encoder,
23813                offset + cur_offset,
23814                depth,
23815            )?;
23816
23817            _prev_end_offset = cur_offset + envelope_size;
23818            if 4 > max_ordinal {
23819                return Ok(());
23820            }
23821
23822            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23823            // are envelope_size bytes.
23824            let cur_offset: usize = (4 - 1) * envelope_size;
23825
23826            // Zero reserved fields.
23827            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23828
23829            // Safety:
23830            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23831            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23832            //   envelope_size bytes, there is always sufficient room.
23833            fidl::encoding::encode_in_envelope_optional::<
23834                NodeAttributes2,
23835                fidl::encoding::DefaultFuchsiaResourceDialect,
23836            >(
23837                self.attributes
23838                    .as_ref()
23839                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
23840                encoder,
23841                offset + cur_offset,
23842                depth,
23843            )?;
23844
23845            _prev_end_offset = cur_offset + envelope_size;
23846
23847            Ok(())
23848        }
23849    }
23850
23851    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileInfo {
23852        #[inline(always)]
23853        fn new_empty() -> Self {
23854            Self::default()
23855        }
23856
23857        unsafe fn decode(
23858            &mut self,
23859            decoder: &mut fidl::encoding::Decoder<
23860                '_,
23861                fidl::encoding::DefaultFuchsiaResourceDialect,
23862            >,
23863            offset: usize,
23864            mut depth: fidl::encoding::Depth,
23865        ) -> fidl::Result<()> {
23866            decoder.debug_check_bounds::<Self>(offset);
23867            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23868                None => return Err(fidl::Error::NotNullable),
23869                Some(len) => len,
23870            };
23871            // Calling decoder.out_of_line_offset(0) is not allowed.
23872            if len == 0 {
23873                return Ok(());
23874            };
23875            depth.increment()?;
23876            let envelope_size = 8;
23877            let bytes_len = len * envelope_size;
23878            let offset = decoder.out_of_line_offset(bytes_len)?;
23879            // Decode the envelope for each type.
23880            let mut _next_ordinal_to_read = 0;
23881            let mut next_offset = offset;
23882            let end_offset = offset + bytes_len;
23883            _next_ordinal_to_read += 1;
23884            if next_offset >= end_offset {
23885                return Ok(());
23886            }
23887
23888            // Decode unknown envelopes for gaps in ordinals.
23889            while _next_ordinal_to_read < 1 {
23890                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23891                _next_ordinal_to_read += 1;
23892                next_offset += envelope_size;
23893            }
23894
23895            let next_out_of_line = decoder.next_out_of_line();
23896            let handles_before = decoder.remaining_handles();
23897            if let Some((inlined, num_bytes, num_handles)) =
23898                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23899            {
23900                let member_inline_size =
23901                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23902                if inlined != (member_inline_size <= 4) {
23903                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23904                }
23905                let inner_offset;
23906                let mut inner_depth = depth.clone();
23907                if inlined {
23908                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23909                    inner_offset = next_offset;
23910                } else {
23911                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23912                    inner_depth.increment()?;
23913                }
23914                let val_ref = self.is_append.get_or_insert_with(|| {
23915                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
23916                });
23917                fidl::decode!(
23918                    bool,
23919                    fidl::encoding::DefaultFuchsiaResourceDialect,
23920                    val_ref,
23921                    decoder,
23922                    inner_offset,
23923                    inner_depth
23924                )?;
23925                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23926                {
23927                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23928                }
23929                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23930                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23931                }
23932            }
23933
23934            next_offset += envelope_size;
23935            _next_ordinal_to_read += 1;
23936            if next_offset >= end_offset {
23937                return Ok(());
23938            }
23939
23940            // Decode unknown envelopes for gaps in ordinals.
23941            while _next_ordinal_to_read < 2 {
23942                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23943                _next_ordinal_to_read += 1;
23944                next_offset += envelope_size;
23945            }
23946
23947            let next_out_of_line = decoder.next_out_of_line();
23948            let handles_before = decoder.remaining_handles();
23949            if let Some((inlined, num_bytes, num_handles)) =
23950                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23951            {
23952                let member_inline_size = <fidl::encoding::HandleType<
23953                    fidl::Event,
23954                    { fidl::ObjectType::EVENT.into_raw() },
23955                    2147483648,
23956                > as fidl::encoding::TypeMarker>::inline_size(
23957                    decoder.context
23958                );
23959                if inlined != (member_inline_size <= 4) {
23960                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23961                }
23962                let inner_offset;
23963                let mut inner_depth = depth.clone();
23964                if inlined {
23965                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23966                    inner_offset = next_offset;
23967                } else {
23968                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23969                    inner_depth.increment()?;
23970                }
23971                let val_ref =
23972                self.observer.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
23973                fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
23974                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23975                {
23976                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23977                }
23978                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23979                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23980                }
23981            }
23982
23983            next_offset += envelope_size;
23984            _next_ordinal_to_read += 1;
23985            if next_offset >= end_offset {
23986                return Ok(());
23987            }
23988
23989            // Decode unknown envelopes for gaps in ordinals.
23990            while _next_ordinal_to_read < 3 {
23991                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23992                _next_ordinal_to_read += 1;
23993                next_offset += envelope_size;
23994            }
23995
23996            let next_out_of_line = decoder.next_out_of_line();
23997            let handles_before = decoder.remaining_handles();
23998            if let Some((inlined, num_bytes, num_handles)) =
23999                fidl::encoding::decode_envelope_header(decoder, next_offset)?
24000            {
24001                let member_inline_size = <fidl::encoding::HandleType<
24002                    fidl::Stream,
24003                    { fidl::ObjectType::STREAM.into_raw() },
24004                    2147483648,
24005                > as fidl::encoding::TypeMarker>::inline_size(
24006                    decoder.context
24007                );
24008                if inlined != (member_inline_size <= 4) {
24009                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
24010                }
24011                let inner_offset;
24012                let mut inner_depth = depth.clone();
24013                if inlined {
24014                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24015                    inner_offset = next_offset;
24016                } else {
24017                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24018                    inner_depth.increment()?;
24019                }
24020                let val_ref =
24021                self.stream.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
24022                fidl::decode!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
24023                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24024                {
24025                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
24026                }
24027                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24028                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24029                }
24030            }
24031
24032            next_offset += envelope_size;
24033            _next_ordinal_to_read += 1;
24034            if next_offset >= end_offset {
24035                return Ok(());
24036            }
24037
24038            // Decode unknown envelopes for gaps in ordinals.
24039            while _next_ordinal_to_read < 4 {
24040                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24041                _next_ordinal_to_read += 1;
24042                next_offset += envelope_size;
24043            }
24044
24045            let next_out_of_line = decoder.next_out_of_line();
24046            let handles_before = decoder.remaining_handles();
24047            if let Some((inlined, num_bytes, num_handles)) =
24048                fidl::encoding::decode_envelope_header(decoder, next_offset)?
24049            {
24050                let member_inline_size =
24051                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24052                if inlined != (member_inline_size <= 4) {
24053                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
24054                }
24055                let inner_offset;
24056                let mut inner_depth = depth.clone();
24057                if inlined {
24058                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24059                    inner_offset = next_offset;
24060                } else {
24061                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24062                    inner_depth.increment()?;
24063                }
24064                let val_ref = self.attributes.get_or_insert_with(|| {
24065                    fidl::new_empty!(NodeAttributes2, fidl::encoding::DefaultFuchsiaResourceDialect)
24066                });
24067                fidl::decode!(
24068                    NodeAttributes2,
24069                    fidl::encoding::DefaultFuchsiaResourceDialect,
24070                    val_ref,
24071                    decoder,
24072                    inner_offset,
24073                    inner_depth
24074                )?;
24075                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24076                {
24077                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
24078                }
24079                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24080                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24081                }
24082            }
24083
24084            next_offset += envelope_size;
24085
24086            // Decode the remaining unknown envelopes.
24087            while next_offset < end_offset {
24088                _next_ordinal_to_read += 1;
24089                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24090                next_offset += envelope_size;
24091            }
24092
24093            Ok(())
24094        }
24095    }
24096
24097    impl fidl::encoding::ResourceTypeMarker for ExtendedAttributeValue {
24098        type Borrowed<'a> = &'a mut Self;
24099        fn take_or_borrow<'a>(
24100            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
24101        ) -> Self::Borrowed<'a> {
24102            value
24103        }
24104    }
24105
24106    unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeValue {
24107        type Owned = Self;
24108
24109        #[inline(always)]
24110        fn inline_align(_context: fidl::encoding::Context) -> usize {
24111            8
24112        }
24113
24114        #[inline(always)]
24115        fn inline_size(_context: fidl::encoding::Context) -> usize {
24116            16
24117        }
24118    }
24119
24120    unsafe impl
24121        fidl::encoding::Encode<
24122            ExtendedAttributeValue,
24123            fidl::encoding::DefaultFuchsiaResourceDialect,
24124        > for &mut ExtendedAttributeValue
24125    {
24126        #[inline]
24127        unsafe fn encode(
24128            self,
24129            encoder: &mut fidl::encoding::Encoder<
24130                '_,
24131                fidl::encoding::DefaultFuchsiaResourceDialect,
24132            >,
24133            offset: usize,
24134            _depth: fidl::encoding::Depth,
24135        ) -> fidl::Result<()> {
24136            encoder.debug_check_bounds::<ExtendedAttributeValue>(offset);
24137            encoder.write_num::<u64>(self.ordinal(), offset);
24138            match self {
24139                ExtendedAttributeValue::Bytes(ref val) => fidl::encoding::encode_in_envelope::<
24140                    fidl::encoding::Vector<u8, 32768>,
24141                    fidl::encoding::DefaultFuchsiaResourceDialect,
24142                >(
24143                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::ValueTypeMarker>::borrow(
24144                        val,
24145                    ),
24146                    encoder,
24147                    offset + 8,
24148                    _depth,
24149                ),
24150                ExtendedAttributeValue::Buffer(ref mut val) => {
24151                    fidl::encoding::encode_in_envelope::<
24152                        fidl::encoding::HandleType<
24153                            fidl::Vmo,
24154                            { fidl::ObjectType::VMO.into_raw() },
24155                            2147483648,
24156                        >,
24157                        fidl::encoding::DefaultFuchsiaResourceDialect,
24158                    >(
24159                        <fidl::encoding::HandleType<
24160                            fidl::Vmo,
24161                            { fidl::ObjectType::VMO.into_raw() },
24162                            2147483648,
24163                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
24164                            val
24165                        ),
24166                        encoder,
24167                        offset + 8,
24168                        _depth,
24169                    )
24170                }
24171                ExtendedAttributeValue::__SourceBreaking { .. } => {
24172                    Err(fidl::Error::UnknownUnionTag)
24173                }
24174            }
24175        }
24176    }
24177
24178    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
24179        for ExtendedAttributeValue
24180    {
24181        #[inline(always)]
24182        fn new_empty() -> Self {
24183            Self::__SourceBreaking { unknown_ordinal: 0 }
24184        }
24185
24186        #[inline]
24187        unsafe fn decode(
24188            &mut self,
24189            decoder: &mut fidl::encoding::Decoder<
24190                '_,
24191                fidl::encoding::DefaultFuchsiaResourceDialect,
24192            >,
24193            offset: usize,
24194            mut depth: fidl::encoding::Depth,
24195        ) -> fidl::Result<()> {
24196            decoder.debug_check_bounds::<Self>(offset);
24197            #[allow(unused_variables)]
24198            let next_out_of_line = decoder.next_out_of_line();
24199            let handles_before = decoder.remaining_handles();
24200            let (ordinal, inlined, num_bytes, num_handles) =
24201                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24202
24203            let member_inline_size = match ordinal {
24204                1 => {
24205                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::TypeMarker>::inline_size(
24206                        decoder.context,
24207                    )
24208                }
24209                2 => <fidl::encoding::HandleType<
24210                    fidl::Vmo,
24211                    { fidl::ObjectType::VMO.into_raw() },
24212                    2147483648,
24213                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24214                0 => return Err(fidl::Error::UnknownUnionTag),
24215                _ => num_bytes as usize,
24216            };
24217
24218            if inlined != (member_inline_size <= 4) {
24219                return Err(fidl::Error::InvalidInlineBitInEnvelope);
24220            }
24221            let _inner_offset;
24222            if inlined {
24223                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24224                _inner_offset = offset + 8;
24225            } else {
24226                depth.increment()?;
24227                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24228            }
24229            match ordinal {
24230                1 => {
24231                    #[allow(irrefutable_let_patterns)]
24232                    if let ExtendedAttributeValue::Bytes(_) = self {
24233                        // Do nothing, read the value into the object
24234                    } else {
24235                        // Initialize `self` to the right variant
24236                        *self = ExtendedAttributeValue::Bytes(
24237                            fidl::new_empty!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect),
24238                        );
24239                    }
24240                    #[allow(irrefutable_let_patterns)]
24241                    if let ExtendedAttributeValue::Bytes(ref mut val) = self {
24242                        fidl::decode!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
24243                    } else {
24244                        unreachable!()
24245                    }
24246                }
24247                2 => {
24248                    #[allow(irrefutable_let_patterns)]
24249                    if let ExtendedAttributeValue::Buffer(_) = self {
24250                        // Do nothing, read the value into the object
24251                    } else {
24252                        // Initialize `self` to the right variant
24253                        *self = ExtendedAttributeValue::Buffer(
24254                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
24255                        );
24256                    }
24257                    #[allow(irrefutable_let_patterns)]
24258                    if let ExtendedAttributeValue::Buffer(ref mut val) = self {
24259                        fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
24260                    } else {
24261                        unreachable!()
24262                    }
24263                }
24264                #[allow(deprecated)]
24265                ordinal => {
24266                    for _ in 0..num_handles {
24267                        decoder.drop_next_handle()?;
24268                    }
24269                    *self = ExtendedAttributeValue::__SourceBreaking { unknown_ordinal: ordinal };
24270                }
24271            }
24272            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24273                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24274            }
24275            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24276                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24277            }
24278            Ok(())
24279        }
24280    }
24281
24282    impl fidl::encoding::ResourceTypeMarker for NodeInfoDeprecated {
24283        type Borrowed<'a> = &'a mut Self;
24284        fn take_or_borrow<'a>(
24285            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
24286        ) -> Self::Borrowed<'a> {
24287            value
24288        }
24289    }
24290
24291    unsafe impl fidl::encoding::TypeMarker for NodeInfoDeprecated {
24292        type Owned = Self;
24293
24294        #[inline(always)]
24295        fn inline_align(_context: fidl::encoding::Context) -> usize {
24296            8
24297        }
24298
24299        #[inline(always)]
24300        fn inline_size(_context: fidl::encoding::Context) -> usize {
24301            16
24302        }
24303    }
24304
24305    unsafe impl
24306        fidl::encoding::Encode<NodeInfoDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>
24307        for &mut NodeInfoDeprecated
24308    {
24309        #[inline]
24310        unsafe fn encode(
24311            self,
24312            encoder: &mut fidl::encoding::Encoder<
24313                '_,
24314                fidl::encoding::DefaultFuchsiaResourceDialect,
24315            >,
24316            offset: usize,
24317            _depth: fidl::encoding::Depth,
24318        ) -> fidl::Result<()> {
24319            encoder.debug_check_bounds::<NodeInfoDeprecated>(offset);
24320            encoder.write_num::<u64>(self.ordinal(), offset);
24321            match self {
24322                NodeInfoDeprecated::Service(ref val) => fidl::encoding::encode_in_envelope::<
24323                    Service,
24324                    fidl::encoding::DefaultFuchsiaResourceDialect,
24325                >(
24326                    <Service as fidl::encoding::ValueTypeMarker>::borrow(val),
24327                    encoder,
24328                    offset + 8,
24329                    _depth,
24330                ),
24331                NodeInfoDeprecated::File(ref mut val) => fidl::encoding::encode_in_envelope::<
24332                    FileObject,
24333                    fidl::encoding::DefaultFuchsiaResourceDialect,
24334                >(
24335                    <FileObject as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
24336                    encoder,
24337                    offset + 8,
24338                    _depth,
24339                ),
24340                NodeInfoDeprecated::Directory(ref val) => fidl::encoding::encode_in_envelope::<
24341                    DirectoryObject,
24342                    fidl::encoding::DefaultFuchsiaResourceDialect,
24343                >(
24344                    <DirectoryObject as fidl::encoding::ValueTypeMarker>::borrow(val),
24345                    encoder,
24346                    offset + 8,
24347                    _depth,
24348                ),
24349                NodeInfoDeprecated::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
24350                    SymlinkObject,
24351                    fidl::encoding::DefaultFuchsiaResourceDialect,
24352                >(
24353                    <SymlinkObject as fidl::encoding::ValueTypeMarker>::borrow(val),
24354                    encoder,
24355                    offset + 8,
24356                    _depth,
24357                ),
24358            }
24359        }
24360    }
24361
24362    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
24363        for NodeInfoDeprecated
24364    {
24365        #[inline(always)]
24366        fn new_empty() -> Self {
24367            Self::Service(fidl::new_empty!(Service, fidl::encoding::DefaultFuchsiaResourceDialect))
24368        }
24369
24370        #[inline]
24371        unsafe fn decode(
24372            &mut self,
24373            decoder: &mut fidl::encoding::Decoder<
24374                '_,
24375                fidl::encoding::DefaultFuchsiaResourceDialect,
24376            >,
24377            offset: usize,
24378            mut depth: fidl::encoding::Depth,
24379        ) -> fidl::Result<()> {
24380            decoder.debug_check_bounds::<Self>(offset);
24381            #[allow(unused_variables)]
24382            let next_out_of_line = decoder.next_out_of_line();
24383            let handles_before = decoder.remaining_handles();
24384            let (ordinal, inlined, num_bytes, num_handles) =
24385                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24386
24387            let member_inline_size = match ordinal {
24388                1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24389                2 => <FileObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24390                3 => <DirectoryObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24391                4 => <SymlinkObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24392                _ => return Err(fidl::Error::UnknownUnionTag),
24393            };
24394
24395            if inlined != (member_inline_size <= 4) {
24396                return Err(fidl::Error::InvalidInlineBitInEnvelope);
24397            }
24398            let _inner_offset;
24399            if inlined {
24400                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24401                _inner_offset = offset + 8;
24402            } else {
24403                depth.increment()?;
24404                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24405            }
24406            match ordinal {
24407                1 => {
24408                    #[allow(irrefutable_let_patterns)]
24409                    if let NodeInfoDeprecated::Service(_) = self {
24410                        // Do nothing, read the value into the object
24411                    } else {
24412                        // Initialize `self` to the right variant
24413                        *self = NodeInfoDeprecated::Service(fidl::new_empty!(
24414                            Service,
24415                            fidl::encoding::DefaultFuchsiaResourceDialect
24416                        ));
24417                    }
24418                    #[allow(irrefutable_let_patterns)]
24419                    if let NodeInfoDeprecated::Service(ref mut val) = self {
24420                        fidl::decode!(
24421                            Service,
24422                            fidl::encoding::DefaultFuchsiaResourceDialect,
24423                            val,
24424                            decoder,
24425                            _inner_offset,
24426                            depth
24427                        )?;
24428                    } else {
24429                        unreachable!()
24430                    }
24431                }
24432                2 => {
24433                    #[allow(irrefutable_let_patterns)]
24434                    if let NodeInfoDeprecated::File(_) = self {
24435                        // Do nothing, read the value into the object
24436                    } else {
24437                        // Initialize `self` to the right variant
24438                        *self = NodeInfoDeprecated::File(fidl::new_empty!(
24439                            FileObject,
24440                            fidl::encoding::DefaultFuchsiaResourceDialect
24441                        ));
24442                    }
24443                    #[allow(irrefutable_let_patterns)]
24444                    if let NodeInfoDeprecated::File(ref mut val) = self {
24445                        fidl::decode!(
24446                            FileObject,
24447                            fidl::encoding::DefaultFuchsiaResourceDialect,
24448                            val,
24449                            decoder,
24450                            _inner_offset,
24451                            depth
24452                        )?;
24453                    } else {
24454                        unreachable!()
24455                    }
24456                }
24457                3 => {
24458                    #[allow(irrefutable_let_patterns)]
24459                    if let NodeInfoDeprecated::Directory(_) = self {
24460                        // Do nothing, read the value into the object
24461                    } else {
24462                        // Initialize `self` to the right variant
24463                        *self = NodeInfoDeprecated::Directory(fidl::new_empty!(
24464                            DirectoryObject,
24465                            fidl::encoding::DefaultFuchsiaResourceDialect
24466                        ));
24467                    }
24468                    #[allow(irrefutable_let_patterns)]
24469                    if let NodeInfoDeprecated::Directory(ref mut val) = self {
24470                        fidl::decode!(
24471                            DirectoryObject,
24472                            fidl::encoding::DefaultFuchsiaResourceDialect,
24473                            val,
24474                            decoder,
24475                            _inner_offset,
24476                            depth
24477                        )?;
24478                    } else {
24479                        unreachable!()
24480                    }
24481                }
24482                4 => {
24483                    #[allow(irrefutable_let_patterns)]
24484                    if let NodeInfoDeprecated::Symlink(_) = self {
24485                        // Do nothing, read the value into the object
24486                    } else {
24487                        // Initialize `self` to the right variant
24488                        *self = NodeInfoDeprecated::Symlink(fidl::new_empty!(
24489                            SymlinkObject,
24490                            fidl::encoding::DefaultFuchsiaResourceDialect
24491                        ));
24492                    }
24493                    #[allow(irrefutable_let_patterns)]
24494                    if let NodeInfoDeprecated::Symlink(ref mut val) = self {
24495                        fidl::decode!(
24496                            SymlinkObject,
24497                            fidl::encoding::DefaultFuchsiaResourceDialect,
24498                            val,
24499                            decoder,
24500                            _inner_offset,
24501                            depth
24502                        )?;
24503                    } else {
24504                        unreachable!()
24505                    }
24506                }
24507                ordinal => panic!("unexpected ordinal {:?}", ordinal),
24508            }
24509            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24510                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24511            }
24512            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24513                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24514            }
24515            Ok(())
24516        }
24517    }
24518
24519    impl fidl::encoding::ResourceTypeMarker for Representation {
24520        type Borrowed<'a> = &'a mut Self;
24521        fn take_or_borrow<'a>(
24522            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
24523        ) -> Self::Borrowed<'a> {
24524            value
24525        }
24526    }
24527
24528    unsafe impl fidl::encoding::TypeMarker for Representation {
24529        type Owned = Self;
24530
24531        #[inline(always)]
24532        fn inline_align(_context: fidl::encoding::Context) -> usize {
24533            8
24534        }
24535
24536        #[inline(always)]
24537        fn inline_size(_context: fidl::encoding::Context) -> usize {
24538            16
24539        }
24540    }
24541
24542    unsafe impl
24543        fidl::encoding::Encode<Representation, fidl::encoding::DefaultFuchsiaResourceDialect>
24544        for &mut Representation
24545    {
24546        #[inline]
24547        unsafe fn encode(
24548            self,
24549            encoder: &mut fidl::encoding::Encoder<
24550                '_,
24551                fidl::encoding::DefaultFuchsiaResourceDialect,
24552            >,
24553            offset: usize,
24554            _depth: fidl::encoding::Depth,
24555        ) -> fidl::Result<()> {
24556            encoder.debug_check_bounds::<Representation>(offset);
24557            encoder.write_num::<u64>(self.ordinal(), offset);
24558            match self {
24559                Representation::Node(ref val) => fidl::encoding::encode_in_envelope::<
24560                    NodeInfo,
24561                    fidl::encoding::DefaultFuchsiaResourceDialect,
24562                >(
24563                    <NodeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
24564                    encoder,
24565                    offset + 8,
24566                    _depth,
24567                ),
24568                Representation::Directory(ref val) => fidl::encoding::encode_in_envelope::<
24569                    DirectoryInfo,
24570                    fidl::encoding::DefaultFuchsiaResourceDialect,
24571                >(
24572                    <DirectoryInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
24573                    encoder,
24574                    offset + 8,
24575                    _depth,
24576                ),
24577                Representation::File(ref mut val) => fidl::encoding::encode_in_envelope::<
24578                    FileInfo,
24579                    fidl::encoding::DefaultFuchsiaResourceDialect,
24580                >(
24581                    <FileInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
24582                    encoder,
24583                    offset + 8,
24584                    _depth,
24585                ),
24586                Representation::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
24587                    SymlinkInfo,
24588                    fidl::encoding::DefaultFuchsiaResourceDialect,
24589                >(
24590                    <SymlinkInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
24591                    encoder,
24592                    offset + 8,
24593                    _depth,
24594                ),
24595                Representation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
24596            }
24597        }
24598    }
24599
24600    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
24601        for Representation
24602    {
24603        #[inline(always)]
24604        fn new_empty() -> Self {
24605            Self::__SourceBreaking { unknown_ordinal: 0 }
24606        }
24607
24608        #[inline]
24609        unsafe fn decode(
24610            &mut self,
24611            decoder: &mut fidl::encoding::Decoder<
24612                '_,
24613                fidl::encoding::DefaultFuchsiaResourceDialect,
24614            >,
24615            offset: usize,
24616            mut depth: fidl::encoding::Depth,
24617        ) -> fidl::Result<()> {
24618            decoder.debug_check_bounds::<Self>(offset);
24619            #[allow(unused_variables)]
24620            let next_out_of_line = decoder.next_out_of_line();
24621            let handles_before = decoder.remaining_handles();
24622            let (ordinal, inlined, num_bytes, num_handles) =
24623                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24624
24625            let member_inline_size = match ordinal {
24626                1 => <NodeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24627                2 => <DirectoryInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24628                3 => <FileInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24629                4 => <SymlinkInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24630                0 => return Err(fidl::Error::UnknownUnionTag),
24631                _ => num_bytes as usize,
24632            };
24633
24634            if inlined != (member_inline_size <= 4) {
24635                return Err(fidl::Error::InvalidInlineBitInEnvelope);
24636            }
24637            let _inner_offset;
24638            if inlined {
24639                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24640                _inner_offset = offset + 8;
24641            } else {
24642                depth.increment()?;
24643                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24644            }
24645            match ordinal {
24646                1 => {
24647                    #[allow(irrefutable_let_patterns)]
24648                    if let Representation::Node(_) = self {
24649                        // Do nothing, read the value into the object
24650                    } else {
24651                        // Initialize `self` to the right variant
24652                        *self = Representation::Node(fidl::new_empty!(
24653                            NodeInfo,
24654                            fidl::encoding::DefaultFuchsiaResourceDialect
24655                        ));
24656                    }
24657                    #[allow(irrefutable_let_patterns)]
24658                    if let Representation::Node(ref mut val) = self {
24659                        fidl::decode!(
24660                            NodeInfo,
24661                            fidl::encoding::DefaultFuchsiaResourceDialect,
24662                            val,
24663                            decoder,
24664                            _inner_offset,
24665                            depth
24666                        )?;
24667                    } else {
24668                        unreachable!()
24669                    }
24670                }
24671                2 => {
24672                    #[allow(irrefutable_let_patterns)]
24673                    if let Representation::Directory(_) = self {
24674                        // Do nothing, read the value into the object
24675                    } else {
24676                        // Initialize `self` to the right variant
24677                        *self = Representation::Directory(fidl::new_empty!(
24678                            DirectoryInfo,
24679                            fidl::encoding::DefaultFuchsiaResourceDialect
24680                        ));
24681                    }
24682                    #[allow(irrefutable_let_patterns)]
24683                    if let Representation::Directory(ref mut val) = self {
24684                        fidl::decode!(
24685                            DirectoryInfo,
24686                            fidl::encoding::DefaultFuchsiaResourceDialect,
24687                            val,
24688                            decoder,
24689                            _inner_offset,
24690                            depth
24691                        )?;
24692                    } else {
24693                        unreachable!()
24694                    }
24695                }
24696                3 => {
24697                    #[allow(irrefutable_let_patterns)]
24698                    if let Representation::File(_) = self {
24699                        // Do nothing, read the value into the object
24700                    } else {
24701                        // Initialize `self` to the right variant
24702                        *self = Representation::File(fidl::new_empty!(
24703                            FileInfo,
24704                            fidl::encoding::DefaultFuchsiaResourceDialect
24705                        ));
24706                    }
24707                    #[allow(irrefutable_let_patterns)]
24708                    if let Representation::File(ref mut val) = self {
24709                        fidl::decode!(
24710                            FileInfo,
24711                            fidl::encoding::DefaultFuchsiaResourceDialect,
24712                            val,
24713                            decoder,
24714                            _inner_offset,
24715                            depth
24716                        )?;
24717                    } else {
24718                        unreachable!()
24719                    }
24720                }
24721                4 => {
24722                    #[allow(irrefutable_let_patterns)]
24723                    if let Representation::Symlink(_) = self {
24724                        // Do nothing, read the value into the object
24725                    } else {
24726                        // Initialize `self` to the right variant
24727                        *self = Representation::Symlink(fidl::new_empty!(
24728                            SymlinkInfo,
24729                            fidl::encoding::DefaultFuchsiaResourceDialect
24730                        ));
24731                    }
24732                    #[allow(irrefutable_let_patterns)]
24733                    if let Representation::Symlink(ref mut val) = self {
24734                        fidl::decode!(
24735                            SymlinkInfo,
24736                            fidl::encoding::DefaultFuchsiaResourceDialect,
24737                            val,
24738                            decoder,
24739                            _inner_offset,
24740                            depth
24741                        )?;
24742                    } else {
24743                        unreachable!()
24744                    }
24745                }
24746                #[allow(deprecated)]
24747                ordinal => {
24748                    for _ in 0..num_handles {
24749                        decoder.drop_next_handle()?;
24750                    }
24751                    *self = Representation::__SourceBreaking { unknown_ordinal: ordinal };
24752                }
24753            }
24754            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24755                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24756            }
24757            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24758                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24759            }
24760            Ok(())
24761        }
24762    }
24763}